Class QueueRepositoryImpl
- java.lang.Object
-
- fr.gouv.vitam.storage.offers.tape.impl.queue.QueueRepositoryImpl
-
- All Implemented Interfaces:
QueueRepository
- Direct Known Subclasses:
TapeCatalogRepository
public class QueueRepositoryImpl extends java.lang.Object implements QueueRepository
-
-
Field Summary
Fields Modifier and Type Field Description protected com.mongodb.client.MongoCollection<org.bson.Document>
collection
-
Constructor Summary
Constructors Constructor Description QueueRepositoryImpl(com.mongodb.client.MongoCollection<org.bson.Document> collection)
-
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 COMPLETEDlong
initializeOnBootstrap()
long
markError(java.lang.String queueMessageId)
Mark queueEntity as Errorlong
markReady(java.lang.String queueMessageId)
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)
-
-
-
Method Detail
-
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 queueMessageId) 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
-
-