Class HttpMessageContext
java.lang.Object
com.levigo.jadice.web.transport.server.networking.HttpMessageContext
- All Implemented Interfaces:
MessageContext
This extends the
MessageContext by carrying the HttpServletRequest of the client.-
Constructor Summary
ConstructorsConstructorDescriptionHttpMessageContext(String clientID, jakarta.servlet.http.HttpServletRequest request) Constructs a message context, that interfaces aClient, identified by its id, with the correspondingHttpServletRequest.HttpMessageContext(String clientID, jakarta.servlet.http.HttpServletRequest request, boolean alwaysCreateHttpSession) Constructs a message context, that interfaces aClient, identified by its id, with the correspondingHttpServletRequest. -
Method Summary
Modifier and TypeMethodDescriptionReturns the client id of the client which did send the message associated with this message context.jakarta.servlet.http.HttpSessionReturns theHttpSessionof the message associated with this message context.Returns the query string contained in the message for this context.jakarta.servlet.http.HttpServletRequestGets theHttpServletRequestof the HTTP message.Returns the URI requested by the message for this context from the protocol up to the query string.Returns thePrincipalidentifying the user sending the message.
-
Constructor Details
-
HttpMessageContext
Constructs a message context, that interfaces aClient, identified by its id, with the correspondingHttpServletRequest.- Parameters:
clientID- the id of the clientrequest- the request of the client
-
HttpMessageContext
public HttpMessageContext(String clientID, jakarta.servlet.http.HttpServletRequest request, boolean alwaysCreateHttpSession) Constructs a message context, that interfaces aClient, identified by its id, with the correspondingHttpServletRequest.- Parameters:
clientID- the id of the clientrequest- the request of the clientalwaysCreateHttpSession- set this to false if you do not want to enforece the creation of a http-session
-
-
Method Details
-
getRequest
public jakarta.servlet.http.HttpServletRequest getRequest()Gets theHttpServletRequestof the HTTP message.- Returns:
- the
HttpServletRequestof the HTTP message.
-
getUserPrincipal
Description copied from interface:MessageContextReturns thePrincipalidentifying the user sending the message.- Specified by:
getUserPrincipalin interfaceMessageContext- Returns:
- the user
Principal
-
getRequestURI
Description copied from interface:MessageContextReturns the URI requested by the message for this context from the protocol up to the query string.Example:
- https://somepage.com/somesite?key=value
- RequestURI: somepage.com/somesite
- Specified by:
getRequestURIin interfaceMessageContext- Returns:
- the requested URI
-
getQueryString
Description copied from interface:MessageContextReturns the query string contained in the message for this context.Example:
- https://somepage.com/somesite?key=value
- QueryString: key=value
- Specified by:
getQueryStringin interfaceMessageContext- Returns:
- the query string
-
getClientID
Description copied from interface:MessageContextReturns the client id of the client which did send the message associated with this message context.- Specified by:
getClientIDin interfaceMessageContext- Returns:
- the client id
-
getHTTPSession
public jakarta.servlet.http.HttpSession getHTTPSession()Description copied from interface:MessageContextReturns theHttpSessionof the message associated with this message context.- Specified by:
getHTTPSessionin interfaceMessageContext- Returns:
- the
HttpSession
-