Package org.wildfly.naming.client
Class ProviderEnvironment.Builder
java.lang.Object
org.wildfly.naming.client.ProviderEnvironment.Builder
- Enclosing class:
- ProviderEnvironment
The builder for
ProviderEnvironment instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddProviderUri(URI uri) Add a provider URL to the environment being built.addProviderUris(Collection<URI> uris) Add a provider URL to the environment being built.build()Build the provider environment from a point-in-time snapshot of the values in this builder.populateFromEnvironment(Map<String, ?> environment) Populate this builder from the given JNDI environment map.setAuthenticationContextSupplier(Supplier<AuthenticationContext> authenticationContextSupplier) Set the authentication context supplier to use.
-
Constructor Details
-
Builder
public Builder()Construct a new instance.
-
-
Method Details
-
addProviderUri
Add a provider URL to the environment being built.- Parameters:
uri- the URI of the provider (must not benull)- Returns:
- this builder
-
addProviderUris
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<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 NamingExceptionPopulate 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
Build the provider environment from a point-in-time snapshot of the values in this builder.- Returns:
- the new provider environment
-