@SuppressWarnings("unused") public void createBaseDN(String partitionName, String baseDN) throws Exception { Partition partition = addPartition(partitionName, baseDN); // And start the service service.startup(); /* * // Inject the apache root entry if (!service.getAdminSession().exists(partition.getSuffixDn())) { DN dnApache = new * DN(baseDN); ServerEntry entryApache = service.newEntry(dnApache); entryApache.add("objectClass", "top", "domain", * "extensibleObject"); entryApache.add("dc", "Apache"); service.getAdminSession().add(entryApache); } */ }
@Override public void start() throws DirectoryServerException { try { this.service.startup(); this.ldapServer.start(); logger.info("LDAP server started."); } catch (Exception e) { logger.error("Error starting LDAP server.", e); throw new DirectoryServerException("Can not start the server ", e); } }
/** * Start the server : * <li>initialize the DirectoryService</li> * <li>start the LDAP server</li> * <li>start the LDAPS server</li> * * @throws NamingException If the server cannot be started * @throws IOException If an IO error occured while reading some file */ public void startup() throws Exception { LOG.debug( "Starting the server" ); // Start the directory service if not started yet if ( ! directoryService.isStarted() ) { LOG.debug( "1. Starting the DirectoryService" ); directoryService.startup(); } // Load the LDIF files - if any - into the server loadLdifs(); // Start the LDAP server if ( ldapServer != null && ! ldapServer.isStarted() ) { LOG.debug( "3. Starting the LDAP server" ); ldapServer.start(); } LOG.debug( "Server successfully started" ); }
/** * Builds the apacheds server instance. * * @param name the instance name * @throws Exception In case if unable to extract schema or if an error occurred when building * the working directory. */ private void build(String name) throws Exception { directoryService.setInstanceId(name); buildWorkingDirectory(name); // Init the service now initSchema(); initSystemPartition(); directoryService.startup(); }
directoryService.startup(); ldapServer = new LdapServer(); ldapServer.setDirectoryService( directoryService );
DefaultDirectoryServiceFactory.DEFAULT.init( "default" ); DirectoryService directoryService = DefaultDirectoryServiceFactory.DEFAULT.getDirectoryService(); directoryService.startup(); ldapServer = new LdapServer(); ldapServer.setDirectoryService( directoryService );
service.startup();
service.startup( this, env );
server.setTransports(new TcpTransport(getServerPort())); service.startup(); server.start();
directoryService.startup();
directoryService.startup();
service.startup();
service.startup();