Class RemoteServletRequest
- java.lang.Object
-
- org.forgerock.openam.authentication.service.protocol.RemoteServletRequest
-
- All Implemented Interfaces:
jakarta.servlet.ServletRequest,Serializable
- Direct Known Subclasses:
RemoteHttpServletRequest
public class RemoteServletRequest extends Object implements jakarta.servlet.ServletRequest, Serializable
This class encapsulates a ServletRequest allowing its state to be serialized.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Debugdebugprotected jakarta.servlet.ServletRequestrequeststatic StringSERIALIZABLE_INTstatic longserialVersionUID
-
Constructor Summary
Constructors Constructor Description RemoteServletRequest()Called during the deserialization process.RemoteServletRequest(jakarta.servlet.ServletRequest request)Creates a ServletRequest adaptor wrapping the given request object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description jakarta.servlet.AsyncContextgetAsyncContext()ObjectgetAttribute(String name)The default behavior of this method is to call getAttribute(String name) on the wrapped request object.Enumeration<String>getAttributeNames()The default behavior of this method is to return getAttributeNames() on the wrapped request object.StringgetCharacterEncoding()The default behavior of this method is to return getCharacterEncoding() on the wrapped request object.intgetContentLength()The default behavior of this method is to return getContentLength() on the wrapped request object.longgetContentLengthLong()StringgetContentType()The default behavior of this method is to return getContentType() on the wrapped request object.jakarta.servlet.DispatcherTypegetDispatcherType()jakarta.servlet.ServletInputStreamgetInputStream()The default behavior of this method is to return getInputStream() on the wrapped request object.StringgetLocalAddr()Returns the Internet Protocol (IP) address of the interface on which the request was received.LocalegetLocale()The default behavior of this method is to return getLocale() on the wrapped request object.Enumeration<Locale>getLocales()The default behavior of this method is to return getLocales() on the wrapped request object.StringgetLocalName()Returns the host name of the Internet Protocol (IP) interface on which the request was received.intgetLocalPort()Returns the Internet Protocol (IP) port number of the interface on which the request was received.StringgetParameter(String name)The default behavior of this method is to return getParameter(String name) on the wrapped request object.Map<String,String[]>getParameterMap()The default behavior of this method is to return getParameterMap() on the wrapped request object.Enumeration<String>getParameterNames()The default behavior of this method is to return getParameterNames() on the wrapped request object.String[]getParameterValues(String name)The default behavior of this method is to return getParameterValues(String name) on the wrapped request object.StringgetProtocol()The default behavior of this method is to return getProtocol() on the wrapped request object.BufferedReadergetReader()The default behavior of this method is to return getReader() on the wrapped request object.StringgetRealPath(String path)The default behavior of this method is to return getRealPath(String path) on the wrapped request object.StringgetRemoteAddr()The default behavior of this method is to return getRemoteAddr() on the wrapped request object.StringgetRemoteHost()The default behavior of this method is to return getRemoteHost() on the wrapped request object.intgetRemotePort()Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.jakarta.servlet.ServletRequestgetRequest()Return the wrapped request object.jakarta.servlet.RequestDispatchergetRequestDispatcher(String path)The default behavior of this method is to return getRequestDispatcher(String path) on the wrapped request object.StringgetScheme()The default behavior of this method is to return getScheme() on the wrapped request object.StringgetServerName()The default behavior of this method is to return getServerName() on the wrapped request object.intgetServerPort()The default behavior of this method is to return getServerPort() on the wrapped request object.jakarta.servlet.ServletContextgetServletContext()booleanisAsyncStarted()booleanisAsyncSupported()booleanisSecure()The default behavior of this method is to return isSecure() on the wrapped request object.protected booleanisSerializable(Object obj)Tests if an object implements the java.io.Serializable interface.protected voidprocessRequest()voidremoveAttribute(String name)The default behavior of this method is to call removeAttribute(String name) on the wrapped request object.voidsetAttribute(String name, Object o)The default behavior of this method is to return setAttribute(String name, Object o) on the wrapped request object.voidsetCharacterEncoding(String enc)The default behavior of this method is to set the character encoding on the wrapped request object, if available.voidsetRequest(jakarta.servlet.ServletRequest request)Sets the request object being wrapped.jakarta.servlet.AsyncContextstartAsync()jakarta.servlet.AsyncContextstartAsync(jakarta.servlet.ServletRequest servletRequest, jakarta.servlet.ServletResponse servletResponse)StringtoString()
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
- See Also:
- Constant Field Values
-
request
protected transient jakarta.servlet.ServletRequest request
-
debug
protected transient Debug debug
-
SERIALIZABLE_INT
public static final String SERIALIZABLE_INT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RemoteServletRequest
public RemoteServletRequest(jakarta.servlet.ServletRequest request)
Creates a ServletRequest adaptor wrapping the given request object.- Parameters:
request- The ServletRequest to be serialized- Throws:
IllegalArgumentException- if the request is null
-
RemoteServletRequest
public RemoteServletRequest()
Called during the deserialization process.
-
-
Method Detail
-
processRequest
protected void processRequest()
-
getRequest
public jakarta.servlet.ServletRequest getRequest()
Return the wrapped request object.- Returns:
- The ServletRequest or null if the object has been deserialized
-
setRequest
public void setRequest(jakarta.servlet.ServletRequest request)
Sets the request object being wrapped.- Throws:
IllegalArgumentException- if the request is null.
-
getAttribute
public Object getAttribute(String name)
The default behavior of this method is to call getAttribute(String name) on the wrapped request object. Only those attributes that are serializable will have been serialized. Some attributes may be missing post serialization.- Specified by:
getAttributein interfacejakarta.servlet.ServletRequest- Parameters:
name- The name of the attibute to get- Returns:
- The value of the attribute or null.
-
getAttributeNames
public Enumeration<String> getAttributeNames()
The default behavior of this method is to return getAttributeNames() on the wrapped request object. Serialized.- Specified by:
getAttributeNamesin interfacejakarta.servlet.ServletRequest- Returns:
- Enumeration of attribute names
-
getCharacterEncoding
public String getCharacterEncoding()
The default behavior of this method is to return getCharacterEncoding() on the wrapped request object. Serialized.- Specified by:
getCharacterEncodingin interfacejakarta.servlet.ServletRequest- Returns:
- The character encoding of this request
-
setCharacterEncoding
public void setCharacterEncoding(String enc) throws UnsupportedEncodingException
The default behavior of this method is to set the character encoding on the wrapped request object, if available. After serialization justs updates the internal state.- Specified by:
setCharacterEncodingin interfacejakarta.servlet.ServletRequest- Parameters:
enc- The new character encoding for the request- Throws:
UnsupportedEncodingException
-
getContentLength
public int getContentLength()
The default behavior of this method is to return getContentLength() on the wrapped request object. Serialized.- Specified by:
getContentLengthin interfacejakarta.servlet.ServletRequest- Returns:
- The content length of the request
-
getContentLengthLong
public long getContentLengthLong()
- Specified by:
getContentLengthLongin interfacejakarta.servlet.ServletRequest
-
getContentType
public String getContentType()
The default behavior of this method is to return getContentType() on the wrapped request object. Serialized.- Specified by:
getContentTypein interfacejakarta.servlet.ServletRequest- Returns:
- The content type of the request
-
getInputStream
public jakarta.servlet.ServletInputStream getInputStream() throws IOExceptionThe default behavior of this method is to return getInputStream() on the wrapped request object. Not serialized, null post serialization.- Specified by:
getInputStreamin interfacejakarta.servlet.ServletRequest- Returns:
- The InputStream if available.
- Throws:
IOException
-
getLocalAddr
public String getLocalAddr()
Returns the Internet Protocol (IP) address of the interface on which the request was received.- Specified by:
getLocalAddrin interfacejakarta.servlet.ServletRequest- Returns:
- a
Stringcontaining the IP address on which the request was received. - Since:
- 2.4
-
getLocalName
public String getLocalName()
Returns the host name of the Internet Protocol (IP) interface on which the request was received.- Specified by:
getLocalNamein interfacejakarta.servlet.ServletRequest- Returns:
- a
Stringcontaining the host name of the IP on which the request was received. - Since:
- 2.4
-
getRemotePort
public int getRemotePort()
Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.- Specified by:
getRemotePortin interfacejakarta.servlet.ServletRequest- Returns:
- an integer specifying the port number
- Since:
- 2.4
-
getLocalPort
public int getLocalPort()
Returns the Internet Protocol (IP) port number of the interface on which the request was received.- Specified by:
getLocalPortin interfacejakarta.servlet.ServletRequest- Returns:
- an integer specifying the port number
- Since:
- 2.4
-
getServletContext
public jakarta.servlet.ServletContext getServletContext()
- Specified by:
getServletContextin interfacejakarta.servlet.ServletRequest
-
startAsync
public jakarta.servlet.AsyncContext startAsync() throws IllegalStateException- Specified by:
startAsyncin interfacejakarta.servlet.ServletRequest- Throws:
IllegalStateException
-
startAsync
public jakarta.servlet.AsyncContext startAsync(jakarta.servlet.ServletRequest servletRequest, jakarta.servlet.ServletResponse servletResponse) throws IllegalStateException- Specified by:
startAsyncin interfacejakarta.servlet.ServletRequest- Throws:
IllegalStateException
-
isAsyncStarted
public boolean isAsyncStarted()
- Specified by:
isAsyncStartedin interfacejakarta.servlet.ServletRequest
-
isAsyncSupported
public boolean isAsyncSupported()
- Specified by:
isAsyncSupportedin interfacejakarta.servlet.ServletRequest
-
getAsyncContext
public jakarta.servlet.AsyncContext getAsyncContext()
- Specified by:
getAsyncContextin interfacejakarta.servlet.ServletRequest
-
getDispatcherType
public jakarta.servlet.DispatcherType getDispatcherType()
- Specified by:
getDispatcherTypein interfacejakarta.servlet.ServletRequest
-
getParameter
public String getParameter(String name)
The default behavior of this method is to return getParameter(String name) on the wrapped request object. Serialized. Only those parameters that are serializable are transferred.- Specified by:
getParameterin interfacejakarta.servlet.ServletRequest- Returns:
- The value of the specified parameter or null.
-
getParameterMap
public Map<String,String[]> getParameterMap()
The default behavior of this method is to return getParameterMap() on the wrapped request object. Serialized. Only those parameters that are serailzable are transferred.- Specified by:
getParameterMapin interfacejakarta.servlet.ServletRequest- Returns:
- A map of the parameters.
-
getParameterNames
public Enumeration<String> getParameterNames()
The default behavior of this method is to return getParameterNames() on the wrapped request object. Serialized.- Specified by:
getParameterNamesin interfacejakarta.servlet.ServletRequest- Returns:
- Enumeration of paramters names.
-
getParameterValues
public String[] getParameterValues(String name)
The default behavior of this method is to return getParameterValues(String name) on the wrapped request object. Serilized. Only those parameters values that are serializable are transferred.- Specified by:
getParameterValuesin interfacejakarta.servlet.ServletRequest- Returns:
- Array of Strings of the specified parameter values.
-
getProtocol
public String getProtocol()
The default behavior of this method is to return getProtocol() on the wrapped request object. Serialized.- Specified by:
getProtocolin interfacejakarta.servlet.ServletRequest- Returns:
- The protocol associated with the request.
-
getScheme
public String getScheme()
The default behavior of this method is to return getScheme() on the wrapped request object. Serialized.- Specified by:
getSchemein interfacejakarta.servlet.ServletRequest- Returns:
- The scheme associated with the request.
-
getServerName
public String getServerName()
The default behavior of this method is to return getServerName() on the wrapped request object. Serialized.- Specified by:
getServerNamein interfacejakarta.servlet.ServletRequest- Returns:
- The name of the server.
-
getServerPort
public int getServerPort()
The default behavior of this method is to return getServerPort() on the wrapped request object. Serialized.- Specified by:
getServerPortin interfacejakarta.servlet.ServletRequest- Returns:
- The port of the server.
-
getReader
public BufferedReader getReader() throws IOException
The default behavior of this method is to return getReader() on the wrapped request object. Not serialized, null post serialization.- Specified by:
getReaderin interfacejakarta.servlet.ServletRequest- Throws:
IOException
-
getRemoteAddr
public String getRemoteAddr()
The default behavior of this method is to return getRemoteAddr() on the wrapped request object. Serialized.- Specified by:
getRemoteAddrin interfacejakarta.servlet.ServletRequest- Returns:
- The remote address of the client associated with the request.
-
getRemoteHost
public String getRemoteHost()
The default behavior of this method is to return getRemoteHost() on the wrapped request object. Serialized.- Specified by:
getRemoteHostin interfacejakarta.servlet.ServletRequest- Returns:
- The remote host of the client associated with the request.
-
setAttribute
public void setAttribute(String name, Object o)
The default behavior of this method is to return setAttribute(String name, Object o) on the wrapped request object. If the underlying request is available, it is updated.- Specified by:
setAttributein interfacejakarta.servlet.ServletRequest- Parameters:
name- The name of the attribute to set.o- The value of the attribute.
-
removeAttribute
public void removeAttribute(String name)
The default behavior of this method is to call removeAttribute(String name) on the wrapped request object. Updates the underlying request if available.- Specified by:
removeAttributein interfacejakarta.servlet.ServletRequest- Parameters:
name- The name of the attribute to remove.
-
getLocale
public Locale getLocale()
The default behavior of this method is to return getLocale() on the wrapped request object. Serialized.- Specified by:
getLocalein interfacejakarta.servlet.ServletRequest- Returns:
- The locale of the request.
-
getLocales
public Enumeration<Locale> getLocales()
The default behavior of this method is to return getLocales() on the wrapped request object. Serialized.- Specified by:
getLocalesin interfacejakarta.servlet.ServletRequest- Returns:
- Enumeration of the locales of the request.
-
isSecure
public boolean isSecure()
The default behavior of this method is to return isSecure() on the wrapped request object. Serialized.- Specified by:
isSecurein interfacejakarta.servlet.ServletRequest- Returns:
- true if the cookie is secure, false otherwise.
-
getRequestDispatcher
public jakarta.servlet.RequestDispatcher getRequestDispatcher(String path)
The default behavior of this method is to return getRequestDispatcher(String path) on the wrapped request object. Not serialized, null post serialization.- Specified by:
getRequestDispatcherin interfacejakarta.servlet.ServletRequest- Returns:
- RequestDispatcher or null if not available.
-
getRealPath
public String getRealPath(String path)
The default behavior of this method is to return getRealPath(String path) on the wrapped request object. Not serialized, null post serialization.- Specified by:
getRealPathin interfacejakarta.servlet.ServletRequest- Returns:
- The real path of the request.
-
isSerializable
protected boolean isSerializable(Object obj)
Tests if an object implements the java.io.Serializable interface.- Parameters:
obj- The obj to test for serialization.- Returns:
- true if the object implements Serializable, false otherwise.
-
-