|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nnsoft.shs.http.BaseRequestHandler
public abstract class BaseRequestHandler
Provides an abstract class to be subclassed to create an HTTP handler. This class is inspired from HttpServlet. A subclass should override at least one method, usually one of:
options
, for HTTP OPTIONS requestsget
, for HTTP GET requestshead
, for HTTP HEAD requestspost
, for HTTP POST requestsput
, for HTTP PUT requestsdelete
, for HTTP DELETE requeststrace
, for HTTP TRACE requestsconnect
, for HTTP CONNECT requests
Constructor Summary | |
---|---|
BaseRequestHandler()
|
Method Summary | |
---|---|
protected void |
connect(Request request,
Response response)
HTTP CONNECT request. |
protected void |
delete(Request request,
Response response)
HTTP DELETE request. |
protected void |
get(Request request,
Response response)
HTTP GET request. |
void |
handle(Request request,
Response response)
Allows concrete implementations to populate Response parameters
given the Request . |
protected void |
head(Request request,
Response response)
HTTP HEAD request. |
protected void |
options(Request request,
Response response)
HTTP OPTIONS request. |
protected void |
post(Request request,
Response response)
HTTP POST request. |
protected void |
put(Request request,
Response response)
HTTP PUT request. |
protected void |
trace(Request request,
Response response)
HTTP TRACE request. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BaseRequestHandler()
Method Detail |
---|
public final void handle(Request request, Response response) throws IOException
Response
parameters
given the Request
.
handle
in interface RequestHandler
request
- the received HTTP requestresponse
- the HTTP response will be pushed out.
IOException
- if any I/0 error occurprotected void options(Request request, Response response) throws IOException
request
- the HTTP requestresponse
- the HTTP response
IOException
- if any error occurs while HTTP negotiationprotected void get(Request request, Response response) throws IOException
request
- the HTTP requestresponse
- the HTTP response
IOException
- if any error occurs while HTTP negotiationprotected void head(Request request, Response response) throws IOException
request
- the HTTP requestresponse
- the HTTP response
IOException
- if any error occurs while HTTP negotiationprotected void post(Request request, Response response) throws IOException
request
- the HTTP requestresponse
- the HTTP response
IOException
- if any error occurs while HTTP negotiationprotected void put(Request request, Response response) throws IOException
request
- the HTTP requestresponse
- the HTTP response
IOException
- if any error occurs while HTTP negotiationprotected void delete(Request request, Response response) throws IOException
request
- the HTTP requestresponse
- the HTTP response
IOException
- if any error occurs while HTTP negotiationprotected void trace(Request request, Response response) throws IOException
request
- the HTTP requestresponse
- the HTTP response
IOException
- if any error occurs while HTTP negotiationprotected void connect(Request request, Response response)
request
- the HTTP requestresponse
- the HTTP response
IOException
- if any error occurs while HTTP negotiation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |