/** * Determine whether a credential of the given type is present in this set. * * @param credentialType the credential type class (must not be {@code null}) * @return {@code true} if a matching credential is contained in this set, {@code false} otherwise */ public final boolean contains(Class<? extends Credential> credentialType) { return contains(credentialType, null); }
@Override public final SupportLevel getCredentialAcquireSupport(final Class<? extends Credential> credentialType, final String algorithmName) { return contains(credentialType, algorithmName) ? SupportLevel.SUPPORTED : SupportLevel.UNSUPPORTED; }
@Override public final SupportLevel getCredentialAcquireSupport(final Class<? extends Credential> credentialType) { return contains(credentialType) ? SupportLevel.SUPPORTED : SupportLevel.UNSUPPORTED; }
@Override public final SupportLevel getCredentialAcquireSupport(final Class<? extends Credential> credentialType, final String algorithmName, final AlgorithmParameterSpec parameterSpec) { return contains(credentialType, algorithmName, parameterSpec) ? SupportLevel.SUPPORTED : SupportLevel.UNSUPPORTED; }
/** * Determine whether a credential of the given type and algorithm are present in this set. * * @param credentialType the credential type class (must not be {@code null}) * @param algorithmName the algorithm name, or {@code null} if any algorithm is acceptable or the credential type * does not support algorithm names * @return {@code true} if a matching credential is contained in this set, {@code false} otherwise */ public final boolean contains(Class<? extends Credential> credentialType, String algorithmName) { Assert.checkNotNullParam("credentialType", credentialType); return contains(credentialType, algorithmName, null); }
/** * Determine whether a credential of the type, algorithm, and parameters of the given credential is present in this set. * * @param credential the credential to check against (must not be {@code null}) * @return {@code true} if a matching credential is contained in this set, {@code false} otherwise */ public final boolean containsMatching(Credential credential) { Assert.checkNotNullParam("credential", credential); if (credential instanceof AlgorithmCredential) { final AlgorithmCredential algorithmCredential = (AlgorithmCredential) credential; return contains(credential.getClass(), algorithmCredential.getAlgorithm(), algorithmCredential.getParameters()); } else { return contains(credential.getClass(), null, null); } }
@Override public SupportLevel getCredentialAcquireSupport(Class<? extends Credential> credentialType, String algorithmName, final AlgorithmParameterSpec parameterSpec) throws RealmUnavailableException { if (credentials.contains(credentialType, algorithmName, parameterSpec)) { if (log.isTraceEnabled()) { log.tracef("getCredentialAcquireSupport credentialType='%s' with algorithmName='%' known for pincipal='%s'", credentialType.getName(), algorithmName, principal.getName()); } return credentials.getCredentialAcquireSupport(credentialType, algorithmName, parameterSpec); } Credential credential = identity.getCredential(credentialType, algorithmName, parameterSpec); if (credential != null) { if (log.isTraceEnabled()) { log.tracef("getCredentialAcquireSupport Credential for credentialType='%s' with algorithmName='%' obtained from identity - caching for principal='%s'", credentialType.getName(), algorithmName, principal.getName()); } credentials = credentials.withCredential(credential); } return credentials.getCredentialAcquireSupport(credentialType, algorithmName, parameterSpec); }
@Override public <C extends Credential> C getCredential(Class<C> credentialType) throws RealmUnavailableException { if (credentials.contains(credentialType)) { if (log.isTraceEnabled()) { log.tracef("getCredential credentialType='%s' cached, returning cached credential for principal='%s'", credentialType.getName(), principal.getName()); } return credentials.getCredential(credentialType); } Credential credential = identity.getCredential(credentialType); if (credential != null) { if (log.isTraceEnabled()) { log.tracef("getCredential credentialType='%s' obtained from identity - caching for principal='%s'", credentialType.getName(), principal.getName()); } credentials = credentials.withCredential(credential); } return credentials.getCredential(credentialType); }
@Override public <C extends Credential> C getCredential(final Class<C> credentialType, final String algorithmName, final AlgorithmParameterSpec parameterSpec) throws RealmUnavailableException { if (credentials.contains(credentialType, algorithmName, parameterSpec)) { if (log.isTraceEnabled()) { log.tracef("getCredential credentialType='%s' with algorithmName='%' cached, returning cached credential for principal='%s'", credentialType.getName(), algorithmName, principal.getName()); } return credentials.getCredential(credentialType, algorithmName, parameterSpec); } Credential credential = identity.getCredential(credentialType, algorithmName, parameterSpec); if (credential != null) { if (log.isTraceEnabled()) { log.tracef("getCredential credentialType='%s' with algorithmName='%' obtained from identity - caching for principal='%s'", credentialType.getName(), algorithmName, principal.getName()); } credentials = credentials.withCredential(credential); } return credentials.getCredential(credentialType, algorithmName, parameterSpec); }
@Override public <C extends Credential> C getCredential(Class<C> credentialType, String algorithmName) throws RealmUnavailableException { if (credentials.contains(credentialType, algorithmName)) { if (log.isTraceEnabled()) { log.tracef("getCredential credentialType='%s' with algorithmName='%' cached, returning cached credential for principal='%s'", credentialType.getName(), algorithmName, principal.getName()); } return credentials.getCredential(credentialType, algorithmName); } Credential credential = identity.getCredential(credentialType, algorithmName); if (credential != null) { if (log.isTraceEnabled()) { log.tracef("getCredential credentialType='%s' with algorithmName='%' obtained from identity - caching.", credentialType.getName(), algorithmName); } credentials = credentials.withCredential(credential); } return credentials.getCredential(credentialType, algorithmName); }
/** * Determine whether a credential of the given type is present in this set. * * @param credentialType the credential type class (must not be {@code null}) * @return {@code true} if a matching credential is contained in this set, {@code false} otherwise */ public final boolean contains(Class<? extends Credential> credentialType) { return contains(credentialType, null); }
/** * Determine whether a credential of the given type is present in this set. * * @param credentialType the credential type class (must not be {@code null}) * @return {@code true} if a matching credential is contained in this set, {@code false} otherwise */ public final boolean contains(Class<? extends Credential> credentialType) { return contains(credentialType, null); }
/** * Determine whether a credential of the given type is present in this set. * * @param credentialType the credential type class (must not be {@code null}) * @return {@code true} if a matching credential is contained in this set, {@code false} otherwise */ public final boolean contains(Class<? extends Credential> credentialType) { return contains(credentialType, null); }
@Override public final SupportLevel getCredentialAcquireSupport(final Class<? extends Credential> credentialType) { return contains(credentialType) ? SupportLevel.SUPPORTED : SupportLevel.UNSUPPORTED; }
@Override public final SupportLevel getCredentialAcquireSupport(final Class<? extends Credential> credentialType, final String algorithmName) { return contains(credentialType, algorithmName) ? SupportLevel.SUPPORTED : SupportLevel.UNSUPPORTED; }
@Override public final SupportLevel getCredentialAcquireSupport(final Class<? extends Credential> credentialType, final String algorithmName, final AlgorithmParameterSpec parameterSpec) { return contains(credentialType, algorithmName, parameterSpec) ? SupportLevel.SUPPORTED : SupportLevel.UNSUPPORTED; }
@Override public final SupportLevel getCredentialAcquireSupport(final Class<? extends Credential> credentialType) { return contains(credentialType) ? SupportLevel.SUPPORTED : SupportLevel.UNSUPPORTED; }
/** * Determine whether a credential of the given type and algorithm are present in this set. * * @param credentialType the credential type class (must not be {@code null}) * @param algorithmName the algorithm name, or {@code null} if any algorithm is acceptable or the credential type * does not support algorithm names * @return {@code true} if a matching credential is contained in this set, {@code false} otherwise */ public final boolean contains(Class<? extends Credential> credentialType, String algorithmName) { Assert.checkNotNullParam("credentialType", credentialType); return contains(credentialType, algorithmName, null); }
/** * Determine whether a credential of the given type and algorithm are present in this set. * * @param credentialType the credential type class (must not be {@code null}) * @param algorithmName the algorithm name, or {@code null} if any algorithm is acceptable or the credential type * does not support algorithm names * @return {@code true} if a matching credential is contained in this set, {@code false} otherwise */ public final boolean contains(Class<? extends Credential> credentialType, String algorithmName) { Assert.checkNotNullParam("credentialType", credentialType); return contains(credentialType, algorithmName, null); }
/** * Determine whether a credential of the given type and algorithm are present in this set. * * @param credentialType the credential type class (must not be {@code null}) * @param algorithmName the algorithm name, or {@code null} if any algorithm is acceptable or the credential type * does not support algorithm names * @return {@code true} if a matching credential is contained in this set, {@code false} otherwise */ public final boolean contains(Class<? extends Credential> credentialType, String algorithmName) { Assert.checkNotNullParam("credentialType", credentialType); return contains(credentialType, algorithmName, null); }