com.ldodds.http.responder
Interface Responder

All Known Implementing Classes:
AddFriendHandler, DocumentHandler, DumpRDFHandler

public interface Responder

Handler for HTTP requests

Author:
ldodds

Method Summary
 boolean canRespond(java.lang.String path)
           
 java.lang.String getMimeType()
           
 byte[] respond(java.lang.String path, java.util.Map parameters)
          Called by the HTTP Server to ask the object to handle the HTTP request.
 

Method Detail

respond

public byte[] respond(java.lang.String path,
                      java.util.Map parameters)
               throws java.io.IOException
Called by the HTTP Server to ask the object to handle the HTTP request. The only context information provided is the path info and the URL parameters. No details of the user agent, etc. are provided.

Parameters:
path - the path-info
parameters - the url parameters
Returns:
a byte array containing the response.
Throws:
java.io.IOException - if there were a problem handling the request, server will generate an HTTP 500 response containing the exception message

getMimeType

public java.lang.String getMimeType()

canRespond

public boolean canRespond(java.lang.String path)