@ Override public void start ( final Logger logger ) { try { logger . logInfo ( "Starting ApacheDS server" ) ; service = new DefaultDirectoryService ( ) ; final List < Interceptor > list = new ArrayList < Interceptor > ( ) ; list . add ( new NormalizationInterceptor ( ) ) ; list . add ( new AuthenticationInterceptor ( ) ) ; list . add ( new ReferralInterceptor ( ) ) ; // list.add( new AciAuthorizationInterceptor() ); // list.add( new DefaultAuthorizationInterceptor() ); list . add ( new ExceptionInterceptor ( ) ) ; // list.add( new ChangeLogInterceptor() ); list . add ( new OperationalAttributeInterceptor ( ) ) ; // list.add( new SchemaInterceptor() ); list . add ( new SubentryInterceptor ( ) ) ; // list.add( new CollectiveAttributeInterceptor() ); // list.add( new EventInterceptor() ); // list.add( new TriggerInterceptor() ); // list.add( new JournalInterceptor() ); service . setInterceptors ( list ) ; service . setWorkingDirectory ( getWorkingDirectory ( ) ) ; final JdbmPartition partition = new JdbmPartition ( ) ; partition . setId ( "rootPartition" ) ; partition . setSuffix ( getRoot ( ) ) ; service . addPartition ( partition ) ; service . setExitVmOnShutdown ( false ) ; service . setShutdownHookEnabled ( false ) ; service . getChangeLog ( ) . setEnabled ( false ) ; service . setDenormalizeOpAttrsEnabled ( true ) ; server = new LdapServer ( ) ; server . setDirectoryService ( service ) ; server . setTransports ( new TcpTransport ( getServerPort ( ) ) ) ; service . startup ( ) ; server . start ( ) ; createRoot ( partition ) ; loadLdifFile ( ) ; logger . logInfo ( "Started ApacheDS server" ) ; } catch ( final Exception e ) { logger . logError ( "Error starting ApacheDS server e" ) ; } }
Configure and start the embedded ApacheDS server creating the root DN and loading the LDIF seed data .