edu.wisc.trace.urcsdk.client.upnp2s
Class Upnp2sClientTun

java.lang.Object
  extended by edu.wisc.trace.urcsdk.client.upnp2s.Upnp2sClientTun
All Implemented Interfaces:
IClientTun

public class Upnp2sClientTun
extends java.lang.Object
implements IClientTun

Upnp2sClientTun

Version:
$Revision: 1.21 $ $Date: 2006/10/25 05:21:34 $
Author:
Tim Costa Modified by Parikshit Thakur

Field Summary
protected  java.util.Map<IClient,java.util.Map<java.lang.String,java.lang.Object>> clientParametersMap
           
protected  java.util.HashMap<java.lang.String,TargetMirror> targetIdTargetMirrorMap
           
 
Constructor Summary
Upnp2sClientTun()
          Creates a new Upnp2sClientTun instance.
 
Method Summary
 void abortSession(java.lang.String sessionId)
          Called when the Target ends a session.
 void acknowledgeNotification(java.lang.String sessionId, IUISocketElement socketElement)
          Called to alert the Target that a notification has been acknowledged
 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)
          Called by the ClientTunManager, when first time a Client calls the ClientTunManager's bindToClientTun method.
 java.lang.String createNextTargetId()
           
 java.lang.Object getElementState(java.lang.String sessionId, java.lang.String elementId)
          Called to retrieve the current value of a state element
 java.lang.String getFriendlyName()
           
 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)
          Should be implemented by the underlying network specific layer to invoke the Locator on the Target
 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
 boolean setElementStateRequest(IUISocketElement socketElement)
          Should be implemented by the underlying network specific layer to indicate to the target that the user would like to change a state element.
 void setListener(IClientTunListener clientTunListener)
          Sets the listener for this ClientTun
 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)
          Called by the ClientTunManager, when Client calls the ClientTunManager's unbindClientTun method.
 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 value)
          Called when the Target updates the value of a state element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

targetIdTargetMirrorMap

protected java.util.HashMap<java.lang.String,TargetMirror> targetIdTargetMirrorMap

clientParametersMap

protected java.util.Map<IClient,java.util.Map<java.lang.String,java.lang.Object>> clientParametersMap
Constructor Detail

Upnp2sClientTun

public Upnp2sClientTun()
Creates a new Upnp2sClientTun instance.

Method Detail

acknowledgeNotification

public void acknowledgeNotification(java.lang.String sessionId,
                                    IUISocketElement socketElement)
                             throws UrcException
Description copied from interface: IClientTun
Called to alert the Target that a notification has been acknowledged

Specified by:
acknowledgeNotification in interface IClientTun
Parameters:
sessionId - a String value
socketElement - an IUISocketElement value
Throws:
UrcException

closeSession

public void closeSession(java.lang.String sessionId)
                  throws UrcException
Description copied from interface: IClientTun
Called to alert the Target that the Client wants to close the session.

Specified by:
closeSession in interface IClientTun
Parameters:
sessionId - a String value
Throws:
UrcException

getElementState

public java.lang.Object getElementState(java.lang.String sessionId,
                                        java.lang.String elementId)
                                 throws UrcException
Description copied from interface: IClientTun
Called to retrieve the current value of a state element

Specified by:
getElementState in interface IClientTun
Parameters:
sessionId - a String value
elementId - a String value
Returns:
a Object value
Throws:
UrcException

invokeCommandRequest

public java.lang.String invokeCommandRequest(IUISocketElement socketElement)
                                      throws UrcException
Description copied from interface: IClientTun
Should be implemented by the underlying network specific layer to indicate to the target that the user has invoked a commmand.

Specified by:
invokeCommandRequest in interface IClientTun
Parameters:
socketElement - an IUISocketElement value
Returns:
The status of an invoked Command
Throws:
UrcException

invokeLocator

public void invokeLocator(java.lang.String locatorId,
                          java.lang.String targetName)
                   throws UrcException
Description copied from interface: IClientTun
Should be implemented by the underlying network specific layer to invoke the Locator on the Target

Specified by:
invokeLocator in interface IClientTun
Throws:
UrcException

setElementStateRequest

public boolean setElementStateRequest(IUISocketElement socketElement)
                               throws UrcException
Description copied from interface: IClientTun
Should be implemented by the underlying network specific layer to indicate to the target that the user would like to change a state element.

Specified by:
setElementStateRequest in interface IClientTun
Parameters:
socketElement - an IUISocketElement value
Returns:
True if the request was successful
Throws:
UrcException

openSessionRequest

public ClientSession openSessionRequest(IClient client,
                                        TargetMirror target,
                                        UISocketMirror socket)
                                 throws UrcException
Description copied from interface: IClientTun
Should be implemented by the underlying network specific layer to open a new Session with the Target

Specified by:
openSessionRequest in interface IClientTun
Returns:
a ClientSession value
Throws:
UrcException

abortSession

public void abortSession(java.lang.String sessionId)
Description copied from interface: IClientTun
Called when the Target ends a session.

Specified by:
abortSession in interface IClientTun
Parameters:
sessionId - a String value

targetDiscarded

public void targetDiscarded(java.lang.String targetId)
Description copied from interface: IClientTun
Called when a Target unregisters itself from the network.

Specified by:
targetDiscarded in interface IClientTun
Parameters:
targetId - a String value

targetDiscovered

public void targetDiscovered(java.net.URI tdURI,
                             java.lang.String targetId)
Description copied from interface: IClientTun
Called when a new Target is discovered on the network.

Specified by:
targetDiscovered in interface IClientTun
Parameters:
tdURI - an URI value
targetId - a String value

updateElementState

public void updateElementState(java.lang.String sessionId,
                               java.lang.String elementId,
                               java.lang.Object value)
Description copied from interface: IClientTun
Called when the Target updates the value of a state element.

Specified by:
updateElementState in interface IClientTun
Parameters:
sessionId - a String value
elementId - a String value
value - an Object array containing propogated values

updateElementCsvList

public void updateElementCsvList(java.lang.String sessionId,
                                 java.lang.String elementIdCsvList,
                                 java.lang.String valueCsvList)
Description copied from interface: IClientTun
Called when the Target sends accumulated update using CSV list

Specified by:
updateElementCsvList in interface IClientTun
Parameters:
sessionId - a String value
elementIdCsvList - a String with CSV
valueCsvList - a String with CSV

getRegisteredTargets

public java.util.List<TargetMirror> getRegisteredTargets()
Description copied from interface: IClientTun
Returns the List of Targets discovered by this TUN

Specified by:
getRegisteredTargets in interface IClientTun
Returns:
a List of TargetMirror

setListener

public void setListener(IClientTunListener clientTunListener)
Description copied from interface: IClientTun
Sets the listener for this ClientTun

Specified by:
setListener in interface IClientTun
Parameters:
clientTunListener - a IClientTunListener value

configureForClient

public void configureForClient(IClient client,
                               java.util.Map<java.lang.String,java.lang.Object> parameterMap)
Description copied from interface: IClientTun
Called by the ClientTunManager, when first time a Client calls the ClientTunManager's bindToClientTun method.

Specified by:
configureForClient in interface IClientTun
parameterMap - a Map

unbindClient

public void unbindClient(IClient client)
                  throws UrcException
Description copied from interface: IClientTun
Called by the ClientTunManager, when Client calls the ClientTunManager's unbindClientTun method.

Specified by:
unbindClient in interface IClientTun
Parameters:
client - a IClient value
Throws:
UrcException

createNextTargetId

public java.lang.String createNextTargetId()

getFriendlyName

public java.lang.String getFriendlyName()


Copyright © 2006 Trace R&D Center, University of Wisconsin-Madison. All Rights Reserved.