protected void initializeLDAPServer()
throws DirectoryServerException {
if (null == this.service || null == this.ldapConfigurations) {
throw new DirectoryServerException(
"The default apacheds service is not initialized. " +
"Make sure apacheds service is initialized first.");
}
this.ldapServer = new LdapServer();
this.ldapServer.setTransports(new TcpTransport(this.ldapConfigurations.getLdapPort()));
// set server initial properties
this.ldapServer.setAllowAnonymousAccess(false);
this.ldapServer.setMaxTimeLimit(this.ldapConfigurations.getMaxTimeLimit());
this.ldapServer.setMaxSizeLimit(this.ldapConfigurations.getMaxSizeLimit());
this.ldapServer.setSaslHost(this.ldapConfigurations.getSaslHostName());
this.ldapServer.setSaslPrincipal(this.ldapConfigurations.getSaslPrincipalName());
// add the apacheds service
this.ldapServer.setDirectoryService(this.service);
setupSaslMechanisms();
try {
this.ldapServer.addExtendedOperationHandler(new StartTlsHandler());
this.ldapServer.addExtendedOperationHandler(
new StoredProcedureExtendedOperationHandler());
} catch (Exception e) {
throw new DirectoryServerException("can not add the extension handlers ", e);
}
}