Package org.faceless.publisher.web
Class AbstractHttpSession
java.lang.Object
org.faceless.publisher.web.AbstractHttpSession
An abstraction of an HTTP request/response sesssion, such as one corresponding
to the HttpServletRequest/Response pair passed inth an HttpServlet.
Will be passed into an HttpController
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
Begin an "async" sequence - the thread can be freedabstract void
Complete an "async" sequence started earlierReturn the Autorization derived from the requestabstract InetAddress
Return the remote address for the connectiongetRequestHeader
(String key) Return a specific header from the request, or null if it wasn't specifiedReturn the full set of request headersabstract InputStream
Return the InputStream supplied with the POST request, or null otherwiseabstract String
Return the request methodReturn the specified parameter from the request URL, or null if it wasn't specified.Return the full set of request parameters.abstract String
Return the full path for the request, relative to the web-application root and beginning with a "/"abstract OutputStream
Return the OutputStream for the responseabstract ServiceEngine
Return the ServiceEngine that applies to this objectgetType()
Return the type, eg "store", "convert"abstract void
Log a message to the ServiceEngineabstract void
setResponseCode
(int code) Set the code for the responsevoid
setResponseDateHeader
(String key, long value) Set a header for the responseabstract void
setResponseHeader
(String key, String value) Set a header for the response
-
Constructor Details
-
AbstractHttpSession
public AbstractHttpSession()
-
-
Method Details
-
getRemoteAddress
Return the remote address for the connection -
getRequestInputStream
Return the InputStream supplied with the POST request, or null otherwise- Throws:
IOException
-
getResponseOutputStream
Return the OutputStream for the response- Throws:
IOException
-
getRequestHeaders
Return the full set of request headers- Throws:
IOException
-
getRequestParameters
Return the full set of request parameters. Should only apply for GET or for application/x-www-form-urlencoded.- Throws:
IOException
-
getRequestMethod
Return the request method -
getRequestPath
Return the full path for the request, relative to the web-application root and beginning with a "/" -
setResponseHeader
Set a header for the response- Throws:
IOException
-
setResponseCode
Set the code for the response- Throws:
IOException
-
beginAsync
public abstract void beginAsync()Begin an "async" sequence - the thread can be freed -
completeAsync
public abstract void completeAsync()Complete an "async" sequence started earlier -
log
Log a message to the ServiceEngine- Parameters:
s
- the messagee
- the optional throwable
-
getServiceEngine
Return the ServiceEngine that applies to this object -
setResponseDateHeader
Set a header for the response- Parameters:
value
- time in millis since epoch- Throws:
IOException
-
getRequestHeader
Return a specific header from the request, or null if it wasn't specified- Parameters:
key
- the case-insensitive header name- Returns:
- the header value, or null if none applies
- Throws:
IOException
-
getRequestParameter
Return the specified parameter from the request URL, or null if it wasn't specified.- Parameters:
key
- the parameter name- Returns:
- the value of that parameter, or null if it doesn't exist
- Throws:
IOException
-
getAuthorization
Return the Autorization derived from the request -
getType
Return the type, eg "store", "convert"
-