| 
 | SRJRCFrames v0.1.296 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface RequestHandler
describes the public interface for classes, that want to handle HTTP requests
| Field Summary | |
|---|---|
| static String | HTTP_CONTENT_LENGTH | 
| static String | HTTP_LANGUAGE | 
| static String | MIME_CSS | 
| static String | MIME_GIF | 
| static String | MIME_HTML | 
| static String | MIME_ICON | 
| static String | MIME_JPEG | 
| static String | MIME_JS | 
| static String | MIME_JSON | 
| static String | MIME_PNG | 
| static String | MIME_TIFF | 
| static String | MIME_UNKNOWN | 
| static String | QUERY_STRING | 
| static String | REQUEST_DEFAULT_HANDLER | 
| static String | REQUEST_DEFAULT_URL | 
| static String | REQUEST_GET_METHOD | 
| static String | REQUEST_HELP_URL | 
| static String | REQUEST_JSON_CHECK | 
| static String | REQUEST_LOCATION | 
| static String | REQUEST_METHOD | 
| static String | REQUEST_OPTIONS_METHOD | 
| static String | REQUEST_POST_METHOD | 
| static String | REQUEST_TIME | 
| static String | REQUEST_URI | 
| static String | REQUEST_WEBIF_BASE | 
| static String | REQUEST_WEBIF_EXT | 
| static String | REQUEST_WEBIF_ROOT | 
| static String | RESPONSE_HEADER | 
| static String | RESPONSE_LEN_HEADER | 
| static String | RESPONSE_STATUS_HEADER | 
| static String | SERVER_PROTOCOL | 
| Method Summary | |
|---|---|
|  ProtocolHandler | getProtocolHandler()getter for the ProtocolHandler, which is used for general error
 or help message handling | 
|  TransactionFactory | getTransactionFactory()getter for the TransactionFactory- just to avoid synthetic
 accessors for anonymous classes | 
|  void | process(Socket clientSocket,
        Map<String,String> header,
        Map<String,String> request)this is the entrypoint for request processing. | 
|  boolean | replySuccess(PrintWriter writer)centralized message creator service. | 
|  boolean | replySuccess(PrintWriter writer,
             HttpStatusCode status,
             String errorMessage)centralized message creator service | 
|  void | setup(String handlerID,
      ProtocolHandler ph)start the second stage of configuration. | 
|  String | usage()tells about the services and their parameters | 
| Field Detail | 
|---|
static final String HTTP_CONTENT_LENGTH
static final String HTTP_LANGUAGE
static final String QUERY_STRING
static final String REQUEST_DEFAULT_HANDLER
static final String REQUEST_DEFAULT_URL
static final String REQUEST_GET_METHOD
static final String REQUEST_HELP_URL
static final String REQUEST_JSON_CHECK
static final String REQUEST_LOCATION
static final String REQUEST_METHOD
static final String REQUEST_OPTIONS_METHOD
static final String REQUEST_POST_METHOD
static final String REQUEST_TIME
static final String REQUEST_URI
static final String REQUEST_WEBIF_ROOT
static final String REQUEST_WEBIF_BASE
static final String REQUEST_WEBIF_EXT
static final String SERVER_PROTOCOL
static final String MIME_CSS
static final String MIME_GIF
static final String MIME_ICON
static final String MIME_JPEG
static final String MIME_PNG
static final String MIME_TIFF
static final String MIME_JS
static final String MIME_JSON
static final String MIME_HTML
static final String MIME_UNKNOWN
static final String RESPONSE_STATUS_HEADER
static final String RESPONSE_LEN_HEADER
static final String RESPONSE_HEADER
| Method Detail | 
|---|
ProtocolHandler getProtocolHandler()
ProtocolHandler, which is used for general error
 or help message handling
ProtocolHandler instanceTransactionFactory getTransactionFactory()
TransactionFactory - just to avoid synthetic
 accessors for anonymous classes
void process(Socket clientSocket,
             Map<String,String> header,
             Map<String,String> request)
             throws Exception
ProtocolHandler. The request handler that decides, what to do,
 based on request parameters.
clientSocket - - the socket for client communicationheader - - a map that contains all requests header parametersrequest - - a map that contains all request parameters
Exception - - type of exception varies depending on the protocol used
boolean replySuccess(PrintWriter writer)
                     throws Exception
writer - - the communication channel to the client
Exception - - type of exception varies depending on the protocol used
boolean replySuccess(PrintWriter writer,
                     HttpStatusCode status,
                     String errorMessage)
                     throws Exception
writer - - the communication channel to the clientstatus - - the status code of the last requesterrorMessage - - the error message for the client
Exception - - type of exception varies depending on the protocol used
void setup(String handlerID,
           ProtocolHandler ph)
handlerID - - the identifier this handler acts upon. The identifier
            typically is the first name after the domain/port-part.ph - - the ProtocolHandler instanceString usage()
| 
 | SRJRCFrames v0.1.296 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||