Interface HttpServerRequest

    • Method Detail

      • getRequestHeaderValues

        List<String> getRequestHeaderValues​(String headerName)
        Get a list of all of the values set for the specified header within the HTTP request.
        Parameters:
        headerName - the not null name of the header the values are required for.
        Returns:
        a list of the values set for this header, if the header is not set on the request then null should be returned.
      • getFirstRequestHeaderValue

        String getFirstRequestHeaderValue​(String headerName)
        Get the first value for the header specified in the HTTP request.
        Parameters:
        headerName - the not null name of the header the value is required for.
        Returns:
        the value for the first instance of the header specified, if the header is not present then null should be returned instead.
      • getSSLSession

        SSLSession getSSLSession()
        Get the SSLSession (if any) that has been established for the connection in use. Note that even if this is null getPeerCertificates() can still return some certificates, as the certificates may have been provided to the underlying server via some external mechanism (such as headers).
        Returns:
        the SSLSession (if any) that has been established for the connection in use, or null if none exists.
      • getPeerCertificates

        Certificate[] getPeerCertificates()
        Get the peer certificates established on the connection.
        Returns:
        the peer certificates established on the connection or null if none available.
      • noAuthenticationInProgress

        void noAuthenticationInProgress​(HttpServerMechanismsResponder responder)
        Notification from the mechanism to state no authentication is in progress whilst evaluating the current request.
        Parameters:
        responder - a HttpServerMechanismsResponder that can send a challenge should it be required.
      • noAuthenticationInProgress

        default void noAuthenticationInProgress()
        Notification from the mechanism to state no authentication is in progress whilst evaluating the current request. If this form is called no challenge is expected from this mechanism.
      • authenticationInProgress

        void authenticationInProgress​(HttpServerMechanismsResponder responder)
        Notification that this mechanism has commenced but not completed authentication, typically because another challenge / response round trip is required.
        Parameters:
        responder - a HttpServerMechanismsResponder that can send a challenge should it be required.
      • authenticationComplete

        void authenticationComplete​(HttpServerMechanismsResponder responder)
        Notification that authentication is now complete. After this point the framework will perform an authorization check for the authenticated user and if successful establish the identity of the request.
        Parameters:
        responder - a HttpServerMechanismsResponder that can send a response.
      • authenticationComplete

        void authenticationComplete​(HttpServerMechanismsResponder responder,
                                    Runnable logoutHandler)

        Notification that authentication is now complete.

        This method behaves exactly like {@link #authenticationComplete(HttpServerMechanismsResponder)}, allowing mechanisms to register a logout handler which should be called when a logout request is received by the underlying container.

        Parameters:
        responder - a HttpServerMechanismsResponder that can send a response.
        logoutHandler - a Runnable that can handle logout
      • authenticationComplete

        default void authenticationComplete()
        Notification that authentication is now complete. After this point the framework will perform an authorization check for the authenticated user and if successful establish the identity of the request. If this form is called no response is expected from this mechanism.
      • authenticationFailed

        default void authenticationFailed​(String message)
        Notification that authentication failes. If this form is called no challenge is expected from this mechanism.
        Parameters:
        message - an error message describing the failure.
      • badRequest

        default void badRequest​(HttpAuthenticationException failure)
        Notification to indicate that this was a bad request. If this form is called no challenge is expected from this mechanism.
        Parameters:
        failure - an HttpAuthenticationException to describe the error.
      • getRequestMethod

        String getRequestMethod()
        Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
        Returns:
        a String specifying the name of the method with which this request was made
      • getRequestURI

        URI getRequestURI()
        Get the URI representation for the current request.
        Returns:
        the URI representation for the current request.
      • getRequestPath

        String getRequestPath()
        Get the request path. This is the path relative to the context path. E.g.: for a HTTP GET request to http://my.appserver.com/my-application/path/sub-path this method is going to return /path/sub-path.
        Returns:
        the request path
      • getRemoteUser

        default String getRemoteUser()
        Returns a remotely authenticated user
        Returns:
        the remote user principal or null if no remote user was authenticated.
      • getParameters

        Map<String,​List<String>> getParameters()
        Returns the parameters received in the current request. These parameters will be from both the query string and the form data when available. Where a parameter is named both in the query string and in the form data the List will contain the values from the query string followed by the values from the form data.
        Returns:
        the parameters received in the current request.
      • getParameterNames

        Set<String> getParameterNames()
        Returns the names of all parameters either from the query string or from the form data where available.
        Returns:
        the names of all parameters either from the query string or from the form data where available.
      • getParameterValues

        List<String> getParameterValues​(String name)
        Return the values for the parameter specified, where a parameter is specified both in the query string and in the form data the query string values will be first in the List.
        Parameters:
        name - the name of the desires parameter values.
        Returns:
        the values for the parameter specified or null if the parameter was not in the request.
      • getFirstParameterValue

        String getFirstParameterValue​(String name)
        Get the first value for the parameter specified.
        Parameters:
        name - the name of the parameter the first value is required for.
        Returns:
        the first value of the named parameter or null if the parameter is not available.
      • getCookies

        List<HttpServerCookie> getCookies()
        Returns a List containing all of the HttpServerCookie objects the client sent with this request, or an empty List if no cookies were included in the request.
        Returns:
        a List containing all of the HttpServerCookie objects the client sent with this request, or an empty List if no cookies were included in the request.
      • getInputStream

        InputStream getInputStream()
        Returns the request input stream.
        Returns:
        the input stream or null if not supported.
      • getSourceAddress

        InetSocketAddress getSourceAddress()
        Get the source address of the HTTP request.
        Returns:
        the source address of the HTTP request
      • suspendRequest

        boolean suspendRequest()
        Suspend the current request so that it can be subsequently resumed.
        Returns:
        true if suspending requests is supported, false otherwise.
      • resumeRequest

        boolean resumeRequest()
        Resume any previously suspended request.
        Returns:
        true if resuming requests is supported, false otherwise.