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.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ConnectionStrategybuildConnectionStrategy(String connectionStrategy) Returns an appropriateConnectionStrategy.static CertificateHostnameVerifierbuildHostnameVerifier(String disableHostnameVerification, String logPrefix) Factory method for overriding hostname verifier.static List<SearchResultHandler>buildReferralHandlers(String followReferrals) Returns search result handlers or null if followReferrals is false.static SaslConfigbuildSaslConfig(String mechanism) Returns a SASL configuration for the supplied mechanism.static List<LdapEntryHandler>buildSearchEntryHandlers(String lowercaseAttributeNames) Factory method for handling spring property replacement.static SearchConnectionValidatorbuildSearchValidator(String validateDN, String validateFilter, String validatePeriod) 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_DELIMITERSand comma.createCache(ParserContext parserContext) Create a results cache bean definition.createConnectionConfig(ParserContext parserContext) Creates a connection config bean definition from a v2 XML configuration.protected BeanDefinitioncreateCredentialConfig(ParserContext parserContext) Read StartTLS trust and authentication credentials.Create the result mapping strategy.createPooledConnectionFactory(ParserContext parserContext) Creates a new pooled connection factory bean definition from a v2 XML configuration.protected BeanDefinitionCreates a new sasl config bean definition from a v2 XML configuration.Creates a new search operation bean definition from a v2 XML configuration.Construct the definition of the template driven search builder.Create the validator.Get the bean ID of an externally defined Connection Factory.Get the bean ID of an externally defined search builder.Get the bean ID of an externally defined Search Operation.(package private) ElementGet the Pool configuration <ConnectionPool> element contents, warning if there is more than one.private StringGet the textual content of the <FilterTemplate>.(package private) StringThe parent's log prefix.
-
Field Details
-
LOG
@Nonnull 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
-
getBeanSearchOperationID
Get the bean ID of an externally defined Search Operation.- Returns:
- Search Operation bean ID
-
createTemplateBuilder
Construct the definition of the template driven search builder.- Returns:
- the bean definition for the template search builder.
-
createSearchOperation
Creates a new search operation bean definition from a v2 XML configuration.- Returns:
- search operation 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.
-
createPooledConnectionFactory
Creates a new pooled connection factory bean definition from a v2 XML configuration.- Parameters:
parserContext- used to create dependent bean definitions- Returns:
- pooled connection factory 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
-
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_DELIMITERSand comma.- Parameters:
value- to convert to a list- Returns:
- list of strings
-
buildSearchValidator
@Nullable public static SearchConnectionValidator buildSearchValidator(@Nullable String validateDN, @Nullable String validateFilter, @Nullable String validatePeriod) Returns a search validator or null if validatePeriodically is false.- Parameters:
validateDN- baseDN to search onvalidateFilter- to search withvalidatePeriod- on which to search- 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<LdapEntryHandler> buildSearchEntryHandlers(@Nullable String lowercaseAttributeNames) Factory method for handling spring property replacement. Adds aDnAttributeEntryHandlerby default. Adds aCaseChangeEntryHandlerif lowercaseAttributeNames is true.- Parameters:
lowercaseAttributeNames- boolean string value- Returns:
- list of search entry handlers
-
buildReferralHandlers
@Nullable public static List<SearchResultHandler> buildReferralHandlers(@Nullable String followReferrals) Returns search result handlers or null if followReferrals is false.- Parameters:
followReferrals- whether to create a search referral handler- Returns:
- search result handlers or null
-
buildSaslConfig
Returns a SASL configuration for the supplied mechanism.- Parameters:
mechanism- SASL mechanism- Returns:
- SASL config
-
buildConnectionStrategy
@Nonnull public static ConnectionStrategy buildConnectionStrategy(@Nullable String connectionStrategy) Returns an appropriateConnectionStrategy.- Parameters:
connectionStrategy- the provided string (with properties stripped)- Returns:
- the appropriate
ConnectionStrategy.
-