DSAnnotationProcessor.applyLdifs( getDescription(), directoryService );
}
else
{
// No : define a default DS for the suite then
DirectoryServiceFactory dsf = DefaultDirectoryServiceFactory.class.newInstance();
directoryService = dsf.getDirectoryService();
// enable CL explicitly cause we are not using DSAnnotationProcessor
directoryService.getChangeLog().setEnabled( true );
dsf.init( "default" + UUID.randomUUID().toString() );
// Stores it into the suite
suite.setDirectoryService( directoryService );
// Apply the suite LDIF first
DSAnnotationProcessor.applyLdifs( suite.getDescription(), directoryService );
// Then tag for reversion and apply the class LDIFs
revision = getCurrentRevision( directoryService );
DSAnnotationProcessor.applyLdifs( getDescription(), directoryService );
}
}
else
{
// No : define a default class DS then
DirectoryServiceFactory dsf = DefaultDirectoryServiceFactory.class.newInstance();
directoryService = dsf.getDirectoryService();
// enable CL explicitly cause we are not using DSAnnotationProcessor
directoryService.getChangeLog().setEnabled( true );
dsf.init( "default" + UUID.randomUUID().toString() );
// Stores the defaultDS in the classDS
classDS = directoryService;
// Apply the class LDIFs
DSAnnotationProcessor.applyLdifs( getDescription(), directoryService );
}
}
// check if it has a LdapServerBuilder
// then use the DS created above
if ( classLdapServerBuilder != null )
{
classLdapServer = ServerAnnotationProcessor.createLdapServer( getDescription(), directoryService );
}
else if ( ( suite != null ) && ( suite.getLdapServer() != null ) )
{
classLdapServer = suite.getLdapServer();
// set directoryService only if there is no class level DS
if ( directoryService == null )
{
directoryService = classLdapServer.getDirectoryService();
}
// no need to inject the LDIF data that would have been done above
// if ApplyLdifs is present
}
if ( classKdcServer == null )
{
int minPort = getMinPort();
classKdcServer = ServerAnnotationProcessor.getKdcServer( getDescription(), directoryService,
minPort + 1 );
}
else if ( suite != null )
{
// TODO add suite level KdcServer support
}
if ( suite == null )
{
// print out information which partition factory we use
DirectoryServiceFactory dsFactory = DefaultDirectoryServiceFactory.class.newInstance();
PartitionFactory partitionFactory = dsFactory.getPartitionFactory();
LOG.debug( "Using partition factory {}", partitionFactory.getClass().getSimpleName() );
}
// Now run the class
super.run( notifier );