Class AbstractObjectValidator<T extends XMLObject>
- java.lang.Object
-
- se.litsec.opensaml.common.validation.AbstractObjectValidator<T>
-
- All Implemented Interfaces:
ObjectValidator<T>
- Direct Known Subclasses:
AbstractSignableObjectValidator
public abstract class AbstractObjectValidator<T extends XMLObject> extends Object implements ObjectValidator<T>
Abstract base class forObjectValidator
.Supports the following
ValidationContext
static parameters:CoreValidatorParameters.STRICT_VALIDATION
: Optional. If not supplied, defaults to 'false'. Tells whether strict validation should be performed.CoreValidatorParameters.ALLOWED_CLOCK_SKEW
: Optional. Gives the number of milliseconds that is the maximum allowed clock skew. If not givenDEFAULT_ALLOWED_CLOCK_SKEW
is used.CoreValidatorParameters.MAX_AGE_MESSAGE
: Optional. Gives the maximum age (difference between issuance time and the validation time). If not given, theDEFAULT_MAX_AGE_RECEIVED_MESSAGE
is used.
- Author:
- Martin Lindström (martin.lindstrom@litsec.se)
-
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_ALLOWED_CLOCK_SKEW
The default allowed clock skew - 30000L milliseconds.static long
DEFAULT_MAX_AGE_RECEIVED_MESSAGE
The default value for how old a received message is allowed to be - 180000L milliseconds.
-
Constructor Summary
Constructors Constructor Description AbstractObjectValidator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static long
getAllowedClockSkew(ValidationContext context)
Returns the number of milliseconds that is the maximum allowed clock skew that we accept when comparing time stamps.static long
getMaxAgeReceivedMessage(ValidationContext context)
Returns the number of milliseconds that a received message (or element) is allowed to less than the current time.static long
getReceiveInstant(ValidationContext context)
Returns the timestamp (milliseconds since epoch) for when the message being validated was received.static boolean
isStrictValidation(ValidationContext context)
Tells whether this validator runs in "strict" mode.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface se.litsec.opensaml.common.validation.ObjectValidator
validate
-
-
-
-
Field Detail
-
DEFAULT_ALLOWED_CLOCK_SKEW
public static final long DEFAULT_ALLOWED_CLOCK_SKEW
The default allowed clock skew - 30000L milliseconds.- See Also:
- Constant Field Values
-
DEFAULT_MAX_AGE_RECEIVED_MESSAGE
public static final long DEFAULT_MAX_AGE_RECEIVED_MESSAGE
The default value for how old a received message is allowed to be - 180000L milliseconds.- See Also:
- Constant Field Values
-
-
Method Detail
-
isStrictValidation
public static boolean isStrictValidation(ValidationContext context)
Tells whether this validator runs in "strict" mode. This value is read from the static validation context parameterCoreValidatorParameters.STRICT_VALIDATION
. If this parameter is not availablefalse
is returned.- Parameters:
context
- the validation context- Returns:
true
for strict mode, andfalse
otherwise
-
getAllowedClockSkew
public static long getAllowedClockSkew(ValidationContext context)
Returns the number of milliseconds that is the maximum allowed clock skew that we accept when comparing time stamps. The value is read from the static validation context parameterCoreValidatorParameters.ALLOWED_CLOCK_SKEW
. If this parameter is not available,DEFAULT_ALLOWED_CLOCK_SKEW
is used.- Parameters:
context
- the validation context- Returns:
- the number of milliseconds that is the maximum allowed clock skew
-
getMaxAgeReceivedMessage
public static long getMaxAgeReceivedMessage(ValidationContext context)
Returns the number of milliseconds that a received message (or element) is allowed to less than the current time. The value is read from the static validation context parameterCoreValidatorParameters.MAX_AGE_MESSAGE
. If this parameter is not available,DEFAULT_MAX_AGE_RECEIVED_MESSAGE
is used.- Parameters:
context
- the validation context- Returns:
- the maximum number of milliseconds that may have elapsed since the issuance of a message and validation of it
-
getReceiveInstant
public static long getReceiveInstant(ValidationContext context)
Returns the timestamp (milliseconds since epoch) for when the message being validated was received. The value is read fromCoreValidatorParameters.RECEIVE_INSTANT
. If the parameter is not available the current time is returned.- Parameters:
context
- the validation context.- Returns:
- the timestamp for when the message being validated was received
-
-