Class GenericContractValidator.GenericRejectionCause

    • Constructor Detail

      • GenericRejectionCause

        public GenericRejectionCause​(java.lang.String error)
        Constructor
        Parameters:
        error - the error
    • 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 identifier
        msg - custom message
        e - 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 identifier
        guidArrayAsString - 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 identifier
        guidArrayAsString - 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 identifier
        guidArrayAsString - 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
      • 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
      • rejectInvalidVersionRetentionPolicyParamOfUsage

        public static GenericContractValidator.GenericRejectionCause rejectInvalidVersionRetentionPolicyParamOfUsage​(java.lang.String fieldName,
                                                                                                                     java.lang.String UsageName,
                                                                                                                     java.lang.String contractName)
        Reject if versionRentionPolicy parameter is invalid
        Parameters:
        initialVersion -
        fieldName -
        Returns:
        GenericRejectionCause
      • getReason

        public java.lang.String getReason()
        Get Reason
        Returns:
        the reason