org.activemath.webapp.ws.delegation.siette
Class SietteCallback

java.lang.Object
  extended by org.activemath.webapp.ws.delegation.siette.SietteCallback
All Implemented Interfaces:
ResourceHandler

public class SietteCallback
extends Object
implements ResourceHandler

Describe me!


Constructor Summary
SietteCallback(SietteDelegation sietteGuide)
           
 
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.
 String getUrlForExercise(String exerciseId)
           
 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

SietteCallback

public SietteCallback(SietteDelegation sietteGuide)
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)

getUrlForExercise

public String getUrlForExercise(String exerciseId)
Parameters:
exerciseId -
Returns:
URL for playing exerciseId

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

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

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