public abstract class MappingResponseProcessor extends Object implements ResponseProcessor
Modifier and Type | Field and Description |
---|---|
protected DataApiRequest |
apiRequest |
protected javax.ws.rs.core.MultivaluedHashMap<String,Serializable> |
headers |
protected List<ResultSetMapper> |
mappers |
protected ObjectMappersSuite |
objectMappers |
protected ResponseContext |
responseContext |
Constructor and Description |
---|
MappingResponseProcessor(DataApiRequest apiRequest,
ObjectMappersSuite objectMappers)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected javax.ws.rs.core.MultivaluedHashMap<String,Serializable> |
buildHeaderList()
Create headers which belong in the response.
|
protected List<ResultSetMapper> |
buildResultSetMapperList(DataApiRequest apiRequest)
Extract all ResultSetMappers from the api request.
|
DataApiRequest |
getDataApiRequest() |
javax.ws.rs.core.MultivaluedMap<String,Serializable> |
getHeaders() |
List<ResultSetMapper> |
getMappers() |
protected ObjectMappersSuite |
getObjectMappers() |
ResponseContext |
getResponseContext()
The response context allows state to be injected from construction and visible across response processor
layers as necessary.
|
HttpErrorCallback |
getStandardError(rx.subjects.Subject responseEmitter,
DruidAggregationQuery<?> druidQuery)
Get the standard error callback.
|
FailureCallback |
getStandardFailure(rx.subjects.Subject responseEmitter,
DruidAggregationQuery<?> druidQuery)
Get the standard failure callback.
|
protected ResultSet |
mapResultSet(ResultSet resultSet)
Builds a mapped result set by running through ResultSetMappers.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getErrorCallback, getFailureCallback, processResponse
protected final DataApiRequest apiRequest
protected final ResponseContext responseContext
protected final javax.ws.rs.core.MultivaluedHashMap<String,Serializable> headers
protected final List<ResultSetMapper> mappers
protected final ObjectMappersSuite objectMappers
public MappingResponseProcessor(DataApiRequest apiRequest, ObjectMappersSuite objectMappers)
apiRequest
- The request for which the response is being processedobjectMappers
- Jackson mappers to use for processing JSONprotected List<ResultSetMapper> buildResultSetMapperList(DataApiRequest apiRequest)
apiRequest
- The query api requestprotected javax.ws.rs.core.MultivaluedHashMap<String,Serializable> buildHeaderList()
protected ResultSet mapResultSet(ResultSet resultSet)
resultSet
- The result set being processedpublic HttpErrorCallback getStandardError(rx.subjects.Subject responseEmitter, DruidAggregationQuery<?> druidQuery)
responseEmitter
- Channel to send the error response todruidQuery
- Query for which we got an errorpublic FailureCallback getStandardFailure(rx.subjects.Subject responseEmitter, DruidAggregationQuery<?> druidQuery)
responseEmitter
- Channel to send the response todruidQuery
- Query for which we got a failurepublic ResponseContext getResponseContext()
ResponseProcessor
getResponseContext
in interface ResponseProcessor
public javax.ws.rs.core.MultivaluedMap<String,Serializable> getHeaders()
public List<ResultSetMapper> getMappers()
public DataApiRequest getDataApiRequest()
protected ObjectMappersSuite getObjectMappers()
Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.