Class IngestContractImpl
java.lang.Object
fr.gouv.vitam.functional.administration.core.contract.IngestContractImpl
- All Implemented Interfaces:
VitamAutoCloseable
,ContractService<IngestContractModel>
,AutoCloseable
IngestContract implementation class
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static final class
Contract validator -
Field Summary
-
Constructor Summary
ConstructorDescriptionIngestContractImpl
(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService) ConstructorIngestContractImpl
(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, MetaDataClient metaDataClient, LogbookOperationsClient logbookClient, FunctionalBackupService functionalBackupService, ContractService<ManagementContractModel> managementContractService) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
createContracts
(List<IngestContractModel> 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:
-
-
Constructor Details
-
IngestContractImpl
public IngestContractImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService) Constructor- Parameters:
mongoAccess
- the mongo access servicevitamCounterService
- the vitam counter service
-
IngestContractImpl
public IngestContractImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, MetaDataClient metaDataClient, LogbookOperationsClient logbookClient, FunctionalBackupService functionalBackupService, ContractService<ManagementContractModel> managementContractService) Constructor- Parameters:
mongoAccess
- the mongo access servicevitamCounterService
- the vitam counter servicemetaDataClient
- the metadata clientlogbookClient
- the logbook clientfunctionalBackupService
-managementContractService
-
-
-
Method Details
-
createContracts
public RequestResponse<IngestContractModel> createContracts(List<IngestContractModel> 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<IngestContractModel>
- Parameters:
contractModelList
- the list of contracts to be created- Returns:
- RequestResponseOK if success or VitamError
- Throws:
VitamException
- if in error occurs while validating contracts
-
findByIdentifier
public IngestContractModel findByIdentifier(String identifier) throws ReferentialException, InvalidParseOperationException Description copied from interface:ContractService
Find contract by identifier- Specified by:
findByIdentifier
in interfaceContractService<IngestContractModel>
- 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<IngestContractModel> findContracts(com.fasterxml.jackson.databind.JsonNode queryDsl) throws ReferentialException, InvalidParseOperationException Description copied from interface:ContractService
find contract by QueryDsl- Specified by:
findContracts
in interfaceContractService<IngestContractModel>
- 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
-
updateContract
public RequestResponse<IngestContractModel> 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<IngestContractModel>
- 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
-