Class RemoteHttpServletRequest
- java.lang.Object
-
- org.forgerock.openam.authentication.service.protocol.RemoteServletRequest
-
- org.forgerock.openam.authentication.service.protocol.RemoteHttpServletRequest
-
- All Implemented Interfaces:
jakarta.servlet.http.HttpServletRequest,jakarta.servlet.ServletRequest,Serializable
public class RemoteHttpServletRequest extends RemoteServletRequest implements jakarta.servlet.http.HttpServletRequest, Serializable
This class encapsulates a HttpServletRequest extending from RemoteServletRequest. The information or state that can be serialized is with non serialized content handled sensibly.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static longserialVersionUID-
Fields inherited from class org.forgerock.openam.authentication.service.protocol.RemoteServletRequest
debug, request, SERIALIZABLE_INT
-
-
Constructor Summary
Constructors Constructor Description RemoteHttpServletRequest()Called during deserialization.RemoteHttpServletRequest(jakarta.servlet.http.HttpServletRequest request)Creates a serializable request around the normal request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanauthenticate(jakarta.servlet.http.HttpServletResponse response)StringchangeSessionId()StringgetAuthType()The default behavior of this method is to return getAuthType() on the wrapped request object.StringgetContextPath()The default behavior of this method is to return getContextPath() on the wrapped request object.jakarta.servlet.http.Cookie[]getCookies()The default behavior of this method is to return getCookies() on the wrapped request object.longgetDateHeader(String name)The default behavior of this method is to return getDateHeader(String name) on the wrapped request object.StringgetHeader(String name)The default behavior of this method is to return getHeader(String name) on the wrapped request object.Enumeration<String>getHeaderNames()The default behavior of this method is to return getHeaderNames() on the wrapped request object.Enumeration<String>getHeaders(String name)The default behavior of this method is to return getHeaders(String name) on the wrapped request object.intgetIntHeader(String name)The default behavior of this method is to return getIntHeader(String name) on the wrapped request object.StringgetMethod()The default behavior of this method is to return getMethod() on the wrapped request object.jakarta.servlet.http.PartgetPart(String name)Collection<jakarta.servlet.http.Part>getParts()StringgetPathInfo()The default behavior of this method is to return getPathInfo() on the wrapped request object.StringgetPathTranslated()The default behavior of this method is to return getPathTranslated() on the wrapped request object.StringgetQueryString()The default behavior of this method is to return getQueryString() on the wrapped request object.StringgetRemoteUser()The default behavior of this method is to return getRemoteUser() on the wrapped request object.StringgetRequestedSessionId()The default behavior of this method is to return getRequestedSessionId() on the wrapped request object.StringgetRequestURI()The default behavior of this method is to return getRequestURI() on the wrapped request object.StringBuffergetRequestURL()The default behavior of this method is to return getRequestURL() on the wrapped request object.StringgetServletPath()The default behavior of this method is to return getServletPath() on the wrapped request object.jakarta.servlet.http.HttpSessiongetSession()The default behavior of this method is to return getSession() on the wrapped request object.jakarta.servlet.http.HttpSessiongetSession(boolean create)The default behavior of this method is to return getSession(boolean create) on the wrapped request object.PrincipalgetUserPrincipal()The default behavior of this method is to return getUserPrincipal() on the wrapped request object.booleanisRequestedSessionIdFromCookie()The default behavior of this method is to return isRequestedSessionIdFromCookie() on the wrapped request object.booleanisRequestedSessionIdFromUrl()The default behavior of this method is to return isRequestedSessionIdFromUrl() on the wrapped request object.booleanisRequestedSessionIdFromURL()The default behavior of this method is to return isRequestedSessionIdFromURL() on the wrapped request object.booleanisRequestedSessionIdValid()The default behavior of this method is to return isRequestedSessionIdValid() on the wrapped request object.booleanisUserInRole(String role)The default behavior of this method is to return isUserInRole(String role) on the wrapped request object.voidlogin(String username, String password)voidlogout()<T extends jakarta.servlet.http.HttpUpgradeHandler>
Tupgrade(Class<T> handlerClass)-
Methods inherited from class org.forgerock.openam.authentication.service.protocol.RemoteServletRequest
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isSerializable, processRequest, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsync, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jakarta.servlet.http.HttpServletRequest
getHttpServletMapping, getTrailerFields, isTrailerFieldsReady, newPushBuilder
-
Methods inherited from interface jakarta.servlet.ServletRequest
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
-
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RemoteHttpServletRequest
public RemoteHttpServletRequest()
Called during deserialization.
-
RemoteHttpServletRequest
public RemoteHttpServletRequest(jakarta.servlet.http.HttpServletRequest request)
Creates a serializable request around the normal request.- Parameters:
request- The request to encapsulate.
-
-
Method Detail
-
getAuthType
public String getAuthType()
The default behavior of this method is to return getAuthType() on the wrapped request object. Serialized.- Specified by:
getAuthTypein interfacejakarta.servlet.http.HttpServletRequest- Returns:
- The auth type of the request.
-
getCookies
public jakarta.servlet.http.Cookie[] getCookies()
The default behavior of this method is to return getCookies() on the wrapped request object. Serialized.- Specified by:
getCookiesin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- The cookies associates with the request
-
getDateHeader
public long getDateHeader(String name)
The default behavior of this method is to return getDateHeader(String name) on the wrapped request object. Not Serialized as we cannot differentiate date headers from normal headers.- Specified by:
getDateHeaderin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- The named date header in seconds or -1 if not available.
-
getHeader
public String getHeader(String name)
The default behavior of this method is to return getHeader(String name) on the wrapped request object. Serialized.- Specified by:
getHeaderin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- The value of the named header.
-
getHeaders
public Enumeration<String> getHeaders(String name)
The default behavior of this method is to return getHeaders(String name) on the wrapped request object. Serialized.- Specified by:
getHeadersin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- Enumeration of the value of the named header.
-
getHeaderNames
public Enumeration<String> getHeaderNames()
The default behavior of this method is to return getHeaderNames() on the wrapped request object. Serialized.- Specified by:
getHeaderNamesin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- Enumeration of header names
-
getIntHeader
public int getIntHeader(String name)
The default behavior of this method is to return getIntHeader(String name) on the wrapped request object. Serialized.- Specified by:
getIntHeaderin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- The value of the header expressed as an int
- Throws:
NumberFormatException- if the header cannot be expressed as an int
-
getMethod
public String getMethod()
The default behavior of this method is to return getMethod() on the wrapped request object. Serialized.- Specified by:
getMethodin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- The method associated with the request.
-
getPathInfo
public String getPathInfo()
The default behavior of this method is to return getPathInfo() on the wrapped request object. Serialized.- Specified by:
getPathInfoin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- The path info associated with the request.
-
getPathTranslated
public String getPathTranslated()
The default behavior of this method is to return getPathTranslated() on the wrapped request object. Serialized.- Specified by:
getPathTranslatedin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- The translated path of the request.
-
getContextPath
public String getContextPath()
The default behavior of this method is to return getContextPath() on the wrapped request object. Serialized.- Specified by:
getContextPathin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- The context path of the request.
-
getQueryString
public String getQueryString()
The default behavior of this method is to return getQueryString() on the wrapped request object. Serialized.- Specified by:
getQueryStringin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- The query string of the request.
-
getRemoteUser
public String getRemoteUser()
The default behavior of this method is to return getRemoteUser() on the wrapped request object. Serialized.- Specified by:
getRemoteUserin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- The remote user of the request, if set null otherwise.
-
isUserInRole
public boolean isUserInRole(String role)
The default behavior of this method is to return isUserInRole(String role) on the wrapped request object. Not serialized.- Specified by:
isUserInRolein interfacejakarta.servlet.http.HttpServletRequest- Returns:
- True if user is in named role, false otherwise.
-
getUserPrincipal
public Principal getUserPrincipal()
The default behavior of this method is to return getUserPrincipal() on the wrapped request object. Serialized.- Specified by:
getUserPrincipalin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- The principal of the authenticated user, if available otherwise null.
-
getRequestedSessionId
public String getRequestedSessionId()
The default behavior of this method is to return getRequestedSessionId() on the wrapped request object. Serialized.- Specified by:
getRequestedSessionIdin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- The session id of the request, if available.
-
getRequestURI
public String getRequestURI()
The default behavior of this method is to return getRequestURI() on the wrapped request object. Serialized.- Specified by:
getRequestURIin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- The request URI
-
getRequestURL
public StringBuffer getRequestURL()
The default behavior of this method is to return getRequestURL() on the wrapped request object. Serialized.- Specified by:
getRequestURLin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- The requests URL
-
getServletPath
public String getServletPath()
The default behavior of this method is to return getServletPath() on the wrapped request object. Serialized.- Specified by:
getServletPathin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- The servlets path.
-
getSession
public jakarta.servlet.http.HttpSession getSession(boolean create)
The default behavior of this method is to return getSession(boolean create) on the wrapped request object. Not Serailzed.- Specified by:
getSessionin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- The HttpSession associated with the request or null if unavailable.
-
getSession
public jakarta.servlet.http.HttpSession getSession()
The default behavior of this method is to return getSession() on the wrapped request object. Not Serialized.- Specified by:
getSessionin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- The HttpSession associated with the request or null if unavailable.
-
isRequestedSessionIdValid
public boolean isRequestedSessionIdValid()
The default behavior of this method is to return isRequestedSessionIdValid() on the wrapped request object. Not Serialized.- Specified by:
isRequestedSessionIdValidin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- true if the session id is valid, false otherwise.
-
isRequestedSessionIdFromCookie
public boolean isRequestedSessionIdFromCookie()
The default behavior of this method is to return isRequestedSessionIdFromCookie() on the wrapped request object. Not serialized.- Specified by:
isRequestedSessionIdFromCookiein interfacejakarta.servlet.http.HttpServletRequest- Returns:
- true if the session id is from a cookie, false otherwise.
-
isRequestedSessionIdFromURL
public boolean isRequestedSessionIdFromURL()
The default behavior of this method is to return isRequestedSessionIdFromURL() on the wrapped request object. Not Serialized.- Specified by:
isRequestedSessionIdFromURLin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- true if the session id is from a URL, false otherwise.
-
isRequestedSessionIdFromUrl
public boolean isRequestedSessionIdFromUrl()
The default behavior of this method is to return isRequestedSessionIdFromUrl() on the wrapped request object. Not Serialized.- Specified by:
isRequestedSessionIdFromUrlin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- true if the session id is from a URL, false otherwise.
-
authenticate
public boolean authenticate(jakarta.servlet.http.HttpServletResponse response) throws IOException, jakarta.servlet.ServletException- Specified by:
authenticatein interfacejakarta.servlet.http.HttpServletRequest- Throws:
IOExceptionjakarta.servlet.ServletException
-
login
public void login(String username, String password) throws jakarta.servlet.ServletException
- Specified by:
loginin interfacejakarta.servlet.http.HttpServletRequest- Throws:
jakarta.servlet.ServletException
-
logout
public void logout() throws jakarta.servlet.ServletException- Specified by:
logoutin interfacejakarta.servlet.http.HttpServletRequest- Throws:
jakarta.servlet.ServletException
-
getParts
public Collection<jakarta.servlet.http.Part> getParts() throws IOException, jakarta.servlet.ServletException
- Specified by:
getPartsin interfacejakarta.servlet.http.HttpServletRequest- Throws:
IOExceptionjakarta.servlet.ServletException
-
getPart
public jakarta.servlet.http.Part getPart(String name) throws IOException, jakarta.servlet.ServletException
- Specified by:
getPartin interfacejakarta.servlet.http.HttpServletRequest- Throws:
IOExceptionjakarta.servlet.ServletException
-
changeSessionId
public String changeSessionId()
- Specified by:
changeSessionIdin interfacejakarta.servlet.http.HttpServletRequest
-
upgrade
public <T extends jakarta.servlet.http.HttpUpgradeHandler> T upgrade(Class<T> handlerClass) throws IOException, jakarta.servlet.ServletException
- Specified by:
upgradein interfacejakarta.servlet.http.HttpServletRequest- Throws:
IOExceptionjakarta.servlet.ServletException
-
-