Class ArchiveServiceImpl
- java.lang.Object
-
- org.bonitasoft.engine.archive.impl.ArchiveServiceImpl
-
- All Implemented Interfaces:
ArchiveService
public class ArchiveServiceImpl extends java.lang.Object implements ArchiveService
- Author:
- Matthieu Chaffotte, Hongwen Zang, Celine Souchet
-
-
Constructor Summary
Constructors Constructor Description ArchiveServiceImpl(PersistenceService definitiveArchivePersistenceService, TechnicalLoggerService logger, ArchivingStrategy archivingStrategy, UserTransactionService transactionService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BatchArchiveCallablebuildBatchArchiveCallable(ArchiveInsertRecord... records)intdeleteFromQuery(java.lang.String queryName, java.util.Map<java.lang.String,java.lang.Object> parameters)ReadPersistenceServicegetDefinitiveArchiveReadPersistenceService()Get the ReadPersistenceService corresponding to the definitive archivebooleanisArchivable(java.lang.Class<? extends PersistentObject> sourceObjectClass)voidrecordDelete(DeleteRecord record)Remove the given entity from both sliding archive (if present) and the right archive level (if present) This operation should normally to be used.voidrecordInsert(long time, ArchiveInsertRecord record)Archive the given entity in sliding archive if relevant and in the appropriate definitive archivevoidrecordInserts(long time, ArchiveInsertRecord... records)Archive the given entities in the definitive archive
-
-
-
Constructor Detail
-
ArchiveServiceImpl
public ArchiveServiceImpl(PersistenceService definitiveArchivePersistenceService, TechnicalLoggerService logger, ArchivingStrategy archivingStrategy, UserTransactionService transactionService)
-
-
Method Detail
-
recordInsert
public void recordInsert(long time, ArchiveInsertRecord record) throws SRecorderExceptionDescription copied from interface:ArchiveServiceArchive the given entity in sliding archive if relevant and in the appropriate definitive archive- Specified by:
recordInsertin interfaceArchiveService- Parameters:
time- The archive daterecord- Archive insert record containing the entity to be archived- Throws:
SRecorderException
-
recordInserts
public void recordInserts(long time, ArchiveInsertRecord... records) throws SRecorderExceptionDescription copied from interface:ArchiveServiceArchive the given entities in the definitive archive- Specified by:
recordInsertsin interfaceArchiveService- Parameters:
time- the time of archivingrecords- Archive inserts record containing the entity to be archived- Throws:
SRecorderException- in case of a write error
-
buildBatchArchiveCallable
protected BatchArchiveCallable buildBatchArchiveCallable(ArchiveInsertRecord... records) throws SRecorderException
- Throws:
SRecorderException
-
recordDelete
public void recordDelete(DeleteRecord record) throws SRecorderException
Description copied from interface:ArchiveServiceRemove the given entity from both sliding archive (if present) and the right archive level (if present) This operation should normally to be used. This is for admin purpose only- Specified by:
recordDeletein interfaceArchiveService- Parameters:
record- The delete record containing archived entity to be deleted- Throws:
SRecorderException
-
isArchivable
public boolean isArchivable(java.lang.Class<? extends PersistentObject> sourceObjectClass)
- Specified by:
isArchivablein interfaceArchiveService- Parameters:
sourceObjectClass- Persistent object to be judged achievable or not- Returns:
- Return true if the objects of the given class can be archived.
-
getDefinitiveArchiveReadPersistenceService
public ReadPersistenceService getDefinitiveArchiveReadPersistenceService()
Description copied from interface:ArchiveServiceGet the ReadPersistenceService corresponding to the definitive archive- Specified by:
getDefinitiveArchiveReadPersistenceServicein interfaceArchiveService- Returns:
- the ReadPersistenceService corresponding to the definitive archive
-
deleteFromQuery
public int deleteFromQuery(java.lang.String queryName, java.util.Map<java.lang.String,java.lang.Object> parameters) throws SRecorderException- Specified by:
deleteFromQueryin interfaceArchiveService- Throws:
SRecorderException
-
-