Solving querable keys issue
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-analytics@131483 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
75d3f25978
commit
4366a5b5e5
|
@ -11,7 +11,6 @@ import java.util.Map;
|
||||||
import java.util.SortedMap;
|
import java.util.SortedMap;
|
||||||
import java.util.SortedSet;
|
import java.util.SortedSet;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
import java.util.TreeSet;
|
|
||||||
|
|
||||||
import javax.activity.InvalidActivityException;
|
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.DuplicatedKeyFilterException;
|
||||||
import org.gcube.accounting.analytics.exception.KeyException;
|
import org.gcube.accounting.analytics.exception.KeyException;
|
||||||
import org.gcube.accounting.analytics.exception.ValueException;
|
import org.gcube.accounting.analytics.exception.ValueException;
|
||||||
import org.gcube.accounting.datamodel.UsageRecord;
|
|
||||||
import org.gcube.accounting.datamodel.aggregation.AggregatedStorageUsageRecord;
|
import org.gcube.accounting.datamodel.aggregation.AggregatedStorageUsageRecord;
|
||||||
import org.gcube.documentstore.records.AggregatedRecord;
|
import org.gcube.documentstore.records.AggregatedRecord;
|
||||||
import org.gcube.documentstore.records.Record;
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
@ -50,27 +47,18 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
|
||||||
return accountingPersistenceQuery;
|
return accountingPersistenceQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public static SortedSet<String> getQuerableKeys(
|
public static SortedSet<String> getQuerableKeys(
|
||||||
@SuppressWarnings("rawtypes") AggregatedRecord instance)
|
@SuppressWarnings("rawtypes") AggregatedRecord instance)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
SortedSet<String> properties = new TreeSet<>(
|
return instance.getQuerableKeys();
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SortedSet<String> getQuerableKeys(
|
public static SortedSet<String> getQuerableKeys(
|
||||||
Class<? extends AggregatedRecord<?,?>> clz)
|
Class<? extends AggregatedRecord<?,?>> clz)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
AggregatedRecord<?,?> instance = clz.newInstance();
|
AggregatedRecord<?,?> instance = clz.newInstance();
|
||||||
return getQuerableKeys(instance);
|
return instance.getQuerableKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getDefaultOrderingProperties(
|
public static String getDefaultOrderingProperties(
|
||||||
|
|
Loading…
Reference in New Issue