Class ChainingNameIdentifierGenerator<NameIdType extends org.opensaml.saml.common.SAMLObject>
- java.lang.Object
-
- org.opensaml.saml.common.profile.impl.ChainingNameIdentifierGenerator<NameIdType>
-
- Type Parameters:
NameIdType- the type of identifier object supported
- All Implemented Interfaces:
org.opensaml.saml.common.profile.NameIdentifierGenerator<NameIdType>
- Direct Known Subclasses:
ChainingSAML1NameIdentifierGenerator,ChainingSAML2NameIDGenerator
public class ChainingNameIdentifierGenerator<NameIdType extends org.opensaml.saml.common.SAMLObject> extends Object implements org.opensaml.saml.common.profile.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 org.opensaml.saml.common.profile.NameIdentifierGenerator<NameIdType>defaultNameIdGeneratorFallback generator, generally for legacy support.private org.slf4j.LoggerlogClass logger.private ListMultimap<String,org.opensaml.saml.common.profile.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(org.opensaml.profile.context.ProfileRequestContext profileRequestContext, String format)voidsetDefaultGenerator(org.opensaml.saml.common.profile.NameIdentifierGenerator<NameIdType> generator)Set the generator to try if no generator(s) are mapped to a desired format.voidsetGenerators(List<org.opensaml.saml.common.profile.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,org.opensaml.saml.common.profile.NameIdentifierGenerator<NameIdType extends org.opensaml.saml.common.SAMLObject>> nameIdGeneratorMap
Map of formats to generators.
-
defaultNameIdGenerator
@Nullable private org.opensaml.saml.common.profile.NameIdentifierGenerator<NameIdType extends org.opensaml.saml.common.SAMLObject> defaultNameIdGenerator
Fallback generator, generally for legacy support.
-
-
Method Detail
-
setGenerators
public void setGenerators(@Nonnull @NullableElements List<org.opensaml.saml.common.profile.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 org.opensaml.saml.common.profile.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 org.opensaml.profile.context.ProfileRequestContext profileRequestContext, @Nonnull @NotEmpty String format) throws org.opensaml.saml.common.SAMLException
- Specified by:
generatein interfaceorg.opensaml.saml.common.profile.NameIdentifierGenerator<NameIdType extends org.opensaml.saml.common.SAMLObject>- Throws:
org.opensaml.saml.common.SAMLException
-
-