Package org.wildfly.security.auth.realm
Class CachingModifiableSecurityRealm
- java.lang.Object
-
- org.wildfly.security.auth.realm.CachingSecurityRealm
-
- org.wildfly.security.auth.realm.CachingModifiableSecurityRealm
-
- All Implemented Interfaces:
ModifiableSecurityRealm,SecurityRealm
public class CachingModifiableSecurityRealm extends CachingSecurityRealm implements ModifiableSecurityRealm
A wrapper class that provides caching capabilities for a
ModifiableSecurityRealmand its identities.- Author:
- Pedro Igor
-
-
Field Summary
-
Fields inherited from interface org.wildfly.security.auth.server.SecurityRealm
EMPTY_REALM
-
-
Constructor Summary
Constructors Constructor Description CachingModifiableSecurityRealm(CacheableSecurityRealm realm, RealmIdentityCache cache)Creates a new instance.CachingModifiableSecurityRealm(CacheableSecurityRealm realm, RealmIdentityCache cache, Supplier<Provider[]> providerSupplier)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private ModifiableSecurityRealmgetModifiableSecurityRealm()ModifiableRealmIdentitygetRealmIdentityForUpdate(Principal principal)Get an update handle for to the identity for the given principal in the context of this security realm.ModifiableRealmIdentityIteratorgetRealmIdentityIterator()Get an iterator over all of this realm's identities.private ModifiableRealmIdentitywrap(ModifiableRealmIdentity modifiable)-
Methods inherited from class org.wildfly.security.auth.realm.CachingSecurityRealm
getCacheableRealm, getCredentialAcquireSupport, getEvidenceVerifySupport, getRealmIdentity, handleRealmEvent, removeAllFromCache, removeFromCache
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.wildfly.security.auth.server.ModifiableSecurityRealm
getRealmIdentityForUpdate
-
Methods inherited from interface org.wildfly.security.auth.server.SecurityRealm
getCredentialAcquireSupport, getCredentialAcquireSupport, getEvidenceVerifySupport, getRealmIdentity, getRealmIdentity, getRealmIdentity, handleRealmEvent
-
-
-
-
Constructor Detail
-
CachingModifiableSecurityRealm
public CachingModifiableSecurityRealm(CacheableSecurityRealm realm, RealmIdentityCache cache)
Creates a new instance.- Parameters:
realm- theCacheableSecurityRealmwhoseRealmIdentityshould be cached.cache- theRealmIdentityCacheinstance
-
CachingModifiableSecurityRealm
public CachingModifiableSecurityRealm(CacheableSecurityRealm realm, RealmIdentityCache cache, Supplier<Provider[]> providerSupplier)
Creates a new instance.- Parameters:
realm- theCacheableSecurityRealmwhoseRealmIdentityshould be cached.cache- theRealmIdentityCacheinstanceproviderSupplier- the provider supplier to use for verification purposes (must not benull)
-
-
Method Detail
-
getRealmIdentityForUpdate
public ModifiableRealmIdentity getRealmIdentityForUpdate(Principal principal) throws RealmUnavailableException
Description copied from interface:ModifiableSecurityRealmGet an update handle for to the identity for the given principal in the context of this security realm. Any validation / name mapping is an implementation detail for the realm. The identity may or may not exist. The returned handle must be cleaned up by a call toRealmIdentity.dispose(). During the lifespan of aModifiableRealmIdentity, no other updates or authentications may take place for the corresponding realm identity, thus care should be taken to minimize the duration of the identity's lifespan.If there is not enough information to locate an identity compatible with this realm,
ModifiableRealmIdentity.NON_EXISTENTmay be returned.- Specified by:
getRealmIdentityForUpdatein interfaceModifiableSecurityRealm- Parameters:
principal- the principal to use to locate theModifiableRealmIdentityhandle (must not benull)- Returns:
- the
ModifiableRealmIdentityfor the provided information (notnull) - Throws:
RealmUnavailableException
-
getRealmIdentityIterator
public ModifiableRealmIdentityIterator getRealmIdentityIterator() throws RealmUnavailableException
Description copied from interface:ModifiableSecurityRealmGet an iterator over all of this realm's identities.- Specified by:
getRealmIdentityIteratorin interfaceModifiableSecurityRealm- Returns:
- the identity iterator
- Throws:
RealmUnavailableException- if the realm fails for some reason
-
wrap
private ModifiableRealmIdentity wrap(ModifiableRealmIdentity modifiable)
-
getModifiableSecurityRealm
private ModifiableSecurityRealm getModifiableSecurityRealm()
-
-