public class AccountingPersistenceQuery extends Object implements AccountingPersistenceBackendQuery
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_LIMIT_RESULT_NUMBER |
KEY_VALUES_LIMIT| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the connection to persistence
|
static String |
getDefaultOrderingProperties(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz) |
SortedSet<NumberedFilter> |
getFilterValues(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz,
TemporalConstraint temporalConstraint,
List<Filter> filters,
String key)
Return a sortedSet filter value
|
protected static AccountingPersistenceQuery |
getInstance() |
SortedSet<NumberedFilter> |
getNextPossibleValues(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz,
TemporalConstraint temporalConstraint,
List<Filter> filters,
String key) |
SortedSet<NumberedFilter> |
getNextPossibleValues(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz,
TemporalConstraint temporalConstraint,
List<Filter> filters,
String key,
String orderingProperty) |
protected static org.json.JSONObject |
getPaddingJSONObject(Map<Calendar,Info> unpaddedResults) |
static SortedSet<String> |
getQuerableKeys(org.gcube.documentstore.records.AggregatedRecord instance)
Deprecated.
|
static SortedSet<String> |
getQuerableKeys(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz) |
SortedMap<Calendar,Info> |
getTimeSeries(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz,
TemporalConstraint temporalConstraint,
List<Filter> filters)
Query the persistence obtaining a Map where the date is the key and the
#Info is the value.
|
SortedMap<Calendar,Info> |
getTimeSeries(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz,
TemporalConstraint temporalConstraint,
List<Filter> filters,
boolean pad) |
SortedMap<NumberedFilter,SortedMap<Calendar,Info>> |
getTopValues(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz,
TemporalConstraint temporalConstraint,
List<Filter> filters,
String topKey) |
SortedMap<NumberedFilter,SortedMap<Calendar,Info>> |
getTopValues(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz,
TemporalConstraint temporalConstraint,
List<Filter> filters,
String topKey,
String orderingProperty)
Return a SortedMap containing the TimeSeries for top values for a certain
key taking in account all Filters.
|
SortedMap<NumberedFilter,SortedMap<Calendar,Info>> |
getTopValues(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz,
TemporalConstraint temporalConstraint,
List<Filter> filters,
String topKey,
String orderingProperty,
boolean pad,
int limit) |
org.json.JSONObject |
getUsageValue(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz,
TemporalConstraint temporalConstraint,
Filter applicant)
Return a JsonObject with value
e.g.for StorageUsageRecord {"dataVolume":1860328,"operationCount":4115}
e.g.
|
List<Filters> |
getUsageValueQuota(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz,
TemporalConstraint temporalConstraint,
List<Filters> listUsage)
in:[{ "consumerId" : "alessandro.pieve" }, { "serviceClass" : "DataAccess" }, { "serviceName" : "CkanConnector" }], d=null, orderingProperty=null]
out:[{ "consumerId" : "alessandro.pieve" }, { "serviceClass" : "DataAccess" }, { "serviceName" : "CkanConnector" }], d=88.0, orderingProperty=operationCount]
|
List<TotalFilters> |
getUsageValueQuotaTotal(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz,
TemporalConstraint temporalConstraint,
List<TotalFilters> listUsage) |
static SortedMap<Calendar,Info> |
padMap(SortedMap<Calendar,Info> unpaddedData,
TemporalConstraint temporalConstraint)
Pad the data
|
void |
prepareConnection(AccountingPersistenceBackendQueryConfiguration configuration) |
public static final int DEFAULT_LIMIT_RESULT_NUMBER
protected static AccountingPersistenceQuery getInstance()
@Deprecated public static SortedSet<String> getQuerableKeys(org.gcube.documentstore.records.AggregatedRecord instance) throws Exception
Exceptionpublic static SortedSet<String> getQuerableKeys(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz) throws Exception
Exceptionpublic static String getDefaultOrderingProperties(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz)
protected static org.json.JSONObject getPaddingJSONObject(Map<Calendar,Info> unpaddedResults) throws org.json.JSONException
org.json.JSONExceptionpublic static SortedMap<Calendar,Info> padMap(SortedMap<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 SortedMap<Calendar,Info> getTimeSeries(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz, TemporalConstraint temporalConstraint, List<Filter> filters) throws DuplicatedKeyFilterException, KeyException, ValueException, Exception
getTimeSeries in interface AccountingPersistenceBackendQueryclz - the Record Class of interesttemporalConstraint - the TemporalConstraint (interval and aggregation)filters - list of filter to obtain the time series. If null or empty
list get all data for the interested Record Class with the
applying temporal constraint. All Filter must have not null
and not empty key and value. The filters are must be related
to different keys and are in AND. If the list contains more
than one filter with the same key an Exception is thrown.DuplicatedKeyFilterExceptionKeyExceptionValueExceptionExceptionpublic SortedMap<Calendar,Info> getTimeSeries(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz, TemporalConstraint temporalConstraint, List<Filter> filters, boolean pad) throws DuplicatedKeyFilterException, KeyException, ValueException, Exception
public SortedMap<NumberedFilter,SortedMap<Calendar,Info>> getTopValues(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz, TemporalConstraint temporalConstraint, List<Filter> filters, String topKey, String orderingProperty, boolean pad, int limit) throws DuplicatedKeyFilterException, KeyException, ValueException, Exception
public SortedMap<NumberedFilter,SortedMap<Calendar,Info>> getTopValues(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz, TemporalConstraint temporalConstraint, List<Filter> filters, String topKey) throws DuplicatedKeyFilterException, KeyException, ValueException, Exception
public SortedMap<NumberedFilter,SortedMap<Calendar,Info>> getTopValues(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz, TemporalConstraint temporalConstraint, List<Filter> filters, String topKey, String orderingProperty) throws DuplicatedKeyFilterException, KeyException, ValueException, Exception
getTopValues in interface AccountingPersistenceBackendQueryclz - the Usage Record Class of interesttemporalConstraint - the TemporalConstraint (interval and aggregation)filters - list of filter to obtain the time series of top values. If
null or empty list get all data for the interested Record
Class with the applying temporal constraint. All Filter must
have not null and not empty key and value. The filters are
must be related to different keys and are in AND. If the list
contains more than one filter with the same key an Exception
is thrown.DuplicatedKeyFilterExceptionKeyExceptionValueExceptionExceptionpublic SortedSet<NumberedFilter> getNextPossibleValues(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz, TemporalConstraint temporalConstraint, List<Filter> filters, String key) throws DuplicatedKeyFilterException, KeyException, ValueException, Exception
public SortedSet<NumberedFilter> getNextPossibleValues(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz, TemporalConstraint temporalConstraint, List<Filter> filters, String key, String orderingProperty) throws DuplicatedKeyFilterException, KeyException, ValueException, Exception
getNextPossibleValues in interface AccountingPersistenceBackendQueryDuplicatedKeyFilterExceptionKeyExceptionValueExceptionExceptionpublic void close()
throws Exception
close in interface AccountingPersistenceBackendQueryException - if the close failspublic void prepareConnection(AccountingPersistenceBackendQueryConfiguration configuration) throws Exception
prepareConnection in interface AccountingPersistenceBackendQueryExceptionpublic SortedSet<NumberedFilter> getFilterValues(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz, TemporalConstraint temporalConstraint, List<Filter> filters, String key) throws Exception
AccountingPersistenceBackendQuerygetFilterValues in interface AccountingPersistenceBackendQueryDuplicatedKeyFilterExceptionKeyExceptionValueExceptionExceptionpublic org.json.JSONObject getUsageValue(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz, TemporalConstraint temporalConstraint, Filter applicant) throws Exception
AccountingPersistenceBackendQuerygetUsageValue in interface AccountingPersistenceBackendQueryclz - the Usage Record Class of interesttemporalConstraint - the TemporalConstraint (interval and aggregation)applicant - the type field and valueExceptionpublic List<Filters> getUsageValueQuota(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz, TemporalConstraint temporalConstraint, List<Filters> listUsage) throws Exception
AccountingPersistenceBackendQuerygetUsageValueQuota in interface AccountingPersistenceBackendQueryclz - the Usage Record Class of interesttemporalConstraint - the TemporalConstraint (interval and aggregation)Exceptionpublic List<TotalFilters> getUsageValueQuotaTotal(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz, TemporalConstraint temporalConstraint, List<TotalFilters> listUsage) throws Exception
getUsageValueQuotaTotal in interface AccountingPersistenceBackendQueryExceptionCopyright © 2016. All Rights Reserved.