Merged from branch version 3.4 of release 4.13
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@173920 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
7f3ce5e96f
commit
92e4d99c47
|
@ -21,7 +21,7 @@ public class AccountingPersistence {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
private PersistenceBackend getAccountingPersistence(){
|
private PersistenceBackend getPersistenceBackend(){
|
||||||
return PersistenceBackendFactory.getPersistenceBackend(this.context);
|
return PersistenceBackendFactory.getPersistenceBackend(this.context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,14 +36,14 @@ public class AccountingPersistence {
|
||||||
*/
|
*/
|
||||||
public void account(final Record record) throws InvalidValueException {
|
public void account(final Record record) throws InvalidValueException {
|
||||||
try {
|
try {
|
||||||
getAccountingPersistence().account(record);
|
getPersistenceBackend().account(record);
|
||||||
} catch (org.gcube.documentstore.exception.InvalidValueException e) {
|
} catch (org.gcube.documentstore.exception.InvalidValueException e) {
|
||||||
throw new InvalidValueException(e);
|
throw new InvalidValueException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void flush() throws Exception {
|
public void flush() throws Exception {
|
||||||
getAccountingPersistence().flush();
|
getPersistenceBackend().flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -58,11 +58,11 @@ public class AccountingPersistence {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void close() throws Exception{
|
public void close() throws Exception{
|
||||||
getAccountingPersistence().close();
|
getPersistenceBackend().close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isConnectionActive() throws Exception {
|
public boolean isConnectionActive() throws Exception {
|
||||||
return getAccountingPersistence().isConnectionActive();
|
return getPersistenceBackend().isConnectionActive();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,7 @@ public class AccountingPersistenceFactory {
|
||||||
AccountingPersistence accountingPersistence = persistences.get(context);
|
AccountingPersistence accountingPersistence = persistences.get(context);
|
||||||
if(accountingPersistence==null){
|
if(accountingPersistence==null){
|
||||||
accountingPersistence = new AccountingPersistence(context);
|
accountingPersistence = new AccountingPersistence(context);
|
||||||
|
persistences.put(context, accountingPersistence);
|
||||||
}
|
}
|
||||||
return accountingPersistence;
|
return accountingPersistence;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue