Class GenericContractValidator.GenericRejectionCause
- java.lang.Object
-
- fr.gouv.vitam.functional.administration.contract.core.GenericContractValidator.GenericRejectionCause
-
- Enclosing interface:
- GenericContractValidator<T extends AbstractContractModel>
public static class GenericContractValidator.GenericRejectionCause extends java.lang.Object
Generic Rejection Cause inner class
-
-
Constructor Summary
Constructors Constructor Description GenericRejectionCause(java.lang.String error)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getReason()
Get Reasonstatic GenericContractValidator.GenericRejectionCause
rejectArchiveProfileNotFoundInDatabase(java.lang.String contractName)
Verify for each contract that all archive profiles exists in databasestatic GenericContractValidator.GenericRejectionCause
rejectAuNotFoundInDatabase(java.lang.String linkParentId)
Reject if the id of the AU is not in filing schemastatic GenericContractValidator.GenericRejectionCause
rejectDuplicatedInDatabase(java.lang.String contractName)
Verify for each contract if already exists one in database that have the same name.static GenericContractValidator.GenericRejectionCause
rejectExceptionOccurred(java.lang.String contractName, java.lang.String msg, java.lang.Throwable e)
Generate RejectionCause from any throwablestatic GenericContractValidator.GenericRejectionCause
rejectExcludedAndRootUnitsNotFound(java.lang.String contractName, java.lang.String guidArrayAsString)
Generate RejectionCause for not found unit for given GUIDstatic GenericContractValidator.GenericRejectionCause
rejectExcludedRootUnitsNotFound(java.lang.String contractName, java.lang.String guidArrayAsString)
Generate RejectionCause for not found unit for given GUIDstatic GenericContractValidator.GenericRejectionCause
rejectFormatFileTypeNotFoundInDatabase(java.lang.String contractName)
Verify for each contract that all archive profiles exists in databasestatic GenericContractValidator.GenericRejectionCause
rejectIdNotAllowedInCreate(java.lang.String contractName)
Reject if id exisit and the action is creation.static GenericContractValidator.GenericRejectionCause
rejectInconsistentContract(java.lang.String contractName, java.lang.String reason)
static GenericContractValidator.GenericRejectionCause
rejectMandatoryMissing(java.lang.String fieldName)
Reject if one of multiple mandatory parameter are nullstatic GenericContractValidator.GenericRejectionCause
rejectMCNotFoundInDatabase(java.lang.String managementContractID)
Reject if the id of the MC is not in databasestatic GenericContractValidator.GenericRejectionCause
rejectRootUnitsNotFound(java.lang.String contractName, java.lang.String guidArrayAsString)
Generate RejectionCause for not found unit for given GUIDstatic GenericContractValidator.GenericRejectionCause
rejectStorageStrategyDoesNotContainsOneReferent(java.lang.String storageStrategy, java.lang.String fieldName)
Reject if storage strategy does not contains referentstatic GenericContractValidator.GenericRejectionCause
rejectStorageStrategyMissing(java.lang.String storageStrategy, java.lang.String fieldName)
Reject if storage strategy was not found
-
-
-
Method Detail
-
rejectIdNotAllowedInCreate
public static GenericContractValidator.GenericRejectionCause rejectIdNotAllowedInCreate(java.lang.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(java.lang.String linkParentId)
Reject if the id of the AU is not in filing schema- Parameters:
linkParentId
-- Returns:
- GenericRejectionCause
-
rejectMCNotFoundInDatabase
public static GenericContractValidator.GenericRejectionCause rejectMCNotFoundInDatabase(java.lang.String managementContractID)
Reject if the id of the MC is not in database- Parameters:
managementContractID
-- Returns:
- GenericRejectionCause
-
rejectDuplicatedInDatabase
public static GenericContractValidator.GenericRejectionCause rejectDuplicatedInDatabase(java.lang.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(java.lang.String contractName)
Verify for each contract that all archive profiles exists in database- Parameters:
contractName
-- Returns:
- GenericRejectionCause
-
rejectExceptionOccurred
public static GenericContractValidator.GenericRejectionCause rejectExceptionOccurred(java.lang.String contractName, java.lang.String msg, java.lang.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(java.lang.String contractName, java.lang.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(java.lang.String contractName, java.lang.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(java.lang.String contractName, java.lang.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(java.lang.String fieldName)
Reject if one of multiple mandatory parameter are null- Parameters:
fieldName
-- Returns:
- GenericRejectionCause
-
rejectFormatFileTypeNotFoundInDatabase
public static GenericContractValidator.GenericRejectionCause rejectFormatFileTypeNotFoundInDatabase(java.lang.String contractName)
Verify for each contract that all archive profiles exists in database- Parameters:
contractName
-- Returns:
- GenericRejectionCause
-
rejectInconsistentContract
public static GenericContractValidator.GenericRejectionCause rejectInconsistentContract(java.lang.String contractName, java.lang.String reason)
-
rejectStorageStrategyMissing
public static GenericContractValidator.GenericRejectionCause rejectStorageStrategyMissing(java.lang.String storageStrategy, java.lang.String fieldName)
Reject if storage strategy was not found- Parameters:
storageStrategy
-fieldName
-- Returns:
- GenericRejectionCause
-
rejectStorageStrategyDoesNotContainsOneReferent
public static GenericContractValidator.GenericRejectionCause rejectStorageStrategyDoesNotContainsOneReferent(java.lang.String storageStrategy, java.lang.String fieldName)
Reject if storage strategy does not contains referent- Parameters:
storageStrategy
-fieldName
-- Returns:
- GenericRejectionCause
-
getReason
public java.lang.String getReason()
Get Reason- Returns:
- the reason
-
-