Class RemoteServletRequest

    • 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.AsyncContext getAsyncContext()  
      Object getAttribute​(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.
      String getCharacterEncoding()
      The default behavior of this method is to return getCharacterEncoding() on the wrapped request object.
      int getContentLength()
      The default behavior of this method is to return getContentLength() on the wrapped request object.
      long getContentLengthLong()  
      String getContentType()
      The default behavior of this method is to return getContentType() on the wrapped request object.
      jakarta.servlet.DispatcherType getDispatcherType()  
      jakarta.servlet.ServletInputStream getInputStream()
      The default behavior of this method is to return getInputStream() on the wrapped request object.
      String getLocalAddr()
      Returns the Internet Protocol (IP) address of the interface on which the request was received.
      Locale getLocale()
      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.
      String getLocalName()
      Returns the host name of the Internet Protocol (IP) interface on which the request was received.
      int getLocalPort()
      Returns the Internet Protocol (IP) port number of the interface on which the request was received.
      String getParameter​(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.
      String getProtocol()
      The default behavior of this method is to return getProtocol() on the wrapped request object.
      BufferedReader getReader()
      The default behavior of this method is to return getReader() on the wrapped request object.
      String getRealPath​(String path)
      The default behavior of this method is to return getRealPath(String path) on the wrapped request object.
      String getRemoteAddr()
      The default behavior of this method is to return getRemoteAddr() on the wrapped request object.
      String getRemoteHost()
      The default behavior of this method is to return getRemoteHost() on the wrapped request object.
      int getRemotePort()
      Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.
      jakarta.servlet.ServletRequest getRequest()
      Return the wrapped request object.
      jakarta.servlet.RequestDispatcher getRequestDispatcher​(String path)
      The default behavior of this method is to return getRequestDispatcher(String path) on the wrapped request object.
      String getScheme()
      The default behavior of this method is to return getScheme() on the wrapped request object.
      String getServerName()
      The default behavior of this method is to return getServerName() on the wrapped request object.
      int getServerPort()
      The default behavior of this method is to return getServerPort() on the wrapped request object.
      jakarta.servlet.ServletContext getServletContext()  
      boolean isAsyncStarted()  
      boolean isAsyncSupported()  
      boolean isSecure()
      The default behavior of this method is to return isSecure() on the wrapped request object.
      protected boolean isSerializable​(Object obj)
      Tests if an object implements the java.io.Serializable interface.
      protected void processRequest()  
      void removeAttribute​(String name)
      The default behavior of this method is to call removeAttribute(String name) on the wrapped request object.
      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.
      void setCharacterEncoding​(String enc)
      The default behavior of this method is to set the character encoding on the wrapped request object, if available.
      void setRequest​(jakarta.servlet.ServletRequest request)
      Sets the request object being wrapped.
      jakarta.servlet.AsyncContext startAsync()  
      jakarta.servlet.AsyncContext startAsync​(jakarta.servlet.ServletRequest servletRequest, jakarta.servlet.ServletResponse servletResponse)  
      String toString()  
    • Field Detail

      • request

        protected transient jakarta.servlet.ServletRequest request
      • debug

        protected transient Debug debug
    • 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:
        getAttribute in interface jakarta.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:
        getAttributeNames in interface jakarta.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:
        getCharacterEncoding in interface jakarta.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:
        setCharacterEncoding in interface jakarta.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:
        getContentLength in interface jakarta.servlet.ServletRequest
        Returns:
        The content length of the request
      • getContentLengthLong

        public long getContentLengthLong()
        Specified by:
        getContentLengthLong in interface jakarta.servlet.ServletRequest
      • getContentType

        public String getContentType()
        The default behavior of this method is to return getContentType() on the wrapped request object. Serialized.
        Specified by:
        getContentType in interface jakarta.servlet.ServletRequest
        Returns:
        The content type of the request
      • getInputStream

        public jakarta.servlet.ServletInputStream getInputStream()
                                                          throws IOException
        The default behavior of this method is to return getInputStream() on the wrapped request object. Not serialized, null post serialization.
        Specified by:
        getInputStream in interface jakarta.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:
        getLocalAddr in interface jakarta.servlet.ServletRequest
        Returns:
        a String containing 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:
        getLocalName in interface jakarta.servlet.ServletRequest
        Returns:
        a String containing 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:
        getRemotePort in interface jakarta.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:
        getLocalPort in interface jakarta.servlet.ServletRequest
        Returns:
        an integer specifying the port number
        Since:
        2.4
      • getServletContext

        public jakarta.servlet.ServletContext getServletContext()
        Specified by:
        getServletContext in interface jakarta.servlet.ServletRequest
      • startAsync

        public jakarta.servlet.AsyncContext startAsync​(jakarta.servlet.ServletRequest servletRequest,
                                                       jakarta.servlet.ServletResponse servletResponse)
                                                throws IllegalStateException
        Specified by:
        startAsync in interface jakarta.servlet.ServletRequest
        Throws:
        IllegalStateException
      • isAsyncStarted

        public boolean isAsyncStarted()
        Specified by:
        isAsyncStarted in interface jakarta.servlet.ServletRequest
      • isAsyncSupported

        public boolean isAsyncSupported()
        Specified by:
        isAsyncSupported in interface jakarta.servlet.ServletRequest
      • getAsyncContext

        public jakarta.servlet.AsyncContext getAsyncContext()
        Specified by:
        getAsyncContext in interface jakarta.servlet.ServletRequest
      • getDispatcherType

        public jakarta.servlet.DispatcherType getDispatcherType()
        Specified by:
        getDispatcherType in interface jakarta.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:
        getParameter in interface jakarta.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:
        getParameterMap in interface jakarta.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:
        getParameterNames in interface jakarta.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:
        getParameterValues in interface jakarta.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:
        getProtocol in interface jakarta.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:
        getScheme in interface jakarta.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:
        getServerName in interface jakarta.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:
        getServerPort in interface jakarta.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:
        getReader in interface jakarta.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:
        getRemoteAddr in interface jakarta.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:
        getRemoteHost in interface jakarta.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:
        setAttribute in interface jakarta.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:
        removeAttribute in interface jakarta.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:
        getLocale in interface jakarta.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:
        getLocales in interface jakarta.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:
        isSecure in interface jakarta.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:
        getRequestDispatcher in interface jakarta.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:
        getRealPath in interface jakarta.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.