Package org.wildfly.security.auth.realm
Class FailoverSecurityRealm
- java.lang.Object
-
- org.wildfly.security.auth.realm.FailoverSecurityRealm
-
- All Implemented Interfaces:
SecurityRealm
public class FailoverSecurityRealm extends Object implements SecurityRealm
A realm which wraps one realm and fails over to another in case the first is unavailable.- Author:
- Martin Mazanek
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classFailoverSecurityRealm.FailoverRealmIdentity
-
Field Summary
Fields Modifier and Type Field Description protected SecurityRealmdelegateRealmprotected Consumer<RealmUnavailableException>failoverCallbackprotected SecurityRealmfailoverRealm-
Fields inherited from interface org.wildfly.security.auth.server.SecurityRealm
EMPTY_REALM
-
-
Constructor Summary
Constructors Constructor Description FailoverSecurityRealm(SecurityRealm delegateRealm, SecurityRealm failoverRealm, Consumer<RealmUnavailableException> failoverCallback)Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected RealmIdentitycreateFailoverIdentity(RealmIdentity identity, Principal principal)protected RealmIdentitycreateFailoverIdentity(RealmIdentity identity, Evidence evidence)SupportLevelgetCredentialAcquireSupport(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec)SupportLevelgetEvidenceVerifySupport(Class<? extends Evidence> evidenceType, String algorithmName)RealmIdentitygetRealmIdentity(Principal principal)RealmIdentitygetRealmIdentity(Evidence evidence)-
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.SecurityRealm
getCredentialAcquireSupport, getRealmIdentity, handleRealmEvent
-
-
-
-
Field Detail
-
delegateRealm
protected final SecurityRealm delegateRealm
-
failoverRealm
protected final SecurityRealm failoverRealm
-
failoverCallback
protected final Consumer<RealmUnavailableException> failoverCallback
-
-
Constructor Detail
-
FailoverSecurityRealm
public FailoverSecurityRealm(SecurityRealm delegateRealm, SecurityRealm failoverRealm, Consumer<RealmUnavailableException> failoverCallback)
Construct a new instance.- Parameters:
delegateRealm- the wrapped realmfailoverRealm- the realm to use in case delegateRealm is unavailablefailoverCallback- callback function that gets called in case delegateRealm is unavailable
-
-
Method Detail
-
getRealmIdentity
public RealmIdentity getRealmIdentity(Evidence evidence) throws RealmUnavailableException
- Specified by:
getRealmIdentityin interfaceSecurityRealm- Throws:
RealmUnavailableException
-
getRealmIdentity
public RealmIdentity getRealmIdentity(Principal principal) throws RealmUnavailableException
- 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
-
createFailoverIdentity
protected RealmIdentity createFailoverIdentity(RealmIdentity identity, Evidence evidence)
-
createFailoverIdentity
protected RealmIdentity createFailoverIdentity(RealmIdentity identity, Principal principal)
-
-