Class Request

  • All Implemented Interfaces:
    jakarta.servlet.http.HttpServletRequest, jakarta.servlet.ServletRequest, HttpRequest, Request
    Direct Known Subclasses:
    PwcCoyoteRequest

    public class Request
    extends Object
    implements HttpRequest, jakarta.servlet.http.HttpServletRequest
    Wrapper object for the Coyote request.
    Version:
    $Revision: 1.67.2.9 $ $Date: 2008/04/17 18:37:34 $
    Author:
    Remy Maucherat, Craig R. McClanahan, Rajiv Mordani
    • Field Detail

      • cookies

        protected ArrayList<jakarta.servlet.http.Cookie> cookies
        The set of cookies associated with this Request.
      • defaultLocale

        protected static final Locale defaultLocale
        The default Locale if none are specified.
      • attributes

        protected Map<String,​Object> attributes
        The attributes associated with this Request, keyed by attribute name.
      • locales

        protected ArrayList<Locale> locales
        The preferred Locales associated with this Request.
      • authType

        protected String authType
        Authentication type.
      • dispatcherTypeAttr

        protected Object dispatcherTypeAttr
        The current dispatcher type.
      • inputBuffer

        protected InputBuffer inputBuffer
        The associated input buffer.
      • usingInputStream

        protected boolean usingInputStream
        Using stream flag.
      • usingReader

        protected boolean usingReader
        Using writer flag.
      • userPrincipal

        protected Principal userPrincipal
        User principal.
      • sessionParsed

        protected boolean sessionParsed
        Session parsed flag.
      • parametersProcessed

        protected boolean parametersProcessed
      • cookiesParsed

        protected boolean cookiesParsed
        Cookies parsed flag.
      • secure

        protected boolean secure
        Secure flag.
      • subject

        protected Subject subject
        The Subject associated with the current AccessControllerContext
      • CACHED_POST_LEN

        protected static final int CACHED_POST_LEN
        Post data buffer.
        See Also:
        Constant Field Values
      • postData

        protected byte[] postData
      • session

        protected Session session
        The currently active session for this request.
      • requestDispatcherPath

        protected Object requestDispatcherPath
        The current request dispatcher path.
      • requestedSessionCookie

        protected boolean requestedSessionCookie
        Was the requested session ID received in a cookie?
      • requestedSessionId

        protected String requestedSessionId
        The requested session ID (if any) for this request.
      • requestedSessionVersion

        protected String requestedSessionVersion
        The requested session version (if any) for this request.
      • requestedSessionCookiePath

        protected String requestedSessionCookiePath
      • uriParamsCC

        protected org.glassfish.grizzly.http.util.CharChunk uriParamsCC
      • requestedSessionURL

        protected boolean requestedSessionURL
        Was the requested session ID received in a URL?
      • socket

        protected Socket socket
        The socket through which this Request was received.
      • localesParsed

        protected boolean localesParsed
        Parse locales.
      • localPort

        protected int localPort
        Local port
      • remoteAddr

        protected String remoteAddr
        Remote address.
      • remoteHost

        protected String remoteHost
        Remote host.
      • remotePort

        protected int remotePort
        Remote port
      • localName

        protected String localName
        Local address
      • localAddr

        protected String localAddr
        Local address
      • checkRestrictedResources

        protected boolean checkRestrictedResources
        Whether or not access to resources in WEB-INF or META-INF needs to be checked.
      • checkUnsuccessfulSessionFind

        protected boolean checkUnsuccessfulSessionFind
      • coyoteRequest

        protected org.glassfish.grizzly.http.server.Request coyoteRequest
        Coyote request.
      • facade

        protected RequestFacade facade
        The facade associated with this request.
      • defaultContextMaskingFacade

        protected RequestFacade defaultContextMaskingFacade
        Request facade that masks the fact that a request received at the root context was mapped to a default-web-module (if such a mapping exists). For example, its getContextPath() will return "/" rather than the context root of the default-web-module.
      • response

        protected Response response
        The response with which this request is associated.
      • connector

        protected Connector connector
        Associated Catalina connector.
      • mappingData

        protected org.glassfish.grizzly.http.server.util.MappingData mappingData
        Mapping data.
      • wrapper

        protected Wrapper wrapper
        Associated wrapper.
      • filterChain

        protected jakarta.servlet.FilterChain filterChain
        Filter chain associated with the request.
      • context

        protected Context context
        Associated context.
      • servletContext

        protected jakarta.servlet.ServletContext servletContext
      • discardDisconnectEvent

        public static final boolean discardDisconnectEvent
      • URIConverter

        protected org.glassfish.grizzly.http.util.B2CConverter URIConverter
        URI byte to char converter (not recycled).
    • Constructor Detail

      • Request

        public Request()
    • Method Detail

      • setCoyoteRequest

        public void setCoyoteRequest​(org.glassfish.grizzly.http.server.Request grizzlyRequest)
        Set the Coyote request.
        Parameters:
        grizzlyRequest - The Coyote request
      • getCoyoteRequest

        public org.glassfish.grizzly.http.server.Request getCoyoteRequest()
        Get the Coyote request.
      • setEnforceScope

        public static void setEnforceScope​(boolean enforce)
        Set whether or not to enforce scope checking of this object.
      • recycle

        public void recycle()
        Release all object references, and initialize instance variables, in preparation for reuse of this object.
        Specified by:
        recycle in interface Request
      • setUnsuccessfulSessionFind

        public void setUnsuccessfulSessionFind​(boolean unsuccessfulSessionFind)
        Set the unsuccessfulSessionFind flag.
        Parameters:
        unsuccessfulSessionFind -
      • getUnsuccessfulSessionFind

        public boolean getUnsuccessfulSessionFind()
        Get the unsuccessfulSessionFind flag.
      • setUpgrade

        public void setUpgrade​(boolean upgrade)
      • isUpgrade

        public boolean isUpgrade()
      • getHttpUpgradeHandler

        public jakarta.servlet.http.HttpUpgradeHandler getHttpUpgradeHandler()
      • getAuthorization

        public String getAuthorization()
        Return the authorization credentials sent with this request.
        Specified by:
        getAuthorization in interface Request
      • getConnector

        public Connector getConnector()
        Return the Connector through which this Request was received.
        Specified by:
        getConnector in interface Request
      • setConnector

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

        public Context getContext()
        Return the Context within which this Request is being processed.
        Specified by:
        getContext in interface Request
      • setContext

        public 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.
        Specified by:
        setContext in interface Request
        Parameters:
        context - The newly associated Context
      • setDefaultContext

        public void setDefaultContext​(boolean isDefaultContext)
        Parameters:
        isDefaultContext - true if this request was mapped to a context with an empty context root that is backed by the vitual server's default-web-module
      • getFilterChain

        public jakarta.servlet.FilterChain getFilterChain()
        Get filter chain associated with the request.
        Specified by:
        getFilterChain in interface Request
      • setFilterChain

        public void setFilterChain​(jakarta.servlet.FilterChain filterChain)
        Set filter chain associated with the request.
        Specified by:
        setFilterChain in interface Request
        Parameters:
        filterChain - new filter chain
      • getHost

        public Host getHost()
        Return the Host within which this Request is being processed.
        Specified by:
        getHost in interface Request
      • setHost

        public 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.
        Specified by:
        setHost in interface Request
        Parameters:
        host - The newly associated Host
      • getHttpServletMapping

        public jakarta.servlet.http.HttpServletMapping getHttpServletMapping()
        Specified by:
        getHttpServletMapping in interface jakarta.servlet.http.HttpServletRequest
      • getInfo

        public String getInfo()
        Return descriptive information about this Request implementation and the corresponding version number, in the format <description>/<version>.
        Specified by:
        getInfo in interface Request
      • getMappingData

        public org.glassfish.grizzly.http.server.util.MappingData getMappingData()
        Return mapping data.
      • setMappingData

        public void setMappingData​(org.glassfish.grizzly.http.server.util.MappingData mappingData)
        Set the mapping data for this Request.
      • updatePaths

        public void updatePaths​(org.glassfish.grizzly.http.server.util.MappingData md)
        Update this instance with the content of the MappingData MappingData
      • getRequest

        public jakarta.servlet.http.HttpServletRequest getRequest()
        Gets the ServletRequest for which this object is the facade. This method must be implemented by a subclass.
        Specified by:
        getRequest in interface Request
      • getRequest

        public jakarta.servlet.http.HttpServletRequest getRequest​(boolean maskDefaultContextMapping)
        Gets the ServletRequest for which this object is the facade. This method must be implemented by a subclass.
        Specified by:
        getRequest in interface Request
        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

        public Response getResponse()
        Return the Response with which this Request is associated.
        Specified by:
        getResponse in interface Request
      • setResponse

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

        public 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.
        Specified by:
        getSocket in interface Request
      • setSocket

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

        public InputStream getStream()
        Return the input stream associated with this Request.
        Specified by:
        getStream in interface Request
      • setStream

        public void setStream​(InputStream stream)
        Set the input stream associated with this Request.
        Specified by:
        setStream in interface Request
        Parameters:
        stream - The new input stream
      • getURIConverter

        protected org.glassfish.grizzly.http.util.B2CConverter getURIConverter()
        Return the URI converter.
      • setURIConverter

        protected void setURIConverter​(org.glassfish.grizzly.http.util.B2CConverter URIConverter)
        Set the URI converter.
        Parameters:
        URIConverter - the new URI converter
      • getWrapper

        public Wrapper getWrapper()
        Return the Wrapper within which this Request is being processed.
        Specified by:
        getWrapper in interface Request
      • setWrapper

        public 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.
        Specified by:
        setWrapper in interface Request
        Parameters:
        wrapper - The newly associated Wrapper
      • createInputStream

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

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

        public 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.
        Specified by:
        getNote in interface Request
        Parameters:
        name - Name of the note to be returned
      • getNoteNames

        public Iterator<String> getNoteNames()
        Return an Iterator containing the String names of all notes bindings that exist for this request.
        Specified by:
        getNoteNames in interface Request
        Returns:
        Iterator containing the String names
      • removeNote

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

        public 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.
        Specified by:
        setNote in interface Request
        Parameters:
        name - Name to which the object should be bound
        value - Object to be bound to the specified name
      • setContentLength

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

        public 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.
        Specified by:
        setContentType in interface Request
        Parameters:
        type - The new content type
      • setProtocol

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

        public void setRemoteAddr​(String remoteAddr)
        Set the IP address of the remote client associated with this Request.
        Specified by:
        setRemoteAddr in interface Request
        Parameters:
        remoteAddr - The remote IP address
      • setRemoteHost

        public void setRemoteHost​(String remoteHost)
        Set the fully qualified name of the remote client associated with this Request.
        Parameters:
        remoteHost - The remote host name
      • setSecure

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

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

        public void setServerPort​(int port)
        Set the port number of the server to process this request.
        Specified by:
        setServerPort in interface Request
        Parameters:
        port - The server port
      • setCheckRestrictedResources

        public void setCheckRestrictedResources​(boolean check)
        Set whether or not access to resources under WEB-INF or META-INF needs to be checked.
        Specified by:
        setCheckRestrictedResources in interface Request
      • getCheckRestrictedResources

        public boolean getCheckRestrictedResources()
        Return whether or not access to resources under WEB-INF or META-INF needs to be checked.
        Specified by:
        getCheckRestrictedResources in interface Request
      • getAttribute

        public Object getAttribute​(String name)
        Return the specified request attribute if it exists; otherwise, return null.
        Specified by:
        getAttribute in interface jakarta.servlet.ServletRequest
        Parameters:
        name - Name of the request attribute to return
      • getAttributeNames

        public Enumeration<String> getAttributeNames()
        Return the names of all request attributes for this Request, or an empty Enumeration if there are none.
        Specified by:
        getAttributeNames in interface jakarta.servlet.ServletRequest
      • getCharacterEncoding

        public String getCharacterEncoding()
        Return the character encoding for this Request.
        Specified by:
        getCharacterEncoding in interface jakarta.servlet.ServletRequest
      • getContentLength

        public int getContentLength()
        Return the content length for this Request.
        Specified by:
        getContentLength in interface jakarta.servlet.ServletRequest
      • getContentLengthLong

        public long getContentLengthLong()
        Return the content length for this Request.
        Specified by:
        getContentLengthLong in interface jakarta.servlet.ServletRequest
      • getContentType

        public String getContentType()
        Return the content type for this Request.
        Specified by:
        getContentType in interface jakarta.servlet.ServletRequest
      • getInputStream

        public jakarta.servlet.ServletInputStream getInputStream()
                                                          throws IOException
        Return the servlet input stream for this Request. The default implementation returns a servlet input stream created by createInputStream().
        Specified by:
        getInputStream in interface jakarta.servlet.ServletRequest
        Throws:
        IllegalStateException - if getReader() has already been called for this request
        IOException - if an input/output error occurs
      • getLocale

        public Locale getLocale()
        Return the preferred Locale that the client will accept content in, based on the value for the first Accept-Language header that was encountered. If the request did not specify a preferred language, the server's default Locale is returned.
        Specified by:
        getLocale in interface jakarta.servlet.ServletRequest
      • getLocales

        public Enumeration<Locale> getLocales()
        Return the set of preferred Locales that the client will accept content in, based on the values for any Accept-Language headers that were encountered. If the request did not specify a preferred language, the server's default Locale is returned.
        Specified by:
        getLocales in interface jakarta.servlet.ServletRequest
      • getParameter

        public String getParameter​(String name)
        Return the value of the specified request parameter, if any; otherwise, return null. If there is more than one value defined, return only the first one.
        Specified by:
        getParameter in interface jakarta.servlet.ServletRequest
        Parameters:
        name - Name of the desired request parameter
      • getParameterMap

        public Map<String,​String[]> getParameterMap()
        Returns a Map of the parameters of this request. Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data.
        Specified by:
        getParameterMap in interface jakarta.servlet.ServletRequest
        Returns:
        A Map containing parameter names as keys and parameter values as map values.
      • getParameterNames

        public Enumeration<String> getParameterNames()
        Return the names of all defined request parameters for this request.
        Specified by:
        getParameterNames in interface jakarta.servlet.ServletRequest
      • getParameterValues

        public String[] getParameterValues​(String name)
        Return the defined values for the specified request parameter, if any; otherwise, return null.
        Specified by:
        getParameterValues in interface jakarta.servlet.ServletRequest
        Parameters:
        name - Name of the desired request parameter
      • getProtocol

        public String getProtocol()
        Return the protocol and version used to make this Request.
        Specified by:
        getProtocol in interface jakarta.servlet.ServletRequest
      • getReader

        public BufferedReader getReader()
                                 throws IOException
        Read the Reader wrapping the input stream for this Request. The default implementation wraps a BufferedReader around the servlet input stream returned by createInputStream().
        Specified by:
        getReader in interface jakarta.servlet.ServletRequest
        Throws:
        IllegalStateException - if getInputStream() has already been called for this request
        IOException - if an input/output error occurs
      • getRemoteAddr

        public String getRemoteAddr()
        Return the remote IP address making this Request.
        Specified by:
        getRemoteAddr in interface jakarta.servlet.ServletRequest
      • getRemoteHost

        public String getRemoteHost()
        Return the remote host name making this Request.
        Specified by:
        getRemoteHost in interface jakarta.servlet.ServletRequest
      • 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
      • 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
      • 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
      • 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
      • getRequestDispatcher

        public jakarta.servlet.RequestDispatcher getRequestDispatcher​(String path)
        Return a RequestDispatcher that wraps the resource at the specified path, which may be interpreted as relative to the current request path.
        Specified by:
        getRequestDispatcher in interface jakarta.servlet.ServletRequest
        Parameters:
        path - Path of the resource to be wrapped
      • getScheme

        public String getScheme()
        Return the scheme used to make this Request.
        Specified by:
        getScheme in interface jakarta.servlet.ServletRequest
      • getServerName

        public String getServerName()
        Return the server name responding to this Request.
        Specified by:
        getServerName in interface jakarta.servlet.ServletRequest
      • getServerPort

        public int getServerPort()
        Return the server port responding to this Request.
        Specified by:
        getServerPort in interface jakarta.servlet.ServletRequest
      • isSecure

        public boolean isSecure()
        Was this request received on a secure connection?
        Specified by:
        isSecure in interface jakarta.servlet.ServletRequest
      • removeAttribute

        public void removeAttribute​(String name)
        Remove the specified request attribute if it exists.
        Specified by:
        removeAttribute in interface jakarta.servlet.ServletRequest
        Parameters:
        name - Name of the request attribute to remove
      • setAttribute

        public void setAttribute​(String name,
                                 Object value)
        Set the specified request attribute to the specified value.
        Specified by:
        setAttribute in interface jakarta.servlet.ServletRequest
        Parameters:
        name - Name of the request attribute to set
        value - The associated value
      • setCharacterEncoding

        public void setCharacterEncoding​(String enc)
                                  throws UnsupportedEncodingException
        Overrides the name of the character encoding used in the body of this request. This method must be called prior to reading request parameters or reading input using getReader(). Otherwise, it has no effect.
        Specified by:
        setCharacterEncoding in interface jakarta.servlet.ServletRequest
        Parameters:
        enc - String containing the name of the character encoding.
        Throws:
        UnsupportedEncodingException - if this ServletRequest is still in a state where a character encoding may be set, but the specified encoding is invalid
        Since:
        Servlet 2.3
      • setMaxDispatchDepth

        public static void setMaxDispatchDepth​(int depth)
        Static setter method for the maximum dispatch depth
      • getMaxDispatchDepth

        public static int getMaxDispatchDepth()
      • incrementDispatchDepth

        public int incrementDispatchDepth()
        Increment the depth of application dispatch
      • decrementDispatchDepth

        public int decrementDispatchDepth()
        Decrement the depth of application dispatch
      • isMaxDispatchDepthReached

        public boolean isMaxDispatchDepthReached()
        Check if the application dispatching has reached the maximum
      • authenticate

        public boolean authenticate​(jakarta.servlet.http.HttpServletResponse response)
                             throws IOException,
                                    jakarta.servlet.ServletException
        Specified by:
        authenticate in interface jakarta.servlet.http.HttpServletRequest
        Throws:
        IOException
        jakarta.servlet.ServletException
      • login

        public void login​(String username,
                          String password)
                   throws jakarta.servlet.ServletException
        Specified by:
        login in interface jakarta.servlet.http.HttpServletRequest
        Throws:
        jakarta.servlet.ServletException
      • login

        public void login​(String username,
                          char[] password)
                   throws jakarta.servlet.ServletException
        Throws:
        jakarta.servlet.ServletException
      • logout

        public void logout()
                    throws jakarta.servlet.ServletException
        Specified by:
        logout in interface jakarta.servlet.http.HttpServletRequest
        Throws:
        jakarta.servlet.ServletException
      • addCookie

        public void addCookie​(jakarta.servlet.http.Cookie cookie)
        Add a Cookie to the set of Cookies associated with this Request.
        Specified by:
        addCookie in interface HttpRequest
        Parameters:
        cookie - The new cookie
      • addHeader

        public void addHeader​(String name,
                              String value)
        Add a Header to the set of Headers associated with this Request.
        Specified by:
        addHeader in interface HttpRequest
        Parameters:
        name - The new header name
        value - The new header value
      • addLocale

        public void addLocale​(Locale locale)
        Add a Locale to the set of preferred Locales for this Request. The first added Locale will be the first one returned by getLocales().
        Specified by:
        addLocale in interface HttpRequest
        Parameters:
        locale - The new preferred Locale
      • addParameter

        public void addParameter​(String name,
                                 String[] values)
        Add a parameter name and corresponding set of values to this Request. (This is used when restoring the original request on a form based login).
        Specified by:
        addParameter in interface HttpRequest
        Parameters:
        name - Name of this request parameter
        values - Corresponding values for this request parameter
      • clearCookies

        public void clearCookies()
        Clear the collection of Cookies associated with this Request.
        Specified by:
        clearCookies in interface HttpRequest
      • clearHeaders

        public void clearHeaders()
        Clear the collection of Headers associated with this Request.
        Specified by:
        clearHeaders in interface HttpRequest
      • clearLocales

        public void clearLocales()
        Clear the collection of Locales associated with this Request.
        Specified by:
        clearLocales in interface HttpRequest
      • clearParameters

        public void clearParameters()
        Clear the collection of parameters associated with this Request and reset the query string encoding charset.
        Specified by:
        clearParameters in interface HttpRequest
      • replayPayload

        public void replayPayload​(byte[] payloadByteArray)
        Specified by:
        replayPayload in interface HttpRequest
      • setAuthType

        public void setAuthType​(String type)
        Set the authentication type used for this request, if any; otherwise set the type to null. Typical values are "BASIC", "DIGEST", or "SSL".
        Specified by:
        setAuthType in interface HttpRequest
        Parameters:
        type - The authentication type used
      • setMethod

        public void setMethod​(String method)
        Set the HTTP request method used for this Request.

        Used by FBL when the original request is restored after successful authentication.

        Specified by:
        setMethod in interface HttpRequest
        Parameters:
        method - The request method
      • setQueryString

        public void setQueryString​(String query)
        Sets the query string for this Request.

        Used by FBL when the original request is restored after successful authentication.

        Specified by:
        setQueryString in interface HttpRequest
        Parameters:
        query - The query string
      • setPathInfo

        public void setPathInfo​(String pathInfo)
        Set the path information for this Request.
        Specified by:
        setPathInfo in interface HttpRequest
        Parameters:
        pathInfo - The path information
      • setRequestedSessionCookie

        public void setRequestedSessionCookie​(boolean flag)
        Set a flag indicating whether or not the requested session ID for this request came in through a cookie. This is normally called by the HTTP Connector, when it parses the request headers.
        Specified by:
        setRequestedSessionCookie in interface HttpRequest
        Parameters:
        flag - The new flag
      • setRequestedSessionCookiePath

        public void setRequestedSessionCookiePath​(String cookiePath)
        Sets the requested session cookie path, see IT 7426
        Specified by:
        setRequestedSessionCookiePath in interface Request
      • setRequestedSessionId

        public void setRequestedSessionId​(String id)
        Set the requested session ID for this request. This is normally called by the HTTP Connector, when it parses the request headers. This method, which is called when the session id is sent as a cookie, or when it is encoded in the request URL, removes a jvmRoute (if present) from the given id.
        Specified by:
        setRequestedSessionId in interface HttpRequest
        Parameters:
        id - The new session id
      • setRequestedSessionURL

        public void setRequestedSessionURL​(boolean flag)
        Set a flag indicating whether or not the requested session ID for this request came in through a URL. This is normally called by the HTTP Connector, when it parses the request headers.
        Specified by:
        setRequestedSessionURL in interface HttpRequest
        Parameters:
        flag - The new flag
      • setRequestURI

        public void setRequestURI​(String uri)
        Set the unparsed request URI for this Request. This will normally be called by the HTTP Connector, when it parses the request headers. Used by FBL when restoring original request after successful authentication.
        Specified by:
        setRequestURI in interface HttpRequest
        Parameters:
        uri - The request URI
      • getDecodedRequestURI

        public String getDecodedRequestURI()
        Get the decoded request URI.
        Specified by:
        getDecodedRequestURI in interface HttpRequest
        Returns:
        the URL decoded request URI
      • getDecodedRequestURI

        public String getDecodedRequestURI​(boolean maskDefaultContextMapping)
        Gets the decoded request URI.
        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
      • setServletPath

        public void setServletPath​(String servletPath)
        Sets the servlet path for this Request.
        Specified by:
        setServletPath in interface HttpRequest
        Parameters:
        servletPath - The servlet path
      • setUserPrincipal

        public void setUserPrincipal​(Principal principal)
        Set the Principal who has been authenticated for this Request. This value is also used to calculate the value to be returned by the getRemoteUser() method.
        Specified by:
        setUserPrincipal in interface HttpRequest
        Parameters:
        principal - The user Principal
      • getAuthType

        public String getAuthType()
        Return the authentication type used for this Request.
        Specified by:
        getAuthType in interface jakarta.servlet.http.HttpServletRequest
      • getContextPath

        public String getContextPath()
        Return the portion of the request URI used to select the Context of the Request.
        Specified by:
        getContextPath in interface jakarta.servlet.http.HttpServletRequest
      • getContextPath

        public String getContextPath​(boolean maskDefaultContextMapping)
        Gets the portion of the request URI used to select the Context of the Request.
        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
      • getCookies

        public jakarta.servlet.http.Cookie[] getCookies()
        Return the set of Cookies received with this Request.
        Specified by:
        getCookies in interface jakarta.servlet.http.HttpServletRequest
      • setCookies

        public void setCookies​(jakarta.servlet.http.Cookie[] cookies)
        Set the set of cookies received with this Request.
      • getDateHeader

        public long getDateHeader​(String name)
        Return the value of the specified date header, if any; otherwise return -1.
        Specified by:
        getDateHeader in interface jakarta.servlet.http.HttpServletRequest
        Parameters:
        name - Name of the requested date header
        Throws:
        IllegalArgumentException - if the specified header value cannot be converted to a date
      • getHeader

        public String getHeader​(String name)
        Return the first value of the specified header, if any; otherwise, return null
        Specified by:
        getHeader in interface jakarta.servlet.http.HttpServletRequest
        Parameters:
        name - Name of the requested header
      • getHeaders

        public Enumeration<String> getHeaders​(String name)
        Return all of the values of the specified header, if any; otherwise, return an empty enumeration.
        Specified by:
        getHeaders in interface jakarta.servlet.http.HttpServletRequest
        Parameters:
        name - Name of the requested header
      • getHeaderNames

        public Enumeration<String> getHeaderNames()
        Return the names of all headers received with this request.
        Specified by:
        getHeaderNames in interface jakarta.servlet.http.HttpServletRequest
      • getIntHeader

        public int getIntHeader​(String headerName)
        Return the value of the specified header as an integer, or -1 if there is no such header for this request.
        Specified by:
        getIntHeader in interface jakarta.servlet.http.HttpServletRequest
        Parameters:
        headerName - Name of the requested header
        Throws:
        IllegalArgumentException - if the specified header value cannot be converted to an integer
      • getTrailerFields

        public Map<String,​String> getTrailerFields()
        Specified by:
        getTrailerFields in interface jakarta.servlet.http.HttpServletRequest
      • isTrailerFieldsReady

        public boolean isTrailerFieldsReady()
        Specified by:
        isTrailerFieldsReady in interface jakarta.servlet.http.HttpServletRequest
      • getMethod

        public String getMethod()
        Return the HTTP request method used in this Request.
        Specified by:
        getMethod in interface jakarta.servlet.http.HttpServletRequest
      • getPathInfo

        public String getPathInfo()
        Return the path information associated with this Request.
        Specified by:
        getPathInfo in interface jakarta.servlet.http.HttpServletRequest
      • getPathTranslated

        public String getPathTranslated()
        Return the extra path information for this request, translated to a real path.
        Specified by:
        getPathTranslated in interface jakarta.servlet.http.HttpServletRequest
      • newPushBuilder

        public jakarta.servlet.http.PushBuilder newPushBuilder()
        Specified by:
        newPushBuilder in interface jakarta.servlet.http.HttpServletRequest
      • getQueryString

        public String getQueryString()
        Return the query string associated with this request.
        Specified by:
        getQueryString in interface jakarta.servlet.http.HttpServletRequest
      • getRemoteUser

        public String getRemoteUser()
        Return the name of the remote user that has been authenticated for this Request.
        Specified by:
        getRemoteUser in interface jakarta.servlet.http.HttpServletRequest
      • getRequestPathMB

        public org.glassfish.grizzly.http.util.DataChunk getRequestPathMB()
        Get the request path.
        Specified by:
        getRequestPathMB in interface HttpRequest
        Returns:
        the request path
      • getRequestedSessionId

        public String getRequestedSessionId()
        Return the session identifier included in this request, if any.
        Specified by:
        getRequestedSessionId in interface jakarta.servlet.http.HttpServletRequest
      • getRequestURI

        public String getRequestURI()
        Return the request URI for this request.
        Specified by:
        getRequestURI in interface jakarta.servlet.http.HttpServletRequest
      • getRequestURI

        public String getRequestURI​(boolean maskDefaultContextMapping)
        Gets the request URI for this request.
        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
      • getRequestURL

        public StringBuffer getRequestURL()
        Reconstructs the URL the client used to make the request. The returned URL contains a protocol, server name, port number, and server path, but it does not include query string parameters.

        Because this method returns a StringBuilder, not a String, you can modify the URL easily, for example, to append query parameters.

        This method is useful for creating redirect messages and for reporting errors.

        Specified by:
        getRequestURL in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        A StringBuilder object containing the reconstructed URL
      • getRequestURL

        public StringBuffer getRequestURL​(boolean maskDefaultContextMapping)
      • getServletPath

        public String getServletPath()
        Return the portion of the request URI used to select the servlet that will process this request.
        Specified by:
        getServletPath in interface jakarta.servlet.http.HttpServletRequest
      • getSession

        public jakarta.servlet.http.HttpSession getSession()
        Return the session associated with this Request, creating one if necessary.
        Specified by:
        getSession in interface jakarta.servlet.http.HttpServletRequest
      • getSession

        public jakarta.servlet.http.HttpSession getSession​(boolean create)
        Return the session associated with this Request, creating one if necessary and requested.
        Specified by:
        getSession in interface jakarta.servlet.http.HttpServletRequest
        Parameters:
        create - Create a new session if one does not exist
      • setSession

        public void setSession​(Session newSess)
        set the session - this method is not for general use
        Parameters:
        newSess - the new session
      • isRequestedSessionIdFromCookie

        public boolean isRequestedSessionIdFromCookie()
        Return true if the session identifier included in this request came from a cookie.
        Specified by:
        isRequestedSessionIdFromCookie in interface jakarta.servlet.http.HttpServletRequest
      • isRequestedSessionIdFromURL

        public boolean isRequestedSessionIdFromURL()
        Return true if the session identifier included in this request came from the request URI.
        Specified by:
        isRequestedSessionIdFromURL in interface jakarta.servlet.http.HttpServletRequest
      • setRequestedSessionIdFromSecureCookie

        public void setRequestedSessionIdFromSecureCookie​(boolean secure)
        Marks (or unmarks) this request as having a JSESSIONID cookie that is marked as secure
        Parameters:
        secure - true if this request has a JSESSIONID cookie that is marked as secure, false otherwise
      • isRequestedSessionIdFromSecureCookie

        public boolean isRequestedSessionIdFromSecureCookie()
        Returns:
        true if this request contains a JSESSIONID cookie that is marked as secure, false otherwise
      • isRequestedSessionIdValid

        public boolean isRequestedSessionIdValid()
        Return true if the session identifier included in this request identifies a valid session.
        Specified by:
        isRequestedSessionIdValid in interface jakarta.servlet.http.HttpServletRequest
      • isUserInRole

        public boolean isUserInRole​(String role)
        Return true if the authenticated user principal possesses the specified role name.
        Specified by:
        isUserInRole in interface jakarta.servlet.http.HttpServletRequest
        Parameters:
        role - Role name to be validated
      • getUserPrincipal

        public Principal getUserPrincipal()
        Return the principal that has been authenticated for this Request.
        Specified by:
        getUserPrincipal in interface jakarta.servlet.http.HttpServletRequest
      • getSessionInternal

        public Session getSessionInternal()
        Return the session associated with this Request, creating one if necessary.
      • getSessionInternal

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

        public String changeSessionId()
        Change the session id of the current session associated with this request and return the new session id.
        Specified by:
        changeSessionId in interface jakarta.servlet.http.HttpServletRequest
        Specified by:
        changeSessionId in interface Request
        Returns:
        the new session id
        Throws:
        IllegalStateException - if there is no session associated with the request
        Since:
        Servlet 3.1
      • generateSessionId

        public String generateSessionId()
        This object does not implement a session ID generator. Provide a dummy implementation so that the default one will be used.
        Specified by:
        generateSessionId in interface Request
      • getServletContext

        public jakarta.servlet.ServletContext getServletContext()
        Gets the servlet context to which this servlet request was last dispatched.
        Specified by:
        getServletContext in interface jakarta.servlet.ServletRequest
        Returns:
        the servlet context to which this servlet request was last dispatched
      • upgrade

        public <T extends jakarta.servlet.http.HttpUpgradeHandler> T upgrade​(Class<T> handlerClass)
                                                                      throws IOException,
                                                                             jakarta.servlet.ServletException
        Create an instance of HttpUpgradeHandler for an given class and uses it for the http protocol upgrade processing.
        Specified by:
        upgrade in interface jakarta.servlet.http.HttpServletRequest
        Parameters:
        handlerClass - The HttpUpgradeHandler class used for the upgrade.
        Returns:
        an instance of the HttpUpgradeHandler
        Throws:
        IOException - if an I/O error occurred during the upgrade
        jakarta.servlet.ServletException - if the given clazz fails to be instantiated
        Since:
        Servlet 3.1
        See Also:
        HttpUpgradeHandler, WebConnection
      • initialiseHttpUpgradeHandler

        public void initialiseHttpUpgradeHandler​(jakarta.servlet.http.WebConnection wc)
      • getWebConnection

        public jakarta.servlet.http.WebConnection getWebConnection()
      • setWebConnection

        public void setWebConnection​(jakarta.servlet.http.WebConnection wc)
      • doGetSession

        protected Session doGetSession​(boolean create)
      • configureSessionCookie

        protected void configureSessionCookie​(jakarta.servlet.http.Cookie cookie)
        Configures the given JSESSIONID cookie.
        Parameters:
        cookie - The JSESSIONID cookie to be configured
      • parseCookies

        protected void parseCookies()
        Parse cookies.
      • makeCookie

        protected jakarta.servlet.http.Cookie makeCookie​(org.glassfish.grizzly.http.Cookie scookie)
      • makeCookie

        protected jakarta.servlet.http.Cookie makeCookie​(org.glassfish.grizzly.http.Cookie scookie,
                                                         boolean decode)
      • getPostBody

        protected byte[] getPostBody()
                              throws IOException
        Gets the POST body of this request.
        Returns:
        The POST body of this request
        Throws:
        IOException
      • readPostBody

        protected int readPostBody​(byte[] body,
                                   int len)
                            throws IOException
        Read post body in an array.
        Throws:
        IOException
      • isAlpha

        protected static boolean isAlpha​(String value)
      • obtainSessionId

        protected void obtainSessionId()
        Take the session id from Grizzly Request
      • parseSessionId

        protected void parseSessionId​(String sessionParameterName,
                                      org.glassfish.grizzly.http.util.CharChunk uriBB)
        Parse session id in URL.
      • parseSessionVersion

        protected void parseSessionVersion​(org.glassfish.grizzly.http.util.CharChunk uriCC)
        Parses and removes any session version (if present) from the request URI.
      • parseJReplica

        protected void parseJReplica​(org.glassfish.grizzly.http.util.CharChunk uriCC)
        Parses and removes jreplica (if present) from the request URI.
      • getJrouteId

        public 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).
        Specified by:
        getJrouteId in interface Request
        Returns:
        The jroute id of this request, or null if this request does not carry any jroute id
      • parseSessionCookiesId

        protected void parseSessionCookiesId()
        Parse session id in URL.
      • convertURI

        protected void convertURI​(org.glassfish.grizzly.http.util.MessageBytes uri)
                           throws Exception
        Character conversion of the URI.
        Throws:
        Exception
      • getDispatcherType

        public jakarta.servlet.DispatcherType getDispatcherType()
        Specified by:
        getDispatcherType in interface jakarta.servlet.ServletRequest
      • startAsync

        public jakarta.servlet.AsyncContext startAsync()
                                                throws IllegalStateException
        Starts async processing on this request.
        Specified by:
        startAsync in interface jakarta.servlet.ServletRequest
        Throws:
        IllegalStateException
      • startAsync

        public jakarta.servlet.AsyncContext startAsync​(jakarta.servlet.ServletRequest servletRequest,
                                                       jakarta.servlet.ServletResponse servletResponse)
                                                throws IllegalStateException
        Starts async processing on this request.
        Specified by:
        startAsync in interface jakarta.servlet.ServletRequest
        Parameters:
        servletRequest - the ServletRequest with which to initialize the AsyncContext
        servletResponse - the ServletResponse with which to initialize the AsyncContext
        Throws:
        IllegalStateException
      • isAsyncStarted

        public boolean isAsyncStarted()
        Checks whether async processing has started on this request.
        Specified by:
        isAsyncStarted in interface jakarta.servlet.ServletRequest
      • disableAsyncSupport

        public void disableAsyncSupport()
        Disables async support for this request. Async support is disabled as soon as this request has passed a filter or servlet that does not support async (either via the designated annotation or declaratively).
        Specified by:
        disableAsyncSupport in interface Request
      • isAsyncSupported

        public boolean isAsyncSupported()
        Checks whether this request supports async.
        Specified by:
        isAsyncSupported in interface jakarta.servlet.ServletRequest
      • getAsyncContext

        public jakarta.servlet.AsyncContext getAsyncContext()
        Gets the AsyncContext of this request.
        Specified by:
        getAsyncContext in interface jakarta.servlet.ServletRequest
      • getParts

        public Collection<jakarta.servlet.http.Part> getParts()
                                                       throws IOException,
                                                              jakarta.servlet.ServletException
        Specified by:
        getParts in interface jakarta.servlet.http.HttpServletRequest
        Throws:
        IOException
        jakarta.servlet.ServletException
      • getPart

        public jakarta.servlet.http.Part getPart​(String name)
                                          throws IOException,
                                                 jakarta.servlet.ServletException
        Specified by:
        getPart in interface jakarta.servlet.http.HttpServletRequest
        Throws:
        IOException
        jakarta.servlet.ServletException
      • lockSession

        public Session lockSession()
        lock the session associated with this request this will be a foreground lock checks for background lock to clear and does a decay poll loop to wait until it is clear; after 5 times it takes control for the foreground
        Specified by:
        lockSession in interface Request
        Returns:
        the session that's been locked
      • unlockSession

        public void unlockSession()
        unlock the session associated with this request
        Specified by:
        unlockSession in interface Request
      • getRequestId

        public String getRequestId()
        Specified by:
        getRequestId in interface jakarta.servlet.ServletRequest
      • getProtocolRequestId

        public String getProtocolRequestId()
        Specified by:
        getProtocolRequestId in interface jakarta.servlet.ServletRequest
      • getServletConnection

        public jakarta.servlet.ServletConnection getServletConnection()
        Specified by:
        getServletConnection in interface jakarta.servlet.ServletRequest