Package com.yahoo.jdisc.http
Class HttpResponse
java.lang.Object
com.yahoo.jdisc.Response
com.yahoo.jdisc.http.HttpResponse
public class HttpResponse
extends com.yahoo.jdisc.Response
A HTTP response.
- Author:
- Einar M R Rosenvinge
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHttpResponse(com.yahoo.jdisc.Request request, int status, String message, Throwable error) -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyHeaders(com.yahoo.jdisc.HeaderFields target) voidencodeSetCookieHeader(List<Cookie> cookies) booleanstatic booleanisServerError(com.yahoo.jdisc.Response response) static HttpResponsestatic HttpResponsenewInstance(int status) static HttpResponsenewInstance(int status, String message) static HttpResponsenewInternalServerError(com.yahoo.jdisc.Request request, Throwable error) voidsetChunkedEncodingEnabled(boolean chunkedEncodingEnabled) voidsetMessage(String message) com.yahoo.jdisc.HeaderFieldstrailers()Returns the set of trailer header fields of this HttpResponse.Methods inherited from class com.yahoo.jdisc.Response
context, dispatchTimeout, getError, getRequestType, getStatus, headers, setError, setRequestType, setStatus
-
Constructor Details
-
HttpResponse
-
-
Method Details
-
isChunkedEncodingEnabled
public boolean isChunkedEncodingEnabled() -
setChunkedEncodingEnabled
public void setChunkedEncodingEnabled(boolean chunkedEncodingEnabled) -
setMessage
-
getMessage
-
copyHeaders
public void copyHeaders(com.yahoo.jdisc.HeaderFields target) -
decodeSetCookieHeader
-
encodeSetCookieHeader
-
trailers
public com.yahoo.jdisc.HeaderFields trailers()Returns the set of trailer header fields of this HttpResponse. These are typically meta-data that should have been part of
Response.headers(), but were not available prior to callingResponseHandler.handleResponse(Response). You must NOT WRITE to these headers AFTER callingContentChannel.close(CompletionHandler), and you must NOT READ from these headers BEFOREContentChannel.close(CompletionHandler)has been called.NOTE: These headers are NOT thread-safe. You need to explicitly synchronized on the returned object to prevent concurrency issues such as ConcurrentModificationExceptions.
- Returns:
- The trailer headers of this HttpRequest.
-
isServerError
public static boolean isServerError(com.yahoo.jdisc.Response response) -
newInstance
-
newInstance
-
newError
-
newInternalServerError
-