org.activemath.webapp.ws.delegation
Class DelegationProcess

java.lang.Object
  extended by org.activemath.webapp.ws.delegation.DelegationProcess

public class DelegationProcess
extends Object

A class to model the generic process of delegating a browser from one server to the other. This class is thought to be used on both the activity-server side and guide-server-side.

Subclasses of this class should be linked to the web-service-invocation logic. Subclasses of this class could be:


Nested Class Summary
static class DelegationProcess.DelegationBean
          A simple class with get and set for delegation states...
 
Constructor Summary
DelegationProcess(String name)
           
 
Method Summary
protected  void createDelegationBean()
          Creates an initializes the delegation-bean which stores all states of this process.
 Hashtable delegatedActivityFinished(float score, String user, String resourceIdentifier, Hashtable optionalParams)
          Signals the end of the delegation... copy from step 3.
protected  void fillMapToStartDelegation(Map map)
          Populates the return map using, at least, directBrowserUrlTo.
 void outputDelegationState(OutputStream out)
          Outputs to the stream an XML document representing the state of the delegation as read from the currently stored state.
 Hashtable startDelegation(String resourceIdentifier, String userId, String urlToReturnTheResultTo, String urlToSendEventsTo, Hashtable optionalParams)
          Starts the delegation process as in step 1 of the browser delegation scenario.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegationProcess

public DelegationProcess(String name)
Method Detail

createDelegationBean

protected void createDelegationBean()
Creates an initializes the delegation-bean which stores all states of this process.


outputDelegationState

public void outputDelegationState(OutputStream out)
                           throws IOException
Outputs to the stream an XML document representing the state of the delegation as read from the currently stored state.

Parameters:
out -
Throws:
IOException

startDelegation

public Hashtable startDelegation(String resourceIdentifier,
                                 String userId,
                                 String urlToReturnTheResultTo,
                                 String urlToSendEventsTo,
                                 Hashtable optionalParams)
Starts the delegation process as in step 1 of the browser delegation scenario. This method calls all the setters for the fields os same name followed by #postStartDelegation.

Parameters:
resourceIdentifier -
userId -
urlToReturnTheResultTo -
urlToSendEventsTo -
optionalParams -
Returns:
the map returned should have the keys:
  • directBrowserUrlTo which is the first place where the delegated browser is taken to
  • optional arguments...

fillMapToStartDelegation

protected void fillMapToStartDelegation(Map map)
Populates the return map using, at least, directBrowserUrlTo. This value should be a string URL, which will be resolved relative to the root-URL that called us. TODO: check if can have this!

Parameters:
map -

delegatedActivityFinished

public Hashtable delegatedActivityFinished(float score,
                                           String user,
                                           String resourceIdentifier,
                                           Hashtable optionalParams)
Signals the end of the delegation... copy from step 3.

Implementations of this method should check that the user and resourceIdentifier strings are the same.

Parameters:
score -
user -
resourceIdentifier -
optionalParams -
Returns:
a map with at least the keys:
  • urlToComeBack