Class Chain<T extends eu.europa.esig.dss.detailedreport.jaxb.XmlConstraintsConclusion>

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, AbstractAlgorithmCryptographicChecker, AbstractBasicValidationProcess, AbstractFormatChecking, AbstractQWACValidationProcessBlock, AlgorithmObsolescenceValidation, CertificateQualificationBlock, CertificateRevocationSelector, CertQualificationAtTimeBlock, CryptographicVerification, EvidenceRecordValidationProcess, IdentificationOfTheSigningCertificate, PastCertificateValidation, PastSignatureValidation, QWACForTLSBindingCertificateValidationBlock, QWACForTLSCertificateValidationBlock, RevocationAcceptanceChecker, RevocationFreshnessChecker, SignatureQualificationBlock, SubX509CertificateValidation, TimestampQualificationAtTimeBlock, TimestampQualificationBlock, TLSCertificateSupportedByQWAC2ValidationProcessBlock, TLValidationBlock, ValidationContextInitialization, ValidationProcessForSignaturesWithArchivalData, ValidationProcessForSignaturesWithLongTermValidationData, ValidationProcessForTimestampsWithArchivalData, ValidationTimeSliding, X509CertificateValidation

public abstract class Chain<T extends eu.europa.esig.dss.detailedreport.jaxb.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(ChainItem).
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected ChainItem<T>
    The first item to execute the chain
    protected final eu.europa.esig.dss.i18n.I18nProvider
    Internationalization provider
    protected final T
    The result object : a sub-class of XmlConstraintsConclusion
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Chain(eu.europa.esig.dss.i18n.I18nProvider i18nProvider, T newInstance)
    Common constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Adds additional info to the chain
    protected String
    Builds the chain title
    protected void
    collectAdditionalMessages(eu.europa.esig.dss.detailedreport.jaxb.XmlConclusion conclusion)
    The method allows to fill up additional messages into the conclusion
    protected void
    collectAllMessages(eu.europa.esig.dss.detailedreport.jaxb.XmlConclusion conclusionToFill, eu.europa.esig.dss.detailedreport.jaxb.XmlConclusion conclusionToFillFrom)
    Fills all messages from conclusionToFillFrom into conclusionToFill
    protected void
    collectMessages(eu.europa.esig.dss.detailedreport.jaxb.XmlConclusion conclusion, eu.europa.esig.dss.detailedreport.jaxb.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
    This method allows initialization and execution of complete chain until the first failure.
    protected eu.europa.esig.dss.model.policy.LevelRule
    Returns the FAIL level constraint
    protected eu.europa.esig.dss.model.policy.LevelRule
    Returns the INFO level constraint
    protected eu.europa.esig.dss.i18n.MessageTag
    Returns title of a Chain (i.e.
    protected eu.europa.esig.dss.model.policy.LevelRule
    Returns the WARN level constraint
    protected abstract void
    Initializes the chain
    protected boolean
    isValid(eu.europa.esig.dss.detailedreport.jaxb.XmlConstraintsConclusion constraintConclusion)
    Checks if the constraintConclusion has a successful validation result
    protected boolean
    isValidConclusion(eu.europa.esig.dss.detailedreport.jaxb.XmlConclusion conclusion)
    Checks if the conclusion is valid

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • result

      protected final T extends eu.europa.esig.dss.detailedreport.jaxb.XmlConstraintsConclusion result
      The result object : a sub-class of XmlConstraintsConclusion
    • i18nProvider

      protected final eu.europa.esig.dss.i18n.I18nProvider i18nProvider
      Internationalization provider
    • firstItem

      protected ChainItem<T extends eu.europa.esig.dss.detailedreport.jaxb.XmlConstraintsConclusion> firstItem
      The first item to execute the chain
  • Constructor Details

    • Chain

      protected Chain(eu.europa.esig.dss.i18n.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 eu.europa.esig.dss.i18n.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(eu.europa.esig.dss.detailedreport.jaxb.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(eu.europa.esig.dss.detailedreport.jaxb.XmlConclusion conclusion)
      Checks if the conclusion is valid
      Parameters:
      conclusion - XmlConclusion
      Returns:
      TRUE if the conclusion has a PASSED Indication, FALSE otherwise
    • getFailLevelRule

      protected eu.europa.esig.dss.model.policy.LevelRule getFailLevelRule()
      Returns the FAIL level constraint
      Returns:
      LevelRule
    • getWarnLevelRule

      protected eu.europa.esig.dss.model.policy.LevelRule getWarnLevelRule()
      Returns the WARN level constraint
      Returns:
      LevelRule
    • getInfoLevelRule

      protected eu.europa.esig.dss.model.policy.LevelRule getInfoLevelRule()
      Returns the INFO level constraint
      Returns:
      LevelRule
    • collectMessages

      protected void collectMessages(eu.europa.esig.dss.detailedreport.jaxb.XmlConclusion conclusion, eu.europa.esig.dss.detailedreport.jaxb.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(eu.europa.esig.dss.detailedreport.jaxb.XmlConclusion conclusionToFill, eu.europa.esig.dss.detailedreport.jaxb.XmlConclusion conclusionToFillFrom)
      Fills all messages from conclusionToFillFrom into conclusionToFill
      Parameters:
      conclusionToFill - XmlConclusion to be filled
      conclusionToFillFrom - XmlConclusion to fill from
    • collectAdditionalMessages

      protected void collectAdditionalMessages(eu.europa.esig.dss.detailedreport.jaxb.XmlConclusion conclusion)
      The method allows to fill up additional messages into the conclusion
      Parameters:
      conclusion - XmlConclusion to fill up