refs #166: Create accouting-analytics library
https://support.d4science.org/issues/166 Added filter support git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-analytics@117562 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
d3865b307c
commit
52836049c9
|
@ -16,6 +16,7 @@ import org.gcube.accounting.analytics.exception.NoAvailableScopeException;
|
|||
import org.gcube.accounting.analytics.exception.NoUsableAccountingPersistenceQueryFound;
|
||||
import org.gcube.accounting.analytics.persistence.AccountingPersistenceQuery;
|
||||
import org.gcube.accounting.analytics.persistence.AccountingPersistenceQueryFactory;
|
||||
import org.gcube.accounting.datamodel.AggregatedUsageRecord;
|
||||
import org.gcube.accounting.datamodel.SingleUsageRecord;
|
||||
import org.gcube.accounting.datamodel.usagerecords.ServiceUsageRecord;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
|
@ -110,7 +111,7 @@ public class ResourceRecordQuery {
|
|||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<Info> getInfo(Class<? extends SingleUsageRecord> usageRecordType,
|
||||
public List<Info> getInfo(@SuppressWarnings("rawtypes") Class<? extends AggregatedUsageRecord> usageRecordType,
|
||||
TemporalConstraint temporalConstraint, List<Filter> filters, boolean pad) throws Exception {
|
||||
Map<Calendar, Info> unpaddedResults = accountingPersistenceQuery.query(usageRecordType, temporalConstraint, filters);
|
||||
if(!pad){
|
||||
|
@ -128,7 +129,7 @@ public class ResourceRecordQuery {
|
|||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<Info> getInfo(Class<? extends SingleUsageRecord> usageRecordType,
|
||||
public List<Info> getInfo(@SuppressWarnings("rawtypes") Class<? extends AggregatedUsageRecord> usageRecordType,
|
||||
TemporalConstraint temporalConstraint, List<Filter> filters) throws Exception{
|
||||
return getInfo(usageRecordType, temporalConstraint, filters, false);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import java.util.Map;
|
|||
import org.gcube.accounting.analytics.Filter;
|
||||
import org.gcube.accounting.analytics.Info;
|
||||
import org.gcube.accounting.analytics.TemporalConstraint;
|
||||
import org.gcube.accounting.datamodel.SingleUsageRecord;
|
||||
import org.gcube.accounting.datamodel.AggregatedUsageRecord;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
||||
|
@ -20,10 +20,10 @@ public abstract class AccountingPersistenceQuery {
|
|||
|
||||
protected abstract void prepareConnection(AccountingPersistenceQueryConfiguration configuration) throws Exception;
|
||||
|
||||
protected abstract Map<Calendar, Info> reallyQuery(Class<? extends SingleUsageRecord> usageRecordType,
|
||||
protected abstract Map<Calendar, Info> reallyQuery(@SuppressWarnings("rawtypes") Class<? extends AggregatedUsageRecord> usageRecordType,
|
||||
TemporalConstraint temporalConstraint, List<Filter> filters) throws Exception;
|
||||
|
||||
public Map<Calendar, Info> query(Class<? extends SingleUsageRecord> usageRecordType,
|
||||
public Map<Calendar, Info> query(@SuppressWarnings("rawtypes") Class<? extends AggregatedUsageRecord> usageRecordType,
|
||||
TemporalConstraint temporalConstraint, List<Filter> filters) throws Exception{
|
||||
return reallyQuery(usageRecordType, temporalConstraint, filters);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue