Class BeetRootHTTPSession

java.lang.Object
org.nanohttpd.protocols.http.HTTPSession
ch.autumo.beetroot.BeetRootHTTPSession
All Implemented Interfaces:
org.nanohttpd.protocols.http.IHTTPSession

public class BeetRootHTTPSession extends org.nanohttpd.protocols.http.HTTPSession
BeetRoot HTTP session.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final org.slf4j.Logger
     
    static final int
     
    static final int
     
    static final int
     

    Fields inherited from class org.nanohttpd.protocols.http.HTTPSession

    BUFSIZE, cookies, headers, MAX_HEADER_SIZE, method, parms, POST_DATA, protocolVersion, tempFileManager, uri
  • Constructor Summary

    Constructors
    Constructor
    Description
    BeetRootHTTPSession(String externalSessionId, org.nanohttpd.protocols.http.tempfiles.ITempFileManager tempFileManager, InputStream inputStream)
    Constructor used for external servlet containers.
    BeetRootHTTPSession(org.nanohttpd.protocols.http.NanoHTTPD httpd, org.nanohttpd.protocols.http.tempfiles.ITempFileManager tempFileManager, InputStream inputStream, OutputStream outputStream)
     
    BeetRootHTTPSession(org.nanohttpd.protocols.http.NanoHTTPD httpd, org.nanohttpd.protocols.http.tempfiles.ITempFileManager tempFileManager, InputStream inputStream, OutputStream outputStream, InetAddress inetAddress)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    executeForServlet(BeetRootService beetRootService, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
    Provide a method for executing the request and response for the HTTP body only from the servlet context in this nano/beetRoot session.
     
    Get user session for this HTTP session.
    void
    Overwrites existing parameter or adds it if it doens't exist.
    void
    parseBodyForServlet(Map<String,String> files, jakarta.servlet.http.HttpServletRequest request)
    Provide a method for parsing the body from a servlet context in this nano session.
    void
    Update one parameter.

    Methods inherited from class org.nanohttpd.protocols.http.HTTPSession

    execute, getBodySize, getCookies, getHeaders, getInputStream, getMethod, getParameters, getParms, getQueryParameterString, getRemoteIpAddress, getUri, parseBody, saveTmpFile

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOG

      protected static final org.slf4j.Logger LOG
    • UPLOAD_BUFFER_SIZE

      public static final int UPLOAD_BUFFER_SIZE
    • RESPONSE_BUFFER_SIZE

      public static final int RESPONSE_BUFFER_SIZE
    • RESPONSE_DOWNLOAD_BUFFER_SIZE

      public static final int RESPONSE_DOWNLOAD_BUFFER_SIZE
  • Constructor Details

    • BeetRootHTTPSession

      public BeetRootHTTPSession(org.nanohttpd.protocols.http.NanoHTTPD httpd, org.nanohttpd.protocols.http.tempfiles.ITempFileManager tempFileManager, InputStream inputStream, OutputStream outputStream)
    • BeetRootHTTPSession

      public BeetRootHTTPSession(org.nanohttpd.protocols.http.NanoHTTPD httpd, org.nanohttpd.protocols.http.tempfiles.ITempFileManager tempFileManager, InputStream inputStream, OutputStream outputStream, InetAddress inetAddress)
    • BeetRootHTTPSession

      public BeetRootHTTPSession(String externalSessionId, org.nanohttpd.protocols.http.tempfiles.ITempFileManager tempFileManager, InputStream inputStream)
      Constructor used for external servlet containers.
      Parameters:
      externalSessionId - external session id
      tempFileManager - temp file manager
      inputStream - http input stream
  • Method Details

    • getExternalSessionId

      public String getExternalSessionId()
    • executeForServlet

      public void executeForServlet(BeetRootService beetRootService, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException
      Provide a method for executing the request and response for the HTTP body only from the servlet context in this nano/beetRoot session.
      Parameters:
      beetRootService - beetRoot service, in this case the beetRoor server when running in a web container!
      request - HTTP request
      response - HTTP response
      Throws:
      IOException - IO exception
    • parseBodyForServlet

      public void parseBodyForServlet(Map<String,String> files, jakarta.servlet.http.HttpServletRequest request) throws IOException, org.nanohttpd.protocols.http.NanoHTTPD.ResponseException
      Provide a method for parsing the body from a servlet context in this nano session.
      Parameters:
      files - the map for the files
      request - HttpServletRequest
      Throws:
      IOException - IO exception
      org.nanohttpd.protocols.http.NanoHTTPD.ResponseException - response exception
    • getUserSession

      public Session getUserSession()
      Get user session for this HTTP session.
      Returns:
      user session
    • updateParameter

      public void updateParameter(String key, String value)
      Update one parameter. It is only updated, if a matching value for this key exists and it's a single value, not a list of parameter values.
      Parameters:
      key - key
      value - new value
    • overwriteParameter

      public void overwriteParameter(String key, String value)
      Overwrites existing parameter or adds it if it doens't exist.
      Parameters:
      key - key
      value - new value