Class QueueRepositoryImpl
java.lang.Object
fr.gouv.vitam.storage.offers.tape.impl.queue.QueueRepositoryImpl
- All Implemented Interfaces:
QueueRepository
- Direct Known Subclasses:
TapeCatalogRepository
-
Field Summary
Modifier and TypeFieldDescriptionprotected final com.mongodb.client.MongoCollection<org.bson.Document>
-
Constructor Summary
ConstructorDescriptionQueueRepositoryImpl
(com.mongodb.client.MongoCollection<org.bson.Document> collection) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(QueueMessageEntity queue) void
addIfAbsent
(List<QueryCriteria> criteria, QueueMessageEntity queueMessageEntity) long
Make QueueMessageEntity COMPLETEDMap<org.apache.commons.lang3.tuple.Pair<QueueState,
QueueMessageType>, Integer> count queue entries grouped by state & message typelong
long
Mark queueEntity as Errorlong
Mark queueEntity as READY<T> Optional<T>
receive
(QueueMessageType messageType) <T> Optional<T>
receive
(QueueMessageType messageType, boolean usePriority) <T> Optional<T>
receive
(org.bson.conversions.Bson inQuery, QueueMessageType messageType) <T> Optional<T>
receive
(org.bson.conversions.Bson inQuery, QueueMessageType messageType, boolean usePriority) long
void
tryCancelIfNotStarted
(List<QueryCriteria> criteria)
-
Field Details
-
collection
protected final com.mongodb.client.MongoCollection<org.bson.Document> collection
-
-
Constructor Details
-
QueueRepositoryImpl
public QueueRepositoryImpl(com.mongodb.client.MongoCollection<org.bson.Document> collection)
-
-
Method Details
-
add
- Specified by:
add
in interfaceQueueRepository
- Throws:
QueueException
-
addIfAbsent
public void addIfAbsent(List<QueryCriteria> criteria, QueueMessageEntity queueMessageEntity) throws QueueException - Specified by:
addIfAbsent
in interfaceQueueRepository
- Throws:
QueueException
-
tryCancelIfNotStarted
- Specified by:
tryCancelIfNotStarted
in interfaceQueueRepository
- Throws:
QueueException
-
remove
- Specified by:
remove
in interfaceQueueRepository
- Throws:
QueueException
-
complete
Description copied from interface:QueueRepository
Make QueueMessageEntity COMPLETED- Specified by:
complete
in interfaceQueueRepository
- Returns:
- Throws:
QueueException
-
markError
Description copied from interface:QueueRepository
Mark queueEntity as Error- Specified by:
markError
in interfaceQueueRepository
- Returns:
- Throws:
QueueException
-
markReady
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
- Specified by:
receive
in interfaceQueueRepository
- Throws:
QueueException
-
receive
public <T> Optional<T> receive(QueueMessageType messageType, boolean usePriority) throws QueueException - Specified by:
receive
in interfaceQueueRepository
- Throws:
QueueException
-
receive
public <T> Optional<T> receive(org.bson.conversions.Bson inQuery, QueueMessageType messageType) throws QueueException - Specified by:
receive
in interfaceQueueRepository
- Throws:
QueueException
-
receive
public <T> Optional<T> receive(org.bson.conversions.Bson inQuery, QueueMessageType messageType, boolean usePriority) throws QueueException - Specified by:
receive
in interfaceQueueRepository
- Throws:
QueueException
-
countByStateAndType
public Map<org.apache.commons.lang3.tuple.Pair<QueueState,QueueMessageType>, countByStateAndType() throws QueueExceptionInteger> count queue entries grouped by state & message type- Returns:
- number of queue entries by state & message type
- Throws:
QueueException
-