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
-
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 the full set of request headersabstract InputStream
Return the InputStream supplied with the POST request, or null otherwiseabstract String
Return the request methodReturn 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
getType()
Return the type, eg "store", "convert"void
Json
load()
abstract void
abstract 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
-
getServiceEngine
-
setResponseDateHeader
Set a header for the response- Parameters:
value
- time in millis since epoch- Throws:
IOException
-
getRequestHeader
- Throws:
IOException
-
getRequestParameter
- Throws:
IOException
-
initialize
- Throws:
IOException
-
getAuthorization
Return the Autorization derived from the request -
getType
Return the type, eg "store", "convert" -
load
- Throws:
IOException
-