Class LDAPDataConnectorParser.V2Parser
java.lang.Object
net.shibboleth.idp.attribute.resolver.spring.dc.ldap.impl.LDAPDataConnectorParser.V2Parser
- Enclosing class:
- LDAPDataConnectorParser
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.buildStringList
(String value) Converts the supplied value to a list of strings delimited byXMLConstants.LIST_DELIMITERS
and comma.createCache
(ParserContext parserContext) Create a results cache bean definition.createConnectionConfig
(ParserContext parserContext) Creates a connection config bean definition from a v2 XML configuration.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.Create the result mapping strategy.protected BeanDefinition
Creates a new pool config bean definition from a v2 XML configuration.protected BeanDefinition
Creates a new sasl config bean definition from a v2 XML configuration.Creates a new search executor bean definition from a v2 XML configuration.Construct the definition of the template driven search builder.Create the validator.createValidator
(String connectionFactoryId) Create the validator.Get the bean ID of an externally defined Connection FactoryGet the bean ID of an externally defined search builder.Get the bean ID of an externally defined Search Executor(package private) Element
Get the Pool configuration <ConnectionPool> element contents, warning if there is more than one.private String
Get the textual content of the <FilterTemplate>.(package private) String
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
-
getBeanConnectionFactoryID
Get the bean ID of an externally defined Connection Factory- Returns:
- Connection Factory bean ID
-
getBeanSearchExecutorID
Get the bean ID of an externally defined Search Executor- Returns:
- Search Executor 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
.- Returns:
- validator
-
createValidator
Create the validator. SeeValidator
.- Parameters:
connectionFactoryId
- reference 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
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
.
-