Interface Request

  • All Known Subinterfaces:
    HttpRequest
    All Known Implementing Classes:
    DummyRequest, HttpRequestWrapper, PwcCoyoteRequest, Request

    public interface Request
    A Request is the Catalina-internal facade for a ServletRequest that is to be processed, in order to produce the corresponding Response.
    Version:
    $Revision: 1.4 $ $Date: 2006/04/24 16:36:12 $
    Author:
    Craig R. McClanahan
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      String changeSessionId()
      Change the ID of the session that this request is associated with.
      jakarta.servlet.ServletInputStream createInputStream()
      Create and return a ServletInputStream to read the content associated with this Request.
      void disableAsyncSupport()
      Disables async support on this request.
      void finishRequest()
      Perform whatever actions are required to flush and close the input stream or reader, in a single operation.
      String generateSessionId()
      Generate and return a new session ID.
      String getAuthorization()
      Return the authorization credentials sent with this request.
      boolean getCheckRestrictedResources()
      Return whether or not access to resources under WEB-INF or META-INF needs to be checked.
      Connector getConnector()
      Return the Connector through which this Request was received.
      Context getContext()
      Return the Context within which this Request is being processed.
      jakarta.servlet.FilterChain getFilterChain()
      Get filter chain associated with the request.
      Host getHost()
      Return the Host within which this Request is being processed.
      String getInfo()
      Return descriptive information about this Request implementation and the corresponding version number, in the format <description>/<version>.
      String getJrouteId()
      Gets the jroute id of this request, which may have been sent as a separate JROUTE cookie or appended to the session identifier encoded in the URI (if cookies have been disabled).
      Object getNote​(String name)
      Return the object bound with the specified name to the internal notes for this request, or null if no such binding exists.
      Iterator getNoteNames()
      Return an Iterator containing the String names of all notes bindings that exist for this request.
      jakarta.servlet.ServletRequest getRequest()
      Return the ServletRequest for which this object is the facade.
      jakarta.servlet.ServletRequest getRequest​(boolean maskDefaultContextMapping)
      Return the ServletRequest for which this object is the facade.
      Response getResponse()
      Return the Response with which this Request is associated.
      Session getSessionInternal​(boolean create)
      Gets the session associated with this Request, creating one if necessary and requested.
      Socket getSocket()
      Return the Socket (if any) through which this Request was received.
      InputStream getStream()
      Return the input stream associated with this Request.
      Wrapper getWrapper()
      Return the Wrapper within which this Request is being processed.
      Session lockSession()  
      void recycle()
      Release all object references, and initialize instance variables, in preparation for reuse of this object.
      void removeNote​(String name)
      Remove any object bound to the specified name in the internal notes for this request.
      void setCheckRestrictedResources​(boolean check)
      Set whether or not access to resources under WEB-INF or META-INF needs to be checked.
      void setConnector​(Connector connector)
      Set the Connector through which this Request was received.
      void setContentLength​(int length)
      Set the content length associated with this Request.
      void setContentType​(String type)
      Set the content type (and optionally the character encoding) associated with this Request.
      void setContext​(Context context)
      Set the Context within which this Request is being processed.
      void setFilterChain​(jakarta.servlet.FilterChain filterChain)
      Set filter chain associated with the request.
      void setHost​(Host host)
      Set the Host within which this Request is being processed.
      void setNote​(String name, Object value)
      Bind an object to a specified name in the internal notes associated with this request, replacing any existing binding for this name.
      void setProtocol​(String protocol)
      Set the protocol name and version associated with this Request.
      void setRemoteAddr​(String remote)
      Set the remote IP address associated with this Request.
      void setRequestedSessionCookiePath​(String cookiePath)
      Sets the requested session cookie path, see IT 7426
      void setResponse​(Response response)
      Set the Response with which this Request is associated.
      void setSecure​(boolean secure)
      Set the value to be returned by isSecure() for this Request.
      void setServerName​(String name)
      Set the name of the server (virtual host) to process this request.
      void setServerPort​(int port)
      Set the port number of the server to process this request.
      void setSocket​(Socket socket)
      Set the Socket (if any) through which this Request was received.
      void setStream​(InputStream stream)
      Set the input stream associated with this Request.
      void setWrapper​(Wrapper wrapper)
      Set the Wrapper within which this Request is being processed.
      void unlockSession()  
    • Method Detail

      • getAuthorization

        String getAuthorization()
        Return the authorization credentials sent with this request.
      • getConnector

        Connector getConnector()
        Return the Connector through which this Request was received.
      • setConnector

        void setConnector​(Connector connector)
        Set the Connector through which this Request was received.
        Parameters:
        connector - The new connector
      • getContext

        Context getContext()
        Return the Context within which this Request is being processed.
      • setContext

        void setContext​(Context context)
        Set the Context within which this Request is being processed. This must be called as soon as the appropriate Context is identified, because it identifies the value to be returned by getContextPath(), and thus enables parsing of the request URI.
        Parameters:
        context - The newly associated Context
      • getFilterChain

        jakarta.servlet.FilterChain getFilterChain()
        Get filter chain associated with the request.
      • setFilterChain

        void setFilterChain​(jakarta.servlet.FilterChain filterChain)
        Set filter chain associated with the request.
        Parameters:
        filterChain - new filter chain
      • getHost

        Host getHost()
        Return the Host within which this Request is being processed.
      • setHost

        void setHost​(Host host)
        Set the Host within which this Request is being processed. This must be called as soon as the appropriate Host is identified, and before the Request is passed to a context.
        Parameters:
        host - The newly associated Host
      • getInfo

        String getInfo()
        Return descriptive information about this Request implementation and the corresponding version number, in the format <description>/<version>.
      • getRequest

        jakarta.servlet.ServletRequest getRequest()
        Return the ServletRequest for which this object is the facade.
      • getRequest

        jakarta.servlet.ServletRequest getRequest​(boolean maskDefaultContextMapping)
        Return the ServletRequest for which this object is the facade.
        Parameters:
        maskDefaultContextMapping - true if the fact that a request received at the root context was mapped to a default-web-module will be masked, false otherwise
      • getResponse

        Response getResponse()
        Return the Response with which this Request is associated.
      • setResponse

        void setResponse​(Response response)
        Set the Response with which this Request is associated.
        Parameters:
        response - The new associated response
      • getSocket

        Socket getSocket()
        Return the Socket (if any) through which this Request was received. This should only be used to access underlying state information about this Socket, such as the SSLSession associated with an SSLSocket.
      • setSocket

        void setSocket​(Socket socket)
        Set the Socket (if any) through which this Request was received.
        Parameters:
        socket - The socket through which this request was received
      • getStream

        InputStream getStream()
        Return the input stream associated with this Request.
      • setStream

        void setStream​(InputStream stream)
        Set the input stream associated with this Request.
        Parameters:
        stream - The new input stream
      • getWrapper

        Wrapper getWrapper()
        Return the Wrapper within which this Request is being processed.
      • setWrapper

        void setWrapper​(Wrapper wrapper)
        Set the Wrapper within which this Request is being processed. This must be called as soon as the appropriate Wrapper is identified, and before the Request is ultimately passed to an application servlet.
        Parameters:
        wrapper - The newly associated Wrapper
      • createInputStream

        jakarta.servlet.ServletInputStream createInputStream()
                                                      throws IOException
        Create and return a ServletInputStream to read the content associated with this Request.
        Throws:
        IOException - if an input/output error occurs
      • finishRequest

        void finishRequest()
                    throws IOException
        Perform whatever actions are required to flush and close the input stream or reader, in a single operation.
        Throws:
        IOException - if an input/output error occurs
      • getNote

        Object getNote​(String name)
        Return the object bound with the specified name to the internal notes for this request, or null if no such binding exists.
        Parameters:
        name - Name of the note to be returned
      • getNoteNames

        Iterator getNoteNames()
        Return an Iterator containing the String names of all notes bindings that exist for this request.
      • recycle

        void recycle()
        Release all object references, and initialize instance variables, in preparation for reuse of this object.
      • removeNote

        void removeNote​(String name)
        Remove any object bound to the specified name in the internal notes for this request.
        Parameters:
        name - Name of the note to be removed
      • setContentLength

        void setContentLength​(int length)
        Set the content length associated with this Request.
        Parameters:
        length - The new content length
      • setContentType

        void setContentType​(String type)
        Set the content type (and optionally the character encoding) associated with this Request. For example, text/html; charset=ISO-8859-4.
        Parameters:
        type - The new content type
      • setNote

        void setNote​(String name,
                     Object value)
        Bind an object to a specified name in the internal notes associated with this request, replacing any existing binding for this name.
        Parameters:
        name - Name to which the object should be bound
        value - Object to be bound to the specified name
      • setProtocol

        void setProtocol​(String protocol)
        Set the protocol name and version associated with this Request.
        Parameters:
        protocol - Protocol name and version
      • setRemoteAddr

        void setRemoteAddr​(String remote)
        Set the remote IP address associated with this Request. NOTE: This value will be used to resolve the value for getRemoteHost() if that method is called.
        Parameters:
        remote - The remote IP address
      • setSecure

        void setSecure​(boolean secure)
        Set the value to be returned by isSecure() for this Request.
        Parameters:
        secure - The new isSecure value
      • setServerName

        void setServerName​(String name)
        Set the name of the server (virtual host) to process this request.
        Parameters:
        name - The server name
      • setServerPort

        void setServerPort​(int port)
        Set the port number of the server to process this request.
        Parameters:
        port - The server port
      • setCheckRestrictedResources

        void setCheckRestrictedResources​(boolean check)
        Set whether or not access to resources under WEB-INF or META-INF needs to be checked.
      • getCheckRestrictedResources

        boolean getCheckRestrictedResources()
        Return whether or not access to resources under WEB-INF or META-INF needs to be checked.
      • getJrouteId

        String getJrouteId()
        Gets the jroute id of this request, which may have been sent as a separate JROUTE cookie or appended to the session identifier encoded in the URI (if cookies have been disabled).
        Returns:
        The jroute id of this request, or null if this request does not carry any jroute id
      • generateSessionId

        String generateSessionId()
        Generate and return a new session ID. This hook allows connectors to provide their own scalable session ID generators.
      • disableAsyncSupport

        void disableAsyncSupport()
        Disables async support on this request.
      • setRequestedSessionCookiePath

        void setRequestedSessionCookiePath​(String cookiePath)
        Sets the requested session cookie path, see IT 7426
      • getSessionInternal

        Session getSessionInternal​(boolean create)
        Gets the session associated with this Request, creating one if necessary and requested.
        Parameters:
        create - true if a new session is to be created if one does not already exist, false otherwise
      • changeSessionId

        String changeSessionId()
        Change the ID of the session that this request is associated with. There are several things that may trigger an ID change. These include moving between nodes in a cluster and session fixation prevention during the authentication process.
      • lockSession

        Session lockSession()
      • unlockSession

        void unlockSession()