Package org.gcube.accounting.persistence
Class AccountingPersistence
- java.lang.Object
-
- org.gcube.accounting.persistence.AccountingPersistence
-
public class AccountingPersistence extends Object
- Author:
- Luca Frosini (ISTI - CNR)
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAccountingPersistence(String context)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaccount(org.gcube.documentstore.records.Record record)Persist the UsageRecord.voidclose()voidflush()voidflush(long timeout, TimeUnit timeUnit)Deprecated.booleanisConnectionActive()
-
-
-
Field Detail
-
context
protected String context
-
-
Constructor Detail
-
AccountingPersistence
protected AccountingPersistence(String context)
-
-
Method Detail
-
account
public void account(org.gcube.documentstore.records.Record record) throws org.gcube.documentstore.exception.InvalidValueExceptionPersist the UsageRecord. The Record is validated first, then accounted, in a separated thread. So that the program can continue the execution. If the persistence fails the class write that the record in a local file so that the UsageRecord can be recorder later.- Parameters:
record- the UsageRecord to persist- Throws:
org.gcube.documentstore.exception.InvalidValueException
-
flush
@Deprecated public void flush(long timeout, TimeUnit timeUnit) throws Exception
Deprecated.Usedinstead- Parameters:
timeout-timeUnit-- Throws:
Exception
-
-