NameIdType
- the type of identifier object supportedpublic class ChainingNameIdentifierGenerator<NameIdType extends SAMLObject> extends Object implements NameIdentifierGenerator<NameIdType>
NameIdentifierGenerator
interface that wraps a sequence of
candidate generators along with a default to try if no format-specific options are available.Constructor and Description |
---|
ChainingNameIdentifierGenerator()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
NameIdType |
generate(ProfileRequestContext profileRequestContext,
String format)
Generate an identifier object.
|
void |
setDefaultGenerator(NameIdentifierGenerator<NameIdType> generator)
Set the generator to try if no generator(s) are mapped to a desired format.
|
void |
setGenerators(List<NameIdentifierGenerator<NameIdType>> generators)
Set the format-specific generators to use.
|
public ChainingNameIdentifierGenerator()
public void setGenerators(@Nonnull @NullableElements List<NameIdentifierGenerator<NameIdType>> generators)
Only generators that support the FormatSpecificNameIdentifierGenerator
interface are
installed, and the generators are prioritized for a given format by the order they are supplied.
generators
- generators to usepublic void setDefaultGenerator(@Nullable NameIdentifierGenerator<NameIdType> generator)
generator
- a fallback default generator, if any@Nullable public NameIdType generate(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull @NotEmpty String format) throws SAMLException
generate
in interface NameIdentifierGenerator<NameIdType extends SAMLObject>
profileRequestContext
- the current profile request contextformat
- the identifier format to generateSAMLException
- if an error occurs generating an identifierCopyright © 2018. All rights reserved.