Class OffsetRepository
java.lang.Object
fr.gouv.vitam.common.database.offset.OffsetRepository
Offset collection repository (use for logbook and metadata database)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOffsetRepository(MongoDbAccess mongoDbAccess) ConstructorOffsetRepository(MongoDbAccess mongoDbAccess, String collectionName) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateOrUpdateOffset(int tenant, String strategy, String collection, long offset) Create or update offsetlongfindOffsetBy(int tenant, String strategy, String collection) Get current offset
-
Field Details
-
COLLECTION_NAME
- See Also:
-
-
Constructor Details
-
OffsetRepository
-
OffsetRepository
Constructor- Parameters:
mongoDbAccess- mongoDbAccess
-
-
Method Details
-
createOrUpdateOffset
Create or update offset- Parameters:
tenant- the tenantstrategy- the strategy idcollection- the collection name
-
findOffsetBy
Get current offset- Parameters:
tenant- the tenantstrategy- the strategy idcollection- the collection name we want to reconstruct, bat can be any other unique name (graph)- Returns:
- the offset value for collection/tenant, 0L if not found
-