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 void
add(QueueMessageEntity queue)
void
addIfAbsent(java.util.List<QueryCriteria> criteria, QueueMessageEntity queueMessageEntity)
long
complete(java.lang.String queueId)
Make QueueMessageEntity COMPLETEDvoid
create(TapeCatalog tapeCatalog)
java.util.List<TapeCatalog>
find(java.util.List<QueryCriteria> criteria)
TapeCatalog
findById(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 maplong
initializeOnBootstrap()
long
markError(java.lang.String queueMessageId)
Mark queueEntity as Errorlong
markReady(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)
long
remove(java.lang.String queueId)
boolean
replace(TapeCatalog tapeCatalog)
boolean
update(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:
create
in interfaceTapeCatalogService
- Throws:
TapeCatalogException
-
replace
public boolean replace(TapeCatalog tapeCatalog) throws TapeCatalogException
- Specified by:
replace
in 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:
update
in 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:TapeCatalogService
Return map of drive index with his current tape If all drive are empty then return an empty map- Specified by:
init
in interfaceTapeCatalogService
- Returns:
- Throws:
TapeCatalogException
-
findById
public TapeCatalog findById(java.lang.String tapeId) throws TapeCatalogException
- Specified by:
findById
in interfaceTapeCatalogService
- Throws:
TapeCatalogException
-
find
public java.util.List<TapeCatalog> find(java.util.List<QueryCriteria> criteria) throws TapeCatalogException
- Specified by:
find
in interfaceTapeCatalogService
- Throws:
TapeCatalogException
-
add
public void add(QueueMessageEntity queue) throws QueueException
- Specified by:
add
in interfaceQueueRepository
- Throws:
QueueException
-
addIfAbsent
public void addIfAbsent(java.util.List<QueryCriteria> criteria, QueueMessageEntity queueMessageEntity) throws QueueException
- Specified by:
addIfAbsent
in interfaceQueueRepository
- Throws:
QueueException
-
remove
public long remove(java.lang.String queueId) throws QueueException
- Specified by:
remove
in interfaceQueueRepository
- Throws:
QueueException
-
complete
public long complete(java.lang.String queueId) throws QueueException
Description copied from interface:QueueRepository
Make QueueMessageEntity COMPLETED- Specified by:
complete
in interfaceQueueRepository
- Returns:
- Throws:
QueueException
-
markError
public long markError(java.lang.String queueMessageId) throws QueueException
Description copied from interface:QueueRepository
Mark queueEntity as Error- Specified by:
markError
in interfaceQueueRepository
- Returns:
- Throws:
QueueException
-
markReady
public long markReady(java.lang.String queueId) throws QueueException
Description copied from interface:QueueRepository
Mark queueEntity as READY- Specified by:
markReady
in interfaceQueueRepository
- Returns:
- Throws:
QueueException
-
initializeOnBootstrap
public long initializeOnBootstrap()
- Specified by:
initializeOnBootstrap
in interfaceQueueRepository
-
receive
public <T> java.util.Optional<T> receive(QueueMessageType messageType) throws QueueException
- Specified by:
receive
in interfaceQueueRepository
- Throws:
QueueException
-
receive
public <T> java.util.Optional<T> receive(QueueMessageType messageType, boolean usePriority) throws QueueException
- Specified by:
receive
in interfaceQueueRepository
- Throws:
QueueException
-
receive
public <T> java.util.Optional<T> receive(org.bson.conversions.Bson inQuery, QueueMessageType messageType) throws QueueException
- Specified by:
receive
in interfaceQueueRepository
- Throws:
QueueException
-
receive
public <T> java.util.Optional<T> receive(org.bson.conversions.Bson inQuery, QueueMessageType messageType, boolean usePriority) throws QueueException
- Specified by:
receive
in 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:
receive
in 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:
receive
in interfaceQueueRepository
- Parameters:
inQuery
- filterinUpdate
- atomic updateusePriority
- if true sort by priority and take first- Returns:
- Throws:
QueueException
-
-