diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml
index 1b22d70..fb95c45 100644
--- a/.settings/org.eclipse.wst.common.project.facet.core.xml
+++ b/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/distro/changelog.xml b/distro/changelog.xml
index 664e933..c740f71 100644
--- a/distro/changelog.xml
+++ b/distro/changelog.xml
@@ -1,7 +1,10 @@
-
+
+ Implemented isConnectionActive() api
+
+
Added api to sum StorageUsage values got from MapReduce avoiding the client to perform such a computation.
diff --git a/pom.xml b/pom.xml
index 0a8197f..80ec199 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,7 @@
org.gcube.accounting
accounting-analytics
- 2.5.0-SNAPSHOT
+ 2.6.0-SNAPSHOT
accounting-analytics
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 accc767..1df7aad 100644
--- a/src/main/java/org/gcube/accounting/analytics/persistence/AccountingPersistenceBackendQuery.java
+++ b/src/main/java/org/gcube/accounting/analytics/persistence/AccountingPersistenceBackendQuery.java
@@ -16,7 +16,6 @@ import org.gcube.accounting.analytics.UsageValue;
import org.gcube.accounting.analytics.exception.DuplicatedKeyFilterException;
import org.gcube.accounting.analytics.exception.KeyException;
import org.gcube.accounting.analytics.exception.ValueException;
-import org.gcube.accounting.datamodel.aggregation.AggregatedStorageStatusRecord;
import org.gcube.documentstore.records.AggregatedRecord;
import org.json.JSONObject;
@@ -60,8 +59,6 @@ public interface AccountingPersistenceBackendQuery {
throws DuplicatedKeyFilterException, KeyException, ValueException,
Exception;
-
-
/**
* Query the persistence obtaining a Map where the date is the key and the
* #Info is the value. The result is relative to an Usage Record Type,
@@ -146,7 +143,6 @@ public interface AccountingPersistenceBackendQuery {
DuplicatedKeyFilterException, KeyException, ValueException,
Exception;
-
/**
* Same method but use if possible a map-reduce
@@ -171,8 +167,6 @@ public interface AccountingPersistenceBackendQuery {
*/
public void close() throws Exception;
-
-
/**
* Return a sortedSet filter value
*
@@ -193,7 +187,6 @@ public interface AccountingPersistenceBackendQuery {
TemporalConstraint temporalConstraint, List filters,
String key) throws Exception;
-
/**
* Return a JsonObject with value
* e.g.for StorageUsageRecord {"dataVolume":1860328,"operationCount":4115}
@@ -211,9 +204,8 @@ public interface AccountingPersistenceBackendQuery {
public JSONObject getUsageValue(Class extends AggregatedRecord, ?>> clz,
TemporalConstraint temporalConstraint, Filter applicant)
throws Exception;
-
- /**
+ /* *
*
* getUsageValueQuota
* use for a specifiy consumer id and for single quota
@@ -284,7 +276,6 @@ public interface AccountingPersistenceBackendQuery {
public List getUsageValueQuotaTotal(
List listUsage)
throws Exception;
-
/**
* Return a SortedMap containing the TimeSeries for each context.
@@ -299,7 +290,6 @@ public interface AccountingPersistenceBackendQuery {
TemporalConstraint temporalConstraint, List filters,List contexts)
throws Exception;
-
/**
* Return a record
* @param recordId
@@ -316,18 +306,25 @@ public interface AccountingPersistenceBackendQuery {
*/
public SortedSet getSpaceProvidersIds() throws Exception;
-
-
-
-
-
-
+ /**
+ *
+ * @param clz
+ * @param temporalConstraint
+ * @param filters
+ * @param providersId
+ * @return
+ * @throws Exception
+ */
public SortedMap> getSpaceTimeSeries(
Class extends AggregatedRecord, ?>> clz,
TemporalConstraint temporalConstraint, List filters,
List providersId) throws Exception;
-
-
+ /**
+ * @return
+ * @throws Exception
+ */
+ boolean isConnectionActive() throws Exception;
+
}
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 73d79c2..353f1ff 100644
--- a/src/main/java/org/gcube/accounting/analytics/persistence/AccountingPersistenceQuery.java
+++ b/src/main/java/org/gcube/accounting/analytics/persistence/AccountingPersistenceQuery.java
@@ -23,7 +23,6 @@ import org.gcube.accounting.analytics.UsageValue;
import org.gcube.accounting.analytics.exception.DuplicatedKeyFilterException;
import org.gcube.accounting.analytics.exception.KeyException;
import org.gcube.accounting.analytics.exception.ValueException;
-import org.gcube.accounting.datamodel.aggregation.AggregatedServiceUsageRecord;
import org.gcube.accounting.datamodel.aggregation.AggregatedStorageStatusRecord;
import org.gcube.accounting.datamodel.aggregation.AggregatedStorageUsageRecord;
import org.gcube.documentstore.records.AggregatedRecord;
@@ -63,7 +62,7 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
throws Exception {
AggregatedRecord,?> instance = clz.newInstance();
- //limit filterky for accounting storage status (used from portlet accounting for tad space)
+ //limit filter key for accounting storage status (used from portlet accounting for tad space)
if (clz.equals(AggregatedStorageStatusRecord.class)){
SortedSet storageStatus= new TreeSet<>();
storageStatus.add(AggregatedStorageStatusRecord.CONSUMER_ID);
@@ -474,6 +473,11 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
return unpaddedData;
}
+ @Override
+ public boolean isConnectionActive() throws Exception {
+ return AccountingPersistenceBackendQueryFactory.getInstance().isConnectionActive();
+ }
+