edu.wisc.trace.urcsdk.target.upnp2s
Class Upnp2sTargetTun

java.lang.Object
  extended by edu.wisc.trace.urcsdk.target.upnp2s.Upnp2sTargetTun
All Implemented Interfaces:
ITargetTun

public class Upnp2sTargetTun
extends java.lang.Object
implements ITargetTun

Upnp2sTargetTun is the UPnP implementation of the Target TUN interface.

Version:
$Revision: 1.21 $ $Date: 2006/10/25 05:23:33 $
Author:
Tim Costa, Modified by: Parikshit Thakur

Field Summary
protected  java.util.Map<ITarget,java.util.Map<java.lang.String,java.lang.Object>> targetParametersMap
           
 
Constructor Summary
Upnp2sTargetTun()
          Creates a new Upnp2sTargetTun instance.
 
Method Summary
 void abortSession(java.lang.String sessionId)
          abortSession is called when the target needs to close a session on the Client.
 void acknowledgeNotification(java.lang.String sessionId, java.lang.String elementId)
          acknowledgeNotification is called from the lower level of the Tun, when a Client wants to acknowledge a Notification
 void closeSession(java.lang.String sessionId)
          closeSession is called from the lower level of the Tun, when a Client needs to close a session.
 void configureForTarget(ITarget target, java.util.Map<java.lang.String,java.lang.Object> parameterMap)
          configureForTarget is called by the TargetTunManager, when first time a Target calls the TargetTunManager's bindtoTun method.
 java.lang.Object getElementState(java.lang.String sessionId, java.lang.String elementId)
          getElementState is an incoming call from the lower levels of the Tun, from a Client that needs the current value of a SocketElement
 java.lang.String getFriendlyName()
           
 java.lang.String invokeCommandRequest(java.lang.String sessionId, java.lang.String elementId)
          invokeCommandRequest is called from the lower level of the Tun, when a Client wants to invoke a command
 void invokeLocator(java.lang.String targetName, java.lang.String locatorId)
          invokeLocator is called from the lower level of the Tun, when a Client wants to invoke a Locator on the Target.
 boolean isClientDiscovered(java.lang.String clientUdn)
          isClientDiscovered
 java.lang.String openSessionRequest(java.lang.String targetName, java.lang.String socketName, java.lang.String clientUdn)
          openSessionRequest is called from the lower level of the Tun, when a Client needs to open a session.
 void propagateUpdates(java.lang.String sessionId, java.util.HashMap<java.lang.String,java.lang.Object> accUpdateMap)
          This method is called to send bulk accumulated updates to the Client
 boolean setElementStateRequest(java.lang.String sessionId, java.lang.String elementId, java.lang.Object value)
          setElementStateRequest is called from the lower level of the Tun, when a Client wants to set the value of a stateElement.
 void setListener(ITargetTunListener targetTunListener)
          setListener Sets the Listener for this Tun
 void unbindTarget(ITarget target)
          unbindTarget is called by the TargetTunManager, when Target calls the TargetTunManager's unbindTargetTun method.
 void updateElementState(java.lang.String sessionId, IUISocketElement element)
          updateElementState is called to alert a Client of a change to a socketElement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

targetParametersMap

protected java.util.Map<ITarget,java.util.Map<java.lang.String,java.lang.Object>> targetParametersMap
Constructor Detail

Upnp2sTargetTun

public Upnp2sTargetTun()
Creates a new Upnp2sTargetTun instance.

Method Detail

abortSession

public void abortSession(java.lang.String sessionId)
                  throws UrcException
Description copied from interface: ITargetTun
abortSession is called when the target needs to close a session on the Client. Need not be called if the Client has requested the session be closed.

Specified by:
abortSession in interface ITargetTun
Parameters:
sessionId - a String value
Throws:
UrcException

updateElementState

public void updateElementState(java.lang.String sessionId,
                               IUISocketElement element)
                        throws UrcException
Description copied from interface: ITargetTun
updateElementState is called to alert a Client of a change to a socketElement.

Specified by:
updateElementState in interface ITargetTun
Parameters:
sessionId - a String value
element - an IUISocketElement value
Throws:
UrcException

propagateUpdates

public void propagateUpdates(java.lang.String sessionId,
                             java.util.HashMap<java.lang.String,java.lang.Object> accUpdateMap)
                      throws UrcException
Description copied from interface: ITargetTun
This method is called to send bulk accumulated updates to the Client

Specified by:
propagateUpdates in interface ITargetTun
Throws:
UrcException

closeSession

public void closeSession(java.lang.String sessionId)
Description copied from interface: ITargetTun
closeSession is called from the lower level of the Tun, when a Client needs to close a session.

Specified by:
closeSession in interface ITargetTun
Parameters:
sessionId - a String value

setElementStateRequest

public boolean setElementStateRequest(java.lang.String sessionId,
                                      java.lang.String elementId,
                                      java.lang.Object value)
Description copied from interface: ITargetTun
setElementStateRequest is called from the lower level of the Tun, when a Client wants to set the value of a stateElement.

Specified by:
setElementStateRequest in interface ITargetTun
Parameters:
sessionId - a String value
elementId - a String value
value - a Object value
Returns:
a boolean response

getElementState

public java.lang.Object getElementState(java.lang.String sessionId,
                                        java.lang.String elementId)
Description copied from interface: ITargetTun
getElementState is an incoming call from the lower levels of the Tun, from a Client that needs the current value of a SocketElement

Specified by:
getElementState in interface ITargetTun
Parameters:
sessionId - a String value
elementId - a String value
Returns:
an Object Value

invokeCommandRequest

public java.lang.String invokeCommandRequest(java.lang.String sessionId,
                                             java.lang.String elementId)
Description copied from interface: ITargetTun
invokeCommandRequest is called from the lower level of the Tun, when a Client wants to invoke a command

Specified by:
invokeCommandRequest in interface ITargetTun
Parameters:
sessionId - a String value
elementId - a String value
Returns:
a String Status

acknowledgeNotification

public void acknowledgeNotification(java.lang.String sessionId,
                                    java.lang.String elementId)
Description copied from interface: ITargetTun
acknowledgeNotification is called from the lower level of the Tun, when a Client wants to acknowledge a Notification

Specified by:
acknowledgeNotification in interface ITargetTun
Parameters:
sessionId - a String value
elementId - a String value

openSessionRequest

public java.lang.String openSessionRequest(java.lang.String targetName,
                                           java.lang.String socketName,
                                           java.lang.String clientUdn)
Description copied from interface: ITargetTun
openSessionRequest is called from the lower level of the Tun, when a Client needs to open a session.

Specified by:
openSessionRequest in interface ITargetTun
Parameters:
targetName - a String value
socketName - a String value
clientUdn - a String value
Returns:
a String sessionId

invokeLocator

public void invokeLocator(java.lang.String targetName,
                          java.lang.String locatorId)
Description copied from interface: ITargetTun
invokeLocator is called from the lower level of the Tun, when a Client wants to invoke a Locator on the Target.

Specified by:
invokeLocator in interface ITargetTun
Parameters:
targetName - a String
locatorId - a String

setListener

public void setListener(ITargetTunListener targetTunListener)
Description copied from interface: ITargetTun
setListener Sets the Listener for this Tun

Specified by:
setListener in interface ITargetTun
Parameters:
targetTunListener - a ITargetTunListener value

isClientDiscovered

public boolean isClientDiscovered(java.lang.String clientUdn)
isClientDiscovered

Parameters:
clientUdn -
Returns:
a boolean value

unbindTarget

public void unbindTarget(ITarget target)
                  throws UrcException
Description copied from interface: ITargetTun
unbindTarget is called by the TargetTunManager, when Target calls the TargetTunManager's unbindTargetTun method.

Specified by:
unbindTarget in interface ITargetTun
Parameters:
target - a ITarget
Throws:
UrcException

configureForTarget

public void configureForTarget(ITarget target,
                               java.util.Map<java.lang.String,java.lang.Object> parameterMap)
Description copied from interface: ITargetTun
configureForTarget is called by the TargetTunManager, when first time a Target calls the TargetTunManager's bindtoTun method.

Specified by:
configureForTarget in interface ITargetTun
Parameters:
target - a ITarget
parameterMap - a Map

getFriendlyName

public java.lang.String getFriendlyName()


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