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, FluxService fluxService, WorkspaceClientFactory workspaceCollectClientFactory, AccessInternalClientFactory accessInternalClientFactory, IngestInternalClientFactory ingestInternalClientFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
attachVitamOperationId(java.lang.String transactionId, java.lang.String operationId)
void
changeTransactionStatus(TransactionStatus transactionStatus, java.lang.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
deleteTransaction(java.lang.String id)
delete transaction according to idvoid
deleteTransactionContent(java.lang.String transactionId)
java.util.Optional<TransactionModel>
findLastTransactionByProjectId(java.lang.String id)
Deprecated.boolean
findOneAndReplace(TransactionStatus transactionStatus, TransactionModel transactionModel)
java.util.List<TransactionModel>
findReadyAutoIngestTransactions()
java.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
purgeByBatchId(java.lang.String batchId, TransactionModel transactionModel)
TransactionModel
replaceTransaction(TransactionDto transactionDto)
update a transaction modelvoid
replaceTransaction(TransactionModel transactionModel)
javax.ws.rs.core.Response
uploadTransactionZip(java.io.InputStream inputStreamObject, TransactionModel transactionModel, java.lang.String encoding)
-
-
-
Constructor Detail
-
TransactionService
public TransactionService(TransactionRepository transactionRepository, ProjectService projectService, MetadataRepository metadataRepository, FluxService fluxService, WorkspaceClientFactory workspaceCollectClientFactory, AccessInternalClientFactory accessInternalClientFactory, IngestInternalClientFactory ingestInternalClientFactory)
-
-
Method Detail
-
createTransaction
public void createTransaction(TransactionDto transactionDto, ProjectDto projectDto) 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
-
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
@Deprecated public java.util.Optional<TransactionModel> findLastTransactionByProjectId(java.lang.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
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
-
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, 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
-
findReadyAutoIngestTransactions
public java.util.List<TransactionModel> findReadyAutoIngestTransactions() throws CollectInternalException
- Throws:
CollectInternalException
-
manageTransactionsStatus
public void manageTransactionsStatus() throws CollectInternalException
- Throws:
CollectInternalException
-
replaceTransaction
public TransactionModel 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
-
deleteTransactionContent
public void deleteTransactionContent(java.lang.String transactionId) throws CollectInternalException
- Throws:
CollectInternalException
-
purgeByBatchId
public void purgeByBatchId(java.lang.String batchId, TransactionModel transactionModel) throws CollectInternalException
- Throws:
CollectInternalException
-
uploadTransactionZip
public javax.ws.rs.core.Response uploadTransactionZip(java.io.InputStream inputStreamObject, TransactionModel transactionModel, @Nullable java.lang.String encoding) throws CollectInternalException
- Throws:
CollectInternalException
-
changeTransactionToSendingIfBatchesNotKo
public boolean changeTransactionToSendingIfBatchesNotKo(TransactionModel transaction) throws InvalidParseOperationException, CollectInternalException
-
-