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

# Class ProfileManager

java.lang.Object
fr.gouv.vitam.functional.administration.core.profile.ProfileManager

public class ProfileManager extends Object
This class manage validation and log operation of profile service

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `DUPLICATE_IN_DATABASE`
  `static final String`
  `EMPTY_REQUIRED_FIELD`
  `static final String`
  `IMPORT_KO`
  `static final String`
  `PROFILE_NOT_FOUND_IN_DATABASE`
  `static final String`
  `UPDATE_DUPLICATE_IN_DATABASE`
  `static final String`
  `UPDATE_KO`
  `static final String`
  `UPDATE_PROFILE_NOT_FOUND`
  `static final String`
  `UPDATE_VALUE_NOT_IN_ENUM`
  `static final String`
  `WRONG_FIELD_FORMAT`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ProfileManager(LogbookOperationsClient logbookClient, GUID eip)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ProfileValidator`
  `createCheckDuplicateInDatabaseValidator()`
  Check if the profile identifier already exists in database
  `ProfileValidator`
  `createMandatoryParamsValidator()`
  Validate that profile have not a missing mandatory parameter
  `ProfileValidator`
  `createWrongFieldFormatValidator()`
  Set a default value if null
  `void`
  `logFatalError(String eventType, String objectId, String errorsDetails)`
  log fatal error (system or technical error)
  `void`
  `logStarted(String eventType, String objectId)`
  log start process
  `void`
  `logSuccess(String eventType, String objectId, String message)`
  log end success process
  `void`
  `logValidationError(String eventType, String objectId, String errorsDetails, String eventTypeKO)`
  Log validation error (business error)
  `boolean`
  `validateProfile(ProfileModel profile, VitamError error)`
  `boolean`
  `validateProfileFile(ProfileModel profileModel, File file, VitamError error)`
  Validate if the profile file is valide XSD => is file xsd is xml valide RNG => if file rng is xml valide, rng valide, check default values if already exists in vitam
  `boolean`
  `validateRNG(File file, VitamError error)`
  TODO 1.
  `boolean`
  `validateXSD(File file, VitamError error)`
  Just check if inputStream is xml valid

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

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

- ## Field Details

  - ### EMPTY_REQUIRED_FIELD

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

  - ### WRONG_FIELD_FORMAT

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

  - ### DUPLICATE_IN_DATABASE

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

  - ### PROFILE_NOT_FOUND_IN_DATABASE

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

  - ### IMPORT_KO

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

  - ### UPDATE_PROFILE_NOT_FOUND

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

  - ### UPDATE_VALUE_NOT_IN_ENUM

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

  - ### UPDATE_DUPLICATE_IN_DATABASE

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

  - ### UPDATE_KO

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

- ## Constructor Details

  - ### ProfileManager

    public ProfileManager(LogbookOperationsClient logbookClient, GUID eip)

- ## Method Details

  - ### validateProfile

    public boolean validateProfile(ProfileModel profile, VitamError error)

  - ### validateProfileFile

    public boolean validateProfileFile(ProfileModel profileModel, File file, VitamError error) throws Exception
    Validate if the profile file is valide XSD => is file xsd is xml valide RNG => if file rng is xml valide, rng valide, check default values if already exists in vitam
    Parameters:
      `profileModel` -
      `file` -
      `error` -
    Returns:
      boolean true/false
    Throws:
      `Exception`

  - ### validateXSD

    public boolean validateXSD(File file, VitamError error) throws Exception
    Just check if inputStream is xml valid
    Parameters:
      `file` -
      `error` -
    Returns:
      boolean true/false
    Throws:
      `Exception`

  - ### validateRNG

    public boolean validateRNG(File file, VitamError error) throws Exception
    TODO 1. Validate if rng is xml valide, 2. Validate if rng is rng valide 3. Validate if data in rng is valide
    Parameters:
      `file` -
      `error` -
    Returns:
      boolean true/false
    Throws:
      `Exception`

  - ### logValidationError

    public void logValidationError(String eventType, String objectId, String errorsDetails, String eventTypeKO) throws VitamException
    Log validation error (business error)
    Parameters:
      `eventType` -
      `objectId` -
      `errorsDetails` -
      `eventTypeKO` -
    Throws:
      `VitamException`

  - ### logFatalError

    public void logFatalError(String eventType, String objectId, String errorsDetails) throws VitamException
    log fatal error (system or technical error)
    Parameters:
      `errorsDetails` -
    Throws:
      `VitamException`

  - ### logStarted

    public void logStarted(String eventType, String objectId) throws VitamException
    log start process
    Throws:
      `VitamException`

  - ### logSuccess

    public void logSuccess(String eventType, String objectId, String message) throws VitamException
    log end success process
    Throws:
      `VitamException`

  - ### createMandatoryParamsValidator

    public ProfileValidator createMandatoryParamsValidator()
    Validate that profile have not a missing mandatory parameter
    Returns:

  - ### createWrongFieldFormatValidator

    public ProfileValidator createWrongFieldFormatValidator()
    Set a default value if null
    Returns:

  - ### createCheckDuplicateInDatabaseValidator

    public ProfileValidator createCheckDuplicateInDatabaseValidator()
    Check if the profile identifier already exists in database
    Returns: