public class MetricsApiRequestImpl extends ApiRequestImpl implements MetricsApiRequest
asyncAfter, builder, COMMA_AFTER_BRACKET_PATTERN, format, pagination, paginationParameters, uriInfo
REQUEST_MAPPER_NAMESPACE
ASYNCHRONOUS_ASYNC_AFTER_VALUE, SYNCHRONOUS_ASYNC_AFTER_VALUE
Constructor and Description |
---|
MetricsApiRequestImpl(String metricName,
String format,
String perPage,
String page,
MetricDictionary metricDictionary,
javax.ws.rs.core.UriInfo uriInfo)
Parses the API request URL and generates the Api Request object.
|
Modifier and Type | Method and Description |
---|---|
protected Set<LogicalMetric> |
generateMetrics(String metricName,
MetricDictionary metricDictionary)
Generates the set of all available metrics.
|
LogicalMetric |
getMetric()
Returns an available metric.
|
Set<LogicalMetric> |
getMetrics()
Returns a set of all available metrics.
|
addPageLink, addPageLink, generateAcceptFormat, generateAsyncAfter, generateDimensions, generateFilters, generateGranularity, generateGranularity, generateIntervals, generateIntervals, generateLogicalMetrics, generateMetricName, generatePaginationParameters, generateTable, generateTimeZone, getAllPagesPaginationFactory, getAsDateTime, getAsyncAfter, getBuilder, getDefaultPagination, getFormat, getPage, getPage, getPagination, getPaginationParameters, getUriInfo, validateMetrics, validateRequestDimensions, validateTimeAlignment
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
generateDateTimeFormatter, getAsyncAfter, getBuilder, getDefaultPagination, getFormat, getPage, getPage, getPagination, getPaginationParameters, getUriInfo
public MetricsApiRequestImpl(String metricName, String format, @NotNull String perPage, @NotNull String page, MetricDictionary metricDictionary, javax.ws.rs.core.UriInfo uriInfo) throws BadApiRequestException
metricName
- string corresponding to the metric name specified in the URL
((field name and operation):((multiple values bounded by [])or(single value))))(followed by , or end of string)
format
- response data format JSON or CSV. Default is JSON.perPage
- number of rows to display per page of results. If present in the original request,
must be a positive integer. If not present, must be the empty string.page
- desired page of results. If present in the original request, must be a positive
integer. If not present, must be the empty string.metricDictionary
- cache containing all the valid metric objects.uriInfo
- The URI of the request object.BadApiRequestException
- is thrown in the following scenarios:
protected Set<LogicalMetric> generateMetrics(String metricName, MetricDictionary metricDictionary) throws BadApiRequestException
metricName
- string corresponding to the metric name specified in the URLmetricDictionary
- metric dictionary that contains the map of valid metric names to metric objects.BadApiRequestException
- if an invalid metric is requested or the metric dictionary is empty.public Set<LogicalMetric> getMetrics()
MetricsApiRequest
getMetrics
in interface MetricsApiRequest
public LogicalMetric getMetric()
MetricsApiRequest
getMetric
in interface MetricsApiRequest
Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.