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

# Class GenericContractValidator.GenericRejectionCause

java.lang.Object
fr.gouv.vitam.functional.administration.core.contract.GenericContractValidator.GenericRejectionCause

Enclosing interface:
  `GenericContractValidator<T extends AbstractContractModel>`

public static class GenericContractValidator.GenericRejectionCause extends Object
Generic Rejection Cause inner class

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GenericRejectionCause(String error)`
  Constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getReason()`
  Get Reason
  `static GenericContractValidator.GenericRejectionCause`
  `rejectArchiveProfileNotFoundInDatabase(String contractName)`
  Verify for each contract that all archive profiles exists in database
  `static GenericContractValidator.GenericRejectionCause`
  `rejectAuNotFoundInDatabase(String linkParentId)`
  Reject if the id of the AU is not in filing schema
  `static GenericContractValidator.GenericRejectionCause`
  `rejectDuplicatedInDatabase(String contractName)`
  Verify for each contract if already exists one in database that have the same name.
  `static GenericContractValidator.GenericRejectionCause`
  `rejectDuplicateVersionRetentionPolicyUsage(String fieldName, String contractName)`
  `static GenericContractValidator.GenericRejectionCause`
  `rejectExceptionOccurred(String contractName, String msg, Throwable e)`
  Generate RejectionCause from any throwable
  `static GenericContractValidator.GenericRejectionCause`
  `rejectExcludedAndRootUnitsNotFound(String contractName, String guidArrayAsString)`
  Generate RejectionCause for not found unit for given GUID
  `static GenericContractValidator.GenericRejectionCause`
  `rejectExcludedRootUnitsNotFound(String contractName, String guidArrayAsString)`
  Generate RejectionCause for not found unit for given GUID
  `static GenericContractValidator.GenericRejectionCause`
  `rejectFormatFileTypeNotFoundInDatabase(String contractName)`
  Verify for each contract that all archive profiles exists in database
  `static GenericContractValidator.GenericRejectionCause`
  `rejectIdNotAllowedInCreate(String contractName)`
  Reject if id exisit and the action is creation.
  `static GenericContractValidator.GenericRejectionCause`
  `rejectInconsistentContract(String contractName, String reason)`
  `static GenericContractValidator.GenericRejectionCause`
  `rejectInvalidVersionRetentionPolicyParamOfUsage(String fieldName, String UsageName, String contractName)`
  Reject if versionRentionPolicy parameter is invalid
  `static GenericContractValidator.GenericRejectionCause`
  `rejectInvalidVersionRetentionPolicyUsage(String fieldName, String contractName)`
  `static GenericContractValidator.GenericRejectionCause`
  `rejectMandatoryMissing(String fieldName)`
  Reject if one of multiple mandatory parameter are null
  `static GenericContractValidator.GenericRejectionCause`
  `rejectMCNotFoundInDatabase(String managementContractID)`
  Reject if the id of the MC is not in database
  `static GenericContractValidator.GenericRejectionCause`
  `rejectRootUnitsNotFound(String contractName, String guidArrayAsString)`
  Generate RejectionCause for not found unit for given GUID
  `static GenericContractValidator.GenericRejectionCause`
  `rejectStorageStrategyDoesNotContainsOneReferent(String storageStrategy, String fieldName)`
  Reject if storage strategy does not contains referent
  `static GenericContractValidator.GenericRejectionCause`
  `rejectStorageStrategyMissing(String storageStrategy, String fieldName)`
  Reject if storage strategy was not found

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

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

- ## Constructor Details

  - ### GenericRejectionCause

    public GenericRejectionCause(String error)
    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 identifier
      `msg` - custom message
      `e` - 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 identifier
      `guidArrayAsString` - 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 identifier
      `guidArrayAsString` - 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 identifier
      `guidArrayAsString` - 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:
      `fieldName` -
      `initialVersion` -
    Returns:
      GenericRejectionCause

  - ### rejectInvalidVersionRetentionPolicyUsage

    public static GenericContractValidator.GenericRejectionCause rejectInvalidVersionRetentionPolicyUsage(String fieldName, String contractName)

  - ### rejectDuplicateVersionRetentionPolicyUsage

    public static GenericContractValidator.GenericRejectionCause rejectDuplicateVersionRetentionPolicyUsage(String fieldName, String contractName)

  - ### getReason

    public String getReason()
    Get Reason
    Returns:
      the reason