public class RequestHandlerUtils extends Object
| Constructor and Description |
|---|
RequestHandlerUtils() |
| Modifier and Type | Method and Description |
|---|---|
static javax.ws.rs.core.Response |
makeErrorResponse(int statusCode,
String reason,
String description,
DruidQuery<?> druidQuery,
com.fasterxml.jackson.databind.ObjectWriter writer)
Builds error response for Web Service.
|
static javax.ws.rs.core.Response |
makeErrorResponse(javax.ws.rs.core.Response.StatusType status,
DruidQuery<?> druidQuery,
Throwable cause,
com.fasterxml.jackson.databind.ObjectWriter writer)
Builds error response from exception.
|
static javax.ws.rs.core.Response |
makeErrorResponse(javax.ws.rs.core.Response.StatusType status,
Throwable cause,
com.fasterxml.jackson.databind.ObjectWriter writer)
Builds error response from exception without group by.
|
public static javax.ws.rs.core.Response makeErrorResponse(javax.ws.rs.core.Response.StatusType status,
Throwable cause,
com.fasterxml.jackson.databind.ObjectWriter writer)
status - the response statuscause - exceptionwriter - The Writer to use for writing errorspublic static javax.ws.rs.core.Response makeErrorResponse(javax.ws.rs.core.Response.StatusType status,
DruidQuery<?> druidQuery,
Throwable cause,
com.fasterxml.jackson.databind.ObjectWriter writer)
status - the response statusdruidQuery - failed Druid Query if available or nullcause - exceptionwriter - The Writer to use for writing errorspublic static javax.ws.rs.core.Response makeErrorResponse(int statusCode,
String reason,
String description,
DruidQuery<?> druidQuery,
com.fasterxml.jackson.databind.ObjectWriter writer)
{
"status" : 500
"statusName" : "INTERNAL_SERVER_ERROR",
"reason" : "Request failed.",
"description" : "",
"druidQuery" : {
"queryType" : "groupBy",
"dataSource" : { "name" : "slice_pr_ptf_ptfv_us_pf", "type" : "table" },
"dimensions" : [ "login_state","product_region","platform","platform_version"],
"aggregations" : [
{ "name" : "pageViews", "fieldName" : "other_page_views", "type" : "longSum" }
],
"postAggregations" : [ ],
"intervals" : [ "2014-06-01T00:00:00.000Z/2014-06-01T00:00:00.000Z" ],
"granularity" : { "type" : "period", "period" : "P1W" }
}
}
statusCode - the response status codereason - error typedescription - error descriptiondruidQuery - failed Druid Query if available or nullwriter - the writer to use for writing errorsCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.