diff --git a/src/main/java/org/gcube/accounting/analytics/persistence/AccountingPersistenceQuery.java b/src/main/java/org/gcube/accounting/analytics/persistence/AccountingPersistenceQuery.java index 4f0f5e6..a392874 100644 --- a/src/main/java/org/gcube/accounting/analytics/persistence/AccountingPersistenceQuery.java +++ b/src/main/java/org/gcube/accounting/analytics/persistence/AccountingPersistenceQuery.java @@ -66,23 +66,7 @@ public class AccountingPersistenceQuery { AggregatedRecord instance = aggregatedRecordClass.newInstance(); return getQuerableKeys(instance); } - - public static SortedMap getTimeSeries( - Class> aggregatedRecordClass, - TemporalConstraint temporalConstraint, List filters, boolean pad) - throws Exception { - SortedMap ret = - AccountingPersistenceBackendQueryFactory.getInstance() - .getTimeSeries(aggregatedRecordClass, temporalConstraint, - filters); - - if(pad){ - ret = padMap(ret, temporalConstraint); - } - - return ret; - } - + public static String getDefaultOrderingProperties(Class> recordClass){ if(recordClass.isAssignableFrom(AggregatedStorageUsageRecord.class)){ return AggregatedStorageUsageRecord.DATA_VOLUME; @@ -133,8 +117,24 @@ public class AccountingPersistenceQuery { } return unpaddedData; } - - public static SortedMap> getTopValues( + + public SortedMap getTimeSeries( + Class> aggregatedRecordClass, + TemporalConstraint temporalConstraint, List filters, boolean pad) + throws Exception { + SortedMap ret = + AccountingPersistenceBackendQueryFactory.getInstance() + .getTimeSeries(aggregatedRecordClass, temporalConstraint, + filters); + + if(pad){ + ret = padMap(ret, temporalConstraint); + } + + return ret; + } + + public SortedMap> getTopValues( Class> aggregatedRecordClass, TemporalConstraint temporalConstraint, List filters, String orderingProperty, boolean pad, int limit) throws Exception { @@ -162,7 +162,7 @@ public class AccountingPersistenceQuery { return ret; } - public static SortedMap> getTopValues( + public SortedMap> getTopValues( Class> aggregatedRecordClass, TemporalConstraint temporalConstraint, List filters) throws Exception { @@ -171,7 +171,7 @@ public class AccountingPersistenceQuery { filters); } - public static SortedSet getNextPossibleValues( + public SortedSet getNextPossibleValues( Class> aggregatedRecordClass, TemporalConstraint temporalConstraint, List filters) throws Exception {