Allow to specify a limit when querying values for suggestion. refs #9943

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-analytics@155177 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2017-10-12 13:56:51 +00:00
parent 99f2205b63
commit 4a4417212d
2 changed files with 9 additions and 4 deletions

View File

@ -184,6 +184,7 @@ public interface AccountingPersistenceBackendQuery {
* @throws ValueException * @throws ValueException
* @throws Exception * @throws Exception
*/ */
@Deprecated
public SortedSet<NumberedFilter> getFilterValues( public SortedSet<NumberedFilter> getFilterValues(
Class<? extends AggregatedRecord<?, ?>> clz, Class<? extends AggregatedRecord<?, ?>> clz,
TemporalConstraint temporalConstraint, List<Filter> filters, TemporalConstraint temporalConstraint, List<Filter> filters,
@ -196,14 +197,14 @@ public interface AccountingPersistenceBackendQuery {
* @param temporalConstraint * @param temporalConstraint
* @param filters * @param filters
* @param key * @param key
* @param limit * @param limit use null to get the results with no limits
* @return * @return
* @throws Exception * @throws Exception
*/ */
public SortedSet<NumberedFilter> getFilterValues( public SortedSet<NumberedFilter> getFilterValues(
Class<? extends AggregatedRecord<?, ?>> clz, Class<? extends AggregatedRecord<?, ?>> clz,
TemporalConstraint temporalConstraint, List<Filter> filters, TemporalConstraint temporalConstraint, List<Filter> filters,
String key, int limit) throws Exception; String key, Integer limit) throws Exception;
/** /**
* Return a JsonObject with value * Return a JsonObject with value

View File

@ -250,6 +250,9 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
} }
/**
* {@inheritDoc}
*/
@Override @Override
public SortedSet<NumberedFilter> getNextPossibleValuesWithMap(Class<? extends AggregatedRecord<?, ?>> clz, public SortedSet<NumberedFilter> getNextPossibleValuesWithMap(Class<? extends AggregatedRecord<?, ?>> clz,
TemporalConstraint temporalConstraint, List<Filter> filters, String key, String orderingProperty) TemporalConstraint temporalConstraint, List<Filter> filters, String key, String orderingProperty)
@ -275,14 +278,15 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
} }
@Override @Override
@Deprecated
public SortedSet<NumberedFilter> getFilterValues(Class<? extends AggregatedRecord<?, ?>> clz, public SortedSet<NumberedFilter> getFilterValues(Class<? extends AggregatedRecord<?, ?>> clz,
TemporalConstraint temporalConstraint, List<Filter> filters, String key) throws Exception { TemporalConstraint temporalConstraint, List<Filter> filters, String key) throws Exception {
return getFilterValues(clz, temporalConstraint, filters, key, 100); return getFilterValues(clz, temporalConstraint, filters, key, null);
} }
@Override @Override
public SortedSet<NumberedFilter> getFilterValues(Class<? extends AggregatedRecord<?, ?>> clz, public SortedSet<NumberedFilter> getFilterValues(Class<? extends AggregatedRecord<?, ?>> clz,
TemporalConstraint temporalConstraint, List<Filter> filters, String key, int limit) throws Exception { TemporalConstraint temporalConstraint, List<Filter> filters, String key, Integer limit) throws Exception {
return AccountingPersistenceBackendQueryFactory.getInstance().getFilterValues(clz, temporalConstraint, filters, return AccountingPersistenceBackendQueryFactory.getInstance().getFilterValues(clz, temporalConstraint, filters,
key, limit); key, limit);