public class ResourceRecordQuery extends Object
| Modifier and Type | Field and Description |
|---|---|
protected AccountingPersistenceBackendQuery |
accountingPersistenceQuery |
protected static Map<Class<? extends org.gcube.documentstore.records.Record>,Set<String>> |
resourceRecords |
| Constructor and Description |
|---|
ResourceRecordQuery()
Instantiate the ResourceRecord for the current scope
|
ResourceRecordQuery(String scope)
Instantiate the ResourceRecord for the provided scope
|
| Modifier and Type | Method and Description |
|---|---|
List<Info> |
getInfo(Class<? extends org.gcube.documentstore.records.AggregatedRecord> usageRecordType,
TemporalConstraint temporalConstraint,
List<Filter> filters)
Return unpadded results
|
List<Info> |
getInfo(Class<? extends org.gcube.documentstore.records.AggregatedRecord> usageRecordType,
TemporalConstraint temporalConstraint,
List<Filter> filters,
boolean pad)
Return results with padding if pad is set to true.
|
List<String> |
getKeys(Class<? extends org.gcube.documentstore.records.AggregatedRecord> usageRecordType)
Return the list of key valid for queries a certain usage record type
|
static List<Info> |
getPaddedResults(Map<Calendar,Info> unpaddedData,
TemporalConstraint temporalConstraint)
Pad the data
|
protected static org.json.JSONObject |
getPaddingJSONObject(Map<Calendar,Info> unpaddedResults) |
List<String> |
getPossibleValuesForKey(Class<? extends org.gcube.documentstore.records.AggregatedRecord> usageRecordType,
String key) |
List<String> |
getPossibleValuesForKey(Class<? extends org.gcube.documentstore.records.AggregatedRecord> usageRecordType,
String key,
int limit) |
static Map<Class<? extends org.gcube.documentstore.records.Record>,Set<String>> |
getResourceRecordsTypes()
Return a Map containing a set of required fields for each Resource
Records Types
|
protected static Map<Class<? extends org.gcube.documentstore.records.Record>,Set<String>> resourceRecords
protected AccountingPersistenceBackendQuery accountingPersistenceQuery
public ResourceRecordQuery()
throws NoAvailableScopeException,
NoUsableAccountingPersistenceQueryFound
NoAvailableScopeException - if there is not possible to query in
the current scopeNoUsableAccountingPersistenceQueryFound - if there is no available
instance which can query in that scopepublic ResourceRecordQuery(String scope) throws NoAvailableScopeException, NoUsableAccountingPersistenceQueryFound
scope - the scopeNoAvailableScopeException - if there is not possible to query in
that scopeNoUsableAccountingPersistenceQueryFound - if there is no available
instance which can query in that scopepublic static Map<Class<? extends org.gcube.documentstore.records.Record>,Set<String>> getResourceRecordsTypes()
protected static org.json.JSONObject getPaddingJSONObject(Map<Calendar,Info> unpaddedResults) throws org.json.JSONException
org.json.JSONExceptionpublic static List<Info> getPaddedResults(Map<Calendar,Info> unpaddedData, TemporalConstraint temporalConstraint) throws Exception
unpaddedData - the data to be padtemporalConstraint - temporalConstraint the temporal interval and
the granularity of the data to padException - if failspublic List<Info> getInfo(Class<? extends org.gcube.documentstore.records.AggregatedRecord> usageRecordType, TemporalConstraint temporalConstraint, List<Filter> filters, boolean pad) throws Exception
usageRecordType - the UsageRecord type to querytemporalConstraint - the temporal interval and the granularityfilters - the list keys to filter (in AND)pad - indicate is the results have to be padded with zeros when
there is no data available at certain data points of sequenceException - if failspublic List<Info> getInfo(Class<? extends org.gcube.documentstore.records.AggregatedRecord> usageRecordType, TemporalConstraint temporalConstraint, List<Filter> filters) throws Exception
usageRecordType - the UsageRecord type to querytemporalConstraint - the temporal interval and the granularityfilters - the list keys to filter (in AND)Exception - if failspublic List<String> getKeys(Class<? extends org.gcube.documentstore.records.AggregatedRecord> usageRecordType) throws Exception
usageRecordType - the usage record typeException - if failspublic List<String> getPossibleValuesForKey(Class<? extends org.gcube.documentstore.records.AggregatedRecord> usageRecordType, String key) throws Exception
ExceptionCopyright © 2016. All Rights Reserved.