edu.wisc.trace.urcsdk.target
Class TargetSession

java.lang.Object
  extended by edu.wisc.trace.urcsdk.target.TargetSession

public class TargetSession
extends java.lang.Object

TargetSession is created when a new Session is opened on a UISocket. It allows changes to be propagated to the ISessionListener

Version:
$Revision: 1.21 $
Author:
Parikshit Thakur & Team

Field Summary
protected  java.util.logging.Logger logger
           
 
Constructor Summary
TargetSession(UISocket socket, java.lang.String sessionId)
          Creates a new TargetSession instance.
 
Method Summary
 void abortSession()
          abortSession to abort the session.
 boolean acknowledgeNotification(java.lang.String elementId)
          acknowledgeNotification is called to notify the sessionListeners that a Urc has acknowledged a notification.
 void closeSession()
          closeSession is called by the Client to close the session.
 java.lang.String getId()
          getId gets the unique sessionID of this Session
 UISocket getParentSocket()
          getParentSocket Returns the parent UISocket
 ISessionListener getSessionListener()
          getSessionListener Gets the current list of listeners.
 AbstractUISocketElement getUISocketElement(java.lang.String elementId)
          getUISocketElement gets a UISocketElement specific to this session
 java.util.List<AbstractUISocketElement> getUISocketElements()
          getUISocketElements Gets the UISocketElements for this particular TargetSession
 java.lang.String invokeCommandRequest(java.lang.String elementId)
          invokeCommandRequest notifies sessionListener that a Client has invoked a command.
 void propagateUpdates()
          Invoke this method of propagate accumulated updates to the Client
 void removeSessionListener()
          removeSessionListener Remove the listener from the Session.
 void setElementForAccUpdate(java.lang.String elementId, java.lang.Object value)
          Stores the elementId and the corresponding new value for pushing an Accumulated update to the Client when the propagateUpdates() method is called
 boolean setElementStateRequest(java.lang.String elementId, java.lang.Object value)
          setElementStateRequest notifies sessionListener that a Client wants to change the state of an element.
 void setSessionListener(ISessionListener sessionListener)
          setSessionListener Sets a listener to the Session object allowing the reception of Session events.
 
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
Constructor Detail

TargetSession

public TargetSession(UISocket socket,
                     java.lang.String sessionId)
Creates a new TargetSession instance.

Parameters:
socket - an UISocket value
sessionId - a String value unique to this session.
Method Detail

setSessionListener

public void setSessionListener(ISessionListener sessionListener)
setSessionListener Sets a listener to the Session object allowing the reception of Session events.

Parameters:
sessionListener - an ISessionListener value

removeSessionListener

public void removeSessionListener()
removeSessionListener Remove the listener from the Session.


getSessionListener

public ISessionListener getSessionListener()
getSessionListener Gets the current list of listeners.

Returns:
the ISessionListener object

getUISocketElements

public java.util.List<AbstractUISocketElement> getUISocketElements()
getUISocketElements Gets the UISocketElements for this particular TargetSession

Returns:
a List of the UISocketElements

getParentSocket

public UISocket getParentSocket()
getParentSocket Returns the parent UISocket

Returns:
a UISocket

getId

public java.lang.String getId()
getId gets the unique sessionID of this Session

Returns:
a String value

closeSession

public void closeSession()
closeSession is called by the Client to close the session. It takes care of alerting the UISocket of the close.


abortSession

public void abortSession()
                  throws UrcException
abortSession to abort the session. It takes care of alerting the connected Client.

Throws:
UrcException

getUISocketElement

public AbstractUISocketElement getUISocketElement(java.lang.String elementId)
getUISocketElement gets a UISocketElement specific to this session

Parameters:
elementId -
Returns:
the AbstractUISocketElement requested

acknowledgeNotification

public boolean acknowledgeNotification(java.lang.String elementId)
acknowledgeNotification is called to notify the sessionListeners that a Urc has acknowledged a notification.

Parameters:
elementId - a String value
Returns:
a boolean value

invokeCommandRequest

public java.lang.String invokeCommandRequest(java.lang.String elementId)
invokeCommandRequest notifies sessionListener that a Client has invoked a command.

Parameters:
elementId - a String value

setElementStateRequest

public boolean setElementStateRequest(java.lang.String elementId,
                                      java.lang.Object value)
setElementStateRequest notifies sessionListener that a Client wants to change the state of an element.

Parameters:
elementId - a String value
value - a Object value
Returns:
a boolean value

setElementForAccUpdate

public void setElementForAccUpdate(java.lang.String elementId,
                                   java.lang.Object value)
Stores the elementId and the corresponding new value for pushing an Accumulated update to the Client when the propagateUpdates() method is called

Parameters:
elementId - a String value
value - a Object value

propagateUpdates

public void propagateUpdates()
Invoke this method of propagate accumulated updates to the Client



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