Package fr.gouv.vitam.functional.administration.common.counter

# Class VitamCounterService

java.lang.Object
fr.gouv.vitam.functional.administration.common.counter.VitamCounterService

public class VitamCounterService extends Object
Vitam functional counter service

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VitamCounterService(MongoDbAccessAdminImpl dbConfiguration, List<Integer> tenants, Map<Integer,List<String>> externalIdentifiers)`
  Constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `VitamSequence`
  `getNextBackupSequenceDocument(Integer tenant, SequenceType sequenceType)`
  Atomically find a backup sequence and update it, returning updated document.
  `Integer`
  `getNextSequence(Integer tenant, SequenceType sequenceType)`
  Atomically find a sequence and update it.
  `String`
  `getNextSequenceAsString(Integer tenant, SequenceType sequenceType)`
  Atomically find a sequence and update it.
  `Integer`
  `getSequence(Integer tenant, SequenceType sequenceType)`
  Get the last sequence functional collection
  `VitamSequence`
  `getSequenceDocument(Integer tenant, SequenceType sequenceType)`
  `boolean`
  `isSlaveFunctionnalCollectionOnTenant(FunctionalAdminCollections collection, Integer tenant)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### VitamCounterService

    public VitamCounterService(MongoDbAccessAdminImpl dbConfiguration, List<Integer> tenants, Map<Integer,List<String>> externalIdentifiers) throws VitamException
    Constructor
    Parameters:
      `dbConfiguration` -
      `tenants` -
      `externalIdentifiers` -
    Throws:
      `VitamException`

- ## Method Details

  - ### getNextSequenceAsString

    public String getNextSequenceAsString(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 Integer getNextSequence(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(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 Integer getSequence(Integer tenant, SequenceType sequenceType) throws ReferentialException
    Get the last sequence functional collection
    Parameters:
      `tenant` -
      `sequenceType` -
    Returns:
    Throws:
      `ReferentialException`

  - ### getSequenceDocument

    public VitamSequence getSequenceDocument(Integer tenant, SequenceType sequenceType) throws ReferentialException
    Throws:
      `ReferentialException`

  - ### isSlaveFunctionnalCollectionOnTenant

    public boolean isSlaveFunctionnalCollectionOnTenant(FunctionalAdminCollections collection, Integer tenant)