Class VitamCounterService
- java.lang.Object
-
- fr.gouv.vitam.functional.administration.common.counter.VitamCounterService
-
public class VitamCounterService extends java.lang.Object
Vitam functional counter service
-
-
Constructor Summary
Constructors Constructor Description VitamCounterService(MongoDbAccessAdminImpl dbConfiguration, java.util.List<java.lang.Integer> tenants, java.util.Map<java.lang.Integer,java.util.List<java.lang.String>> externalIdentifiers)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VitamSequence
getNextBackupSequenceDocument(java.lang.Integer tenant, SequenceType sequenceType)
Atomically find a backup sequence and update it, returning updated document.java.lang.Integer
getNextSequence(java.lang.Integer tenant, SequenceType sequenceType)
Atomically find a sequence and update it.java.lang.String
getNextSequenceAsString(java.lang.Integer tenant, SequenceType sequenceType)
Atomically find a sequence and update it.java.lang.Integer
getSequence(java.lang.Integer tenant, SequenceType sequenceType)
Get the last sequence functional collectionVitamSequence
getSequenceDocument(java.lang.Integer tenant, SequenceType sequenceType)
boolean
isSlaveFunctionnalCollectionOnTenant(FunctionalAdminCollections collection, java.lang.Integer tenant)
-
-
-
Constructor Detail
-
VitamCounterService
public VitamCounterService(MongoDbAccessAdminImpl dbConfiguration, java.util.List<java.lang.Integer> tenants, java.util.Map<java.lang.Integer,java.util.List<java.lang.String>> externalIdentifiers) throws VitamException
Constructor- Parameters:
dbConfiguration
-tenants
-externalIdentifiers
-- Throws:
VitamException
-
-
Method Detail
-
getNextSequenceAsString
public java.lang.String getNextSequenceAsString(java.lang.Integer tenant, SequenceType sequenceType) throws ReferentialException
Atomically find a sequence and update it.- Parameters:
tenant
-sequenceType
-- Returns:
- the sequence concatenated with it name the name
- Throws:
ReferentialException
-
getNextSequence
public java.lang.Integer getNextSequence(java.lang.Integer tenant, SequenceType sequenceType) throws ReferentialException
Atomically find a sequence and update it.- Parameters:
tenant
-sequenceType
-- Returns:
- the sequence
- Throws:
InvalidCreateOperationException
InvalidParseOperationException
ReferentialException
-
getNextBackupSequenceDocument
public VitamSequence getNextBackupSequenceDocument(java.lang.Integer tenant, SequenceType sequenceType) throws ReferentialException
Atomically find a backup sequence and update it, returning updated document.- Parameters:
tenant
-sequenceType
-- Returns:
- the sequence
- Throws:
InvalidCreateOperationException
InvalidParseOperationException
ReferentialException
-
getSequence
public java.lang.Integer getSequence(java.lang.Integer tenant, SequenceType sequenceType) throws ReferentialException
Get the last sequence functional collection- Parameters:
tenant
-sequenceType
-- Returns:
- Throws:
ReferentialException
-
getSequenceDocument
public VitamSequence getSequenceDocument(java.lang.Integer tenant, SequenceType sequenceType) throws ReferentialException
- Throws:
ReferentialException
-
isSlaveFunctionnalCollectionOnTenant
public boolean isSlaveFunctionnalCollectionOnTenant(FunctionalAdminCollections collection, java.lang.Integer tenant)
-
-