Class Chain<T extends XmlConstraintsConclusion>
java.lang.Object
eu.europa.esig.dss.validation.process.Chain<T>
- Type Parameters:
T
- the class used as result. The selected class must extendXmlConstraintsConclusion
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
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 Summary
Modifier and TypeFieldDescriptionThe first item to execute the chainprotected final I18nProvider
Internationalization providerprotected final T
The result object : a sub-class ofXmlConstraintsConclusion
-
Constructor Summary
ModifierConstructorDescriptionprotected
Chain
(I18nProvider i18nProvider, T newInstance) Common constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Adds additional info to the chainprotected String
Builds the chain titleprotected void
collectAdditionalMessages
(XmlConclusion conclusion) The method allows to fill up additional messages into the conclusionprotected void
collectAllMessages
(XmlConclusion conclusionToFill, XmlConclusion conclusionToFillFrom) Fills all messages fromconclusionToFillFrom
intoconclusionToFill
protected void
collectMessages
(XmlConclusion conclusion, XmlConstraint constraint) Collects required messages fromxmlConstraint
to the givenconclusion
NOTE: bye default the only one error is already collected in the chain (no more possible), therefore no need to collect it againexecute()
This method allows initialization and execution of complete chain until the first failure.protected LevelConstraint
Returns the FAIL level constraintprotected LevelConstraint
Returns the INFO level constraintprotected MessageTag
getTitle()
Returns title of a Chain (i.e.protected LevelConstraint
Returns the WARN level constraintprotected abstract void
Initializes the chainprotected boolean
isValid
(XmlConstraintsConclusion constraintConclusion) Checks if theconstraintConclusion
has a successful validation resultprotected boolean
isValidConclusion
(XmlConclusion conclusion) Checks if the conclusion is valid
-
Field Details
-
result
The result object : a sub-class ofXmlConstraintsConclusion
-
i18nProvider
Internationalization provider -
firstItem
The first item to execute the chain
-
-
Constructor Details
-
Chain
Common constructor- Parameters:
i18nProvider
- the access to translationsnewInstance
- a new instance of the result object
-
-
Method Details
-
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
Builds the chain title- Returns:
String
chain title
-
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
Checks if theconstraintConclusion
has a successful validation result- Parameters:
constraintConclusion
-XmlConstraintsConclusion
- Returns:
- TRUE if the conclusion is valid, FALSE otherwise
-
isValidConclusion
Checks if the conclusion is valid- Parameters:
conclusion
-XmlConclusion
- Returns:
- TRUE if the conclusion has a PASSED Indication, FALSE otherwise
-
getFailLevelConstraint
Returns the FAIL level constraint- Returns:
LevelConstraint
-
getWarnLevelConstraint
Returns the WARN level constraint- Returns:
LevelConstraint
-
getInfoLevelConstraint
Returns the INFO level constraint- Returns:
LevelConstraint
-
collectMessages
Collects required messages fromxmlConstraint
to the givenconclusion
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 upconstraint
-XmlConstraint
to extract messages from
-
collectAllMessages
protected void collectAllMessages(XmlConclusion conclusionToFill, XmlConclusion conclusionToFillFrom) Fills all messages fromconclusionToFillFrom
intoconclusionToFill
- Parameters:
conclusionToFill
-XmlConclusion
to be filledconclusionToFillFrom
-XmlConclusion
to fill from
-
collectAdditionalMessages
The method allows to fill up additional messages into the conclusion- Parameters:
conclusion
-XmlConclusion
to fill up
-