public class IdentityConfigurationBuilder extends Builder<List<IdentityConfiguration>> implements IdentityConfigurationChildBuilder
A class used to build IdentityConfiguration instances, providing a fluent API with some meaningful
methods.
It can be initialized in two ways:
List of
IdentityConfiguration. In this case the builder will be initialized with all the configuration read from the
provided configurations.Multiple configurations are supported and each one must have a unique name. At least one configuration must be provided, otherwise the build methods will fail when invoked.
| Constructor and Description |
|---|
IdentityConfigurationBuilder() |
IdentityConfigurationBuilder(List<IdentityConfiguration> configurations)
Creates a new instance reading all the configuration from a previously created list of
IdentityConfiguration. |
| Modifier and Type | Method and Description |
|---|---|
IdentityConfiguration |
build()
Builds a single
IdentityConfiguration. |
List<IdentityConfiguration> |
buildAll()
Builds a
List of IdentityConfiguration. |
protected List<IdentityConfiguration> |
create()
Creates a new configuration.
|
Collection<NamedIdentityConfigurationBuilder> |
getNamedIdentityConfigurationBuilders()
Returns all
NamedIdentityConfigurationBuilder. |
boolean |
isConfigured()
Indicates if any configuration was already provided for this instance.
|
NamedIdentityConfigurationBuilder |
named(String configurationName)
Creates a new configuration.
|
protected Builder<List<IdentityConfiguration>> |
readFrom(List<IdentityConfiguration> fromConfiguration)
Reads a pre-created configuration.
|
protected void |
validate()
Validates the internal state.
|
public IdentityConfigurationBuilder()
public IdentityConfigurationBuilder(List<IdentityConfiguration> configurations) throws SecurityConfigurationException
Creates a new instance reading all the configuration from a previously created list of IdentityConfiguration.
configurations - SecurityConfigurationException - if any error occurs or for any invalid configurationpublic NamedIdentityConfigurationBuilder named(String configurationName)
Creates a new configuration.
If a configuration with the given configurationName already
exists, this method will return the same instance instead of creating a new one.
named in interface IdentityConfigurationChildBuilderconfigurationName - public IdentityConfiguration build() throws SecurityConfigurationException
Builds a single IdentityConfiguration.
This method should be called when only a single configuration was provided. Otherwise an exception will be thrown.
For building multiple
configurations use the buildAll method instead.
build in interface IdentityConfigurationChildBuilderSecurityConfigurationException - if multiple configurations was defined, or if any validation check fails
or if any error occurs when building the configuration.public List<IdentityConfiguration> buildAll() throws SecurityConfigurationException
Builds a List of IdentityConfiguration.
This method should be used when multiple configurations exists.
buildAll in interface IdentityConfigurationChildBuilderSecurityConfigurationException - if any validation check fails or if any error occurs when building the
configuration.public boolean isConfigured()
Indicates if any configuration was already provided for this instance.
public Collection<NamedIdentityConfigurationBuilder> getNamedIdentityConfigurationBuilders()
Returns all NamedIdentityConfigurationBuilder.
protected void validate()
throws SecurityConfigurationException
BuilderValidates the internal state.
validate in class Builder<List<IdentityConfiguration>>SecurityConfigurationException - if any error occurs or for any invalid configurationprotected List<IdentityConfiguration> create() throws SecurityConfigurationException
BuilderCreates a new configuration.
create in class Builder<List<IdentityConfiguration>>SecurityConfigurationException - if any error occurs or for any invalid configurationprotected Builder<List<IdentityConfiguration>> readFrom(List<IdentityConfiguration> fromConfiguration) throws SecurityConfigurationException
BuilderReads a pre-created configuration.
readFrom in class Builder<List<IdentityConfiguration>>SecurityConfigurationException - if any error occurs or for any invalid configurationCopyright © 2018 JBoss by Red Hat. All rights reserved.