Class RemoteHttpServletRequest

  • All Implemented Interfaces:
    jakarta.servlet.http.HttpServletRequest, jakarta.servlet.ServletRequest, Serializable

    public class RemoteHttpServletRequest
    extends RemoteServletRequest
    implements jakarta.servlet.http.HttpServletRequest, Serializable
    This class encapsulates a HttpServletRequest extending from RemoteServletRequest. The information or state that can be serialized is with non serialized content handled sensibly.
    See Also:
    Serialized Form
    • Constructor Detail

      • RemoteHttpServletRequest

        public RemoteHttpServletRequest()
        Called during deserialization.
      • RemoteHttpServletRequest

        public RemoteHttpServletRequest​(jakarta.servlet.http.HttpServletRequest request)
        Creates a serializable request around the normal request.
        Parameters:
        request - The request to encapsulate.
    • Method Detail

      • getAuthType

        public String getAuthType()
        The default behavior of this method is to return getAuthType() on the wrapped request object. Serialized.
        Specified by:
        getAuthType in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        The auth type of the request.
      • getCookies

        public jakarta.servlet.http.Cookie[] getCookies()
        The default behavior of this method is to return getCookies() on the wrapped request object. Serialized.
        Specified by:
        getCookies in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        The cookies associates with the request
      • getDateHeader

        public long getDateHeader​(String name)
        The default behavior of this method is to return getDateHeader(String name) on the wrapped request object. Not Serialized as we cannot differentiate date headers from normal headers.
        Specified by:
        getDateHeader in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        The named date header in seconds or -1 if not available.
      • getHeader

        public String getHeader​(String name)
        The default behavior of this method is to return getHeader(String name) on the wrapped request object. Serialized.
        Specified by:
        getHeader in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        The value of the named header.
      • getHeaders

        public Enumeration<String> getHeaders​(String name)
        The default behavior of this method is to return getHeaders(String name) on the wrapped request object. Serialized.
        Specified by:
        getHeaders in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        Enumeration of the value of the named header.
      • getHeaderNames

        public Enumeration<String> getHeaderNames()
        The default behavior of this method is to return getHeaderNames() on the wrapped request object. Serialized.
        Specified by:
        getHeaderNames in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        Enumeration of header names
      • getIntHeader

        public int getIntHeader​(String name)
        The default behavior of this method is to return getIntHeader(String name) on the wrapped request object. Serialized.
        Specified by:
        getIntHeader in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        The value of the header expressed as an int
        Throws:
        NumberFormatException - if the header cannot be expressed as an int
      • getMethod

        public String getMethod()
        The default behavior of this method is to return getMethod() on the wrapped request object. Serialized.
        Specified by:
        getMethod in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        The method associated with the request.
      • getPathInfo

        public String getPathInfo()
        The default behavior of this method is to return getPathInfo() on the wrapped request object. Serialized.
        Specified by:
        getPathInfo in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        The path info associated with the request.
      • getPathTranslated

        public String getPathTranslated()
        The default behavior of this method is to return getPathTranslated() on the wrapped request object. Serialized.
        Specified by:
        getPathTranslated in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        The translated path of the request.
      • getContextPath

        public String getContextPath()
        The default behavior of this method is to return getContextPath() on the wrapped request object. Serialized.
        Specified by:
        getContextPath in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        The context path of the request.
      • getQueryString

        public String getQueryString()
        The default behavior of this method is to return getQueryString() on the wrapped request object. Serialized.
        Specified by:
        getQueryString in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        The query string of the request.
      • getRemoteUser

        public String getRemoteUser()
        The default behavior of this method is to return getRemoteUser() on the wrapped request object. Serialized.
        Specified by:
        getRemoteUser in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        The remote user of the request, if set null otherwise.
      • isUserInRole

        public boolean isUserInRole​(String role)
        The default behavior of this method is to return isUserInRole(String role) on the wrapped request object. Not serialized.
        Specified by:
        isUserInRole in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        True if user is in named role, false otherwise.
      • getUserPrincipal

        public Principal getUserPrincipal()
        The default behavior of this method is to return getUserPrincipal() on the wrapped request object. Serialized.
        Specified by:
        getUserPrincipal in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        The principal of the authenticated user, if available otherwise null.
      • getRequestedSessionId

        public String getRequestedSessionId()
        The default behavior of this method is to return getRequestedSessionId() on the wrapped request object. Serialized.
        Specified by:
        getRequestedSessionId in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        The session id of the request, if available.
      • getRequestURI

        public String getRequestURI()
        The default behavior of this method is to return getRequestURI() on the wrapped request object. Serialized.
        Specified by:
        getRequestURI in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        The request URI
      • getRequestURL

        public StringBuffer getRequestURL()
        The default behavior of this method is to return getRequestURL() on the wrapped request object. Serialized.
        Specified by:
        getRequestURL in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        The requests URL
      • getServletPath

        public String getServletPath()
        The default behavior of this method is to return getServletPath() on the wrapped request object. Serialized.
        Specified by:
        getServletPath in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        The servlets path.
      • getSession

        public jakarta.servlet.http.HttpSession getSession​(boolean create)
        The default behavior of this method is to return getSession(boolean create) on the wrapped request object. Not Serailzed.
        Specified by:
        getSession in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        The HttpSession associated with the request or null if unavailable.
      • getSession

        public jakarta.servlet.http.HttpSession getSession()
        The default behavior of this method is to return getSession() on the wrapped request object. Not Serialized.
        Specified by:
        getSession in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        The HttpSession associated with the request or null if unavailable.
      • isRequestedSessionIdValid

        public boolean isRequestedSessionIdValid()
        The default behavior of this method is to return isRequestedSessionIdValid() on the wrapped request object. Not Serialized.
        Specified by:
        isRequestedSessionIdValid in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        true if the session id is valid, false otherwise.
      • isRequestedSessionIdFromCookie

        public boolean isRequestedSessionIdFromCookie()
        The default behavior of this method is to return isRequestedSessionIdFromCookie() on the wrapped request object. Not serialized.
        Specified by:
        isRequestedSessionIdFromCookie in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        true if the session id is from a cookie, false otherwise.
      • isRequestedSessionIdFromURL

        public boolean isRequestedSessionIdFromURL()
        The default behavior of this method is to return isRequestedSessionIdFromURL() on the wrapped request object. Not Serialized.
        Specified by:
        isRequestedSessionIdFromURL in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        true if the session id is from a URL, false otherwise.
      • isRequestedSessionIdFromUrl

        public boolean isRequestedSessionIdFromUrl()
        The default behavior of this method is to return isRequestedSessionIdFromUrl() on the wrapped request object. Not Serialized.
        Specified by:
        isRequestedSessionIdFromUrl in interface jakarta.servlet.http.HttpServletRequest
        Returns:
        true if the session id is from a URL, false otherwise.
      • authenticate

        public boolean authenticate​(jakarta.servlet.http.HttpServletResponse response)
                             throws IOException,
                                    jakarta.servlet.ServletException
        Specified by:
        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
      • logout

        public void logout()
                    throws jakarta.servlet.ServletException
        Specified by:
        logout in interface jakarta.servlet.http.HttpServletRequest
        Throws:
        jakarta.servlet.ServletException
      • 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
      • changeSessionId

        public String changeSessionId()
        Specified by:
        changeSessionId in interface jakarta.servlet.http.HttpServletRequest
      • upgrade

        public <T extends jakarta.servlet.http.HttpUpgradeHandler> T upgrade​(Class<T> handlerClass)
                                                                      throws IOException,
                                                                             jakarta.servlet.ServletException
        Specified by:
        upgrade in interface jakarta.servlet.http.HttpServletRequest
        Throws:
        IOException
        jakarta.servlet.ServletException