Fixed up javadoc warnings and source paths.

Now using BaseLdapPathAware on all LdapServerManagers.
This commit is contained in:
Ulrik Sandberg
2008-01-13 23:07:52 +00:00
parent cd96ed59e6
commit 70f69e0909
4 changed files with 27 additions and 17 deletions

View File

@@ -8,6 +8,11 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<!-- Used mainly to enable injecting base into LdapServerManager -->
<bean
class="org.springframework.ldap.core.support.BaseLdapPathBeanPostProcessor" />
<!-- JNDI environment variable -->
<bean id="environment"
class="org.springframework.beans.factory.config.PropertiesFactoryBean">

View File

@@ -35,7 +35,7 @@ import org.apache.directory.server.protocol.shared.store.LdifFileLoader;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.ldap.core.ContextSource;
import org.springframework.ldap.core.DistinguishedName;
import org.springframework.ldap.core.support.DefaultDirObjectFactory;
import org.springframework.ldap.core.support.BaseLdapPathAware;
/**
* Utility class to initialize the apache directory server for use in the
@@ -44,15 +44,21 @@ import org.springframework.ldap.core.support.DefaultDirObjectFactory;
* @author Mattias Arthursson
*
*/
public class LdapServerManager implements DisposableBean {
public class LdapServerManager implements DisposableBean, BaseLdapPathAware {
private static Log log = LogFactory.getLog(LdapServerManager.class);
private ContextSource contextSource;
private DistinguishedName baseLdapPath;
public void setContextSource(ContextSource contextSource) {
this.contextSource = contextSource;
}
public void setBaseLdapPath(DistinguishedName baseLdapPath) {
this.baseLdapPath = baseLdapPath;
}
public void destroy() throws Exception {
Properties env = new Properties();
env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
@@ -75,11 +81,10 @@ public class LdapServerManager implements DisposableBean {
// Different test cases have different base paths. This means that the
// starting point will be different.
if (ctx.getEnvironment().get(
DefaultDirObjectFactory.JNDI_ENV_BASE_PATH_KEY) != null) {
if (baseLdapPath.size() != 0) {
startingPoint = DistinguishedName.EMPTY_PATH;
} else {
startingPoint = new DistinguishedName("dc=jayway,dc=se");
startingPoint = new DistinguishedName(baseLdapPath);
}
try {

View File

@@ -74,7 +74,7 @@ import com.sun.jndi.ldap.ctl.VirtualListViewResponseControl;
* </pre>
*
* @author Ulrik Sandberg
* @see http://www3.ietf.org/proceedings/02nov/I-D/draft-ietf-ldapext-ldapv3-vlv-09.txt
* @see <a href="http://www3.ietf.org/proceedings/02nov/I-D/draft-ietf-ldapext-ldapv3-vlv-09.txt">LDAP Extensions for Scrolling View Browsing of Search Results</a>
*/
public class VirtualListViewControlDirContextProcessor implements
DirContextProcessor {