Package org.wildfly.security.auth.server
Class SecurityDomain.Builder
- java.lang.Object
- 
- org.wildfly.security.auth.server.SecurityDomain.Builder
 
- 
- Enclosing class:
- SecurityDomain
 
 public static final class SecurityDomain.Builder extends Object A builder for creating new security domains.
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description SecurityDomain.RealmBuilderaddRealm(String name, SecurityRealm realm)Add a realm to this security domain.SecurityDomainbuild()Construct this security domain.Map<String,RoleMapper>getCategoryRoleMappers()Get the category role mapper map.StringgetDefaultRealmName()Get the default realm name.voidsetCategoryRoleMappers(Map<String,RoleMapper> categoryRoleMappers)Set the category role mapper map.SecurityDomain.BuildersetDefaultRealmName(String defaultRealmName)Set the default realm name.SecurityDomain.BuildersetEvidenceDecoder(EvidenceDecoder evidenceDecoder)Set the evidence decoder for this security domain which will be used to extract the principal from the givenEvidence.SecurityDomain.BuildersetPermissionMapper(PermissionMapper permissionMapper)Set the permission mapper for this security domain, which will be used to obtain and map permissions based on the identities from this security domain.SecurityDomain.BuildersetPostRealmRewriter(Function<Principal,Principal> rewriter)Sets a post-realm name rewriter, which rewrites the authentication name after a realm is selected.SecurityDomain.BuildersetPostRealmRewriter(NameRewriter rewriter)Sets a post-realm name rewriter, which rewrites the authentication name after a realm is selected.SecurityDomain.BuildersetPreRealmRewriter(Function<Principal,Principal> rewriter)Sets a pre-realm name rewriter, which rewrites the authentication name before a realm is selected.SecurityDomain.BuildersetPreRealmRewriter(NameRewriter rewriter)Sets a pre-realm name rewriter, which rewrites the authentication name before a realm is selected.SecurityDomain.BuildersetPrincipalDecoder(PrincipalDecoder principalDecoder)Set the principal decoder for this security domain, which will be used to convertPrincipalobjects into names for handling in the realm.SecurityDomain.BuildersetRealmMapper(RealmMapper realmMapper)Set the realm mapper for this security domain, which selects a realm based on the authentication name.SecurityDomain.BuildersetRoleDecoder(RoleDecoder roleDecoder)Set the role decoder for this security domain.SecurityDomain.BuildersetRoleMapper(RoleMapper roleMapper)Set the role mapper for this security domain, which will be used to perform the last mapping before returning the roles associated with an identity obtained from this security domain.SecurityDomain.BuildersetSecurityEventListener(Consumer<SecurityEvent> securityEventListener)Set the security event listener that will consume allSecurityEventinstances emitted but the domain.SecurityDomain.BuildersetSecurityIdentityTransformer(UnaryOperator<SecurityIdentity> securityIdentityTransformer)Set the security identity transformer to use.SecurityDomain.BuildersetTrustedSecurityDomainPredicate(Predicate<SecurityDomain> trustedSecurityDomain)Set the predicate that should be used to determine if a given domain is trusted by this domain.
 
- 
- 
- 
Method Detail- 
setPreRealmRewriterpublic SecurityDomain.Builder setPreRealmRewriter(NameRewriter rewriter) Sets a pre-realm name rewriter, which rewrites the authentication name before a realm is selected.- Parameters:
- rewriter- the name rewriter (must not be- null)
- Returns:
- this builder
 
 - 
setPreRealmRewriterpublic SecurityDomain.Builder setPreRealmRewriter(Function<Principal,Principal> rewriter) Sets a pre-realm name rewriter, which rewrites the authentication name before a realm is selected.- Parameters:
- rewriter- the name rewriter (must not be- null)
- Returns:
- this builder
 
 - 
setPostRealmRewriterpublic SecurityDomain.Builder setPostRealmRewriter(NameRewriter rewriter) Sets a post-realm name rewriter, which rewrites the authentication name after a realm is selected.- Parameters:
- rewriter- the name rewriter (must not be- null)
- Returns:
- this builder
 
 - 
setPostRealmRewriterpublic SecurityDomain.Builder setPostRealmRewriter(Function<Principal,Principal> rewriter) Sets a post-realm name rewriter, which rewrites the authentication name after a realm is selected.- Parameters:
- rewriter- the name rewriter (must not be- null)
- Returns:
- this builder
 
 - 
setRealmMapperpublic SecurityDomain.Builder setRealmMapper(RealmMapper realmMapper) Set the realm mapper for this security domain, which selects a realm based on the authentication name.- Parameters:
- realmMapper- the realm mapper (must not be- null)
- Returns:
- this builder
 
 - 
setRoleMapperpublic SecurityDomain.Builder setRoleMapper(RoleMapper roleMapper) Set the role mapper for this security domain, which will be used to perform the last mapping before returning the roles associated with an identity obtained from this security domain.- Parameters:
- roleMapper- the role mapper (must not be- null)
- Returns:
- this builder
 
 - 
setPermissionMapperpublic SecurityDomain.Builder setPermissionMapper(PermissionMapper permissionMapper) Set the permission mapper for this security domain, which will be used to obtain and map permissions based on the identities from this security domain.- Parameters:
- permissionMapper- the permission mapper (must not be- null)
- Returns:
- this builder
 
 - 
setPrincipalDecoderpublic SecurityDomain.Builder setPrincipalDecoder(PrincipalDecoder principalDecoder) Set the principal decoder for this security domain, which will be used to convertPrincipalobjects into names for handling in the realm.- Parameters:
- principalDecoder- the principal decoder (must not be- null)
- Returns:
- this builder
 
 - 
addRealmpublic SecurityDomain.RealmBuilder addRealm(String name, SecurityRealm realm) Add a realm to this security domain.- Parameters:
- name- the realm's name in this configuration
- realm- the realm
- Returns:
- the new realm builder
 
 - 
getDefaultRealmNamepublic String getDefaultRealmName() Get the default realm name.- Returns:
- the default realm name
 
 - 
setDefaultRealmNamepublic SecurityDomain.Builder setDefaultRealmName(String defaultRealmName) Set the default realm name.- Parameters:
- defaultRealmName- the default realm name (must not be- null)
 
 - 
getCategoryRoleMapperspublic Map<String,RoleMapper> getCategoryRoleMappers() Get the category role mapper map.- Returns:
- the category role mapper map
 
 - 
setCategoryRoleMapperspublic void setCategoryRoleMappers(Map<String,RoleMapper> categoryRoleMappers) Set the category role mapper map.- Parameters:
- categoryRoleMappers- the category role mapper map (must not be- null)
 
 - 
setSecurityIdentityTransformerpublic SecurityDomain.Builder setSecurityIdentityTransformer(UnaryOperator<SecurityIdentity> securityIdentityTransformer) Set the security identity transformer to use. The transformer must not returnnull, or authentication will fail.- Parameters:
- securityIdentityTransformer- the security identity transformer to use (must not be- null)
- Returns:
- this builder
 
 - 
setTrustedSecurityDomainPredicatepublic SecurityDomain.Builder setTrustedSecurityDomainPredicate(Predicate<SecurityDomain> trustedSecurityDomain) Set the predicate that should be used to determine if a given domain is trusted by this domain.- Parameters:
- trustedSecurityDomain- the predicate that should be used to determine if a given domain is trusted by this domain (must not be- null)
 
 - 
setSecurityEventListenerpublic SecurityDomain.Builder setSecurityEventListener(Consumer<SecurityEvent> securityEventListener) Set the security event listener that will consume allSecurityEventinstances emitted but the domain.- Parameters:
- securityEventListener- the security event listener that will consume all- SecurityEventinstances emitted but the domain.
- Returns:
- this builder
 
 - 
setEvidenceDecoderpublic SecurityDomain.Builder setEvidenceDecoder(EvidenceDecoder evidenceDecoder) Set the evidence decoder for this security domain which will be used to extract the principal from the givenEvidence.- Parameters:
- evidenceDecoder- the evidence decoder (must not be- null)
- Returns:
- this builder
- Since:
- 1.10.0
 
 - 
setRoleDecoderpublic SecurityDomain.Builder setRoleDecoder(RoleDecoder roleDecoder) Set the role decoder for this security domain.- Parameters:
- roleDecoder- the role decoder (must not be- null)
- Returns:
- this builder
- Since:
- 1.11.0
 
 - 
buildpublic SecurityDomain build() Construct this security domain. Construction requirescreateSecurityDomainElytronPermission.- Returns:
- the new security domain
 
 
- 
 
-