edu.wisc.trace.urcsdk.client
Class ClientTunManager

java.lang.Object
  extended by edu.wisc.trace.urcsdk.client.ClientTunManager
All Implemented Interfaces:
IClientTunListener

public class ClientTunManager
extends java.lang.Object
implements IClientTunListener

ClientTunManager Acts as a proxy between the Clients and ClientTuns Created on: March 1st, 2006

Version:
$Revision: 1.21 $
Author:
Parikshit Thakur

Nested Class Summary
 class ClientTunManager.ClientTunAssociation
          Used for maintaining Map of Client and ClientTuns.
 
Field Summary
protected  java.util.logging.Logger logger
           
 
Method Summary
 void abortSession(java.lang.String sessionId)
          abortSession is called when the target ends a session.
 IClientTun bindToClientTun(IClient client, java.lang.String tunClassName, java.util.Map<java.lang.String,java.lang.Object> parameterMap)
          Used to Bind a Client to a particular ClientTun
 void closeSession(java.lang.String sessionId)
          Close Session request from Client
 java.util.List<IClient> getClientsForClientTun(IClientTun cTun)
          Utility method
 IClientTun getClientTun(java.lang.String tunClassName)
          Returns the ClientTun instance for the tunClassName specified.
 java.util.List<IClientTun> getClientTunsForClient(IClient gc)
          Utility method
static ClientTunManager getInstance()
          Get static instance of ClientTunManager.
 ClientSession getSessionById(java.lang.String sessionId)
          Utility method
 UISocketMirror getSocketForSocketName(IClient gc, java.lang.String targetId, java.lang.String socketName)
          Utility method
 java.util.List<UISocketMirror> getSocketsForTargetId(IClient gc, java.lang.String targetId)
          Utility method
 TargetMirror getTargetForTargetId(IClient gc, java.lang.String targetId)
          Utility method
 java.util.List<TargetMirror> getTargetsForClient(IClient gc)
          Utility method
 IClientTun isTunExists(java.lang.String tunClassName)
          Utility Method
 java.lang.String openSessionRequest(IClient client, java.lang.String targetId, java.lang.String socketName)
          Session open request from Client.
 void targetDiscarded(TargetMirror targetMirror)
          targetDiscarded is called when a Target unregisters itself from the network.
 void targetDiscovered(IClient client, TargetMirror targetMirror)
          targetDiscovered is called when a new Target is discovered on the network.
 void unbindClientTun(IClient client, java.lang.String tunClassName)
          Used to unbind a Client from a particular ClientTun
 void updateElementCsvList(java.lang.String sessionId, java.lang.String elementIdCsvList, java.lang.String valueCsvList)
          updateElementCsvList is called when the Target sends accumulated list of updates
 void updateElementState(java.lang.String sessionId, java.lang.String elementId, java.lang.Object value)
          updateElementState is 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

logger

protected java.util.logging.Logger logger
Method Detail

getInstance

public static ClientTunManager getInstance()
Get static instance of ClientTunManager. Singleton Pattern.

Returns:
ClientTunManager

closeSession

public void closeSession(java.lang.String sessionId)
                  throws UrcException
Close Session request from Client

Parameters:
sessionId -
Throws:
UrcException

abortSession

public void abortSession(java.lang.String sessionId)
Description copied from interface: IClientTunListener
abortSession is called when the target ends a session.

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

updateElementState

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

Specified by:
updateElementState in interface IClientTunListener
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: IClientTunListener
updateElementCsvList is called when the Target sends accumulated list of updates

Specified by:
updateElementCsvList in interface IClientTunListener
Parameters:
sessionId - a String value
elementIdCsvList - a String value
valueCsvList - a String value

getClientTunsForClient

public java.util.List<IClientTun> getClientTunsForClient(IClient gc)
Utility method

Parameters:
gc - IClient
Returns:
IClientTun

getClientsForClientTun

public java.util.List<IClient> getClientsForClientTun(IClientTun cTun)
Utility method

Parameters:
cTun - IClientTun
Returns:
IClient

getTargetsForClient

public java.util.List<TargetMirror> getTargetsForClient(IClient gc)
Utility method

Parameters:
gc - IClient
Returns:
TargetMirror

getTargetForTargetId

public TargetMirror getTargetForTargetId(IClient gc,
                                         java.lang.String targetId)
Utility method

Parameters:
gc - IClient
targetId - String
Returns:
TargetMirror

getSocketsForTargetId

public java.util.List<UISocketMirror> getSocketsForTargetId(IClient gc,
                                                            java.lang.String targetId)
                                                     throws UrcException
Utility method

Parameters:
gc - IClient
targetId - String
Returns:
UISocketMirror
Throws:
UrcException

getSocketForSocketName

public UISocketMirror getSocketForSocketName(IClient gc,
                                             java.lang.String targetId,
                                             java.lang.String socketName)
                                      throws UrcException
Utility method

Parameters:
gc - IClient
targetId - String
socketName - String
Returns:
UISocketMirror
Throws:
UrcException

getSessionById

public ClientSession getSessionById(java.lang.String sessionId)
Utility method

Parameters:
sessionId - String
Returns:
ClientSession

getClientTun

public IClientTun getClientTun(java.lang.String tunClassName)
                        throws UrcException
Returns the ClientTun instance for the tunClassName specified. Creates a new one if it doesn't exist.

Parameters:
tunClassName - String
Returns:
IClientTun
Throws:
UrcException

bindToClientTun

public IClientTun bindToClientTun(IClient client,
                                  java.lang.String tunClassName,
                                  java.util.Map<java.lang.String,java.lang.Object> parameterMap)
                           throws UrcException
Used to Bind a Client to a particular ClientTun

Parameters:
client - IClient
tunClassName - String
Returns:
IClientTun
Throws:
UrcException

unbindClientTun

public void unbindClientTun(IClient client,
                            java.lang.String tunClassName)
                     throws UrcException
Used to unbind a Client from a particular ClientTun

Parameters:
client - IClient
tunClassName - String
Throws:
UrcException

openSessionRequest

public java.lang.String openSessionRequest(IClient client,
                                           java.lang.String targetId,
                                           java.lang.String socketName)
                                    throws UrcException
Session open request from Client.

Parameters:
client - IClient
targetId - String
socketName - String
Returns:
sessionId String
Throws:
UrcException

targetDiscovered

public void targetDiscovered(IClient client,
                             TargetMirror targetMirror)
Description copied from interface: IClientTunListener
targetDiscovered is called when a new Target is discovered on the network.

Specified by:
targetDiscovered in interface IClientTunListener
Parameters:
client - a IClient value
targetMirror - a TargetMirror value

targetDiscarded

public void targetDiscarded(TargetMirror targetMirror)
Description copied from interface: IClientTunListener
targetDiscarded is called when a Target unregisters itself from the network.

Specified by:
targetDiscarded in interface IClientTunListener
Parameters:
targetMirror - a TargetMirror value

isTunExists

public IClientTun isTunExists(java.lang.String tunClassName)
Utility Method

Parameters:
tunClassName - String
Returns:
IClientTun


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