java.lang.Object
eu.europa.esig.dss.validation.process.ChainItem<T>
Type Parameters:
T - implementation of the block's conclusion
Direct Known Subclasses:
AbstractCryptographicCheck, AbstractCryptographicCheckerResultCheck, AbstractMultiValuesCheckItem, AbstractPastTokenValidationCheck, AbstractPdfLockDictionaryCheck, AbstractRevocationFreshCheck, AbstractTrustedListCheck, AbstractValueCheckItem, AcceptableBasicSignatureValidationCheck, AcceptableBasicTimestampValidationCheck, AcceptableBuildingBlockConclusionCheck, AcceptableRevocationDataAvailableCheck, AcceptableTrustedListPresenceCheck, AdESAcceptableCheck, AllCertificatesInPathReferencedCheck, AllFilesSignedCheck, AuthorityInfoAccessPresentCheck, BasicConstraintsCACheck, BasicConstraintsMaxPathLengthCheck, BasicTimestampValidationCheck, BasicValidationProcessCheck, BestSignatureTimeAfterCertificateIssuanceAndBeforeCertificateExpirationCheck, BestSignatureTimeBeforeCertificateExpirationCheck, BestSignatureTimeBeforeSuspensionTimeCheck, BestSignatureTimeNotBeforeCertificateIssuanceCheck, ByteRangeAllDocumentCheck, ByteRangeCheck, ByteRangeCollisionCheck, CaQcCheck, CertificateIssuedByConsistentByQCTrustServiceCheck, CertificateIssuedByConsistentByQSCDTrustServiceCheck, CertificateIssuedToLegalPersonCheck, CertificateIssuedToNaturalPersonCheck, CertificateMinQcEuRetentionPeriodCheck, CertificateMinQcTransactionLimitCheck, CertificateNameConstraintsCheck, CertificateNotOnHoldCheck, CertificateNotRevokedCheck, CertificateNotSelfSignedCheck, CertificatePolicyQualifiedIdsCheck, CertificatePolicySupportedByQSCDIdsCheck, CertificatePolicyTreeCheck, CertificateQcComplianceCheck, CertificateQcSSCDCheck, CertificateRevocationSelectorResultCheck, CertificateSelfSignedCheck, CertificateSignatureValidCheck, CertificateTypeAtSigningTimeCheck, CertificateTypeCheck, CertificateTypeCoverageCheck, CertificateValidityRangeCheck, CheckSubXCVResult, CommitmentTypeIndicationsCheck, ContentTimestampCheck, ContentTimestampsCheck, CounterSignatureCheck, CryptographicVerificationResultCheck, CurrentTimeIndicationCheck, DigestValueMatchCheck, DigestValuePresentCheck, DocMDPCheck, EllipticCurveKeySizeCheck, FormatCheckingResultCheck, FullScopeCheck, GrantedStatusAtProductionTimeCheck, GrantedStatusCheck, IdentificationOfSigningCertificateResultCheck, IdPkixOcspNoCheck, IsAbleToSelectOneTrustService, IsNoQualificationConflictDetectedCheck, IssuerSerialMatchCheck, KeyIdentifierMatchCheck, KeyIdentifierPresentCheck, LongTermValidationCheck, ManifestEntryExistenceCheck, ManifestFilePresentCheck, MessageDigestOrSignedPropertiesCheck, MessageImprintDigestAlgorithmValidationCheck, MimeTypeFilePresentCheck, MRACertificateEquivalenceApplied, NextUpdateCheck, PastCertificateValidationAcceptableCheck, PastRevocationDataValidationConclusiveCheck, PastValidationAcceptableRevocationDataAvailable, PDFAComplianceCheck, PdfAnnotationOverlapCheck, PdfPageDifferenceCheck, PdfSignatureDictionaryCheck, PdfVisualDifferenceCheck, POEExistsAtOrBeforeControlTimeCheck, POEExistsCheck, POEExistsWithinCertificateValidityRangeCheck, POENotAfterCARevocationTimeCheck, ProspectiveCertificateChainCheck, ProspectiveCertificateChainCheck, PseudoUsageCheck, QSCDCertificateAtSigningTimeCheck, QSCDCheck, QTSTCheck, QualifiedCertificateAtCertificateIssuanceCheck, QualifiedCertificateAtSigningTimeCheck, QualifiedCheck, ReferenceDataExistenceCheck, ReferenceDataIntactCheck, ReferencesNotAmbiguousCheck, RelatedToMraEnactedTrustServiceCheck, RevocationAcceptanceCheckerResultCheck, RevocationCertHashMatchCheck, RevocationCertHashPresenceCheck, RevocationConsistentCheck, RevocationDataAcceptableCheck, RevocationDataAvailableCheck, RevocationDataKnownCheck, RevocationDateAfterBestSignatureTimeCheck, RevocationFreshnessCheckerResultCheck, RevocationInfoAccessPresentCheck, RevocationIssuedBeforeControlTimeCheck, RevocationIssuerTrustedCheck, RevocationIssuerValidityRangeCheck, RevocationResponderIdMatchCheck, SelfIssuedOCSPCheck, SerialNumberCheck, ServiceConsistencyCheck, SignatureAcceptanceValidationResultCheck, SignatureAcceptanceValidationResultCheck, SignatureIntactCheck, SignatureNotAmbiguousCheck, SignaturePolicyHashValidCheck, SignaturePolicyIdentifiedCheck, SignaturePolicyStoreCheck, SignaturePolicyZeroHashCheck, SignedFilesPresentCheck, SignerInformationStoreCheck, SignerLocationCheck, SigningCertificateAttributePresentCheck, SigningCertificateNotRevokedCheck, SigningCertificateRecognitionCheck, SigningCertificateReferencesValidityCheck, SigningTimeAttributePresentCheck, SigningTimeCheck, StructuralValidationCheck, TimestampCoherenceOrderCheck, TimestampDelayCheck, TimestampGenerationTimeNotAfterCertificateExpirationCheck, TimestampGenerationTimeNotAfterCryptographicConstraintsExpirationCheck, TimestampGenerationTimeNotAfterRevocationTimeCheck, TimestampMessageImprintCheck, TLFreshnessCheck, TLMRACheck, TLNotExpiredCheck, TLVersionCheck, TLWellSignedCheck, TrustedCertificateMatchTrustServiceCheck, TrustedListReachedForCertificateChainCheck, TrustServiceAtTimeCheck, TrustServicesByCertificateTypeCheck, TSAGeneralNameFieldPresentCheck, TSAGeneralNameOrderMatchCheck, TSAGeneralNameValueMatchCheck, UndefinedChangesCheck, UnicitySigningCertificateAttributeCheck, ValidationContextInitializationResultCheck, ValidationTimeAtCertificateValidityRangeCheck, ValidationTimeSlidingCheck, ValidCAQCCheck, X509CertificateValidationResultCheck, ZipCommentPresentCheck

public abstract class ChainItem<T extends XmlConstraintsConclusion> extends Object
This class is an item of the Chain class. That follows the design pattern "chain of responsibility". Depending on the Level in LevelConstraint the Chain will continue/stop the current treatment. The ChainItem is a validation constraint which allows to collect information, warnings, errors,...
See Also:
  • Field Details

    • i18nProvider

      protected final I18nProvider i18nProvider
      i18nProvider
  • Constructor Details

    • ChainItem

      protected ChainItem(I18nProvider i18nProvider, T result, LevelConstraint constraint)
      Common constructor
      Parameters:
      i18nProvider - the I18nProvider internationalization provider
      result - the Chain object parent of this object
      constraint - the LevelConstraint to follow to execute this ChainItem
    • ChainItem

      protected ChainItem(I18nProvider i18nProvider, T result, LevelConstraint constraint, String bbbId)
      Specific constructor for Basic Building Blocks validation
      Parameters:
      i18nProvider - the I18nProvider internationalization provider
      result - the Chain object parent of this object
      constraint - the LevelConstraint to follow to execute this ChainItem
      bbbId - the XmlBasicBuildingBlocks's id
  • Method Details

    • setNextItem

      public ChainItem<T> setNextItem(ChainItem<T> nextItem)
      This method allows to build the chain of responsibility
      Parameters:
      nextItem - the next ChainItem to call if this one succeed
      Returns:
      the next item
    • execute

      public void execute()
      This method allows to execute the chain of responsibility. It will run all the chain until the first Level.FAIL and not valid process.
    • process

      protected abstract boolean process()
      Performs the check
      Returns:
      TRUE if the check succeeds, FALSE otherwise
    • getLevel

      protected Level getLevel()
      Returns an execution Level of the chain item
      Returns:
      Level
    • getMessageTag

      protected MessageTag getMessageTag()
      Returns an i18n key String of a message to get
      Returns:
      MessageTag key
    • getErrorMessageTag

      protected MessageTag getErrorMessageTag()
      Returns an i18n key String of an error message to get
      Returns:
      MessageTag key
    • getPreviousErrors

      protected List<XmlMessage> getPreviousErrors()
      Return a list of previous errors occurred in the chain
      Returns:
      a list of XmlMessages
    • getFailedIndicationForConclusion

      protected abstract Indication getFailedIndicationForConclusion()
      Gets an Indication in case of failure
      Returns:
      Indication
    • getFailedSubIndicationForConclusion

      protected abstract SubIndication getFailedSubIndicationForConclusion()
      Gets a SubIndication in case of failure
      Returns:
      SubIndication
    • buildErrorMessage

      protected XmlMessage buildErrorMessage()
      Builds an error message
      Returns:
      XmlMessage
    • buildConstraintMessage

      protected XmlMessage buildConstraintMessage()
      Builds a constraint message
      Returns:
      XmlMessage
    • getBlockType

      protected XmlBlockType getBlockType()
      Returns the validating block type (used for validation result of RAC, RFC, etc.)
      Returns:
      XmlBlockType
    • buildAdditionalInfo

      protected String buildAdditionalInfo()
      Builds an additional information
      Returns:
      String
    • getAdditionalInfo

      protected MessageTag getAdditionalInfo()
      Gets an additional information
      Returns:
      MessageTag
    • buildXmlMessage

      protected XmlMessage buildXmlMessage(MessageTag messageTag, Object... args)
      Builds the XmlMessage
      Parameters:
      messageTag - MessageTag
      args - arguments
      Returns:
      XmlMessage
    • getSuccessIndication

      protected Indication getSuccessIndication()
      Gets an Indication if the check succeeds
      Returns:
      Indication
    • getSuccessSubIndication

      protected SubIndication getSuccessSubIndication()
      Gets a SubIndication if the check succeeds
      Returns:
      SubIndication
    • isValid

      protected boolean isValid(XmlConstraintsConclusion constraintConclusion)
      Checks if the conclusion is valid
      Parameters:
      constraintConclusion - XmlConstraintsConclusion
      Returns:
      TRUE if the conclusion has a passed status, FALSE otherwise
    • isValidConclusion

      protected boolean isValidConclusion(XmlConclusion conclusion)
      Checks if the conclusion is valid
      Parameters:
      conclusion - XmlConclusion
      Returns:
      TRUE if the conclusion has a PASSED indication, FALSE otherwise
    • isInvalidConclusion

      protected boolean isInvalidConclusion(XmlConclusion conclusion)
      Checks if the conclusion is invalid
      Parameters:
      conclusion - XmlConclusion
      Returns:
      TRUE if the conclusion has a FAILED indication, FALSE otherwise
    • isIndeterminateConclusion

      protected boolean isIndeterminateConclusion(XmlConclusion conclusion)
      Checks if the conclusion is indeterminate
      Parameters:
      conclusion - XmlConclusion
      Returns:
      TRUE if the conclusion has a INDETERMINATE indication, FALSE otherwise