Package com.yahoo.processing.handler
Class ProcessingResponse
java.lang.Object
com.yahoo.container.jdisc.HttpResponse
com.yahoo.container.jdisc.AsyncHttpResponse
com.yahoo.processing.handler.ProcessingResponse
A response from running a request through processing. This response is just a
wrapper of the knowhow needed to render the Response from processing.
- Author:
- bratseth, Steinar Knutsen
-
Field Summary
Fields inherited from class com.yahoo.container.jdisc.HttpResponse
DEFAULT_CHARACTER_ENCODING, DEFAULT_MIME_TYPE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
complete()
Complete creation of this response.The name of the encoding for the response contents, if applicable.The MIME type of the response contents or null.void
render
(OutputStream stream, com.yahoo.jdisc.handler.ContentChannel channel, com.yahoo.jdisc.handler.CompletionHandler completionHandler) Render to output asynchronously.Methods inherited from class com.yahoo.container.jdisc.AsyncHttpResponse
render
Methods inherited from class com.yahoo.container.jdisc.HttpResponse
getJdiscResponse, getRequestType, getStatus, headers, maxPendingBytes, populateAccessLogEntry, setRequestType, setStatus
-
Constructor Details
-
ProcessingResponse
-
-
Method Details
-
render
public void render(OutputStream stream, com.yahoo.jdisc.handler.ContentChannel channel, com.yahoo.jdisc.handler.CompletionHandler completionHandler) throws IOException Description copied from class:AsyncHttpResponse
Render to output asynchronously. The output stream will not be closed when this return. The implementation is responsible for closing the output (using the provided channel and completion handler) when (async) rendering is completed.- Specified by:
render
in classAsyncHttpResponse
- Parameters:
stream
- the stream to which content should be renderedchannel
- the channel which must be closed on completioncompletionHandler
- the completion handler to submit when closing the channel, may be null- Throws:
IOException
-
getContentType
Description copied from class:HttpResponse
The MIME type of the response contents or null. If null is returned, no content type header is added to the HTTP response.- Overrides:
getContentType
in classHttpResponse
- Returns:
- by default
HttpResponse.DEFAULT_MIME_TYPE
-
getCharacterEncoding
Description copied from class:HttpResponse
The name of the encoding for the response contents, if applicable. Return null if character set is not applicable to the response in question (e.g. binary formats). If null is returned, not "charset" element is added to the content type header.- Overrides:
getCharacterEncoding
in classHttpResponse
- Returns:
- by default
HttpResponse.DEFAULT_CHARACTER_ENCODING
-
complete
public void complete()Description copied from class:HttpResponse
Complete creation of this response. This is called by the container once just before writing the response header back to the caller, so this is the last moment at which status and headers can be determined. This default implementation does nothing.- Overrides:
complete
in classHttpResponse
-
getLogValues
- Overrides:
getLogValues
in classHttpResponse
-