Package org.wildfly.naming.client
Class ProviderEnvironment.Builder
- java.lang.Object
-
- org.wildfly.naming.client.ProviderEnvironment.Builder
-
- Enclosing class:
- ProviderEnvironment
public static final class ProviderEnvironment.Builder extends Object
The builder forProviderEnvironmentinstances.
-
-
Constructor Summary
Constructors Constructor Description Builder()Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProviderEnvironment.BuilderaddProviderUri(URI uri)Add a provider URL to the environment being built.ProviderEnvironment.BuilderaddProviderUris(Collection<URI> uris)Add a provider URL to the environment being built.ProviderEnvironmentbuild()Build the provider environment from a point-in-time snapshot of the values in this builder.ProviderEnvironment.BuilderpopulateFromEnvironment(Map<String,?> environment)Populate this builder from the given JNDI environment map.ProviderEnvironment.BuildersetAuthenticationContextSupplier(Supplier<org.wildfly.security.auth.client.AuthenticationContext> authenticationContextSupplier)Set the authentication context supplier to use.
-
-
-
Method Detail
-
addProviderUri
public ProviderEnvironment.Builder addProviderUri(URI uri)
Add a provider URL to the environment being built.- Parameters:
uri- the URI of the provider (must not benull)- Returns:
- this builder
-
addProviderUris
public ProviderEnvironment.Builder addProviderUris(Collection<URI> uris)
Add a provider URL to the environment being built.- Parameters:
uris- the URIs of the provider(s) (must not benullor havenullmembers)- Returns:
- this builder
-
setAuthenticationContextSupplier
public ProviderEnvironment.Builder setAuthenticationContextSupplier(Supplier<org.wildfly.security.auth.client.AuthenticationContext> authenticationContextSupplier)
Set the authentication context supplier to use.- Parameters:
authenticationContextSupplier- the authentication context supplier to use (must not benull)- Returns:
- this builder
-
populateFromEnvironment
public ProviderEnvironment.Builder populateFromEnvironment(Map<String,?> environment) throws NamingException
Populate this builder from the given JNDI environment map. The following information will be populated:- Provider URLs by reading standard and compatibility properties
-
Authentication information including:
- Authentication name
- Credential(s)
- Parameters:
environment- the environment map (must not benull)- Returns:
- this builder (populated from the map)
- Throws:
ConfigurationException- if the given environment is invalid for some reasonNamingException- if some other error occurred
-
build
public ProviderEnvironment build()
Build the provider environment from a point-in-time snapshot of the values in this builder.- Returns:
- the new provider environment
-
-