Class AbstractHttpSession

java.lang.Object
org.faceless.publisher.web.AbstractHttpSession

public abstract class AbstractHttpSession extends Object
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 Details

    • AbstractHttpSession

      public AbstractHttpSession()
  • Method Details

    • getRemoteAddress

      public abstract InetAddress getRemoteAddress()
      Return the remote address for the connection
    • getRequestInputStream

      public abstract InputStream getRequestInputStream() throws IOException
      Return the InputStream supplied with the POST request, or null otherwise
      Throws:
      IOException
    • getResponseOutputStream

      public abstract OutputStream getResponseOutputStream() throws IOException
      Return the OutputStream for the response
      Throws:
      IOException
    • getRequestHeaders

      public abstract Map<String,List<String>> getRequestHeaders() throws IOException
      Return the full set of request headers
      Throws:
      IOException
    • getRequestParameters

      public abstract Map<String,List<String>> getRequestParameters() throws IOException
      Return the full set of request parameters. Should only apply for GET or for application/x-www-form-urlencoded.
      Throws:
      IOException
    • getRequestMethod

      public abstract String getRequestMethod()
      Return the request method
    • getRequestPath

      public abstract String getRequestPath()
      Return the full path for the request, relative to the web-application root and beginning with a "/"
    • setResponseHeader

      public abstract void setResponseHeader(String key, String value) throws IOException
      Set a header for the response
      Throws:
      IOException
    • setResponseCode

      public abstract void setResponseCode(int code) throws IOException
      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

      public abstract void log(String s, Throwable e)
    • getServiceEngine

      public abstract ServiceEngine getServiceEngine()
    • setResponseDateHeader

      public void setResponseDateHeader(String key, long value) throws IOException
      Set a header for the response
      Parameters:
      value - time in millis since epoch
      Throws:
      IOException
    • getRequestHeader

      public String getRequestHeader(String key) throws IOException
      Throws:
      IOException
    • getRequestParameter

      public String getRequestParameter(String key) throws IOException
      Throws:
      IOException
    • initialize

      public void initialize() throws IOException
      Throws:
      IOException
    • getAuthorization

      public Authorization getAuthorization()
      Return the Autorization derived from the request
    • getType

      public String getType()
      Return the type, eg "store", "convert"
    • load

      public Json load() throws IOException
      Throws:
      IOException