@Path(value="/dimensions") @Singleton public class DimensionsServlet extends EndpointServlet
objectMappers
Constructor and Description |
---|
DimensionsServlet(DimensionDictionary dimensionDictionary,
LogicalTableDictionary logicalTableDictionary,
RequestMapper requestMapper,
ObjectMappersSuite objectMappers,
ResponseFormatResolver formatResolver)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
getAllDimensions(String perPage,
String page,
String format,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.container.ContainerRequestContext containerRequestContext)
Get all the dimensions as a summary list.
|
javax.ws.rs.core.Response |
getDimension(String dimensionName,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.container.ContainerRequestContext containerRequestContext)
Get the details of a dimension.
|
static Set<Map<String,String>> |
getDimensionFieldListSummaryView(Collection<DimensionField> dimensionFields)
Deprecated.
should be private, now the internal usage need is gone, will deprecate in case someone is using it
|
static Map<String,String> |
getDimensionFieldSummaryView(DimensionField dimensionField)
Deprecated.
should be private, now the internal usage need is gone, will deprecate in case someone is using it
|
static Map<String,Object> |
getDimensionFullView(Dimension dimension,
LogicalTableDictionary logicalTableDictionary,
javax.ws.rs.core.UriInfo uriInfo)
Get the full view of the dimension.
|
static LinkedHashSet<Map<String,Object>> |
getDimensionListSummaryView(Iterable<Dimension> dimensions,
javax.ws.rs.core.UriInfo uriInfo)
Get the summary list view of the dimensions.
|
javax.ws.rs.core.Response |
getDimensionRows(String dimensionName,
String filterQuery,
String perPage,
String page,
String format,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.container.ContainerRequestContext containerRequestContext)
Endpoint to get values of a dimension.
|
static Map<String,Object> |
getDimensionSummaryView(Dimension dimension,
javax.ws.rs.core.UriInfo uriInfo)
Get the summary view of the dimension.
|
static String |
getDimensionUrl(Dimension dimension,
javax.ws.rs.core.UriInfo uriInfo)
Get the URL of the dimension.
|
static String |
getDimensionValuesUrl(Dimension dimension,
javax.ws.rs.core.UriInfo uriInfo)
Get the URL of the dimension values collection.
|
formatResponse
@Inject public DimensionsServlet(DimensionDictionary dimensionDictionary, LogicalTableDictionary logicalTableDictionary, @Named(value="dimensionsApiRequestMapper") RequestMapper requestMapper, ObjectMappersSuite objectMappers, ResponseFormatResolver formatResolver)
dimensionDictionary
- All dimensionslogicalTableDictionary
- All logical tablesrequestMapper
- Mapper to change the API request if neededobjectMappers
- JSON toolsformatResolver
- The formatResolver for determining correct response format@GET @Timed public javax.ws.rs.core.Response getAllDimensions(@DefaultValue(value="") @NotNull @QueryParam(value="perPage") String perPage, @DefaultValue(value="") @NotNull @QueryParam(value="page") String page, @QueryParam(value="format") String format, @Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.container.ContainerRequestContext containerRequestContext)
perPage
- number of values to return per pagepage
- the page to start fromformat
- the format to use for the responseuriInfo
- UriInfo of the requestcontainerRequestContext
- The context of data provided by the Jersey container for this request
{
"dimensions": <List of Dimension Summaries>
}
getDimensionListSummaryView(Iterable, UriInfo)
@GET @Timed @Produces(value="application/json") @Path(value="/{dimensionName}") public javax.ws.rs.core.Response getDimension(@PathParam(value="dimensionName") String dimensionName, @Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.container.ContainerRequestContext containerRequestContext)
dimensionName
- Dimension to get the details ofuriInfo
- UriInfo of the requestcontainerRequestContext
- The context of data provided by the Jersey container for this requestgetDimensionFullView(Dimension, LogicalTableDictionary, UriInfo)
@GET @Timed @Path(value="/{dimensionName}/values") public javax.ws.rs.core.Response getDimensionRows(@PathParam(value="dimensionName") String dimensionName, @QueryParam(value="filters") String filterQuery, @DefaultValue(value="") @NotNull @QueryParam(value="perPage") String perPage, @DefaultValue(value="") @NotNull @QueryParam(value="page") String page, @QueryParam(value="format") String format, @Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.container.ContainerRequestContext containerRequestContext)
dimensionName
- The dimensionfilterQuery
- The filterspage
- The page numberperPage
- The number of rows per pageformat
- The format of the responseuriInfo
- The injected UriInfocontainerRequestContext
- The injected request context
JSON:
{
"rows" : [
{ "id" : 1234, "description" : "description of dimension value" },
{ "id" : 1235, "description" : "another description" }
],
"next" : "http:// <next_page_uri>/,
"previous": "http:// <previous_page_uri>/
}
CSV:
id, description
1234, description of dimension value
1235, another description
...
public static LinkedHashSet<Map<String,Object>> getDimensionListSummaryView(Iterable<Dimension> dimensions, javax.ws.rs.core.UriInfo uriInfo)
dimensions
- Collection of dimensions to get the summary view foruriInfo
- UriInfo of the requestpublic static Map<String,Object> getDimensionSummaryView(Dimension dimension, javax.ws.rs.core.UriInfo uriInfo)
dimension
- Dimension to get the view ofuriInfo
- UriInfo of the requestpublic static Map<String,Object> getDimensionFullView(Dimension dimension, LogicalTableDictionary logicalTableDictionary, javax.ws.rs.core.UriInfo uriInfo)
dimension
- Dimension to get the view oflogicalTableDictionary
- Logical Table Dictionary to look up the logical tables this dimension is onuriInfo
- UriInfo of the request@Deprecated public static Set<Map<String,String>> getDimensionFieldListSummaryView(Collection<DimensionField> dimensionFields)
dimensionFields
- Collection of dimension fields to get the summary view for@Deprecated public static Map<String,String> getDimensionFieldSummaryView(DimensionField dimensionField)
dimensionField
- Dimension Field to get the view ofpublic static String getDimensionUrl(Dimension dimension, javax.ws.rs.core.UriInfo uriInfo)
dimension
- Dimension to get the URL ofuriInfo
- URI Info for the requestCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.