Package fr.gouv.vitam.collect.internal.core.repository

# Class TransactionRepository

java.lang.Object
fr.gouv.vitam.collect.internal.core.repository.TransactionRepository

public class TransactionRepository extends Object
repository for collect entities management in mongo.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `CREATION_DATE`
  `static final String`
  `ID`
  `static final String`
  `SET`
  `static final String`
  `STATUS`
  `static final String`
  `TENANT_ID`
  `static final String`
  `TRANSACTION_COLLECTION`
  `static final String`
  `VERSION`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TransactionRepository(MongoDbAccess mongoDbAccess)`
  `TransactionRepository(MongoDbAccess mongoDbAccess, String collectionName)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `createTransaction(TransactionModel transactionModel)`
  create a transaction model
  `void`
  `deleteTransaction(String id)`
  delete a transaction model
  `boolean`
  `findOneAndReplace(TransactionStatus transactionStatus, TransactionModel transactionModel)`
  `boolean`
  `findOneAndReplace(TransactionModel transactionModel)`
  `boolean`
  `findOneAndReplace(List<org.bson.conversions.Bson> additionalFilters, TransactionModel transactionModel)`
  `Optional<TransactionModel>`
  `findTransaction(String id)`
  return transaction according to id
  `Optional<TransactionModel>`
  `findTransactionByQuery(org.bson.conversions.Bson query)`
  return transaction according to query
  `List<TransactionModel>`
  `findTransactionsByQuery(org.bson.conversions.Bson query)`
  `List<TransactionModel>`
  `findTransactionsByQueryWithoutTenant(org.bson.conversions.Bson query)`
  `List<TransactionModel>`
  `getListTransactionToDeleteByTenant(Integer tenantId)`
  delete Transaction according to tenant and delay and status
  `void`
  `replaceTransaction(TransactionModel transactionModel)`
  replace a transaction model
  `void`
  `replaceTransactions(List<TransactionModel> transactionsModel)`
  Deprecated.
  : FIXME : Update only if "version = version - 1";

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

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

- ## Field Details

  - ### TRANSACTION_COLLECTION

    public static final String TRANSACTION_COLLECTION
    See Also:
      - Constant Field Values

  - ### ID

    public static final String ID
    See Also:
      - Constant Field Values

  - ### VERSION

    public static final String VERSION
    See Also:
      - Constant Field Values

  - ### TENANT_ID

    public static final String TENANT_ID
    See Also:
      - Constant Field Values

  - ### CREATION_DATE

    public static final String CREATION_DATE
    See Also:
      - Constant Field Values

  - ### SET

    public static final String SET
    See Also:
      - Constant Field Values

  - ### STATUS

    public static final String STATUS
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### TransactionRepository

    public TransactionRepository(MongoDbAccess mongoDbAccess, String collectionName)

  - ### TransactionRepository

    public TransactionRepository(MongoDbAccess mongoDbAccess)

- ## Method Details

  - ### createTransaction

    public void createTransaction(TransactionModel transactionModel) throws CollectInternalException
    create a transaction model
    Parameters:
      `transactionModel` - transaction model to create
    Throws:
      `CollectInternalException` - exception thrown in case of error

  - ### replaceTransaction

    public void replaceTransaction(TransactionModel transactionModel) throws CollectInternalException
    replace a transaction model
    Parameters:
      `transactionModel` - transaction model to replace
    Throws:
      `CollectInternalException` - exception thrown in case of error

  - ### replaceTransactions

    public void replaceTransactions(List<TransactionModel> transactionsModel) throws CollectInternalException
    Deprecated.
    : FIXME : Update only if "version = version - 1";
    replace a transaction model
    Parameters:
      `transactionsModel` - list des transactions model to replace
    Throws:
      `CollectInternalException` - exception thrown in case of error

  - ### findTransaction

    public Optional<TransactionModel> findTransaction(String id) throws CollectInternalException
    return transaction according to id
    Parameters:
      `id` - transaction id to find
    Returns:
      Optional
    Throws:
      `CollectInternalException` - exception thrown in case of error

  - ### findTransactionByQuery

    public Optional<TransactionModel> findTransactionByQuery(org.bson.conversions.Bson query) throws CollectInternalServerSideException
    return transaction according to query
    Parameters:
      `query` - transaction query to find
    Returns:
      Optional
    Throws:
      `CollectInternalException` - exception thrown in case of error
      `CollectInternalServerSideException`

  - ### findTransactionsByQuery

    public List<TransactionModel> findTransactionsByQuery(org.bson.conversions.Bson query) throws CollectInternalServerSideException
    Throws:
      `CollectInternalServerSideException`

  - ### findTransactionsByQueryWithoutTenant

    public List<TransactionModel> findTransactionsByQueryWithoutTenant(org.bson.conversions.Bson query) throws CollectInternalServerSideException
    Throws:
      `CollectInternalServerSideException`

  - ### deleteTransaction

    public void deleteTransaction(String id) throws CollectInternalServerSideException
    delete a transaction model
    Parameters:
      `id` - transaction to delete
    Throws:
      `CollectInternalServerSideException`

  - ### getListTransactionToDeleteByTenant

    public List<TransactionModel> getListTransactionToDeleteByTenant(Integer tenantId) throws CollectInternalServerSideException
    delete Transaction according to tenant and delay and status
    Parameters:
      `tenantId` - tenant id to find
    Returns:
      Optional
    Throws:
      `CollectInternalException` - exception thrown in case of error
      `CollectInternalServerSideException`

  - ### findOneAndReplace

    public boolean findOneAndReplace(TransactionStatus transactionStatus, TransactionModel transactionModel) throws CollectInternalServerSideException
    Throws:
      `CollectInternalServerSideException`

  - ### findOneAndReplace

    public boolean findOneAndReplace(TransactionModel transactionModel) throws CollectInternalServerSideException
    Throws:
      `CollectInternalServerSideException`

  - ### findOneAndReplace

    public boolean findOneAndReplace(List<org.bson.conversions.Bson> additionalFilters, TransactionModel transactionModel) throws CollectInternalServerSideException
    Throws:
      `CollectInternalServerSideException`