Interface ProxyResponse


  • public interface ProxyResponse
    Handles the interoperability of the response between the origin and the user agent.
    Author:
    Julien Viet
    • Method Detail

      • request

        ProxyRequest request()
        Return the corresponding ProxyRequest.
        Returns:
        the proxy request
      • getStatusCode

        int getStatusCode()
        Get the status code.
        Returns:
        the status code to be sent to the user agent
      • setStatusCode

        ProxyResponse setStatusCode​(int sc)
        Set the status code to be sent to the user agent.

        The initial value is the proxied response status code.

        Parameters:
        sc - the status code
        Returns:
        a reference to this, so the API can be used fluently
      • getStatusMessage

        String getStatusMessage()
        Get the status message.
        Returns:
        the status message to be sent to the user agent
      • setStatusMessage

        ProxyResponse setStatusMessage​(String statusMessage)
        Set the status message to be sent to the user agent.

        The initial value is the proxied response status message.

        Parameters:
        statusMessage - the status message
        Returns:
        a reference to this, so the API can be used fluently
      • headers

        MultiMap headers()
        Returns:
        the headers that will be sent to the user agent, the returned headers can be modified. The headers map is populated with the proxied response headers
      • putHeader

        ProxyResponse putHeader​(CharSequence name,
                                CharSequence value)
        Put an HTTP header.
        Parameters:
        name - The header name
        value - The header value
        Returns:
        a reference to this, so the API can be used fluently
      • getBody

        Body getBody()
        Get the body of the response.
        Returns:
        the response body to be sent to the user agent
      • setBody

        ProxyResponse setBody​(Body body)
        Set the request body to be sent to the user agent.

        The initial request body value is the proxied response body.

        Parameters:
        body - the new body
        Returns:
        a reference to this, so the API can be used fluently
      • proxiedResponse

        HttpClientResponse proxiedResponse()
        Returns:
        the proxied HTTP server response
      • publicCacheControl

        boolean publicCacheControl()
      • maxAge

        long maxAge()
      • etag

        String etag()
        Returns:
        the etag sent by the origin response
      • send

        Future<Void> send()
        Send the proxies response to the user agent.
      • release

        ProxyResponse release()
        Release the proxy response.

        The proxied response is resumed, no HTTP response is sent to the user-agent