java.lang.Object
eu.europa.esig.dss.validation.process.Chain<T>
Type Parameters:
T - the class used as result. The selected class must extend XmlConstraintsConclusion which contains some constraints and a conclusion.
Direct Known Subclasses:
AbstractAcceptanceValidation, AbstractBasicValidationProcess, AbstractCryptographicChecker, AbstractFormatChecking, CertificateQualificationBlock, CertificateRevocationSelector, CertQualificationAtTimeBlock, CryptographicVerification, IdentificationOfTheSigningCertificate, MessageImprintDigestAlgorithmValidation, PastCertificateValidation, PastSignatureValidation, RevocationAcceptanceChecker, RevocationFreshnessChecker, SignatureQualificationBlock, SubX509CertificateValidation, TimestampQualificationBlock, TLValidationBlock, ValidationContextInitialization, ValidationProcessForSignaturesWithArchivalData, ValidationProcessForSignaturesWithLongTermValidationData, ValidationTimeSliding, X509CertificateValidation

public abstract class Chain<T extends XmlConstraintsConclusion> extends Object
This class is part of the design pattern "Chain of responsibility". All sub-classes need to implement the method initChain() which will define the ChainItem (constraints) to execute. The chain is built as follows with the method ChainItem.setNextItem(eu.europa.esig.dss.validation.process.ChainItem<T>).
See Also:
  • Field Details

  • Constructor Details

    • Chain

      protected Chain(I18nProvider i18nProvider, T newInstance)
      Common constructor
      Parameters:
      i18nProvider - the access to translations
      newInstance - a new instance of the result object
  • Method Details

    • execute

      public T execute()
      This method allows initialization and execution of complete chain until the first failure.
      Returns:
      the complete result with constraints and final conclusion for the chain
    • buildChainTitle

      protected String buildChainTitle()
      Builds the chain title
      Returns:
      String chain title
    • getTitle

      protected MessageTag getTitle()
      Returns title of a Chain (i.e. BasicBuildingBlock title)
      Returns:
      MessageTag
    • addAdditionalInfo

      protected void addAdditionalInfo()
      Adds additional info to the chain
    • initChain

      protected abstract void initChain()
      Initializes the chain
    • isValid

      protected boolean isValid(XmlConstraintsConclusion constraintConclusion)
      Checks if the constraintConclusion has a successful validation result
      Parameters:
      constraintConclusion - XmlConstraintsConclusion
      Returns:
      TRUE if the conclusion is valid, 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
    • getFailLevelConstraint

      protected LevelConstraint getFailLevelConstraint()
      Returns the FAIL level constraint
      Returns:
      LevelConstraint
    • getWarnLevelConstraint

      protected LevelConstraint getWarnLevelConstraint()
      Returns the WARN level constraint
      Returns:
      LevelConstraint
    • getInfoLevelConstraint

      protected LevelConstraint getInfoLevelConstraint()
      Returns the INFO level constraint
      Returns:
      LevelConstraint
    • collectMessages

      protected void collectMessages(XmlConclusion conclusion, XmlConstraint constraint)
      Collects required messages from xmlConstraint to the given conclusion NOTE: bye default the only one error is already collected in the chain (no more possible), therefore no need to collect it again
      Parameters:
      conclusion - XmlConclusion to fill up
      constraint - XmlConstraint to extract messages from
    • collectAllMessages

      protected void collectAllMessages(XmlConclusion conclusionToFill, XmlConclusion conclusionToFillFrom)
      Fills all messages from conclusionToFillFrom into conclusionToFill
      Parameters:
      conclusionToFill - XmlConclusion to be filled
      conclusionToFillFrom - XmlConclusion to fill from
    • collectAdditionalMessages

      protected void collectAdditionalMessages(XmlConclusion conclusion)
      The method allows to fill up additional messages into the conclusion
      Parameters:
      conclusion - XmlConclusion to fill up