public class TablesApiRequestImpl extends ApiRequestImpl implements TablesApiRequest
asyncAfter, builder, COMMA_AFTER_BRACKET_PATTERN, format, pagination, paginationParameters, uriInfo
REQUEST_MAPPER_NAMESPACE
ASYNCHRONOUS_ASYNC_AFTER_VALUE, SYNCHRONOUS_ASYNC_AFTER_VALUE
Constructor and Description |
---|
TablesApiRequestImpl(String tableName,
String granularity,
String format,
String perPage,
String page,
javax.ws.rs.core.UriInfo uriInfo,
BardConfigResources bardConfigResources)
Parses the API request URL and generates the Api Request object.
|
TablesApiRequestImpl(String tableName,
String granularity,
String format,
String perPage,
String page,
javax.ws.rs.core.UriInfo uriInfo,
BardConfigResources bardConfigResources,
List<javax.ws.rs.core.PathSegment> dimensions,
String metrics,
String intervals,
String filters,
String timeZoneId)
Parses the API request URL and generates the API Request object with specified query constraints, i.e.
|
Modifier and Type | Method and Description |
---|---|
protected LinkedHashSet<LogicalMetric> |
generateLogicalMetrics(String apiMetricQuery,
MetricDictionary metricDictionary)
Extracts the list of metrics from the url metric query string and generates a set of LogicalMetrics.
|
protected Set<LogicalTable> |
generateTables(String tableName,
LogicalTableDictionary tableDictionary)
Extracts the list of logical table names from the url table path segment and generates a set of logical table
objects based on it.
|
ApiFilters |
getApiFilters()
Returns a map of filters by dimension for this request, grouped by dimensions.
|
Set<Dimension> |
getDimensions()
Returns the set of grouping dimensions on this request.
|
Set<Dimension> |
getFilterDimensions()
Returns the dimensions used in filters on this request.
|
Granularity |
getGranularity()
Returns the grain to group the results of this request.
|
Set<org.joda.time.Interval> |
getIntervals()
Returns the intervals for this query.
|
Set<LogicalMetric> |
getLogicalMetrics()
Returns the logical metrics requested in this query.
|
LogicalTable |
getTable()
Returns the LogicalTable requested in the table API request URL.
|
Set<LogicalTable> |
getTables()
Returns a set of LogicalTables associated with a table API request.
|
TablesApiRequest |
withBuilder(javax.ws.rs.core.Response.ResponseBuilder builder) |
TablesApiRequest |
withDimensions(Set<Dimension> dimensions) |
TablesApiRequest |
withFilters(Map<Dimension,Set<ApiFilter>> filters) |
TablesApiRequest |
withFormat(ResponseFormatType format) |
TablesApiRequest |
withGranularity(Set<LogicalTable> tables) |
TablesApiRequest |
withIntervals(Set<org.joda.time.Interval> intervals) |
TablesApiRequest |
withMetrics(Set<LogicalMetric> logicalMetrics) |
TablesApiRequest |
withPaginationParameters(Optional<PaginationParameters> paginationParameters) |
TablesApiRequest |
withTable(LogicalTable table) |
TablesApiRequest |
withTables(Granularity granularity) |
TablesApiRequest |
withTables(Set<LogicalTable> tables) |
TablesApiRequest |
withUriInfo(javax.ws.rs.core.UriInfo uriInfo) |
addPageLink, addPageLink, generateAcceptFormat, generateAsyncAfter, generateDimensions, generateFilters, generateGranularity, generateGranularity, generateIntervals, generateIntervals, 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 TablesApiRequestImpl(String tableName, String granularity, String format, @NotNull String perPage, @NotNull String page, javax.ws.rs.core.UriInfo uriInfo, BardConfigResources bardConfigResources) throws BadApiRequestException
tableName
- logical table corresponding to the table name specified in the URLgranularity
- string time granularity in 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.uriInfo
- The URI of the request object.bardConfigResources
- The configuration resources used to build this api requestBadApiRequestException
- is thrown in the following scenarios:
public TablesApiRequestImpl(String tableName, String granularity, String format, @NotNull String perPage, @NotNull String page, javax.ws.rs.core.UriInfo uriInfo, BardConfigResources bardConfigResources, List<javax.ws.rs.core.PathSegment> dimensions, String metrics, String intervals, String filters, String timeZoneId) throws BadApiRequestException
tableName
- Logical table corresponding to the table name specified in the URLgranularity
- Requested time granularityformat
- Response data format JSON or CSV. Default is JSON.perPage
- Number of rows to display per page of results. It must represent a positive integer or an empty
string if it's not specifiedpage
- Desired page of results. It must represent a positive integer or an empty
string if it's not specifieduriInfo
- The URI of the requestbardConfigResources
- The configuration resources used to build this API requestdimensions
- Grouping dimensions / Dimension constraintmetrics
- Metrics constraintintervals
- Data / Time constraintfilters
- Filter constrainttimeZoneId
- A joda time zone idBadApiRequestException
- on
protected Set<LogicalTable> generateTables(String tableName, LogicalTableDictionary tableDictionary) throws BadApiRequestException
tableName
- logical table corresponding to the table name specified in the URLtableDictionary
- Logical table dictionary contains the map of valid table names and table objects.BadApiRequestException
- if an invalid table is requested or the logical table dictionary is empty.protected LinkedHashSet<LogicalMetric> generateLogicalMetrics(String apiMetricQuery, MetricDictionary metricDictionary) throws BadApiRequestException
generateLogicalMetrics
in class ApiRequestImpl
apiMetricQuery
- URL query string containing the metrics separated by ','.metricDictionary
- Metric dictionary contains the map of valid metric names and logical metric objects.BadApiRequestException
- if the metric dictionary returns a null or if the apiMetricQuery is invalid.public Set<LogicalTable> getTables()
TablesApiRequest
getTables
in interface TablesApiRequest
public LogicalTable getTable()
TablesApiRequest
getTable
in interface TablesApiRequest
public Granularity getGranularity()
TablesApiRequest
getGranularity
in interface TablesApiRequest
public Set<Dimension> getDimensions()
TablesApiRequest
getDimensions
in interface TablesApiRequest
public Set<Dimension> getFilterDimensions()
TablesApiRequest
getFilterDimensions
in interface TablesApiRequest
public ApiFilters getApiFilters()
TablesApiRequest
getApiFilters
in interface TablesApiRequest
public Set<org.joda.time.Interval> getIntervals()
TablesApiRequest
getIntervals
in interface TablesApiRequest
public Set<LogicalMetric> getLogicalMetrics()
TablesApiRequest
getLogicalMetrics
in interface TablesApiRequest
public TablesApiRequest withFormat(ResponseFormatType format)
withFormat
in interface TablesApiRequest
public TablesApiRequest withPaginationParameters(Optional<PaginationParameters> paginationParameters)
withPaginationParameters
in interface TablesApiRequest
public TablesApiRequest withUriInfo(javax.ws.rs.core.UriInfo uriInfo)
withUriInfo
in interface TablesApiRequest
public TablesApiRequest withBuilder(javax.ws.rs.core.Response.ResponseBuilder builder)
withBuilder
in interface TablesApiRequest
public TablesApiRequest withTables(Set<LogicalTable> tables)
withTables
in interface TablesApiRequest
public TablesApiRequest withTable(LogicalTable table)
withTable
in interface TablesApiRequest
public TablesApiRequest withGranularity(Set<LogicalTable> tables)
withGranularity
in interface TablesApiRequest
public TablesApiRequest withTables(Granularity granularity)
withTables
in interface TablesApiRequest
public TablesApiRequest withDimensions(Set<Dimension> dimensions)
withDimensions
in interface TablesApiRequest
public TablesApiRequest withMetrics(Set<LogicalMetric> logicalMetrics)
withMetrics
in interface TablesApiRequest
public TablesApiRequest withIntervals(Set<org.joda.time.Interval> intervals)
withIntervals
in interface TablesApiRequest
public TablesApiRequest withFilters(Map<Dimension,Set<ApiFilter>> filters)
withFilters
in interface TablesApiRequest
Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.