Class TapeCatalogRepository
- java.lang.Object
-
- fr.gouv.vitam.storage.offers.tape.impl.queue.QueueRepositoryImpl
-
- fr.gouv.vitam.storage.offers.tape.impl.catalog.TapeCatalogRepository
-
- All Implemented Interfaces:
QueueRepository
public class TapeCatalogRepository extends QueueRepositoryImpl
repository for Tapes Catalog management in mongo.
-
-
Field Summary
-
Fields inherited from class fr.gouv.vitam.storage.offers.tape.impl.queue.QueueRepositoryImpl
collection
-
-
Constructor Summary
Constructors Constructor Description TapeCatalogRepository(com.mongodb.client.MongoCollection<org.bson.Document> collection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<TapeState,java.lang.Integer>countByState()count tapes matching by statejava.lang.StringcreateTape(TapeCatalog tapeCatalog)create a tape modelTapeCatalogfindTapeById(java.lang.String tapeId)return tape model according to given IDjava.util.List<TapeCatalog>findTapes(java.util.List<QueryCriteria> criteria)return tape models according to given fieldsbooleanreplaceTape(TapeCatalog tapeCatalog)replace a tape modelbooleanupdateTape(java.lang.String tapeId, java.util.Map<java.lang.String,java.lang.Object> fields)apply fields changes for tape tapeId-
Methods inherited from class fr.gouv.vitam.storage.offers.tape.impl.queue.QueueRepositoryImpl
add, addIfAbsent, complete, countByStateAndType, initializeOnBootstrap, markError, markReady, receive, receive, receive, receive, remove, tryCancelIfNotStarted
-
-
-
-
Method Detail
-
createTape
public java.lang.String createTape(TapeCatalog tapeCatalog) throws TapeCatalogException
create a tape model- Parameters:
tapeCatalog-- Throws:
InvalidParseOperationExceptionTapeCatalogException
-
replaceTape
public boolean replaceTape(TapeCatalog tapeCatalog) throws TapeCatalogException
replace a tape model- Parameters:
tapeCatalog-- Throws:
InvalidParseOperationExceptionTapeCatalogException
-
updateTape
public boolean updateTape(java.lang.String tapeId, java.util.Map<java.lang.String,java.lang.Object> fields) throws TapeCatalogExceptionapply fields changes for tape tapeId- Parameters:
tapeId-fields-- Returns:
- true if changes have been applied otherwise false
- Throws:
TapeCatalogException
-
findTapes
public java.util.List<TapeCatalog> findTapes(java.util.List<QueryCriteria> criteria) throws TapeCatalogException
return tape models according to given fields- Parameters:
criteria-- Returns:
- Throws:
TapeCatalogException
-
countByState
public java.util.Map<TapeState,java.lang.Integer> countByState() throws TapeCatalogException
count tapes matching by state- Returns:
- number of tapes by state
- Throws:
TapeCatalogException
-
findTapeById
public TapeCatalog findTapeById(java.lang.String tapeId) throws TapeCatalogException
return tape model according to given ID- Parameters:
tapeId-- Returns:
- Throws:
TapeCatalogException
-
-