|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.wisc.trace.urcsdk.client.upnpdcps.UpnpAvTun
public class UpnpAvTun
UpnpAvTun is a sample TUN for UPnP AV devices in Flat Mode for the SDK.
Presently MediaRenderers and Media Servers can be operated using this TUN with the URC framework.
This tun uses upnpdcpstun.properties file to configure various Map Parameter
e.g
| Nested Class Summary | |
|---|---|
class |
UpnpAvTun.DescriptionReader
For SAX Parsing of DIDL-Lite document received from Media Server |
class |
UpnpAvTun.MediaServerRendererPair
Maintains MediaServer-MediaRenderer pair for a particular Client |
class |
UpnpAvTun.RendererMonitorThread
Thread to periodically monitor a running renderer. |
class |
UpnpAvTun.RendererSubscribeThread
Thread for periodically subscribing a MediaRenderer. |
class |
UpnpAvTun.StopRunner
|
| Field Summary | |
|---|---|
protected java.util.HashMap<IClient,UpnpAvTun.MediaServerRendererPair> |
clientMediaServerRendererPairs
|
protected java.util.logging.Logger |
logger
|
protected java.util.HashMap<java.lang.String,TargetMirror> |
sessionIdTargetMirrorMap
|
protected java.util.ArrayList<TargetMirror> |
targetMirrorList
|
| Constructor Summary | |
|---|---|
UpnpAvTun()
Creates instance of UpnpAvTun |
|
| Method Summary | |
|---|---|
void |
abortSession(java.lang.String sessionId)
Not supported by Upnp Targets |
void |
acknowledgeNotification(java.lang.String sessionId,
IUISocketElement socketElement)
Not supported by Upnp Targets |
boolean |
browse(java.lang.String mediaServerUdn)
browse called for initial browse when Media Server is detected. |
boolean |
browse(java.lang.String mediaServerUdn,
java.lang.String searchingId,
int index,
boolean isCalculateTotalCount)
browse is used for browsing of particular index. |
boolean |
browse(java.lang.String mediaServerUdn,
java.lang.String searchingId,
int index,
java.lang.String browseFlag,
boolean isCalculateTotalCount)
browse is used for browsing a particular index. |
void |
closeSession(java.lang.String sessionId)
Called to alert the Target that the Client wants to close the session. |
void |
configureForClient(IClient client,
java.util.Map<java.lang.String,java.lang.Object> parameterMap)
Nothing specific to configure for Clients binding to this TUN |
void |
eventNotifyReceived(java.lang.String sid,
long seq,
java.lang.String name,
java.lang.String value)
Called by the CLink SDK for UPnP, when an event is received from a Subscribed UPnP Service |
void |
firstChildNode(java.lang.String mediaServerUdn,
java.lang.String parentNode)
firstChildNode called to invoke firstChildNode command. |
java.lang.Object |
getElementState(java.lang.String sessionId,
java.lang.String elementId)
Retrieve the current state of the element from the Upnp Target. |
protected UpnpAvTun.MediaServerRendererPair |
getMediaServerRendererPairByMediaRendererSid(java.lang.String mediaRendererSid)
Returns the MediaServerRendererPair for requested mediaRendererSid (Subscription Id) |
protected UpnpAvTun.MediaServerRendererPair |
getMediaServerRendererPairByMediaRendererUdn(java.lang.String mediaRendererUdn)
Returns the MediaServerRendererPair for requested mediaRendererUdn |
protected UpnpAvTun.MediaServerRendererPair |
getMediaServerRendererPairByMediaServerUdn(java.lang.String mediaServerUdn)
Returns the MediaServerRendererPair for requested mediaServerUdn |
boolean |
getPositionInfo(UpnpAvTun.MediaServerRendererPair mediaServerRendererPair)
Get current connection info for specified connection ID. |
java.util.List<TargetMirror> |
getRegisteredTargets()
Returns the List of Targets discovered by this TUN |
java.lang.String |
invokeCommandRequest(IUISocketElement socketElement)
Should be implemented by the underlying network specific layer to indicate to the target that the user has invoked a commmand. |
void |
invokeLocator(java.lang.String locatorId,
java.lang.String targetName)
Not supported by Upnp Targets |
void |
nextNode(java.lang.String mediaServerUdn,
java.lang.String parentNode)
nextNode called to invoke nextNode command. |
ClientSession |
openSessionRequest(IClient client,
TargetMirror target,
UISocketMirror socket)
Should be implemented by the underlying network specific layer to open a new Session with the Target |
void |
parentNode(java.lang.String mediaServerUdn,
java.lang.String parentNode)
parentNode called to invoke parentNode command. |
void |
pause(java.lang.String mediaRendererUdn)
pause called to invoke pause command. |
void |
play(java.lang.String mediaRendererUdn)
Invoke play command on the MediaRenderer |
void |
prevNode(java.lang.String mediaServerUdn,
java.lang.String parentNode)
prevNode called to invoke previousNode command. |
boolean |
setElementStateRequest(IUISocketElement element)
To set a Upnp State Variable. |
void |
setListener(IClientTunListener clientTunListener)
Sets the listener for this ClientTun |
void |
startMonitorThread(UpnpAvTun.MediaServerRendererPair mediaServerRendererPair)
startMonitorThread is used to start monitor thread which retrieves the Relative Time Position of the Track which is playing |
void |
stopMonitorThread()
stopMonitorThread is used to stop monitor thread |
void |
targetDiscarded(java.lang.String targetId)
Called when a Target unregisters itself from the network. |
void |
targetDiscovered(java.net.URI tduri,
java.lang.String targetId)
Called when a new Target is discovered on the network. |
void |
unbindClient(IClient client)
Not necessary for UPnP DCPs, as the standard UPnP devices have no knowledge about the URC Client |
void |
updateElementCsvList(java.lang.String sessionId,
java.lang.String elementIdCsvList,
java.lang.String valueCsvList)
Called when the Target sends accumulated update using CSV list |
void |
updateElementState(java.lang.String sessionId,
java.lang.String elementId,
java.lang.Object elementValue)
Called when the Target updates the value of a state element. |
void |
ustop(java.lang.String mediaRendererUdn)
ustop called to invoke stop command. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.logging.Logger logger
protected java.util.HashMap<java.lang.String,TargetMirror> sessionIdTargetMirrorMap
protected java.util.HashMap<IClient,UpnpAvTun.MediaServerRendererPair> clientMediaServerRendererPairs
protected java.util.ArrayList<TargetMirror> targetMirrorList
| Constructor Detail |
|---|
public UpnpAvTun()
UpnpAvTun
| Method Detail |
|---|
public void setListener(IClientTunListener clientTunListener)
IClientTun
setListener in interface IClientTunclientTunListener - a IClientTunListener valuepublic java.util.List<TargetMirror> getRegisteredTargets()
IClientTun
getRegisteredTargets in interface IClientTunList of TargetMirror
public void targetDiscovered(java.net.URI tduri,
java.lang.String targetId)
IClientTun
targetDiscovered in interface IClientTuntduri - an URI valuetargetId - a String valuepublic void targetDiscarded(java.lang.String targetId)
IClientTun
targetDiscarded in interface IClientTuntargetId - a String valuepublic java.lang.String invokeCommandRequest(IUISocketElement socketElement)
IClientTun
invokeCommandRequest in interface IClientTunsocketElement - an IUISocketElement value
public ClientSession openSessionRequest(IClient client,
TargetMirror target,
UISocketMirror socket)
throws UrcException
IClientTun
openSessionRequest in interface IClientTunClientSession value
UrcException
public void updateElementState(java.lang.String sessionId,
java.lang.String elementId,
java.lang.Object elementValue)
IClientTun
updateElementState in interface IClientTunsessionId - a String valueelementId - a String valueelementValue - an Object array containing propogated values
public void updateElementCsvList(java.lang.String sessionId,
java.lang.String elementIdCsvList,
java.lang.String valueCsvList)
IClientTun
updateElementCsvList in interface IClientTunsessionId - a String valueelementIdCsvList - a String with CSVvalueCsvList - a String with CSV
public void closeSession(java.lang.String sessionId)
throws UrcException
IClientTun
closeSession in interface IClientTunsessionId - a String value
UrcExceptionprotected UpnpAvTun.MediaServerRendererPair getMediaServerRendererPairByMediaServerUdn(java.lang.String mediaServerUdn)
MediaServerRendererPair for requested mediaServerUdn
mediaServerUdn -
protected UpnpAvTun.MediaServerRendererPair getMediaServerRendererPairByMediaRendererUdn(java.lang.String mediaRendererUdn)
MediaServerRendererPair for requested mediaRendererUdn
mediaRendererUdn -
protected UpnpAvTun.MediaServerRendererPair getMediaServerRendererPairByMediaRendererSid(java.lang.String mediaRendererSid)
MediaServerRendererPair for requested mediaRendererSid (Subscription Id)
mediaRendererSid -
public void play(java.lang.String mediaRendererUdn)
mediaRendererUdn - Unique Device Name of the MediaRenderer on which the Play
command has to be invokedpublic void pause(java.lang.String mediaRendererUdn)
pause called to invoke pause command.
mediaRendererUdn - Unique Device Name of the MediaRenderer on which the Pause
command has to be invokedpublic void ustop(java.lang.String mediaRendererUdn)
ustop called to invoke stop command.
mediaRendererUdn - Unique Device Name of the MediaRenderer on which the Stop
command has to be invoked
public void prevNode(java.lang.String mediaServerUdn,
java.lang.String parentNode)
prevNode called to invoke previousNode command.
mediaServerUdn - Unique Device Name of the MediaServer on which the
previousNode command has to be invokedparentNode - a String Parent Node ID
public void nextNode(java.lang.String mediaServerUdn,
java.lang.String parentNode)
nextNode called to invoke nextNode command.
mediaServerUdn - Unique Device Name of the MediaServer on which the nextNode
command has to be invokedparentNode - a String Parent Node ID
public void firstChildNode(java.lang.String mediaServerUdn,
java.lang.String parentNode)
firstChildNode called to invoke firstChildNode command.
mediaServerUdn - Unique Device Name of the MediaServer on which the
firstChildNode command has to be invokedparentNode - a String Parent Node ID
public void parentNode(java.lang.String mediaServerUdn,
java.lang.String parentNode)
parentNode called to invoke parentNode command.
mediaServerUdn - Unique Device Name of the MediaServer on which the parentNode
command has to be invokedparentNode - a String Parent Node IDpublic boolean browse(java.lang.String mediaServerUdn)
browse called for initial browse when Media Server is detected.
mediaServerUdn - Unique Device Name of the MediaServer on which the browse
command has to be invoked
public boolean browse(java.lang.String mediaServerUdn,
java.lang.String searchingId,
int index,
boolean isCalculateTotalCount)
browse is used for browsing of particular index.
mediaServerUdn - Unique Device Name of the MediaServer on which the browse
command has to be invokedsearchingId - a Stringindex - an intisCalculateTotalCount - aboolean Flag indicating Total Number Of node
to be calculated or not. True in case of navigation through firstChildNode or parentNode invoke
false in other case
public boolean browse(java.lang.String mediaServerUdn,
java.lang.String searchingId,
int index,
java.lang.String browseFlag,
boolean isCalculateTotalCount)
browse is used for browsing a particular index.
mediaServerUdn - Unique Device Name of the MediaServer on which the browse
command has to be invokedsearchingId - a Stringindex - a intbrowseFlag - a String Flag indicates browsing mode i.e. 'BrowseDirectChildren' or 'BrowseMetaData'isCalculateTotalCount - a boolean Flag indicates Total Number Of node
to be calculated or not. True in case of navigation through firstChildNode or parentNode invoke
false in other casepublic boolean getPositionInfo(UpnpAvTun.MediaServerRendererPair mediaServerRendererPair)
mediaServerRendererPair -
public void eventNotifyReceived(java.lang.String sid,
long seq,
java.lang.String name,
java.lang.String value)
eventNotifyReceived in interface org.cybergarage.upnp.event.EventListenersid - Subscription Id of the subscribed Serviceseq - name - value - public void startMonitorThread(UpnpAvTun.MediaServerRendererPair mediaServerRendererPair)
startMonitorThread is used to start monitor thread which retrieves the Relative Time Position of the Track which is playing
public void stopMonitorThread()
stopMonitorThread is used to stop monitor thread
public void abortSession(java.lang.String sessionId)
abortSession in interface IClientTunsessionId - a String value
public void acknowledgeNotification(java.lang.String sessionId,
IUISocketElement socketElement)
throws UrcException
acknowledgeNotification in interface IClientTunsessionId - a String valuesocketElement - an IUISocketElement value
UrcException
public void configureForClient(IClient client,
java.util.Map<java.lang.String,java.lang.Object> parameterMap)
throws UrcException
configureForClient in interface IClientTunparameterMap - a Map
UrcException
public void unbindClient(IClient client)
throws UrcException
unbindClient in interface IClientTunclient - a IClient value
UrcException
public java.lang.Object getElementState(java.lang.String sessionId,
java.lang.String elementId)
throws UrcException
getElementState in interface IClientTunsessionId - a String valueelementId - a String value
Object value
UrcExceptionpublic boolean setElementStateRequest(IUISocketElement element)
setElementStateRequest in interface IClientTunelement - an IUISocketElement value
public void invokeLocator(java.lang.String locatorId,
java.lang.String targetName)
invokeLocator in interface IClientTun
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||