Class ChainingNameIdentifierGenerator<NameIdType extends SAMLObject>
- java.lang.Object
-
- org.opensaml.saml.common.profile.impl.ChainingNameIdentifierGenerator<NameIdType>
-
- Type Parameters:
NameIdType- the type of identifier object supported
- All Implemented Interfaces:
NameIdentifierGenerator<NameIdType>
- Direct Known Subclasses:
ChainingSAML1NameIdentifierGenerator,ChainingSAML2NameIDGenerator
public class ChainingNameIdentifierGenerator<NameIdType extends SAMLObject> extends Object implements NameIdentifierGenerator<NameIdType>
A compound implementation of theNameIdentifierGeneratorinterface that wraps a sequence of candidate generators along with a default to try if no format-specific options are available.
-
-
Field Summary
Fields Modifier and Type Field Description private NameIdentifierGenerator<NameIdType>defaultNameIdGeneratorFallback generator, generally for legacy support.private org.slf4j.LoggerlogClass logger.private ListMultimap<String,NameIdentifierGenerator<NameIdType>>nameIdGeneratorMapMap of formats to generators.
-
Constructor Summary
Constructors Constructor Description ChainingNameIdentifierGenerator()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NameIdTypegenerate(ProfileRequestContext profileRequestContext, String format)voidsetDefaultGenerator(NameIdentifierGenerator<NameIdType> generator)Set the generator to try if no generator(s) are mapped to a desired format.voidsetGenerators(List<NameIdentifierGenerator<NameIdType>> generators)Set the format-specific generators to use.
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
nameIdGeneratorMap
@Nonnull @NonnullElements private ListMultimap<String,NameIdentifierGenerator<NameIdType extends SAMLObject>> nameIdGeneratorMap
Map of formats to generators.
-
defaultNameIdGenerator
@Nullable private NameIdentifierGenerator<NameIdType extends SAMLObject> defaultNameIdGenerator
Fallback generator, generally for legacy support.
-
-
Method Detail
-
setGenerators
public void setGenerators(@Nonnull @NullableElements List<NameIdentifierGenerator<NameIdType>> generators)
Set the format-specific generators to use.Only generators that support the
FormatSpecificNameIdentifierGeneratorinterface are installed, and the generators are prioritized for a given format by the order they are supplied.- Parameters:
generators- generators to use
-
setDefaultGenerator
public void setDefaultGenerator(@Nullable NameIdentifierGenerator<NameIdType> generator)Set the generator to try if no generator(s) are mapped to a desired format.- Parameters:
generator- a fallback default generator, if any
-
generate
@Nullable public NameIdType generate(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull @NotEmpty String format) throws SAMLException
- Specified by:
generatein interfaceNameIdentifierGenerator<NameIdType extends SAMLObject>- Throws:
SAMLException
-
-