From 95101c2281eded5d459a1f65f5f1ab1467771a24 Mon Sep 17 00:00:00 2001 From: Mattias Arthursson Date: Mon, 19 Nov 2007 06:50:08 +0000 Subject: [PATCH] Removed ResponseControlFactory stuff from LdapContextSource, as it's ignored by the LDAP provider anyway. --- .../ldap/core/support/LdapContextSource.java | 48 ------------------- 1 file changed, 48 deletions(-) diff --git a/spring-ldap/src/main/java/org/springframework/ldap/core/support/LdapContextSource.java b/spring-ldap/src/main/java/org/springframework/ldap/core/support/LdapContextSource.java index 0372fcc6..df1f6760 100644 --- a/spring-ldap/src/main/java/org/springframework/ldap/core/support/LdapContextSource.java +++ b/spring-ldap/src/main/java/org/springframework/ldap/core/support/LdapContextSource.java @@ -20,12 +20,7 @@ import java.util.Hashtable; import javax.naming.NamingException; import javax.naming.directory.DirContext; -import javax.naming.ldap.ControlFactory; import javax.naming.ldap.InitialLdapContext; -import javax.naming.ldap.LdapContext; - - -import com.sun.jndi.ldap.ctl.ResponseControlFactory; /** * ContextSource implementation which creates an InitialLdapContext @@ -40,18 +35,6 @@ import com.sun.jndi.ldap.ctl.ResponseControlFactory; */ public class LdapContextSource extends AbstractContextSource { - private static final Class DEFAULT_RESPONSE_CONTROL_FACTORY = ResponseControlFactory.class; - - private Class responseControlFactory = DEFAULT_RESPONSE_CONTROL_FACTORY; - - protected Hashtable getAnonymousEnv() { - Hashtable env = super.getAnonymousEnv(); - env - .put(LdapContext.CONTROL_FACTORIES, responseControlFactory - .getName()); - return env; - } - /* * @see org.springframework.ldap.support.AbstractContextSource#getDirContextInstance(java.util.Hashtable) */ @@ -59,35 +42,4 @@ public class LdapContextSource extends AbstractContextSource { throws NamingException { return new InitialLdapContext(environment, null); } - - /** - * Set the ResponseControlFactory to use. Default is - * {@link com.sun.jndi.ldap.ctl.ResponseControlFactory}. The specified - * class needs to be an implementation of - * {@link javax.naming.ldap.ControlFactory}. - * - * @param responseControlFactory - * the ResponseControlFactory to be used. Null means reset to the - * default. - */ - public void setResponseControlFactory(Class responseControlFactory) { - if (responseControlFactory == null) { - this.responseControlFactory = DEFAULT_RESPONSE_CONTROL_FACTORY; - } else if (ControlFactory.class - .isAssignableFrom(responseControlFactory)) { - this.responseControlFactory = responseControlFactory; - } else { - throw new IllegalArgumentException( - "Invalid ReponseControlFactory: " + responseControlFactory - + " is not an implementation of " - + ControlFactory.class.getName()); - } - } - - /** - * @return the current ResponseControlFactory. - */ - Class getResponseControlFactory() { - return responseControlFactory; - } }