edu.wisc.trace.uch
Class TAListener

java.lang.Object
  extended by edu.wisc.trace.uch.TAListener
All Implemented Interfaces:
ITAListener

public class TAListener
extends Object
implements ITAListener

Implements the methods of ITAListener. Also maintain information about targets and its sessions.

Version:
$Revision: 1.1 $
Author:
Parikshit Thakur & Team, Trace R&D Center

Method Summary
 void abortSession(String sessionId)
          The TA has terminated a session, when the TA will have no knowledge about that session.
 void addUriServiceContexts(String uri, List<Map<String,IProfile>> contexts)
          Called when the TA wants to add one or more contexts to a URI service.
 String getDocument(String uri, String postData, Map<String,IProfile> context)
          Get specified document through HTTP GET or POST.
 String getIpAddress()
          Get the IP address of the UCH.
 IUCHStore getLocalUCHStore()
          Gets an Object of LocalUCHStore.
 List<List<Map<String,List<String>>>> getResources(String sessionId, List<Map<String,List<String>>> resProps)
          Get resource from the UCH specified by Resource Properties.
 List<Map<String,IProfile>> getTargetContexts(String targetId)
          Get list of contexts for specified target.
 Map<String,String> getUCHProps()
          Get a Map of UCH Properties.
 boolean isImplemented(String functionName)
          Returns whether specified function is implemented or not.
 void removeUriServiceContexts(String uri, List<Map<String,IProfile>> contexts)
          Called when the TA wants to remove one or more contexts to a URI service.
 void sessionForwardRequest(String sessionId, Map<String,String> forwardInfo)
          The TA requests the client to open a session with different socket.
 boolean setValidation(ITA ta, boolean activate)
          Check whether to do validation for the TA or not.
 String startUriService(ITA ta, String scheme, int port, boolean portIsFlexible, String basePath, boolean basePathIsFlexible, List<Map<String,IProfile>> contexts)
          The ITA requests the UCH to start servicing a URI which is made up of a given scheme, port, and base path.
 void stopUriService(String uri)
          The ITA requests the UCH to stop servicing a URI that was requested to be serviced in a previous call to startUriService().
 void updateDynRes(List<String> sessionIds, List<String> eltIds)
          Signals that the set of resources pertaining to a specific socket element has been changed.
 void updateValues(List<String> sessionIds, List<String> paths, List<String> operations, List<String> values, List<Boolean> hasDynRes)
          The TA signals a change in the target’s status, affecting one or more sessions.
 List<Map<String,String>> uploadResources(List<Map<String,List<String>>> props, List<String> resourceUri)
          Upload Resources on Resource Server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDocument

public String getDocument(String uri,
                          String postData,
                          Map<String,IProfile> context)
                   throws UCHException
Description copied from interface: ITAListener
Get specified document through HTTP GET or POST.

Specified by:
getDocument in interface ITAListener
Parameters:
uri - a String value of URI
postData - a String value of postData
context - a Map<String, IProfile> of user and controller profile
Returns:
a String value of requested Document
Throws:
UCHException - an Object of UCHException
See Also:
ITAListener.getDocument(String, String, Map)

getIpAddress

public String getIpAddress()
Description copied from interface: ITAListener
Get the IP address of the UCH.

Specified by:
getIpAddress in interface ITAListener
Returns:
return a string value
See Also:
ITAListener.getIpAddress()

getLocalUCHStore

public IUCHStore getLocalUCHStore()
Description copied from interface: ITAListener
Gets an Object of LocalUCHStore.

Specified by:
getLocalUCHStore in interface ITAListener
Returns:
an Object of IUCHStore
See Also:
ITAListener.getLocalUCHStore()

getResources

public List<List<Map<String,List<String>>>> getResources(String sessionId,
                                                         List<Map<String,List<String>>> resProps)
Description copied from interface: ITAListener
Get resource from the UCH specified by Resource Properties.

Specified by:
getResources in interface ITAListener
Parameters:
sessionId - a String value of sessionId
resProps - a Map<String, List<String>> of Resource Properties
Returns:
a List<List<Map<String, List<String>>>> value
See Also:
ITAListener.getResources(String, List)

getUCHProps

public Map<String,String> getUCHProps()
Description copied from interface: ITAListener
Get a Map of UCH Properties.

Specified by:
getUCHProps in interface ITAListener
Returns:
an object of Map<String, String> or UCH Properties
See Also:
ITAListener.getUCHProps()

isImplemented

public boolean isImplemented(String functionName)
Description copied from interface: ITAListener
Returns whether specified function is implemented or not.

Specified by:
isImplemented in interface ITAListener
Parameters:
functionName - a String value of function Name
Returns:
whether the function is implemented or not
See Also:
ITAListener.isImplemented(java.lang.String)

startUriService

public String startUriService(ITA ta,
                              String scheme,
                              int port,
                              boolean portIsFlexible,
                              String basePath,
                              boolean basePathIsFlexible,
                              List<Map<String,IProfile>> contexts)
                       throws UCHException
Description copied from interface: ITAListener
The ITA requests the UCH to start servicing a URI which is made up of a given scheme, port, and base path. If successful, the UCH will forward all messages that have this URI as its base, to controllerRequest().

Specified by:
startUriService in interface ITAListener
Parameters:
ta - an ITA object
scheme - a String value of schema
port - a port no
portIsFlexible - a boolean value
basePath - a String value of basePath
basePathIsFlexible - a boolean value
contexts - a List<Map<String, IProfile>> of user and controller profile map
Returns:
a String value of URI
Throws:
UCHException - an Object of UCHException
See Also:
ITAListener.startUriService(ITA, String, int, boolean, String, boolean, List)

stopUriService

public void stopUriService(String uri)
                    throws UCHException
Description copied from interface: ITAListener
The ITA requests the UCH to stop servicing a URI that was requested to be serviced in a previous call to startUriService().

Specified by:
stopUriService in interface ITAListener
Parameters:
uri - a String value of URI
Throws:
UCHException - an Object of UCHException
See Also:
ITAListener.stopUriService(String)

uploadResources

public List<Map<String,String>> uploadResources(List<Map<String,List<String>>> props,
                                                List<String> resourceUri)
Description copied from interface: ITAListener
Upload Resources on Resource Server.

Specified by:
uploadResources in interface ITAListener
Parameters:
props - an Object of List<Map<String, List<String>>>
resourceUri - an Object of List<String>
Returns:
an Object of Map<String, String>
See Also:
ITAListener.uploadResources(List, List)

abortSession

public void abortSession(String sessionId)
Description copied from interface: ITAListener
The TA has terminated a session, when the TA will have no knowledge about that session.

Specified by:
abortSession in interface ITAListener
Parameters:
sessionId - a String value of sessionId
See Also:
ITAListener.abortSession(java.lang.String)

sessionForwardRequest

public void sessionForwardRequest(String sessionId,
                                  Map<String,String> forwardInfo)
Description copied from interface: ITAListener
The TA requests the client to open a session with different socket.

Specified by:
sessionForwardRequest in interface ITAListener
Parameters:
sessionId - a String value of sessionId
forwardInfo - Map<String, String>
See Also:
ITAListener.sessionForwardRequest(java.lang.String, java.util.Map)

setValidation

public boolean setValidation(ITA ta,
                             boolean activate)
Description copied from interface: ITAListener
Check whether to do validation for the TA or not.

Specified by:
setValidation in interface ITAListener
Parameters:
ta - an Object of ITA
activate - a boolean value of activate
Returns:
boolean whether to do validation for the TA or not
See Also:
ITAListener.setValidation(ITA, boolean)

updateDynRes

public void updateDynRes(List<String> sessionIds,
                         List<String> eltIds)
Description copied from interface: ITAListener
Signals that the set of resources pertaining to a specific socket element has been changed.

Specified by:
updateDynRes in interface ITAListener
Parameters:
sessionIds - a List<String> of sessionIds
eltIds - a List<String> of elementIds
See Also:
ITAListener.updateDynRes(List, List)

updateValues

public void updateValues(List<String> sessionIds,
                         List<String> paths,
                         List<String> operations,
                         List<String> values,
                         List<Boolean> hasDynRes)
Description copied from interface: ITAListener
The TA signals a change in the target’s status, affecting one or more sessions.

Specified by:
updateValues in interface ITAListener
Parameters:
sessionIds - a List<String> of sessionIds
paths - a List<String> of paths
operations - a List<String> of operations
values - a List<String> of values
hasDynRes - a List<Boolean> of hasDynRes
See Also:
ITAListener.updateValues(java.util.List, java.util.List, java.util.List, java.util.List, java.util.List)

addUriServiceContexts

public void addUriServiceContexts(String uri,
                                  List<Map<String,IProfile>> contexts)
                           throws UCHException
Description copied from interface: ITAListener
Called when the TA wants to add one or more contexts to a URI service.

Specified by:
addUriServiceContexts in interface ITAListener
Parameters:
uri - a String value of URI
contexts - a List<Map<String, IProfile>> of user and controller profile map
Throws:
UCHException - an Object of UCHException
See Also:
ITAListener.addUriServiceContexts(String, List)

removeUriServiceContexts

public void removeUriServiceContexts(String uri,
                                     List<Map<String,IProfile>> contexts)
                              throws UCHException
Description copied from interface: ITAListener
Called when the TA wants to remove one or more contexts to a URI service.

Specified by:
removeUriServiceContexts in interface ITAListener
Parameters:
uri - a String value of URI
contexts - a List<Map<String, IProfile>> of user and controller profile map
Throws:
UCHException - an Object of UCHException
See Also:
ITAListener.removeUriServiceContexts(String, List)

getTargetContexts

public List<Map<String,IProfile>> getTargetContexts(String targetId)
Description copied from interface: ITAListener
Get list of contexts for specified target.

Specified by:
getTargetContexts in interface ITAListener
Parameters:
targetId - a String value of targetId
Returns:
a List<Map<String, IProfile>> of user and controller profile map
See Also:
ITAListener.getTargetContexts(String)


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