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
ModifiableSecurityRealm
and 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 ModifiableSecurityRealm
getModifiableSecurityRealm()
ModifiableRealmIdentity
getRealmIdentityForUpdate(Principal principal)
Get an update handle for to the identity for the given principal in the context of this security realm.ModifiableRealmIdentityIterator
getRealmIdentityIterator()
Get an iterator over all of this realm's identities.private ModifiableRealmIdentity
wrap(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
- theCacheableSecurityRealm
whoseRealmIdentity
should be cached.cache
- theRealmIdentityCache
instance
-
CachingModifiableSecurityRealm
public CachingModifiableSecurityRealm(CacheableSecurityRealm realm, RealmIdentityCache cache, Supplier<Provider[]> providerSupplier)
Creates a new instance.- Parameters:
realm
- theCacheableSecurityRealm
whoseRealmIdentity
should be cached.cache
- theRealmIdentityCache
instanceproviderSupplier
- 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:ModifiableSecurityRealm
Get 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_EXISTENT
may be returned.- Specified by:
getRealmIdentityForUpdate
in interfaceModifiableSecurityRealm
- Parameters:
principal
- the principal to use to locate theModifiableRealmIdentity
handle (must not benull
)- Returns:
- the
ModifiableRealmIdentity
for the provided information (notnull
) - Throws:
RealmUnavailableException
-
getRealmIdentityIterator
public ModifiableRealmIdentityIterator getRealmIdentityIterator() throws RealmUnavailableException
Description copied from interface:ModifiableSecurityRealm
Get an iterator over all of this realm's identities.- Specified by:
getRealmIdentityIterator
in interfaceModifiableSecurityRealm
- Returns:
- the identity iterator
- Throws:
RealmUnavailableException
- if the realm fails for some reason
-
wrap
private ModifiableRealmIdentity wrap(ModifiableRealmIdentity modifiable)
-
getModifiableSecurityRealm
private ModifiableSecurityRealm getModifiableSecurityRealm()
-
-