Class OffsetRepository

java.lang.Object
fr.gouv.vitam.common.database.offset.OffsetRepository

public class OffsetRepository extends Object
Offset collection repository (use for logbook and metadata database)
  • Field Details

  • Constructor Details

    • OffsetRepository

      public OffsetRepository(MongoDbAccess mongoDbAccess, String collectionName)
    • OffsetRepository

      public OffsetRepository(MongoDbAccess mongoDbAccess)
      Constructor
      Parameters:
      mongoDbAccess - mongoDbAccess
  • Method Details

    • createOrUpdateOffset

      public void createOrUpdateOffset(int tenant, String strategy, String collection, long offset)
      Create or update offset
      Parameters:
      tenant - the tenant
      strategy - the strategy id
      collection - the collection name
    • findOffsetBy

      public long findOffsetBy(int tenant, String strategy, String collection)
      Get current offset
      Parameters:
      tenant - the tenant
      strategy - the strategy id
      collection - 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