diff --git a/spring-ldap/changelog.txt b/spring-ldap/changelog.txt index df0c8aad..f531b43a 100644 --- a/spring-ldap/changelog.txt +++ b/spring-ldap/changelog.txt @@ -17,6 +17,16 @@ Consequently this is NOT a drop-in replacement for Spring LDAP 1.1.2, though upgrading should not present all that much work. Please see the supplied upgrade guide for details. +* Added getContextSource on LdapTemplate. + +* The following getters on AbstractContextSource have been added: + getContextFactory + getDirObjectFactory + getAuthenticationSource + getUrls (was protected) + isPooled + isAnonymousReadOnly + * Upgraded to Spring 2.0.6 internally. Spring 1.2.x is still supported. Changes in version 1.2-RC1 (5.12.2007) diff --git a/spring-ldap/src/main/java/org/springframework/ldap/core/LdapTemplate.java b/spring-ldap/src/main/java/org/springframework/ldap/core/LdapTemplate.java index b6e2066e..0a2aab5a 100644 --- a/spring-ldap/src/main/java/org/springframework/ldap/core/LdapTemplate.java +++ b/spring-ldap/src/main/java/org/springframework/ldap/core/LdapTemplate.java @@ -100,6 +100,15 @@ public class LdapTemplate implements LdapOperations, InitializingBean { this.contextSource = contextSource; } + /** + * Get the ContextSource. + * + * @return the ContextSource. + */ + public ContextSource getContextSource() { + return contextSource; + } + /** * Specify whether PartialResultException should be ignored * in searches. AD servers typically have a problem with referrals. Normally diff --git a/spring-ldap/src/main/java/org/springframework/ldap/core/support/AbstractContextSource.java b/spring-ldap/src/main/java/org/springframework/ldap/core/support/AbstractContextSource.java index f9ca0250..eec5bfd9 100644 --- a/spring-ldap/src/main/java/org/springframework/ldap/core/support/AbstractContextSource.java +++ b/spring-ldap/src/main/java/org/springframework/ldap/core/support/AbstractContextSource.java @@ -224,6 +224,15 @@ public abstract class AbstractContextSource implements ContextSource, this.contextFactory = contextFactory; } + /** + * Get the context factory. + * + * @return the context factory used when creating Contexts. + */ + public Class getContextFactory() { + return contextFactory; + } + /** * Set the DirObjectFactory to use. Default is * {@link DefaultDirObjectFactory}. The specified class needs to be an @@ -239,6 +248,16 @@ public abstract class AbstractContextSource implements ContextSource, this.dirObjectFactory = dirObjectFactory; } + /** + * Get the DirObjectFactory to use. + * + * @return the DirObjectFactory to be used. null means that + * no DirObjectFactory will be used. + */ + public Class getDirObjectFactory() { + return dirObjectFactory; + } + /** * Checks that all necessary data is set and that there is no compatibility * issues, after which the instance is initialized. Note that you need to @@ -347,6 +366,15 @@ public abstract class AbstractContextSource implements ContextSource, this.urls = urls; } + /** + * Get the urls of the LDAP servers. + * + * @return the urls of all servers. + */ + public String[] getUrls() { + return urls; + } + /** * Set the url of the LDAP server. Utility method if only one server is * used. @@ -368,6 +396,15 @@ public abstract class AbstractContextSource implements ContextSource, this.pooled = pooled; } + /** + * Get whether the pooling flag should be set. + * + * @return whether Contexts should be pooled. + */ + public boolean isPooled() { + return pooled; + } + /** * If any custom environment properties are needed, these can be set using * this method. @@ -397,9 +434,25 @@ public abstract class AbstractContextSource implements ContextSource, return env; } + /** + * Set the authentication source to use when retrieving user principal and + * credentials. + * + * @param authenticationSource + * the AuthenticationSource that will provide user info. + */ public void setAuthenticationSource( - AuthenticationSource authenticationProvider) { - this.authenticationSource = authenticationProvider; + AuthenticationSource authenticationSource) { + this.authenticationSource = authenticationSource; + } + + /** + * Get the authentication source. + * + * @return the AuthenticationSource that will provide user info. + */ + public AuthenticationSource getAuthenticationSource() { + return authenticationSource; } /** @@ -423,13 +476,24 @@ public abstract class AbstractContextSource implements ContextSource, * operations. Default is false. * * @param anonymousReadOnly - * true if and anonymous environment should be - * used for read-only operations, false otherwise. + * true if an anonymous environment should be used + * for read-only operations, false otherwise. */ public void setAnonymousReadOnly(boolean anonymousReadOnly) { this.anonymousReadOnly = anonymousReadOnly; } + /** + * Get whether an anonymous environment should be used for read-only + * operations. + * + * @return true if an anonymous environment should be used + * for read-only operations, false otherwise. + */ + public boolean isAnonymousReadOnly() { + return anonymousReadOnly; + } + /** * Implement in subclass to create a DirContext of the desired type (e.g. * InitialDirContext or InitialLdapContext). @@ -454,8 +518,4 @@ public abstract class AbstractContextSource implements ContextSource, } } - - protected String[] getUrls() { - return urls; - } }