Interface ContractService<T extends AbstractContractModel>
-
- Type Parameters:
T
- AccessContractModel or IngestContractModel
- All Superinterfaces:
java.lang.AutoCloseable
,VitamAutoCloseable
- All Known Implementing Classes:
AccessContractImpl
,IngestContractImpl
,ManagementContractImpl
public interface ContractService<T extends AbstractContractModel> extends VitamAutoCloseable
ContractService Interface declaring common methods for Contracts
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RequestResponse<T>
createContracts(java.util.List<T> contractModelList)
Create a collections of contracts After passing the validation steps.T
findByIdentifier(java.lang.String identifier)
Find contract by identifierRequestResponseOK<T>
findContracts(com.fasterxml.jackson.databind.JsonNode queryDsl)
find contract by QueryDslRequestResponse<T>
updateContract(java.lang.String id, com.fasterxml.jackson.databind.JsonNode queryDsl)
Update contracts status after passing validation steps : Field modified : - ActivationDate - DesactivationDate - LastUpdate - Status-
Methods inherited from interface fr.gouv.vitam.common.model.VitamAutoCloseable
close
-
-
-
-
Method Detail
-
createContracts
RequestResponse<T> createContracts(java.util.List<T> contractModelList) throws VitamException
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
- 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
RequestResponse<T> updateContract(java.lang.String id, com.fasterxml.jackson.databind.JsonNode queryDsl) throws VitamException
Update contracts status after passing validation steps : Field modified :- - ActivationDate
- - DesactivationDate
- - LastUpdate
- - Status
- Parameters:
id
- 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
T findByIdentifier(java.lang.String identifier) throws ReferentialException, InvalidParseOperationException
Find contract by identifier- 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
RequestResponseOK<T> findContracts(com.fasterxml.jackson.databind.JsonNode queryDsl) throws ReferentialException, InvalidParseOperationException
find contract by QueryDsl- 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
-
-