Class ArchiveUnitProfileServiceImpl
- java.lang.Object
-
- fr.gouv.vitam.functional.administration.core.archiveunitprofiles.ArchiveUnitProfileServiceImpl
-
- All Implemented Interfaces:
VitamAutoCloseable
,ArchiveUnitProfileService
,java.lang.AutoCloseable
public class ArchiveUnitProfileServiceImpl extends java.lang.Object implements ArchiveUnitProfileService
The implementation of the archive unit profile CRUD
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ARCHIVE_UNIT_PROFILE_IDENTIFIER_ALREADY_EXISTS_IN_DATABASE
static java.lang.String
ARCHIVE_UNIT_PROFILE_IDENTIFIER_MUST_BE_STRING
-
Constructor Summary
Constructors Constructor Description ArchiveUnitProfileServiceImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, FunctionalBackupService functionalBackupService)
ConstructorArchiveUnitProfileServiceImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, FunctionalBackupService functionalBackupService, boolean checkOntology)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
RequestResponse<ArchiveUnitProfileModel>
createArchiveUnitProfiles(java.util.List<ArchiveUnitProfileModel> profileModelList)
Create a collections of profile After passing the validation steps.RequestResponseOK<ArchiveUnitProfileModel>
findArchiveUnitProfiles(com.fasterxml.jackson.databind.JsonNode queryDsl)
find archive unit profiles by QueryDslArchiveUnitProfileModel
findByIdentifier(java.lang.String id)
RequestResponse<ArchiveUnitProfileModel>
updateArchiveUnitProfile(java.lang.String id, com.fasterxml.jackson.databind.JsonNode queryDsl)
Update an archive unit profile after passing validation steps : Field modified : - ActivationDate - DesactivationDate - LastUpdate - Status
-
-
-
Field Detail
-
ARCHIVE_UNIT_PROFILE_IDENTIFIER_ALREADY_EXISTS_IN_DATABASE
public static final java.lang.String ARCHIVE_UNIT_PROFILE_IDENTIFIER_ALREADY_EXISTS_IN_DATABASE
- See Also:
- Constant Field Values
-
ARCHIVE_UNIT_PROFILE_IDENTIFIER_MUST_BE_STRING
public static final java.lang.String ARCHIVE_UNIT_PROFILE_IDENTIFIER_MUST_BE_STRING
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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 Detail
-
createArchiveUnitProfiles
public RequestResponse<ArchiveUnitProfileModel> createArchiveUnitProfiles(java.util.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(java.lang.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 interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceVitamAutoCloseable
-
findByIdentifier
public ArchiveUnitProfileModel findByIdentifier(java.lang.String id) throws ReferentialException, InvalidParseOperationException
-
-