class DuplicateAuthnRequestValidator {

    public boolean valid(String requestId) {
        AuthnRequestIdKey key = new AuthnRequestIdKey(requestId);

        if (previousRequests.contains(key) && previousRequests.getExpiration(key).isAfterNow()) {
            return false;
        }
        DateTime expire = DateTime.now().plus(expirationDuration);
        previousRequests.setExpiration(key, expire);
        return true;
    }

    @Inject public  DuplicateAuthnRequestValidator(IdExpirationCache<AuthnRequestIdKey> previousRequests, SamlDuplicateRequestValidationConfiguration samlDuplicateRequestValidationConfiguration);

}