Interface ProxyResponse
public interface ProxyResponse
Handles the interoperability of the response between the origin and the user agent.
- Author:
- Julien Viet
-
Method Summary
Modifier and TypeMethodDescriptionetag()getBody()Get the body of the response.intGet the status code.Get the status message.headers()longmaxAge()booleanputHeader(CharSequence name, CharSequence value) Put an HTTP header.release()Release the proxy response.request()Return the correspondingProxyRequest.send()Send the proxies response to the user agent.Set the request body to be sent to the user agent.setStatusCode(int sc) Set the status code to be sent to the user agent.setStatusMessage(String statusMessage) Set the status message to be sent to the user agent.
-
Method Details
-
request
-
getStatusCode
int getStatusCode()Get the status code.- Returns:
- the status code to be sent to the user agent
-
setStatusCode
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
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
Put an HTTP header.- Parameters:
name- The header namevalue- 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
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
etagsent by the origin response
-
send
-
release
ProxyResponse release()Release the proxy response.The proxied response is resumed, no HTTP response is sent to the user-agent
-