Package com.peterphi.std.guice.web
Class HttpCallContext
java.lang.Object
com.peterphi.std.guice.web.HttpCallContext
Represents the current Http Call being processed by this Thread
-
Constructor Summary
ConstructorDescriptionHttpCallContext
(String logId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
clear()
static HttpCallContext
get()
Retrieve the HttpCallContext associated with this ThreadgetLogId()
javax.servlet.http.HttpServletRequest
Returns a string representation of the request (e.g.javax.servlet.http.HttpServletResponse
javax.servlet.ServletContext
boolean
static HttpCallContext
peek()
Retrieve the HttpCallContext associated with this Thread (or null if none is associated)static HttpCallContext
set
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext) Creates and associates an HttpCallContext with the current Thread
-
Constructor Details
-
HttpCallContext
public HttpCallContext(String logId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext)
-
-
Method Details
-
get
Retrieve the HttpCallContext associated with this Thread- Returns:
- Throws:
IllegalStateException
- if not inside an http call
-
peek
Retrieve the HttpCallContext associated with this Thread (or null if none is associated)- Returns:
- Throws:
IllegalStateException
- if not inside an http call
-
clear
public static void clear() -
set
public static HttpCallContext set(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext) Creates and associates an HttpCallContext with the current Thread- Parameters:
request
-response
-- Returns:
-
getLogId
-
getRequest
public javax.servlet.http.HttpServletRequest getRequest() -
getResponse
public javax.servlet.http.HttpServletResponse getResponse() -
getServletContext
public javax.servlet.ServletContext getServletContext() -
getRequestInfo
Returns a string representation of the request (e.g. "GET /webapp/rest/resource?a=b")- Returns:
-
isVerbose
public boolean isVerbose()
-