Class AbstractValidationParametersBuilder<T extends AbstractValidationParametersBuilder<T>>
java.lang.Object
se.swedenconnect.opensaml.common.validation.AbstractValidationParametersBuilder<T>
- All Implemented Interfaces:
ValidationParametersBuilder
- Direct Known Subclasses:
AbstractResponseValidationParametersBuilder
public abstract class AbstractValidationParametersBuilder<T extends AbstractValidationParametersBuilder<T>>
extends Object
implements ValidationParametersBuilder
Abstract base class for building the
ValidationContext
object using a builder pattern. These settings are
parameters that control the validation of an object.- Author:
- Martin Lindström (martin@idsec.se)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
addDynamicParameter
(String name, Object value) Adds a dynamic validation parameter.final void
addDynamicParameters
(Map<String, Object> pars) Adds dynamic validation parameters.final void
addStaticParameter
(String name, Object value) Adds a static validation parameter.final void
addStaticParameterIfMissing
(String name, Object value) Adds a static validation parameter if it is not set yet.final void
addStaticParameters
(Map<String, Object> pars) Adds static validation parameters.allowedClockSkew
(long millis) Gives the number of milliseconds that is the maximum allowed clock skew when verifying time stamps.allowedClockSkew
(Duration skew) Gives the duration that is the maximum allowed clock skew when verifying time stamps.org.opensaml.saml.common.assertion.ValidationContext
build()
Builds aValidationContext
object.dynamicParameter
(String name, Object value) Generic method that adds a dynamic validation parameter.protected final Object
getDynamicParameter
(String name) Gets a dynamic parameter.protected final Object
getStaticParameter
(String name) Gets a static parameter.protected abstract T
getThis()
Returns 'this' object.maxAgeReceivedMessage
(long millis) Gives the maximum age (difference between issuance time and the validation time) that a received message is allowed to have.maxAgeReceivedMessage
(Duration maxAge) Gives the maximum age (difference between issuance time and the validation time) that a received message is allowed to have.receiveInstant
(long instant) Sets the receive instant (i.e., when a message being validated was received).receiveInstant
(Instant instant) Sets the receive instant (i.e., when a message being validated was received).signatureRequired
(boolean required) Tells whether we require an object being validated to be signed.signatureValidationCriteriaSet
(net.shibboleth.shared.resolver.CriteriaSet criteriaSet) Gives the trust basis criteria set to use when verifying signatures (SignatureTrustEngine.validate
).staticParameter
(String name, Object value) Generic method that adds a static validation parameter.strictValidation
(boolean flag) Tells whether strict validation should be performed.
-
Constructor Details
-
AbstractValidationParametersBuilder
public AbstractValidationParametersBuilder()
-
-
Method Details
-
build
public org.opensaml.saml.common.assertion.ValidationContext build()Builds aValidationContext
object.- Specified by:
build
in interfaceValidationParametersBuilder
- Returns:
- the ValidationContext object
-
staticParameter
Generic method that adds a static validation parameter.- Parameters:
name
- the parameter namevalue
- the parameter value- Returns:
- the builder
-
dynamicParameter
Generic method that adds a dynamic validation parameter.- Parameters:
name
- the parameter namevalue
- the parameter value- Returns:
- the builder
-
strictValidation
Tells whether strict validation should be performed.- Parameters:
flag
- true/false- Returns:
- the builder
-
allowedClockSkew
Gives the duration that is the maximum allowed clock skew when verifying time stamps.- Parameters:
skew
- duration- Returns:
- the builder
-
allowedClockSkew
Gives the number of milliseconds that is the maximum allowed clock skew when verifying time stamps.- Parameters:
millis
- number of milliseconds- Returns:
- the builder
-
maxAgeReceivedMessage
Gives the maximum age (difference between issuance time and the validation time) that a received message is allowed to have.- Parameters:
maxAge
- maximum allowed age on messages- Returns:
- the builder
-
maxAgeReceivedMessage
Gives the maximum age (difference between issuance time and the validation time) that a received message is allowed to have.- Parameters:
millis
- number of milliseconds- Returns:
- the builder
-
receiveInstant
Sets the receive instant (i.e., when a message being validated was received).- Parameters:
instant
- the receive instant- Returns:
- the builder
-
receiveInstant
Sets the receive instant (i.e., when a message being validated was received).- Parameters:
instant
- the receive instant- Returns:
- the builder
-
signatureRequired
Tells whether we require an object being validated to be signed.- Parameters:
required
- true/false- Returns:
- the builder
-
getThis
Returns 'this' object.- Returns:
- this object (the concrete builder}
-
addStaticParameter
Adds a static validation parameter.- Parameters:
name
- the name of the parametervalue
- the value of the parameter
-
addStaticParameterIfMissing
Adds a static validation parameter if it is not set yet.- Parameters:
name
- the name of the parametervalue
- the value of the parameter
-
addStaticParameters
Adds static validation parameters.- Parameters:
pars
- static validation parameters
-
addDynamicParameter
Adds a dynamic validation parameter.- Parameters:
name
- the name of the parametervalue
- the value of the parameter
-
addDynamicParameters
Adds dynamic validation parameters.- Parameters:
pars
- dynamic validation parameters
-
getStaticParameter
Gets a static parameter.- Parameters:
name
- the parameter name- Returns:
- the value or null
-
getDynamicParameter
Gets a dynamic parameter.- Parameters:
name
- the parameter name- Returns:
- the value or null
-