Class GenericContractValidator.GenericRejectionCause
java.lang.Object
fr.gouv.vitam.functional.administration.core.contract.GenericContractValidator.GenericRejectionCause
- Enclosing interface:
- GenericContractValidator<T extends AbstractContractModel>
Generic Rejection Cause inner class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet ReasonrejectArchiveProfileNotFoundInDatabase
(String contractName) Verify for each contract that all archive profiles exists in databaserejectAuNotFoundInDatabase
(String linkParentId) Reject if the id of the AU is not in filing schemarejectDuplicatedInDatabase
(String contractName) Verify for each contract if already exists one in database that have the same name.rejectDuplicateVersionRetentionPolicyUsage
(String fieldName, String contractName) rejectExceptionOccurred
(String contractName, String msg, Throwable e) Generate RejectionCause from any throwablerejectExcludedAndRootUnitsNotFound
(String contractName, String guidArrayAsString) Generate RejectionCause for not found unit for given GUIDrejectExcludedRootUnitsNotFound
(String contractName, String guidArrayAsString) Generate RejectionCause for not found unit for given GUIDrejectFormatFileTypeNotFoundInDatabase
(String contractName) Verify for each contract that all archive profiles exists in databaserejectIdNotAllowedInCreate
(String contractName) Reject if id exisit and the action is creation.rejectInconsistentContract
(String contractName, String reason) rejectInvalidVersionRetentionPolicyParamOfUsage
(String fieldName, String UsageName, String contractName) Reject if versionRentionPolicy parameter is invalidrejectInvalidVersionRetentionPolicyUsage
(String fieldName, String contractName) rejectMandatoryMissing
(String fieldName) Reject if one of multiple mandatory parameter are nullrejectMCNotFoundInDatabase
(String managementContractID) Reject if the id of the MC is not in databaserejectRootUnitsNotFound
(String contractName, String guidArrayAsString) Generate RejectionCause for not found unit for given GUIDrejectStorageStrategyDoesNotContainsOneReferent
(String storageStrategy, String fieldName) Reject if storage strategy does not contains referentrejectStorageStrategyMissing
(String storageStrategy, String fieldName) Reject if storage strategy was not found
-
Constructor Details
-
GenericRejectionCause
Constructor- Parameters:
error
- the error
-
-
Method Details
-
rejectIdNotAllowedInCreate
public static GenericContractValidator.GenericRejectionCause rejectIdNotAllowedInCreate(String contractName) Reject if id exisit and the action is creation. If id exists, it should be an update instead of create- Parameters:
contractName
-- Returns:
- GenericRejectionCause
-
rejectAuNotFoundInDatabase
public static GenericContractValidator.GenericRejectionCause rejectAuNotFoundInDatabase(String linkParentId) Reject if the id of the AU is not in filing schema- Parameters:
linkParentId
-- Returns:
- GenericRejectionCause
-
rejectMCNotFoundInDatabase
public static GenericContractValidator.GenericRejectionCause rejectMCNotFoundInDatabase(String managementContractID) Reject if the id of the MC is not in database- Parameters:
managementContractID
-- Returns:
- GenericRejectionCause
-
rejectDuplicatedInDatabase
public static GenericContractValidator.GenericRejectionCause rejectDuplicatedInDatabase(String contractName) Verify for each contract if already exists one in database that have the same name. The database my manage this kind of constraint (by creating an unique index on the field or column)- Parameters:
contractName
-- Returns:
- GenericRejectionCause
-
rejectArchiveProfileNotFoundInDatabase
public static GenericContractValidator.GenericRejectionCause rejectArchiveProfileNotFoundInDatabase(String contractName) Verify for each contract that all archive profiles exists in database- Parameters:
contractName
-- Returns:
- GenericRejectionCause
-
rejectExceptionOccurred
public static GenericContractValidator.GenericRejectionCause rejectExceptionOccurred(String contractName, String msg, Throwable e) Generate RejectionCause from any throwable- Parameters:
contractName
- the contract name or identifiermsg
- custom messagee
- throwable- Returns:
- GenericRejectionCause
-
rejectRootUnitsNotFound
public static GenericContractValidator.GenericRejectionCause rejectRootUnitsNotFound(String contractName, String guidArrayAsString) Generate RejectionCause for not found unit for given GUID- Parameters:
contractName
- the contract name or identifierguidArrayAsString
- root units as string (guid array as string)- Returns:
- GenericRejectionCause
-
rejectExcludedRootUnitsNotFound
public static GenericContractValidator.GenericRejectionCause rejectExcludedRootUnitsNotFound(String contractName, String guidArrayAsString) Generate RejectionCause for not found unit for given GUID- Parameters:
contractName
- the contract name or identifierguidArrayAsString
- root units as string (guid array as string)- Returns:
- GenericRejectionCause
-
rejectExcludedAndRootUnitsNotFound
public static GenericContractValidator.GenericRejectionCause rejectExcludedAndRootUnitsNotFound(String contractName, String guidArrayAsString) Generate RejectionCause for not found unit for given GUID- Parameters:
contractName
- the contract name or identifierguidArrayAsString
- root units as string (guid array as string)- Returns:
- GenericRejectionCause
-
rejectMandatoryMissing
public static GenericContractValidator.GenericRejectionCause rejectMandatoryMissing(String fieldName) Reject if one of multiple mandatory parameter are null- Parameters:
fieldName
-- Returns:
- GenericRejectionCause
-
rejectFormatFileTypeNotFoundInDatabase
public static GenericContractValidator.GenericRejectionCause rejectFormatFileTypeNotFoundInDatabase(String contractName) Verify for each contract that all archive profiles exists in database- Parameters:
contractName
-- Returns:
- GenericRejectionCause
-
rejectInconsistentContract
public static GenericContractValidator.GenericRejectionCause rejectInconsistentContract(String contractName, String reason) -
rejectStorageStrategyMissing
public static GenericContractValidator.GenericRejectionCause rejectStorageStrategyMissing(String storageStrategy, String fieldName) Reject if storage strategy was not found- Parameters:
storageStrategy
-fieldName
-- Returns:
- GenericRejectionCause
-
rejectStorageStrategyDoesNotContainsOneReferent
public static GenericContractValidator.GenericRejectionCause rejectStorageStrategyDoesNotContainsOneReferent(String storageStrategy, String fieldName) Reject if storage strategy does not contains referent- Parameters:
storageStrategy
-fieldName
-- Returns:
- GenericRejectionCause
-
rejectInvalidVersionRetentionPolicyParamOfUsage
public static GenericContractValidator.GenericRejectionCause rejectInvalidVersionRetentionPolicyParamOfUsage(String fieldName, String UsageName, String contractName) Reject if versionRentionPolicy parameter is invalid- Parameters:
initialVersion
-fieldName
-- Returns:
- GenericRejectionCause
-
rejectInvalidVersionRetentionPolicyUsage
public static GenericContractValidator.GenericRejectionCause rejectInvalidVersionRetentionPolicyUsage(String fieldName, String contractName) -
rejectDuplicateVersionRetentionPolicyUsage
public static GenericContractValidator.GenericRejectionCause rejectDuplicateVersionRetentionPolicyUsage(String fieldName, String contractName) -
getReason
Get Reason- Returns:
- the reason
-