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 Summary
Fields Modifier and Type Field Description private Element
configElement
LDAPDirectory XML element.private static org.slf4j.Logger
LOG
Class logger.private String
logPrefix
LogPrefix of parent. -
Constructor Summary
-
Method Summary
Modifier and Type Method Description static ConnectionStrategy
buildConnectionStrategy(String connectionStrategy)
Returns an appropriateConnectionStrategy
.static CertificateHostnameVerifier
buildHostnameVerifier(String disableHostnameVerification, String logPrefix)
Factory method for overriding hostname verifier.static SearchReferralHandler
buildReferralHandler(String followReferrals)
Returns a search referral handler or null if followReferrals is false.static SaslConfig
buildSaslConfig(String mechanism)
Returns a SASL configuration for the supplied mechanism.static List<SearchEntryHandler>
buildSearchEntryHandlers(String lowercaseAttributeNames)
Factory method for handling spring property replacement.static SearchValidator
buildSearchValidator(String validatePeriodically, String validateDN, String validateFilter)
Returns a search validator or null if validatePeriodically is false.static List<String>
buildStringList(String value)
Converts the supplied value to a list of strings delimited byXMLConstants.LIST_DELIMITERS
and comma.BeanDefinition
createCache(ParserContext parserContext)
Create a results cache bean definition.BeanDefinition
createConnectionConfig(ParserContext parserContext)
Creates a connection config bean definition from a v2 XML configuration.BeanDefinition
createConnectionPool(BeanDefinition connectionFactory)
Creates a new connection pool bean definition from a v2 XML configuration.protected BeanDefinition
createCredentialConfig(ParserContext parserContext)
Read StartTLS trust and authentication credentials.BeanDefinition
createMappingStrategy()
Create the result mapping strategy.protected BeanDefinition
createPoolConfig()
Creates a new pool config bean definition from a v2 XML configuration.protected BeanDefinition
createSaslConfig()
Creates a new sasl config bean definition from a v2 XML configuration.BeanDefinition
createSearchExecutor()
Creates a new search executor bean definition from a v2 XML configuration.BeanDefinition
createTemplateBuilder()
Construct the definition of the template driven search builder.BeanDefinition
createValidator(BeanDefinition connectionFactory)
Create the validator.String
getBeanSearchBuilderID()
Get the bean ID of an externally defined search builder.(package private) Element
getConnectionPoolElement()
Get the Pool configuration <ConnectionPool> element contents, warning if there is more than one.private String
getFilterText()
Get the textual content of the <FilterTemplate>.(package private) String
getLogPrefix()
The parent's log prefix.
-
Field Details
-
LOG
private static final org.slf4j.Logger LOGClass logger. -
configElement
LDAPDirectory XML element. -
logPrefix
LogPrefix of parent.
-
-
Constructor Details
-
V2Parser
Creates a new V2Parser with the supplied LDAPDirectory element.- Parameters:
config
- LDAPDirectory elementprefix
- the parent's log prefix
-
-
Method Details
-
createConnectionConfig
Creates a connection config bean definition from a v2 XML configuration.- Parameters:
parserContext
- bean definition parsing context- Returns:
- connection config bean definition
-
createCredentialConfig
Read StartTLS trust and authentication credentials.- Parameters:
parserContext
- bean definition parsing context- Returns:
- credential config
-
getFilterText
Get the textual content of the <FilterTemplate>. We have to look in two places and warn appropriately.- Returns:
- the filter or null.
-
getBeanSearchBuilderID
Get the bean ID of an externally defined search builder.- Returns:
- search builder bean ID
-
createTemplateBuilder
Construct the definition of the template driven search builder.- Returns:
- the bean definition for the template search builder.
-
createSearchExecutor
Creates a new search executor bean definition from a v2 XML configuration.- Returns:
- search executor bean definition
-
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
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
Creates a new pool config bean definition from a v2 XML configuration.- Returns:
- pool config bean definition
-
createSaslConfig
Creates a new sasl config bean definition from a v2 XML configuration.- Returns:
- sasl config bean definition
-
createMappingStrategy
Create the result mapping strategy. SeeMappingStrategy
.- Returns:
- mapping strategy
-
createValidator
Create the validator. SeeValidator
.- Parameters:
connectionFactory
- to provide to the validator- Returns:
- validator
-
createCache
Create a results cache bean definition. SeeCacheConfigParser
.- Parameters:
parserContext
- bean parser context- Returns:
- results cache bean definition
-
getLogPrefix
The parent's log prefix.- Returns:
- the log prefix. Set up in the constructor.
-
buildStringList
Converts the supplied value to a list of strings delimited byXMLConstants.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 validatorvalidateDN
- baseDN to search onvalidateFilter
- 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 verifierlogPrefix
- 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 aDnAttributeEntryHandler
by default. Adds aCaseChangeEntryHandler
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
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 appropriateConnectionStrategy
.- Parameters:
connectionStrategy
- the provided string (with properties stripped)- Returns:
- the appropriate
ConnectionStrategy
.
-