Class ChainingNameIdentifierGenerator<NameIdType extends org.opensaml.saml.common.SAMLObject>

  • 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 the NameIdentifierGenerator interface that wraps a sequence of candidate generators along with a default to try if no format-specific options are available.
    • 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.
    • Constructor Detail

      • ChainingNameIdentifierGenerator

        public ChainingNameIdentifierGenerator()
        Constructor.
    • 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 FormatSpecificNameIdentifierGenerator interface 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:
        generate in interface org.opensaml.saml.common.profile.NameIdentifierGenerator<NameIdType extends org.opensaml.saml.common.SAMLObject>
        Throws:
        org.opensaml.saml.common.SAMLException