Class LDAPDataConnectorParser.V2Parser

java.lang.Object
net.shibboleth.idp.attribute.resolver.spring.dc.ldap.impl.LDAPDataConnectorParser.V2Parser
Enclosing class:
LDAPDataConnectorParser

protected static class LDAPDataConnectorParser.V2Parser
extends Object
Utility class for parsing v2 schema configuration. Note That parsing the V2 configuration will set some beans with hard wired defaults. See LDAPDataConnectorParser.doV2Parse(Element, ParserContext, BeanDefinitionBuilder).
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
      Class logger.
    • configElement

      private final Element configElement
      LDAPDirectory XML element.
    • logPrefix

      private final String logPrefix
      LogPrefix of parent.
  • Constructor Details

    • V2Parser

      public V2Parser​(@Nonnull Element config, @Nonnull String prefix)
      Creates a new V2Parser with the supplied LDAPDirectory element.
      Parameters:
      config - LDAPDirectory element
      prefix - the parent's log prefix
  • Method Details

    • createConnectionConfig

      @Nonnull public BeanDefinition createConnectionConfig​(@Nonnull ParserContext parserContext)
      Creates a connection config bean definition from a v2 XML configuration.
      Parameters:
      parserContext - bean definition parsing context
      Returns:
      connection config bean definition
    • createCredentialConfig

      @Nonnull protected BeanDefinition createCredentialConfig​(@Nonnull ParserContext parserContext)
      Read StartTLS trust and authentication credentials.
      Parameters:
      parserContext - bean definition parsing context
      Returns:
      credential config
    • getFilterText

      @Nullable private String getFilterText()
      Get the textual content of the <FilterTemplate>. We have to look in two places and warn appropriately.
      Returns:
      the filter or null.
    • getBeanSearchBuilderID

      @Nullable public String getBeanSearchBuilderID()
      Get the bean ID of an externally defined search builder.
      Returns:
      search builder bean ID
    • createTemplateBuilder

      @Nonnull public BeanDefinition createTemplateBuilder()
      Construct the definition of the template driven search builder.
      Returns:
      the bean definition for the template search builder.
    • createSearchExecutor

      @Nonnull public BeanDefinition createSearchExecutor()
      Creates a new search executor bean definition from a v2 XML configuration.
      Returns:
      search executor bean definition
    • getConnectionPoolElement

      @Nullable Element getConnectionPoolElement()
      Get the Pool configuration <ConnectionPool> element contents, warning if there is more than one.
      Returns:
      the <ConnectionPool> or null if there isn't one.
    • createConnectionPool

      @Nullable public BeanDefinition createConnectionPool​(BeanDefinition connectionFactory)
      Creates a new connection pool bean definition from a v2 XML configuration.
      Parameters:
      connectionFactory - used by the connection pool
      Returns:
      connection pool bean definition
    • createPoolConfig

      @Nullable protected BeanDefinition createPoolConfig()
      Creates a new pool config bean definition from a v2 XML configuration.
      Returns:
      pool config bean definition
    • createSaslConfig

      @Nullable protected BeanDefinition createSaslConfig()
      Creates a new sasl config bean definition from a v2 XML configuration.
      Returns:
      sasl config bean definition
    • createMappingStrategy

      @Nullable public BeanDefinition createMappingStrategy()
      Create the result mapping strategy. See MappingStrategy.
      Returns:
      mapping strategy
    • createValidator

      @Nullable public BeanDefinition createValidator​(BeanDefinition connectionFactory)
      Create the validator. See Validator.
      Parameters:
      connectionFactory - to provide to the validator
      Returns:
      validator
    • createCache

      @Nullable public BeanDefinition createCache​(@Nonnull ParserContext parserContext)
      Create a results cache bean definition. See CacheConfigParser.
      Parameters:
      parserContext - bean parser context
      Returns:
      results cache bean definition
    • getLogPrefix

      @Nonnull String getLogPrefix()
      The parent's log prefix.
      Returns:
      the log prefix. Set up in the constructor.
    • buildStringList

      @Nonnull public static List<String> buildStringList​(String value)
      Converts the supplied value to a list of strings delimited by XMLConstants.LIST_DELIMITERS and comma.
      Parameters:
      value - to convert to a list
      Returns:
      list of strings
    • buildSearchValidator

      @Nullable public static SearchValidator buildSearchValidator​(@Nullable String validatePeriodically, @Nullable String validateDN, @Nullable String validateFilter)
      Returns a search validator or null if validatePeriodically is false.
      Parameters:
      validatePeriodically - whether to create a search validator
      validateDN - baseDN to search on
      validateFilter - to search with
      Returns:
      search validator or null
    • buildHostnameVerifier

      @Nullable public static CertificateHostnameVerifier buildHostnameVerifier​(@Nullable String disableHostnameVerification, @Nullable String logPrefix)
      Factory method for overriding hostname verifier.
      Parameters:
      disableHostnameVerification - whether to install a null verifier
      logPrefix - log prefix
      Returns:
      custom verifier or null
    • buildSearchEntryHandlers

      @Nonnull public static List<SearchEntryHandler> buildSearchEntryHandlers​(@Nullable String lowercaseAttributeNames)
      Factory method for handling spring property replacement. Adds a DnAttributeEntryHandler by default. Adds a CaseChangeEntryHandler if lowercaseAttributeNames is true.
      Parameters:
      lowercaseAttributeNames - boolean string value
      Returns:
      list of search entry handlers
    • buildReferralHandler

      @Nonnull public static SearchReferralHandler buildReferralHandler​(@Nullable String followReferrals)
      Returns a search referral handler or null if followReferrals is false.
      Parameters:
      followReferrals - whether to create a search referral handler
      Returns:
      search referral handler or null
    • buildSaslConfig

      @Nonnull public static SaslConfig buildSaslConfig​(@Nonnull String mechanism)
      Returns a SASL configuration for the supplied mechanism.
      Parameters:
      mechanism - SASL mechanism
      Returns:
      SASL config
    • buildConnectionStrategy

      @Nonnull public static ConnectionStrategy buildConnectionStrategy​(@Nonnull String connectionStrategy)
      Returns an appropriate ConnectionStrategy.
      Parameters:
      connectionStrategy - the provided string (with properties stripped)
      Returns:
      the appropriate ConnectionStrategy.