Class ArchiveUnitProfileManager
- java.lang.Object
-
- fr.gouv.vitam.functional.administration.archiveunitprofiles.core.ArchiveUnitProfileManager
-
public class ArchiveUnitProfileManager extends java.lang.Object
This class manage validation and log operation of profile service
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DUPLICATE_IN_DATABASE
static java.lang.String
EMPTY_REQUIRED_FIELD
static java.lang.String
IMPORT_KO
static java.lang.String
INVALID_JSON_SCHEMA
static java.lang.String
UPDATE_AUP_NOT_FOUND
static java.lang.String
UPDATE_DUPLICATE_IN_DATABASE
static java.lang.String
UPDATE_KO
static java.lang.String
UPDATE_VALUE_NOT_IN_ENUM
static java.lang.String
WRONG_FIELD_FORMAT
-
Constructor Summary
Constructors Constructor Description ArchiveUnitProfileManager(LogbookOperationsClient logbookClient, MetaDataClient metaDataClient, GUID eip)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArchiveUnitProfileValidator
checkEmptyIdentifierSlaveModeValidator()
Check if the Id of the archive unit profile is emptyArchiveUnitProfileValidator
createCheckDuplicateInDatabaseValidator()
Check if the profile identifier already exists in databaseArchiveUnitProfileValidator
createCheckUsedJsonSchema()
Check if the ArchiveUnitProfile is used in a ArchiveUnitArchiveUnitProfileValidator
createJsonSchemaValidator()
Check if the archive unit ControlSchema property is a valid jon schema .ArchiveUnitProfileValidator
createMandatoryParamsValidator()
Validate that profile have not a missing mandatory parameterArchiveUnitProfileValidator
createWrongFieldFormatValidator()
Set a default value if null and check for wrong data type/format/value for fieldsvoid
logFatalError(java.lang.String eventType, java.lang.String objectId, java.lang.String errorsDetails)
log fatal error (system or technical error)void
logStarted(java.lang.String eventType, java.lang.String objectId)
log start processvoid
logSuccess(java.lang.String eventType, java.lang.String objectId, java.lang.String message)
log end success processvoid
logValidationError(java.lang.String eventType, java.lang.String objectId, java.lang.String errorsDetails, java.lang.String KOEventType)
Log validation error (business error)boolean
validateArchiveUnitProfile(ArchiveUnitProfileModel profile, VitamError error)
-
-
-
Field Detail
-
EMPTY_REQUIRED_FIELD
public static final java.lang.String EMPTY_REQUIRED_FIELD
- See Also:
- Constant Field Values
-
WRONG_FIELD_FORMAT
public static final java.lang.String WRONG_FIELD_FORMAT
- See Also:
- Constant Field Values
-
DUPLICATE_IN_DATABASE
public static final java.lang.String DUPLICATE_IN_DATABASE
- See Also:
- Constant Field Values
-
INVALID_JSON_SCHEMA
public static final java.lang.String INVALID_JSON_SCHEMA
- See Also:
- Constant Field Values
-
IMPORT_KO
public static final java.lang.String IMPORT_KO
- See Also:
- Constant Field Values
-
UPDATE_AUP_NOT_FOUND
public static final java.lang.String UPDATE_AUP_NOT_FOUND
- See Also:
- Constant Field Values
-
UPDATE_VALUE_NOT_IN_ENUM
public static final java.lang.String UPDATE_VALUE_NOT_IN_ENUM
- See Also:
- Constant Field Values
-
UPDATE_DUPLICATE_IN_DATABASE
public static final java.lang.String UPDATE_DUPLICATE_IN_DATABASE
- See Also:
- Constant Field Values
-
UPDATE_KO
public static final java.lang.String UPDATE_KO
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ArchiveUnitProfileManager
public ArchiveUnitProfileManager(LogbookOperationsClient logbookClient, MetaDataClient metaDataClient, GUID eip)
-
-
Method Detail
-
validateArchiveUnitProfile
public boolean validateArchiveUnitProfile(ArchiveUnitProfileModel profile, VitamError error)
-
logValidationError
public void logValidationError(java.lang.String eventType, java.lang.String objectId, java.lang.String errorsDetails, java.lang.String KOEventType) throws VitamException
Log validation error (business error)- Parameters:
errorsDetails
-- Throws:
VitamException
-
logFatalError
public void logFatalError(java.lang.String eventType, java.lang.String objectId, java.lang.String errorsDetails) throws VitamException
log fatal error (system or technical error)- Parameters:
errorsDetails
-- Throws:
VitamException
-
logStarted
public void logStarted(java.lang.String eventType, java.lang.String objectId) throws VitamException
log start process- Throws:
VitamException
-
logSuccess
public void logSuccess(java.lang.String eventType, java.lang.String objectId, java.lang.String message) throws VitamException
log end success process- Throws:
VitamException
-
createMandatoryParamsValidator
public ArchiveUnitProfileValidator createMandatoryParamsValidator()
Validate that profile have not a missing mandatory parameter- Returns:
-
createWrongFieldFormatValidator
public ArchiveUnitProfileValidator createWrongFieldFormatValidator()
Set a default value if null and check for wrong data type/format/value for fields- Returns:
- the validator with thrown errors
-
checkEmptyIdentifierSlaveModeValidator
public ArchiveUnitProfileValidator checkEmptyIdentifierSlaveModeValidator()
Check if the Id of the archive unit profile is empty- Returns:
-
createCheckDuplicateInDatabaseValidator
public ArchiveUnitProfileValidator createCheckDuplicateInDatabaseValidator()
Check if the profile identifier already exists in database- Returns:
-
createJsonSchemaValidator
public ArchiveUnitProfileValidator createJsonSchemaValidator()
Check if the archive unit ControlSchema property is a valid jon schema .- Returns:
-
createCheckUsedJsonSchema
public ArchiveUnitProfileValidator createCheckUsedJsonSchema()
Check if the ArchiveUnitProfile is used in a ArchiveUnit- Returns:
-
-