Class TransactionService
java.lang.Object
fr.gouv.vitam.collect.internal.core.service.TransactionService
-
Constructor Summary
ConstructorDescriptionTransactionService
(TransactionRepository transactionRepository, ProjectService projectService, MetadataRepository metadataRepository, FluxService fluxService, WorkspaceClientFactory workspaceCollectClientFactory, AccessInternalClientFactory accessInternalClientFactory, IngestInternalClientFactory ingestInternalClientFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoid
attachVitamOperationId
(String transactionId, String operationId) void
changeTransactionStatus
(TransactionStatus transactionStatus, String transactionId) boolean
changeTransactionToSendingIfBatchesNotKo
(TransactionModel transaction) 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, ProjectDto projectDto) create a transaction modelvoid
delete transaction according to idvoid
deleteTransactionContent
(String transactionId) Deprecated.boolean
findOneAndReplace
(TransactionStatus transactionStatus, TransactionModel transactionModel) return transaction according to idreturn transaction according to idgetListTransactionToDeleteByTenant
(Integer tenantId) void
check if the transaction content is emptyvoid
void
purgeByBatchId
(String batchId, TransactionModel transactionModel) replaceTransaction
(TransactionDto transactionDto) update a transaction modelvoid
replaceTransaction
(TransactionModel transactionModel) javax.ws.rs.core.Response
uploadTransactionZip
(InputStream inputStreamObject, TransactionModel transactionModel, String encoding)
-
Constructor Details
-
TransactionService
public TransactionService(TransactionRepository transactionRepository, ProjectService projectService, MetadataRepository metadataRepository, FluxService fluxService, WorkspaceClientFactory workspaceCollectClientFactory, AccessInternalClientFactory accessInternalClientFactory, IngestInternalClientFactory ingestInternalClientFactory)
-
-
Method Details
-
createTransaction
public void createTransaction(TransactionDto transactionDto, ProjectDto projectDto) throws CollectInternalException create a transaction model- Throws:
CollectInternalException
- exception thrown in case of error
-
deleteTransaction
delete transaction according to id- Parameters:
id
- transaction to delete- Throws:
CollectInternalException
- exception thrown in case of error
-
findTransaction
return transaction according to id- Parameters:
id
- model id to find- Returns:
- Optional
- Throws:
CollectInternalException
- exception thrown in case of error
-
findLastTransactionByProjectId
@Deprecated public Optional<TransactionModel> findLastTransactionByProjectId(String id) throws CollectInternalException Deprecated.return transaction according to project id- Parameters:
id
- model id to find- Returns:
- Optional
- Throws:
CollectInternalException
- exception thrown in case of error FIXME : Delete usages since no there is no more 1 transaction limit for project
-
findTransactionsByProjectId
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
- Throws:
CollectInternalException
-
replaceTransaction
- Throws:
CollectInternalException
-
findOneAndReplace
public boolean findOneAndReplace(TransactionStatus transactionStatus, TransactionModel transactionModel) throws InvalidParseOperationException - Throws:
InvalidParseOperationException
-
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, String transactionId) throws CollectInternalException - Throws:
CollectInternalException
-
attachVitamOperationId
public void attachVitamOperationId(String transactionId, String operationId) throws CollectInternalException - Throws:
CollectInternalException
-
getListTransactionToDeleteByTenant
public List<TransactionModel> getListTransactionToDeleteByTenant(Integer tenantId) throws CollectInternalException - Throws:
CollectInternalException
-
findReadyAutoIngestTransactions
- Throws:
CollectInternalException
-
manageTransactionsStatus
- Throws:
CollectInternalException
-
replaceTransaction
public TransactionModel replaceTransaction(TransactionDto transactionDto) throws CollectInternalException update a transaction model- Throws:
CollectInternalException
- exception thrown in case of error
-
isTransactionContentEmpty
check if the transaction content is empty- Throws:
CollectInternalException
- exception thrown in case of error
-
deleteTransactionContent
- Throws:
CollectInternalException
-
purgeByBatchId
public void purgeByBatchId(String batchId, TransactionModel transactionModel) throws CollectInternalException - Throws:
CollectInternalException
-
uploadTransactionZip
public javax.ws.rs.core.Response uploadTransactionZip(InputStream inputStreamObject, TransactionModel transactionModel, @Nullable String encoding) throws CollectInternalException - Throws:
CollectInternalException
-
changeTransactionToSendingIfBatchesNotKo
public boolean changeTransactionToSendingIfBatchesNotKo(TransactionModel transaction) throws InvalidParseOperationException, CollectInternalException
-