From 4a4417212da7d4715f84578cc990334cffdddfd5 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Thu, 12 Oct 2017 13:56:51 +0000 Subject: [PATCH] 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 --- .../persistence/AccountingPersistenceBackendQuery.java | 5 +++-- .../analytics/persistence/AccountingPersistenceQuery.java | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/gcube/accounting/analytics/persistence/AccountingPersistenceBackendQuery.java b/src/main/java/org/gcube/accounting/analytics/persistence/AccountingPersistenceBackendQuery.java index 7cebca8..0992024 100644 --- a/src/main/java/org/gcube/accounting/analytics/persistence/AccountingPersistenceBackendQuery.java +++ b/src/main/java/org/gcube/accounting/analytics/persistence/AccountingPersistenceBackendQuery.java @@ -184,6 +184,7 @@ public interface AccountingPersistenceBackendQuery { * @throws ValueException * @throws Exception */ + @Deprecated public SortedSet getFilterValues( Class> clz, TemporalConstraint temporalConstraint, List filters, @@ -196,14 +197,14 @@ public interface AccountingPersistenceBackendQuery { * @param temporalConstraint * @param filters * @param key - * @param limit + * @param limit use null to get the results with no limits * @return * @throws Exception */ public SortedSet getFilterValues( Class> clz, TemporalConstraint temporalConstraint, List filters, - String key, int limit) throws Exception; + String key, Integer limit) throws Exception; /** * Return a JsonObject with value 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 43ffad2..d78d933 100644 --- a/src/main/java/org/gcube/accounting/analytics/persistence/AccountingPersistenceQuery.java +++ b/src/main/java/org/gcube/accounting/analytics/persistence/AccountingPersistenceQuery.java @@ -250,6 +250,9 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ } + /** + * {@inheritDoc} + */ @Override public SortedSet getNextPossibleValuesWithMap(Class> clz, TemporalConstraint temporalConstraint, List filters, String key, String orderingProperty) @@ -275,14 +278,15 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ } @Override + @Deprecated public SortedSet getFilterValues(Class> clz, TemporalConstraint temporalConstraint, List filters, String key) throws Exception { - return getFilterValues(clz, temporalConstraint, filters, key, 100); + return getFilterValues(clz, temporalConstraint, filters, key, null); } @Override public SortedSet getFilterValues(Class> clz, - TemporalConstraint temporalConstraint, List filters, String key, int limit) throws Exception { + TemporalConstraint temporalConstraint, List filters, String key, Integer limit) throws Exception { return AccountingPersistenceBackendQueryFactory.getInstance().getFilterValues(clz, temporalConstraint, filters, key, limit);