Package ch.autumo.beetroot
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
FieldsModifier and TypeFieldDescriptionprotected static final org.slf4j.Loggerstatic final intstatic final intstatic final intFields inherited from class org.nanohttpd.protocols.http.HTTPSession
BUFSIZE, cookies, headers, MAX_HEADER_SIZE, method, parms, POST_DATA, protocolVersion, tempFileManager, uri -
Constructor Summary
ConstructorsConstructorDescriptionBeetRootHTTPSession(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 TypeMethodDescriptionvoidexecuteForServlet(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.voidoverwriteParameter(String key, String value) Overwrites existing parameter or adds it if it doens't exist.voidparseBodyForServlet(Map<String, String> files, jakarta.servlet.http.HttpServletRequest request) Provide a method for parsing the body from a servlet context in this nano session.voidupdateParameter(String key, String value) 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
-
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 idtempFileManager- temp file managerinputStream- http input stream
-
-
Method Details
-
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 requestresponse- 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.ResponseExceptionProvide a method for parsing the body from a servlet context in this nano session.- Parameters:
files- the map for the filesrequest- HttpServletRequest- Throws:
IOException- IO exceptionorg.nanohttpd.protocols.http.NanoHTTPD.ResponseException- response exception
-
getUserSession
Get user session for this HTTP session.- Returns:
- user session
-
updateParameter
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- keyvalue- new value
-
overwriteParameter
Overwrites existing parameter or adds it if it doens't exist.- Parameters:
key- keyvalue- new value
-