Class ProfileManager
java.lang.Object
fr.gouv.vitam.functional.administration.core.profile.ProfileManager
This class manage validation and log operation of profile service
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCheck if the profile identifier already exists in databaseValidate that profile have not a missing mandatory parameterSet a default value if nullvoid
logFatalError
(String eventType, String objectId, String errorsDetails) log fatal error (system or technical error)void
logStarted
(String eventType, String objectId) log start processvoid
logSuccess
(String eventType, String objectId, String message) log end success processvoid
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 vitamboolean
validateRNG
(File file, VitamError error) TODO 1.boolean
validateXSD
(File file, VitamError error) Just check if inputStream is xml valid
-
Field Details
-
EMPTY_REQUIRED_FIELD
- See Also:
-
WRONG_FIELD_FORMAT
- See Also:
-
DUPLICATE_IN_DATABASE
- See Also:
-
PROFILE_NOT_FOUND_IN_DATABASE
- See Also:
-
IMPORT_KO
- See Also:
-
UPDATE_PROFILE_NOT_FOUND
- See Also:
-
UPDATE_VALUE_NOT_IN_ENUM
- See Also:
-
UPDATE_DUPLICATE_IN_DATABASE
- See Also:
-
UPDATE_KO
- See Also:
-
-
Constructor Details
-
ProfileManager
-
-
Method Details
-
validateProfile
-
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
Just check if inputStream is xml valid- Parameters:
file
-error
-- Returns:
- boolean true/false
- Throws:
Exception
-
validateRNG
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
log start process- Throws:
VitamException
-
logSuccess
log end success process- Throws:
VitamException
-
createMandatoryParamsValidator
Validate that profile have not a missing mandatory parameter- Returns:
-
createWrongFieldFormatValidator
Set a default value if null- Returns:
-
createCheckDuplicateInDatabaseValidator
Check if the profile identifier already exists in database- Returns:
-