Package fr.gouv.vitam.functional.administration.core.archiveunitprofiles

# Class ArchiveUnitProfileServiceImpl

java.lang.Object
fr.gouv.vitam.functional.administration.core.archiveunitprofiles.ArchiveUnitProfileServiceImpl

All Implemented Interfaces:
  `VitamAutoCloseable`, `ArchiveUnitProfileService`, `AutoCloseable`

public class ArchiveUnitProfileServiceImpl extends Object implements ArchiveUnitProfileService
The implementation of the archive unit profile CRUD

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `ARCHIVE_UNIT_PROFILE_IDENTIFIER_ALREADY_EXISTS_IN_DATABASE`
  `static final String`
  `ARCHIVE_UNIT_PROFILE_IDENTIFIER_MUST_BE_STRING`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ArchiveUnitProfileServiceImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, FunctionalBackupService functionalBackupService)`
  Constructor
  `ArchiveUnitProfileServiceImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, FunctionalBackupService functionalBackupService, boolean checkOntology)`
  Constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `RequestResponse<ArchiveUnitProfileModel>`
  `createArchiveUnitProfiles(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 QueryDsl
  `ArchiveUnitProfileModel`
  `findByIdentifier(String id)`
  `RequestResponse<ArchiveUnitProfileModel>`
  `updateArchiveUnitProfile(String id, com.fasterxml.jackson.databind.JsonNode queryDsl)`
  Update an archive unit profile after passing validation steps : Field modified : - ActivationDate - DesactivationDate - LastUpdate - Status

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### ARCHIVE_UNIT_PROFILE_IDENTIFIER_ALREADY_EXISTS_IN_DATABASE

    public static final String ARCHIVE_UNIT_PROFILE_IDENTIFIER_ALREADY_EXISTS_IN_DATABASE
    See Also:
      - Constant Field Values

  - ### ARCHIVE_UNIT_PROFILE_IDENTIFIER_MUST_BE_STRING

    public static final String ARCHIVE_UNIT_PROFILE_IDENTIFIER_MUST_BE_STRING
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ArchiveUnitProfileServiceImpl

    public ArchiveUnitProfileServiceImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, FunctionalBackupService functionalBackupService)
    Constructor
    Parameters:
      `mongoAccess` - MongoDB client
      `vitamCounterService` - the vitam counter service
      `functionalBackupService` - the functional backup service

  - ### ArchiveUnitProfileServiceImpl

    public ArchiveUnitProfileServiceImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, FunctionalBackupService functionalBackupService, boolean checkOntology)
    Constructor
    Parameters:
      `mongoAccess` - MongoDB client
      `vitamCounterService` - the vitam counter service
      `functionalBackupService` - the functional backup service
      `checkOntology` - 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 interface `ArchiveUnitProfileService`
    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 interface `ArchiveUnitProfileService`
    Parameters:
      `queryDsl` - the query as a json to be executed
    Returns:
      list of ProfileModel
    Throws:
      `ReferentialException` - thrown if the query could not be executed
      `InvalidParseOperationException` - 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 interface `ArchiveUnitProfileService`
    Parameters:
      `id` - identifier of the archive unit profile to update
      `queryDsl` - 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 interface `AutoCloseable`
    Specified by:
      `close` in interface `VitamAutoCloseable`

  - ### findByIdentifier

    public ArchiveUnitProfileModel findByIdentifier(String id) throws ReferentialException, InvalidParseOperationException
    Throws:
      `ReferentialException`
      `InvalidParseOperationException`