Class ArchiveUnitProfileServiceImpl
java.lang.Object
fr.gouv.vitam.functional.administration.core.archiveunitprofiles.ArchiveUnitProfileServiceImpl
- All Implemented Interfaces:
VitamAutoCloseable
,ArchiveUnitProfileService
,AutoCloseable
The implementation of the archive unit profile CRUD
-
Field Summary
-
Constructor Summary
ConstructorDescriptionArchiveUnitProfileServiceImpl
(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, FunctionalBackupService functionalBackupService) ConstructorArchiveUnitProfileServiceImpl
(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, FunctionalBackupService functionalBackupService, boolean checkOntology) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
createArchiveUnitProfiles
(List<ArchiveUnitProfileModel> profileModelList) Create a collections of profile After passing the validation steps.findArchiveUnitProfiles
(com.fasterxml.jackson.databind.JsonNode queryDsl) find archive unit profiles by QueryDslupdateArchiveUnitProfile
(String id, com.fasterxml.jackson.databind.JsonNode queryDsl) Update an archive unit profile after passing validation steps : Field modified : - ActivationDate - DesactivationDate - LastUpdate - Status
-
Field Details
-
ARCHIVE_UNIT_PROFILE_IDENTIFIER_ALREADY_EXISTS_IN_DATABASE
- See Also:
-
ARCHIVE_UNIT_PROFILE_IDENTIFIER_MUST_BE_STRING
- See Also:
-
-
Constructor Details
-
ArchiveUnitProfileServiceImpl
public ArchiveUnitProfileServiceImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, FunctionalBackupService functionalBackupService) Constructor- Parameters:
mongoAccess
- MongoDB clientvitamCounterService
- the vitam counter servicefunctionalBackupService
- the functional backup service
-
ArchiveUnitProfileServiceImpl
public ArchiveUnitProfileServiceImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, FunctionalBackupService functionalBackupService, boolean checkOntology) Constructor- Parameters:
mongoAccess
- MongoDB clientvitamCounterService
- the vitam counter servicefunctionalBackupService
- the functional backup servicecheckOntology
- true or false to determine if ontology check is required
-
-
Method Details
-
createArchiveUnitProfiles
public RequestResponse<ArchiveUnitProfileModel> createArchiveUnitProfiles(List<ArchiveUnitProfileModel> profileModelList) throws VitamException Description copied from interface:ArchiveUnitProfileService
Create a collections of profile After passing the validation steps. If all the profiles are valid, they are stored in the collection and indexed. The profiles are not valid in the following situations :- The collection contains 2 ore many profile having the same identifier
- One or more mandatory field is missing
- A field has an invalid format
- One or many profile already exist in the database
- Specified by:
createArchiveUnitProfiles
in interfaceArchiveUnitProfileService
- Parameters:
profileModelList
- the list of profiles to be created- Returns:
- RequestResponseOK if success or VitamError
- Throws:
VitamException
- if in error occurs while validating contracts
-
findArchiveUnitProfiles
public RequestResponseOK<ArchiveUnitProfileModel> findArchiveUnitProfiles(com.fasterxml.jackson.databind.JsonNode queryDsl) throws ReferentialException, InvalidParseOperationException Description copied from interface:ArchiveUnitProfileService
find archive unit profiles by QueryDsl- Specified by:
findArchiveUnitProfiles
in interfaceArchiveUnitProfileService
- Parameters:
queryDsl
- the query as a json to be executed- Returns:
- list of ProfileModel
- Throws:
ReferentialException
- thrown if the query could not be executedInvalidParseOperationException
- thrown if the query could not be executed
-
updateArchiveUnitProfile
public RequestResponse<ArchiveUnitProfileModel> updateArchiveUnitProfile(String id, com.fasterxml.jackson.databind.JsonNode queryDsl) throws VitamException Description copied from interface:ArchiveUnitProfileService
Update an archive unit profile after passing validation steps : Field modified :- - ActivationDate
- - DesactivationDate
- - LastUpdate
- - Status
- Specified by:
updateArchiveUnitProfile
in interfaceArchiveUnitProfileService
- Parameters:
id
- identifier of the archive unit profile to updatequeryDsl
- the given dsl for update- Returns:
- RequestResponseOK on success or VitamError else
- Throws:
VitamException
- if in error occurs while validating contracts
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceVitamAutoCloseable
-
findByIdentifier
public ArchiveUnitProfileModel findByIdentifier(String id) throws ReferentialException, InvalidParseOperationException
-