edu.wisc.trace.urcsdk.client
Class ClientSession

java.lang.Object
  extended by edu.wisc.trace.urcsdk.client.ClientSession

public class ClientSession
extends java.lang.Object

ClientSession controls all session management for a socket. Each session has its own copy of the socket's elements for local variable manipulations. Created on: Sep 19, 2004

Version:
$Revision: 1.21 $
Author:
Andrew Martin, Trace R&D Center Modified by Parikshit Thakur

Field Summary
 java.util.HashMap<java.lang.String,IUISocketElement> elementIdUISocketElementMap
           
 
Constructor Summary
ClientSession(UISocketMirror socket, java.lang.String sessionID)
          Creates a new ClientSession instance.
 
Method Summary
static java.util.List<IInteractor> buildInteractors(UISocketMirror socket, ClientSession session, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> interactorMap)
          Build the Interactors for a UISocket
 void checkDependencies()
          checkDependencies checks all the XPath dependencies related to this Session.
 void closeSession()
          closeSession closes the Session with the target
 java.util.List<IInteractor> getInteractors()
          getInteractors returns all the interactors for this session.
 java.lang.String getSessionId()
          Gives this Session's unique ID
 UISocketMirror getSocket()
          getSocket returns the Session's related UISocket
 java.util.List<IUISocketElement> getSocketElements()
          getSocketElements returns all socket elements for the Session.
 IUISocketElement getUISocketElementById(java.lang.String id)
          Return UISocketElement for a Id
 IUISocketElement getUISocketElementByRef(ElementRef ref)
          Returns the specified socket element for the ElementRef
 void setClientSessionListener(IClientSessionListener clientSessionListener)
          setClientSessionListener Sets the client session listener passed through.
protected  void updateElementCsvList(java.lang.String elementIdCsvList, java.lang.String valueCsvList)
          Parses the CSV ElementId List and corresponding Value List.
protected  void updateElementState(java.lang.String elementId, java.lang.Object value)
          updateElementState Updates the value of the element for this session.
 void updateUISocketElements()
          updateUISocketElements Updates all UISocketElements for this session
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

elementIdUISocketElementMap

public java.util.HashMap<java.lang.String,IUISocketElement> elementIdUISocketElementMap
Constructor Detail

ClientSession

public ClientSession(UISocketMirror socket,
                     java.lang.String sessionID)
              throws UrcException
Creates a new ClientSession instance.

Parameters:
socket - an UISocket value
sessionID - a String value
Throws:
UrcException - If there was a problem constructing the session that was unrecoverable
Method Detail

updateUISocketElements

public void updateUISocketElements()
updateUISocketElements Updates all UISocketElements for this session


updateElementState

protected void updateElementState(java.lang.String elementId,
                                  java.lang.Object value)
updateElementState Updates the value of the element for this session.

Parameters:
elementId -
value -

updateElementCsvList

protected void updateElementCsvList(java.lang.String elementIdCsvList,
                                    java.lang.String valueCsvList)
Parses the CSV ElementId List and corresponding Value List. Also sets the value of Session Element and posts update to the IClientSessionListener of the accumulated update in HashMap format.

Parameters:
elementIdCsvList - Comma Separated List of Element Ids
valueCsvList - Comma Separated List of Values

buildInteractors

public static java.util.List<IInteractor> buildInteractors(UISocketMirror socket,
                                                           ClientSession session,
                                                           java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> interactorMap)
Build the Interactors for a UISocket

Parameters:
socket -
session -
interactorMap -
Returns:
a List of IInteractor

getUISocketElementById

public IUISocketElement getUISocketElementById(java.lang.String id)
Return UISocketElement for a Id

Parameters:
id - a String value
Returns:
a IUISocketElement value

getUISocketElementByRef

public IUISocketElement getUISocketElementByRef(ElementRef ref)
Returns the specified socket element for the ElementRef

Parameters:
ref -
Returns:
the specified socket element

getSessionId

public java.lang.String getSessionId()
Gives this Session's unique ID

Returns:
a String value

closeSession

public void closeSession()
                  throws UrcException
closeSession closes the Session with the target

Throws:
UrcException

getSocketElements

public java.util.List<IUISocketElement> getSocketElements()
getSocketElements returns all socket elements for the Session.

Returns:
a List of all socket elements for this session

getSocket

public UISocketMirror getSocket()
getSocket returns the Session's related UISocket

Returns:
an UISocket value

getInteractors

public java.util.List<IInteractor> getInteractors()
getInteractors returns all the interactors for this session.

Returns:
a List of all interactors for this session

checkDependencies

public void checkDependencies()
checkDependencies checks all the XPath dependencies related to this Session.


setClientSessionListener

public void setClientSessionListener(IClientSessionListener clientSessionListener)
setClientSessionListener Sets the client session listener passed through.

Parameters:
clientSessionListener -


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