Package org.wildfly.security.auth.realm
Class CachingSecurityRealm
java.lang.Object
org.wildfly.security.auth.realm.CachingSecurityRealm
- All Implemented Interfaces:
SecurityRealm
- Direct Known Subclasses:
CachingModifiableSecurityRealm
A wrapper class that provides caching capabilities for a SecurityRealm and its identities.
- Author:
- Pedro Igor
-
Field Summary
Fields inherited from interface org.wildfly.security.auth.server.SecurityRealm
EMPTY_REALM -
Constructor Summary
ConstructorsConstructorDescriptionCachingSecurityRealm(SecurityRealm realm, RealmIdentityCache cache) Creates a new instance.CachingSecurityRealm(SecurityRealm realm, RealmIdentityCache cache, Supplier<Provider[]> providerSupplier) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected SecurityRealmGets wrapped backing realm.getCredentialAcquireSupport(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec) getEvidenceVerifySupport(Class<? extends Evidence> evidenceType, String algorithmName) getRealmIdentity(Principal principal) voidhandleRealmEvent(RealmEvent event) voidRemoves all cached identities from the cache.voidremoveFromCache(Principal principal) Removes aRealmIdentityreferenced by the specifiedPrincipalfrom the cache.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.wildfly.security.auth.server.SecurityRealm
getCredentialAcquireSupport, getRealmIdentity, getRealmIdentity
-
Constructor Details
-
CachingSecurityRealm
Creates a new instance.- Parameters:
realm- theSecurityRealmwhoseRealmIdentityshould be cached.cache- theRealmIdentityCacheinstance
-
CachingSecurityRealm
public CachingSecurityRealm(SecurityRealm realm, RealmIdentityCache cache, Supplier<Provider[]> providerSupplier) Creates a new instance.- Parameters:
realm- theSecurityRealmwhoseRealmIdentityshould be cached.cache- theRealmIdentityCacheinstanceproviderSupplier- the provider supplier to use for verification purposes (must not benull)
-
-
Method Details
-
getRealmIdentity
- Specified by:
getRealmIdentityin interfaceSecurityRealm- Throws:
RealmUnavailableException
-
getCredentialAcquireSupport
public SupportLevel getCredentialAcquireSupport(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec) throws RealmUnavailableException - Specified by:
getCredentialAcquireSupportin interfaceSecurityRealm- Throws:
RealmUnavailableException
-
getEvidenceVerifySupport
public SupportLevel getEvidenceVerifySupport(Class<? extends Evidence> evidenceType, String algorithmName) throws RealmUnavailableException - Specified by:
getEvidenceVerifySupportin interfaceSecurityRealm- Throws:
RealmUnavailableException
-
handleRealmEvent
- Specified by:
handleRealmEventin interfaceSecurityRealm
-
removeFromCache
Removes aRealmIdentityreferenced by the specifiedPrincipalfrom the cache.- Parameters:
principal- thePrincipalthat references a previously cached realm identity
-
removeAllFromCache
public void removeAllFromCache()Removes all cached identities from the cache. -
getCacheableRealm
Gets wrapped backing realm.- Returns:
- the wrapped backing realm
-