org.activemath.webapp.ws.delegation
Class DelegationGuide.GuideService

java.lang.Object
  extended by org.activemath.webapp.ws.delegation.DelegationGuide.GuideService
All Implemented Interfaces:
ResourceHandler
Enclosing class:
DelegationGuide

protected class DelegationGuide.GuideService
extends Object
implements ResourceHandler


Constructor Summary
protected DelegationGuide.GuideService()
           
 
Method Summary
 Hashtable activityFinished(Hashtable args)
           
 int getLength()
          To populate the Content-Length header.
 String getMimeTypeChosen(Iterator acceptedMimeType)
          Chooses the appropriate mime-type from the list provided.
 long getModificationDate()
          To be returned to answer such queries as HTTP HEAD queries.
 void outputRepresentation(OutputStream response, String mimeTypes)
          Outputs content a descriptive state representation in the mime-type it recognizes as appropriate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegationGuide.GuideService

protected DelegationGuide.GuideService()
Method Detail

activityFinished

public Hashtable activityFinished(Hashtable args)
Parameters:
args - should contain: user resourceId score
Returns:
a map with at least urlToComeBack (to be resolved along the URL to call the service here)

getModificationDate

public long getModificationDate()
Description copied from interface: ResourceHandler
To be returned to answer such queries as HTTP HEAD queries.

Specified by:
getModificationDate in interface ResourceHandler
Returns:
the expected last-modification date or -1 if it is not known in which case, one assumes it was modified instantenously

getLength

public int getLength()
Description copied from interface: ResourceHandler
To populate the Content-Length header.

Specified by:
getLength in interface ResourceHandler
Returns:
the length if known or -1 if unknown

outputRepresentation

public void outputRepresentation(OutputStream response,
                                 String mimeTypes)
                          throws IOException
Description copied from interface: ResourceHandler
Outputs content a descriptive state representation in the mime-type it recognizes as appropriate.

Specified by:
outputRepresentation in interface ResourceHandler
Parameters:
response - the response to output to, the content-length, content-type and other headers should first be set.
mimeTypes - the list of mime-types as received by the Accept-Type http header.
Throws:
IOException

getMimeTypeChosen

public String getMimeTypeChosen(Iterator acceptedMimeType)
Description copied from interface: ResourceHandler
Chooses the appropriate mime-type from the list provided. This call is expected to be followed by a call to ResourceHandler.outputRepresentation(java.io.OutputStream, java.lang.String).

Specified by:
getMimeTypeChosen in interface ResourceHandler
Parameters:
acceptedMimeType - an iterator of mime-types (such as text/plain possbly followed by a semicolon with a quality value)
Returns:
the chosen mime-type