Class OffsetRepository
- java.lang.Object
-
- fr.gouv.vitam.common.database.offset.OffsetRepository
-
public class OffsetRepository extends java.lang.Object
Offset collection repository (use for logbook and metadata database)
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
COLLECTION_NAME
-
Constructor Summary
Constructors Constructor Description OffsetRepository(MongoDbAccess mongoDbAccess)
ConstructorOffsetRepository(MongoDbAccess mongoDbAccess, java.lang.String collectionName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createOrUpdateOffset(int tenant, java.lang.String strategy, java.lang.String collection, long offset)
Create or update offsetlong
findOffsetBy(int tenant, java.lang.String strategy, java.lang.String collection)
Get current offset
-
-
-
Field Detail
-
COLLECTION_NAME
public static final java.lang.String COLLECTION_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OffsetRepository
public OffsetRepository(MongoDbAccess mongoDbAccess, java.lang.String collectionName)
-
OffsetRepository
public OffsetRepository(MongoDbAccess mongoDbAccess)
Constructor- Parameters:
mongoDbAccess
- mongoDbAccess
-
-
Method Detail
-
createOrUpdateOffset
public void createOrUpdateOffset(int tenant, java.lang.String strategy, java.lang.String collection, long offset)
Create or update offset- Parameters:
tenant
- the tenantstrategy
- the strategy idcollection
- the collection name
-
findOffsetBy
public long findOffsetBy(int tenant, java.lang.String strategy, java.lang.String collection)
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
-
-