/** {@inheritDoc} */ @Nonnull public ValidationResult validate(@Nonnull final Condition condition, @Nonnull final Assertion assertion, @Nonnull final ValidationContext context) throws AssertionValidationException { if (!(condition instanceof OneTimeUse) && !Objects.equals(condition.getElementQName(), getServicedCondition())) { log.warn("Condition '{}' of type '{}' in assertion '{}' was not an '{}' condition. Unable to process.", new Object[] { condition.getElementQName(), condition.getSchemaType(), assertion.getID(), getServicedCondition(), }); return ValidationResult.INDETERMINATE; } if (!replayCache.check(CACHE_CONTEXT, getCacheValue(assertion), getExpires(assertion, context))) { context.setValidationFailureMessage(String.format( "Assertion '%s' has a one time use condition and has been used before", assertion.getID())); return ValidationResult.INVALID; } return ValidationResult.VALID; }
getLogPrefix(), messageId, issueInstant, entityID); if (!getReplayCache().check(getClass().getName(), messageId, issueInstant.getMillis() + expires)) { log.warn("{} Replay detected of message '{}' from issuer '{}'", getLogPrefix(), messageId, entityID); throw new MessageHandlerException("Rejecting replayed message ID '" + messageId + "' from issuer "