refs #513: Suggest Values for filter in accounting-analytics

https://support.d4science.org/issues/513

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-analytics@119327 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2015-10-01 15:35:09 +00:00
parent 9963ed9020
commit 01cb569275
2 changed files with 18 additions and 0 deletions

View File

@ -173,4 +173,11 @@ public class ResourceRecordQuery {
return toSort;
}
public List<String> getPossibleValuesForKey(@SuppressWarnings("rawtypes") Class<? extends AggregatedUsageRecord> usageRecordType, String key) throws Exception {
Set<String> keys = accountingPersistenceQuery.getPossibleValuesForKey(usageRecordType, key);
List<String> toSort = new ArrayList<String>(keys);
Collections.sort(toSort);
return toSort;
}
}

View File

@ -57,9 +57,20 @@ public abstract class AccountingPersistenceQuery {
*/
public abstract Set<String> getKeys(@SuppressWarnings("rawtypes") Class<? extends AggregatedUsageRecord> usageRecordType) throws Exception;
/**
* Return the list of possible values for a key for a certain usage record type
* @param usageRecordType the usage record type
* @param key the key
* @return a set containing the list of possible values
* @throws Exception if fails
*/
public abstract Set<String> getPossibleValuesForKey(@SuppressWarnings("rawtypes") Class<? extends AggregatedUsageRecord> usageRecordType, String key) throws Exception;
/**
* Close the connection to persistence
* @throws Exception if the close fails
*/
public abstract void close() throws Exception;
}