Class TapeCatalogServiceImpl
- java.lang.Object
-
- fr.gouv.vitam.storage.offers.tape.impl.catalog.TapeCatalogServiceImpl
-
- All Implemented Interfaces:
QueueRepository,TapeCatalogService
public class TapeCatalogServiceImpl extends java.lang.Object implements TapeCatalogService
-
-
Constructor Summary
Constructors Constructor Description TapeCatalogServiceImpl(TapeCatalogRepository tapeCatalogRepository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(QueueMessageEntity queue)voidaddIfAbsent(java.util.List<QueryCriteria> criteria, QueueMessageEntity queueMessageEntity)longcomplete(java.lang.String queueId)Make QueueMessageEntity COMPLETEDvoidcreate(TapeCatalog tapeCatalog)java.util.List<TapeCatalog>find(java.util.List<QueryCriteria> criteria)TapeCatalogfindById(java.lang.String tapeId)java.util.Map<java.lang.Integer,TapeCatalog>init(java.lang.String tapeLibraryIdentifier, TapeLibrarySpec libraryState)Return map of drive index with his current tape If all drive are empty then return an empty maplonginitializeOnBootstrap()longmarkError(java.lang.String queueMessageId)Mark queueEntity as ErrorlongmarkReady(java.lang.String queueId)Mark queueEntity as READY<T> java.util.Optional<T>receive(QueueMessageType messageType)<T> java.util.Optional<T>receive(QueueMessageType messageType, boolean usePriority)<T> java.util.Optional<T>receive(org.bson.conversions.Bson inQuery, QueueMessageType messageType)<T> java.util.Optional<T>receive(org.bson.conversions.Bson inQuery, QueueMessageType messageType, boolean usePriority)<T> java.util.Optional<T>receive(org.bson.conversions.Bson inQuery, org.bson.conversions.Bson inUpdate, QueueMessageType messageType)<T> java.util.Optional<T>receive(org.bson.conversions.Bson inQuery, org.bson.conversions.Bson inUpdate, QueueMessageType messageType, boolean usePriority)longremove(java.lang.String queueId)booleanreplace(TapeCatalog tapeCatalog)booleanupdate(java.lang.String tapeId, java.util.Map<java.lang.String,java.lang.Object> criteria)
-
-
-
Constructor Detail
-
TapeCatalogServiceImpl
public TapeCatalogServiceImpl(TapeCatalogRepository tapeCatalogRepository)
-
-
Method Detail
-
create
public void create(TapeCatalog tapeCatalog) throws TapeCatalogException
- Specified by:
createin interfaceTapeCatalogService- Throws:
TapeCatalogException
-
replace
public boolean replace(TapeCatalog tapeCatalog) throws TapeCatalogException
- Specified by:
replacein interfaceTapeCatalogService- Throws:
TapeCatalogException
-
update
public boolean update(java.lang.String tapeId, java.util.Map<java.lang.String,java.lang.Object> criteria) throws TapeCatalogException- Specified by:
updatein interfaceTapeCatalogService- Throws:
TapeCatalogException
-
init
public java.util.Map<java.lang.Integer,TapeCatalog> init(java.lang.String tapeLibraryIdentifier, TapeLibrarySpec libraryState) throws TapeCatalogException
Description copied from interface:TapeCatalogServiceReturn map of drive index with his current tape If all drive are empty then return an empty map- Specified by:
initin interfaceTapeCatalogService- Returns:
- Throws:
TapeCatalogException
-
findById
public TapeCatalog findById(java.lang.String tapeId) throws TapeCatalogException
- Specified by:
findByIdin interfaceTapeCatalogService- Throws:
TapeCatalogException
-
find
public java.util.List<TapeCatalog> find(java.util.List<QueryCriteria> criteria) throws TapeCatalogException
- Specified by:
findin interfaceTapeCatalogService- Throws:
TapeCatalogException
-
add
public void add(QueueMessageEntity queue) throws QueueException
- Specified by:
addin interfaceQueueRepository- Throws:
QueueException
-
addIfAbsent
public void addIfAbsent(java.util.List<QueryCriteria> criteria, QueueMessageEntity queueMessageEntity) throws QueueException
- Specified by:
addIfAbsentin interfaceQueueRepository- Throws:
QueueException
-
remove
public long remove(java.lang.String queueId) throws QueueException- Specified by:
removein interfaceQueueRepository- Throws:
QueueException
-
complete
public long complete(java.lang.String queueId) throws QueueExceptionDescription copied from interface:QueueRepositoryMake QueueMessageEntity COMPLETED- Specified by:
completein interfaceQueueRepository- Returns:
- Throws:
QueueException
-
markError
public long markError(java.lang.String queueMessageId) throws QueueExceptionDescription copied from interface:QueueRepositoryMark queueEntity as Error- Specified by:
markErrorin interfaceQueueRepository- Returns:
- Throws:
QueueException
-
markReady
public long markReady(java.lang.String queueId) throws QueueExceptionDescription copied from interface:QueueRepositoryMark queueEntity as READY- Specified by:
markReadyin interfaceQueueRepository- Returns:
- Throws:
QueueException
-
initializeOnBootstrap
public long initializeOnBootstrap()
- Specified by:
initializeOnBootstrapin interfaceQueueRepository
-
receive
public <T> java.util.Optional<T> receive(QueueMessageType messageType) throws QueueException
- Specified by:
receivein interfaceQueueRepository- Throws:
QueueException
-
receive
public <T> java.util.Optional<T> receive(QueueMessageType messageType, boolean usePriority) throws QueueException
- Specified by:
receivein interfaceQueueRepository- Throws:
QueueException
-
receive
public <T> java.util.Optional<T> receive(org.bson.conversions.Bson inQuery, QueueMessageType messageType) throws QueueException- Specified by:
receivein interfaceQueueRepository- Throws:
QueueException
-
receive
public <T> java.util.Optional<T> receive(org.bson.conversions.Bson inQuery, QueueMessageType messageType, boolean usePriority) throws QueueException- Specified by:
receivein interfaceQueueRepository- Throws:
QueueException
-
receive
public <T> java.util.Optional<T> receive(org.bson.conversions.Bson inQuery, org.bson.conversions.Bson inUpdate, QueueMessageType messageType) throws QueueException- Specified by:
receivein interfaceQueueRepository- Throws:
QueueException
-
receive
public <T> java.util.Optional<T> receive(org.bson.conversions.Bson inQuery, org.bson.conversions.Bson inUpdate, QueueMessageType messageType, boolean usePriority) throws QueueException- Specified by:
receivein interfaceQueueRepository- Parameters:
inQuery- filterinUpdate- atomic updateusePriority- if true sort by priority and take first- Returns:
- Throws:
QueueException
-
-