From 4366a5b5e57e314d4f6ce1428545cecb7f3aa47e Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Mon, 19 Sep 2016 10:54:05 +0000 Subject: [PATCH] Solving querable keys issue git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-analytics@131483 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../AccountingPersistenceQuery.java | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) 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 84e621b..8f0d3aa 100644 --- a/src/main/java/org/gcube/accounting/analytics/persistence/AccountingPersistenceQuery.java +++ b/src/main/java/org/gcube/accounting/analytics/persistence/AccountingPersistenceQuery.java @@ -11,7 +11,6 @@ import java.util.Map; import java.util.SortedMap; import java.util.SortedSet; import java.util.TreeMap; -import java.util.TreeSet; import javax.activity.InvalidActivityException; @@ -22,10 +21,8 @@ import org.gcube.accounting.analytics.TemporalConstraint; import org.gcube.accounting.analytics.exception.DuplicatedKeyFilterException; import org.gcube.accounting.analytics.exception.KeyException; import org.gcube.accounting.analytics.exception.ValueException; -import org.gcube.accounting.datamodel.UsageRecord; import org.gcube.accounting.datamodel.aggregation.AggregatedStorageUsageRecord; import org.gcube.documentstore.records.AggregatedRecord; -import org.gcube.documentstore.records.Record; import org.json.JSONException; import org.json.JSONObject; @@ -50,27 +47,18 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ return accountingPersistenceQuery; } + @Deprecated public static SortedSet getQuerableKeys( @SuppressWarnings("rawtypes") AggregatedRecord instance) throws Exception { - SortedSet properties = new TreeSet<>( - instance.getRequiredFields()); - - properties.removeAll(instance.getAggregatedFields()); - properties.removeAll(instance.getComputedFields()); - properties.remove(Record.ID); - properties.remove(Record.CREATION_TIME); - properties.remove(Record.RECORD_TYPE); - properties.remove(UsageRecord.SCOPE); - - return properties; + return instance.getQuerableKeys(); } public static SortedSet getQuerableKeys( Class> clz) throws Exception { AggregatedRecord instance = clz.newInstance(); - return getQuerableKeys(instance); + return instance.getQuerableKeys(); } public static String getDefaultOrderingProperties(