public class ProcessingResponse extends AsyncHttpResponse
Modifier and Type | Field and Description |
---|---|
private com.yahoo.processing.execution.Execution |
execution |
private boolean |
explicitStatusSet
True if the return status has been set explicitly and should not be further changed
|
private com.yahoo.processing.Request |
processingRequest |
private com.yahoo.processing.Response |
processingResponse |
private Renderer |
renderer |
DEFAULT_CHARACTER_ENCODING, DEFAULT_MIME_TYPE
Constructor and Description |
---|
ProcessingResponse(int status,
com.yahoo.processing.Request processingRequest,
com.yahoo.processing.Response processingResponse,
Renderer renderer,
Executor renderingExecutor,
com.yahoo.processing.execution.Execution execution) |
Modifier and Type | Method and Description |
---|---|
private void |
addHeadersAndStatusFrom(com.yahoo.processing.response.DataList<com.yahoo.processing.response.Data> dataList)
This sets header and status from special Data items used for the purpose.
|
private Set<com.yahoo.processing.request.ErrorMessage> |
addTo(Set<com.yahoo.processing.request.ErrorMessage> allErrors,
List<com.yahoo.processing.request.ErrorMessage> errors) |
void |
complete()
Complete creation of this response.
|
private List<com.yahoo.processing.request.ErrorMessage> |
flattenErrors(com.yahoo.processing.Response processingResponse) |
private Set<com.yahoo.processing.request.ErrorMessage> |
flattenErrors(Set<com.yahoo.processing.request.ErrorMessage> errors,
com.yahoo.processing.response.Data data) |
String |
getCharacterEncoding()
The name of the encoding for the response contents, if applicable.
|
String |
getContentType()
The MIME type of the response contents or null.
|
private int |
getHttpResponseStatus(boolean isSuccess,
com.yahoo.processing.Request request,
com.yahoo.processing.request.ErrorMessage mainError,
List<com.yahoo.processing.request.ErrorMessage> errors) |
Iterable<com.yahoo.processing.execution.Execution.Trace.LogValue> |
getLogValues() |
private boolean |
isBenchmarking(com.yahoo.processing.Request request) |
void |
render(OutputStream stream,
com.yahoo.jdisc.handler.ContentChannel channel,
com.yahoo.jdisc.handler.CompletionHandler completionHandler)
Render to output asynchronously.
|
render
getJdiscResponse, getStatus, headers, populateAccessLogEntry, setStatus
private final com.yahoo.processing.Request processingRequest
private final com.yahoo.processing.Response processingResponse
private final com.yahoo.processing.execution.Execution execution
private final Renderer renderer
private boolean explicitStatusSet
public void render(OutputStream stream, com.yahoo.jdisc.handler.ContentChannel channel, com.yahoo.jdisc.handler.CompletionHandler completionHandler) throws IOException
AsyncHttpResponse
render
in class AsyncHttpResponse
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 nullIOException
public String getContentType()
HttpResponse
getContentType
in class HttpResponse
HttpResponse.DEFAULT_MIME_TYPE
public String getCharacterEncoding()
HttpResponse
getCharacterEncoding
in class HttpResponse
HttpResponse.DEFAULT_CHARACTER_ENCODING
public void complete()
HttpResponse
complete
in class HttpResponse
private void addHeadersAndStatusFrom(com.yahoo.processing.response.DataList<com.yahoo.processing.response.Data> dataList)
private List<com.yahoo.processing.request.ErrorMessage> flattenErrors(com.yahoo.processing.Response processingResponse)
private Set<com.yahoo.processing.request.ErrorMessage> flattenErrors(Set<com.yahoo.processing.request.ErrorMessage> errors, com.yahoo.processing.response.Data data)
private Set<com.yahoo.processing.request.ErrorMessage> addTo(Set<com.yahoo.processing.request.ErrorMessage> allErrors, List<com.yahoo.processing.request.ErrorMessage> errors)
private int getHttpResponseStatus(boolean isSuccess, com.yahoo.processing.Request request, com.yahoo.processing.request.ErrorMessage mainError, List<com.yahoo.processing.request.ErrorMessage> errors)
private boolean isBenchmarking(com.yahoo.processing.Request request)
public Iterable<com.yahoo.processing.execution.Execution.Trace.LogValue> getLogValues()
getLogValues
in class HttpResponse
Copyright © 2017. All rights reserved.