Class ManagementContractImpl
java.lang.Object
fr.gouv.vitam.functional.administration.core.contract.ManagementContractImpl
- All Implemented Interfaces:
VitamAutoCloseable
,ContractService<ManagementContractModel>
,AutoCloseable
public class ManagementContractImpl
extends Object
implements ContractService<ManagementContractModel>
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static final class
Contract validator -
Field Summary
-
Constructor Summary
ConstructorDescriptionManagementContractImpl
(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService) ManagementContractImpl
(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, StorageClient storageClient, LogbookOperationsClient logbookOperationsClient, FunctionalBackupService functionalBackupService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
createContracts
(List<ManagementContractModel> contractModelList) Create a collections of contracts After passing the validation steps.findByIdentifier
(String identifier) Find contract by identifierfindContracts
(com.fasterxml.jackson.databind.JsonNode queryDsl) find contract by QueryDslupdateContract
(String identifier, com.fasterxml.jackson.databind.JsonNode queryDsl) Update contracts status after passing validation steps : Field modified : - ActivationDate - DesactivationDate - LastUpdate - Status
-
Field Details
-
CONTRACT_BACKUP_EVENT
- See Also:
-
INVALID_INTERMEDIARY_VERSION_TYPE
- See Also:
-
-
Constructor Details
-
ManagementContractImpl
public ManagementContractImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService) -
ManagementContractImpl
public ManagementContractImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, StorageClient storageClient, LogbookOperationsClient logbookOperationsClient, FunctionalBackupService functionalBackupService)
-
-
Method Details
-
createContracts
public RequestResponse<ManagementContractModel> createContracts(List<ManagementContractModel> contractModelList) throws VitamException Description copied from interface:ContractService
Create a collections of contracts After passing the validation steps. If all the contracts are valid, they are stored in the collection and indexed. The access contract are valid in the following situations :- The collection contains 2 ore many contracts having the same name
- One or more mandatory field is missing
- A field has an invalid format
- One or many contracts already exist in the database
- Specified by:
createContracts
in interfaceContractService<ManagementContractModel>
- Parameters:
contractModelList
- the list of contracts to be created- Returns:
- RequestResponseOK if success or VitamError
- Throws:
VitamException
- if in error occurs while validating contracts
-
updateContract
public RequestResponse<ManagementContractModel> updateContract(String identifier, com.fasterxml.jackson.databind.JsonNode queryDsl) throws VitamException Description copied from interface:ContractService
Update contracts status after passing validation steps : Field modified :- - ActivationDate
- - DesactivationDate
- - LastUpdate
- - Status
- Specified by:
updateContract
in interfaceContractService<ManagementContractModel>
- Parameters:
identifier
- the id of the contract to be updatedqueryDsl
- the given queryDsl for update- Returns:
- RequestResponseOK if success or VitamError
- Throws:
VitamException
- if in error occurs while validating contracts
-
findByIdentifier
public ManagementContractModel findByIdentifier(String identifier) throws ReferentialException, InvalidParseOperationException Description copied from interface:ContractService
Find contract by identifier- Specified by:
findByIdentifier
in interfaceContractService<ManagementContractModel>
- Parameters:
identifier
- the identifier of the contract- Returns:
- T the contract corresponding to this identifier
- Throws:
ReferentialException
- thrown if the query could not be executedInvalidParseOperationException
- thrown if the query could not be created
-
findContracts
public RequestResponseOK<ManagementContractModel> findContracts(com.fasterxml.jackson.databind.JsonNode queryDsl) throws ReferentialException, InvalidParseOperationException Description copied from interface:ContractService
find contract by QueryDsl- Specified by:
findContracts
in interfaceContractService<ManagementContractModel>
- Parameters:
queryDsl
- the query to be executed- Returns:
- list of T
- Throws:
ReferentialException
- thrown if the query could not be executedInvalidParseOperationException
- thrown is the query is incorrect
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceVitamAutoCloseable
-