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.Modifier and Type | Field and Description |
---|---|
private NameIdentifierGenerator<NameIdType> |
defaultNameIdGenerator
Fallback generator, generally for legacy support.
|
private org.slf4j.Logger |
log
Class logger.
|
private com.google.common.collect.ListMultimap<String,NameIdentifierGenerator<NameIdType>> |
nameIdGeneratorMap
Map of formats to generators.
|
Constructor and Description |
---|
ChainingNameIdentifierGenerator()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
NameIdType |
generate(ProfileRequestContext profileRequestContext,
String format) |
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.
|
@Nonnull private final org.slf4j.Logger log
@Nonnull @NonnullElements private com.google.common.collect.ListMultimap<String,NameIdentifierGenerator<NameIdType extends SAMLObject>> nameIdGeneratorMap
@Nullable private NameIdentifierGenerator<NameIdType extends SAMLObject> defaultNameIdGenerator
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>
SAMLException
Copyright © 1999–2020 Shibboleth Consortium. All rights reserved.