Class ManagementContractImpl
- java.lang.Object
-
- fr.gouv.vitam.functional.administration.contract.core.ManagementContractImpl
-
- All Implemented Interfaces:
VitamAutoCloseable
,ContractService<ManagementContractModel>
,java.lang.AutoCloseable
public class ManagementContractImpl extends java.lang.Object implements ContractService<ManagementContractModel>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
ManagementContractImpl.ManagementContractValidationService
Contract validator
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CONTRACT_BACKUP_EVENT
static java.lang.String
INVALID_INTERMEDIARY_VERSION_TYPE
-
Constructor Summary
Constructors Constructor Description ManagementContractImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService)
ManagementContractImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, StorageClient storageClient, LogbookOperationsClient logbookOperationsClient, FunctionalBackupService functionalBackupService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
RequestResponse<ManagementContractModel>
createContracts(java.util.List<ManagementContractModel> contractModelList)
Create a collections of contracts After passing the validation steps.ManagementContractModel
findByIdentifier(java.lang.String identifier)
Find contract by identifierRequestResponseOK<ManagementContractModel>
findContracts(com.fasterxml.jackson.databind.JsonNode queryDsl)
find contract by QueryDslRequestResponse<ManagementContractModel>
updateContract(java.lang.String identifier, com.fasterxml.jackson.databind.JsonNode queryDsl)
Update contracts status after passing validation steps : Field modified : - ActivationDate - DesactivationDate - LastUpdate - Status
-
-
-
Field Detail
-
CONTRACT_BACKUP_EVENT
public static final java.lang.String CONTRACT_BACKUP_EVENT
- See Also:
- Constant Field Values
-
INVALID_INTERMEDIARY_VERSION_TYPE
public static final java.lang.String INVALID_INTERMEDIARY_VERSION_TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ManagementContractImpl
public ManagementContractImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService)
-
ManagementContractImpl
public ManagementContractImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, StorageClient storageClient, LogbookOperationsClient logbookOperationsClient, FunctionalBackupService functionalBackupService)
-
-
Method Detail
-
createContracts
public RequestResponse<ManagementContractModel> createContracts(java.util.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(java.lang.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(java.lang.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 interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceVitamAutoCloseable
-
-