Class TransactionService
- java.lang.Object
-
- fr.gouv.vitam.collect.internal.core.service.TransactionService
-
public class TransactionService extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description TransactionService(TransactionRepository transactionRepository, ProjectService projectService, MetadataRepository metadataRepository, WorkspaceClientFactory workspaceCollectClientFactory, AccessInternalClientFactory accessInternalClientFactory, IngestInternalClientFactory ingestInternalClientFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
attachVitamOperationId(java.lang.String transactionId, java.lang.String operationId)
void
changeTransactionStatus(TransactionStatus transactionStatus, java.lang.String transactionId)
void
checkAbortTransaction(TransactionModel transactionModel)
void
checkReadyTransaction(TransactionModel transactionModel)
void
checkReopenTransaction(TransactionModel transactionModel)
void
checkSendingTransaction(TransactionModel transactionModel)
void
checkSendTransaction(TransactionModel transactionModel)
boolean
checkStatus(TransactionModel transactionModel, TransactionStatus... transactionStatus)
void
createTransaction(TransactionDto transactionDto, java.lang.String projectId)
create a transaction modelvoid
deleteTransaction(java.lang.String id)
delete transaction according to idvoid
deleteTransactionContent(java.lang.String id)
java.util.Optional<TransactionModel>
findLastTransactionByProjectId(java.lang.String id)
return transaction according to project idjava.util.Optional<TransactionModel>
findTransaction(java.lang.String id)
return transaction according to idjava.util.List<TransactionDto>
findTransactionsByProjectId(java.lang.String id)
return transaction according to idjava.util.List<TransactionModel>
getListTransactionToDeleteByTenant(java.lang.Integer tenantId)
void
isTransactionContentEmpty(java.lang.String id)
check if the transaction content is emptyvoid
manageTransactionsStatus()
void
replaceTransaction(TransactionDto transactionDto)
update a transaction modelvoid
replaceTransaction(TransactionModel transactionModel)
-
-
-
Constructor Detail
-
TransactionService
public TransactionService(TransactionRepository transactionRepository, ProjectService projectService, MetadataRepository metadataRepository, WorkspaceClientFactory workspaceCollectClientFactory, AccessInternalClientFactory accessInternalClientFactory, IngestInternalClientFactory ingestInternalClientFactory)
-
-
Method Detail
-
createTransaction
public void createTransaction(TransactionDto transactionDto, java.lang.String projectId) throws CollectInternalException
create a transaction model- Throws:
CollectInternalException
- exception thrown in case of error
-
deleteTransaction
public void deleteTransaction(java.lang.String id) throws CollectInternalException
delete transaction according to id- Parameters:
id
- transaction to delete- Throws:
CollectInternalException
- exception thrown in case of error
-
deleteTransactionContent
public void deleteTransactionContent(java.lang.String id) throws CollectInternalException
- Throws:
CollectInternalException
-
findTransaction
public java.util.Optional<TransactionModel> findTransaction(java.lang.String id) throws CollectInternalException
return transaction according to id- Parameters:
id
- model id to find- Returns:
- Optional
- Throws:
CollectInternalException
- exception thrown in case of error
-
findLastTransactionByProjectId
public java.util.Optional<TransactionModel> findLastTransactionByProjectId(java.lang.String id) throws CollectInternalException
return transaction according to project id- Parameters:
id
- model id to find- Returns:
- Optional
- Throws:
CollectInternalException
- exception thrown in case of error
-
findTransactionsByProjectId
public java.util.List<TransactionDto> findTransactionsByProjectId(java.lang.String id) throws CollectInternalException
return transaction according to id- Parameters:
id
- model id to find- Returns:
- Optional
- Throws:
CollectInternalException
- exception thrown in case of error
-
checkReadyTransaction
public void checkReadyTransaction(TransactionModel transactionModel) throws CollectInternalException
- Throws:
CollectInternalException
-
checkSendingTransaction
public void checkSendingTransaction(TransactionModel transactionModel) throws CollectInternalException
- Throws:
CollectInternalException
-
checkSendTransaction
public void checkSendTransaction(TransactionModel transactionModel) throws CollectInternalException
- Throws:
CollectInternalException
-
replaceTransaction
public void replaceTransaction(TransactionModel transactionModel) throws CollectInternalException
- Throws:
CollectInternalException
-
checkAbortTransaction
public void checkAbortTransaction(TransactionModel transactionModel) throws CollectInternalException
- Throws:
CollectInternalException
-
checkReopenTransaction
public void checkReopenTransaction(TransactionModel transactionModel) throws CollectInternalException
- Throws:
CollectInternalException
-
checkStatus
public boolean checkStatus(TransactionModel transactionModel, TransactionStatus... transactionStatus)
-
changeTransactionStatus
public void changeTransactionStatus(TransactionStatus transactionStatus, java.lang.String transactionId) throws CollectInternalException
- Throws:
CollectInternalException
-
attachVitamOperationId
public void attachVitamOperationId(java.lang.String transactionId, java.lang.String operationId) throws CollectInternalException
- Throws:
CollectInternalException
-
getListTransactionToDeleteByTenant
public java.util.List<TransactionModel> getListTransactionToDeleteByTenant(java.lang.Integer tenantId) throws CollectInternalException
- Throws:
CollectInternalException
-
manageTransactionsStatus
public void manageTransactionsStatus() throws CollectInternalException
- Throws:
CollectInternalException
-
replaceTransaction
public void replaceTransaction(TransactionDto transactionDto) throws CollectInternalException
update a transaction model- Throws:
CollectInternalException
- exception thrown in case of error
-
isTransactionContentEmpty
public void isTransactionContentEmpty(java.lang.String id) throws CollectInternalException
check if the transaction content is empty- Throws:
CollectInternalException
- exception thrown in case of error
-
-