Package org.wildfly.security.auth.server
Class MechanismConfiguration.Builder
- java.lang.Object
-
- org.wildfly.security.auth.server.MechanismConfiguration.Builder
-
- Enclosing class:
- MechanismConfiguration
public static final class MechanismConfiguration.Builder extends Object
A builder for authentication mechanism configuration.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MechanismConfiguration.BuilderaddMechanismRealm(MechanismRealmConfiguration configuration)Adds a configuration for one of realms of this mechanism.MechanismConfigurationbuild()Build a new instance.MechanismConfiguration.BuildersetFinalRewriter(Function<Principal,Principal> finalRewriter)Set a final principal transformer to apply for this mechanism realm.MechanismConfiguration.BuildersetPostRealmRewriter(Function<Principal,Principal> postRealmRewriter)Set a principal transformer to apply after the realm is selected.MechanismConfiguration.BuildersetPreRealmRewriter(Function<Principal,Principal> preRealmRewriter)Set a principal transformer to apply before the realm is selected.MechanismConfiguration.BuildersetRealmMapper(RealmMapper realmMapper)Sets a realm mapper to be used by the mechanism.MechanismConfiguration.BuildersetServerCredential(Credential credential)Set a single server credential.MechanismConfiguration.BuildersetServerCredential(SecurityFactory<? extends Credential> credentialFactory)Set a single server credential factory.MechanismConfiguration.BuildersetServerCredentialSource(CredentialSource serverCredentialSource)Set the server credential source.
-
-
-
Method Detail
-
setPreRealmRewriter
public MechanismConfiguration.Builder setPreRealmRewriter(Function<Principal,Principal> preRealmRewriter)
Set a principal transformer to apply before the realm is selected.- Parameters:
preRealmRewriter- a principal transformer to apply before the realm is selected- Returns:
- this builder
-
setPostRealmRewriter
public MechanismConfiguration.Builder setPostRealmRewriter(Function<Principal,Principal> postRealmRewriter)
Set a principal transformer to apply after the realm is selected. Any previously set credential source will be overwritten.- Parameters:
postRealmRewriter- a principal transformer to apply after the realm is selected- Returns:
- this builder
-
setFinalRewriter
public MechanismConfiguration.Builder setFinalRewriter(Function<Principal,Principal> finalRewriter)
Set a final principal transformer to apply for this mechanism realm. Any previously set credential source will be overwritten.- Parameters:
finalRewriter- a final principal transformer to apply for this mechanism realm- Returns:
- this builder
-
setRealmMapper
public MechanismConfiguration.Builder setRealmMapper(RealmMapper realmMapper)
Sets a realm mapper to be used by the mechanism. Any previously set credential source will be overwritten.- Parameters:
realmMapper- a realm mapper to be used by the mechanism- Returns:
- this builder
-
addMechanismRealm
public MechanismConfiguration.Builder addMechanismRealm(MechanismRealmConfiguration configuration)
Adds a configuration for one of realms of this mechanism.- Parameters:
configuration- a configuration for one of realms of this mechanism- Returns:
- this builder
-
setServerCredential
public MechanismConfiguration.Builder setServerCredential(Credential credential)
Set a single server credential. Any previously set credential source will be overwritten.- Parameters:
credential- the credential to set (must not benull)- Returns:
- this builder
-
setServerCredential
public MechanismConfiguration.Builder setServerCredential(SecurityFactory<? extends Credential> credentialFactory)
Set a single server credential factory. Any previously set credential source will be overwritten.- Parameters:
credentialFactory- the credential factory to set (must not benull)- Returns:
- this builder
-
setServerCredentialSource
public MechanismConfiguration.Builder setServerCredentialSource(CredentialSource serverCredentialSource)
Set the server credential source. Any previously set credential source will be overwritten.- Parameters:
serverCredentialSource- the server credential source (must not benull)- Returns:
- this builder
-
build
public MechanismConfiguration build()
Build a new instance. If no mechanism realms are offered, an empty collection should be provided formechanismRealms; otherwise, if the mechanism only supports one realm, the first will be used. If the mechanism does not support realms,mechanismRealmsis ignored.- Returns:
- a new instance
-
-