Package org.apache.directory.server.core

Examples of org.apache.directory.server.core.DefaultDirectoryService


            apacheDS = ( ApacheDS ) factory.getBean( "apacheDS" ); //$NON-NLS-1$
        }
        else
        {
            LOG.info( "server: using default settings ..." ); //$NON-NLS-1$
            DirectoryService directoryService = new DefaultDirectoryService();
            directoryService.startup();
            ldapServer = new LdapServer();
            ldapServer.setDirectoryService( directoryService );
            TcpTransport tcpTransportSsl = new TcpTransport( 10636 );
            tcpTransportSsl.enableSSL( true );
            ldapServer.setTransports( new TcpTransport( 10389 ), tcpTransportSsl );
View Full Code Here


    partition.setSuffix( dn );
    return partition;
  }

  private static DefaultDirectoryService createDirectory( Partition rootPartition, File workDir ) throws Exception {
    DefaultDirectoryService directory = new DefaultDirectoryService();
    directory.addPartition( rootPartition );
    directory.setExitVmOnShutdown( false );
    directory.setShutdownHookEnabled( true );
    directory.getChangeLog().setEnabled( false );
    directory.setDenormalizeOpAttrsEnabled( true );
    directory.setWorkingDirectory( initWorkDir( null ) );
    return directory;
  }
View Full Code Here

    private SchemaManager loadSchemaManager() throws Exception
    {
        // --------------------------------------------------------------------
        // Load the bootstrap schemas to start up the schema partition
        // --------------------------------------------------------------------
        directoryService = new DefaultDirectoryService();
        directoryService.setWorkingDirectory( getInstanceLayout().getPartitionsDir() );
        directoryService.startup();

        SchemaManager schemaManager = directoryService.getSchemaManager();
       
View Full Code Here


    @BeforeClass public static void setUp() throws Exception
    {
        // setup working directory
        directoryService = new DefaultDirectoryService();
        File workingDirectory = new File( System.getProperty( "workingDirectory", System.getProperty( "user.dir" ) ) );
       
        if ( ! workingDirectory.exists() )
        {
            workingDirectory.mkdirs();
View Full Code Here

       
        directoryService = ldapServer.getDirectoryService();
       
        if ( directoryService == null )
        {
            directoryService = new DefaultDirectoryService();
        }
    }
View Full Code Here

     * @param workDir the directory to be used for storing the data
     * @throws Exception if there were some problems while initializing
     */
    private void initDirectoryService(final ServletContext servletContext, final File workDir) throws Exception {
        // Initialize the LDAP service
        service = new DefaultDirectoryService();
        service.setWorkingDirectory(workDir);

        // first load the schema
        initSchemaPartition(servletContext);

View Full Code Here

        try
        {
            // creating the instance here so that
            // we we can set some properties like accesscontrol, anon access
            // before starting up the service
            directoryService = new DefaultDirectoryService();

            // no need to register a shutdown hook during tests because this
            // starts a lot of threads and slows down test execution
            directoryService.setShutdownHookEnabled( false );
        }
View Full Code Here

     * @throws Exception
     */
    public static DirectoryService createDirectoryService( DirectoryServiceBean directoryServiceBean,
        InstanceLayout instanceLayout, SchemaManager schemaManager ) throws Exception
    {
        DirectoryService directoryService = new DefaultDirectoryService();

        // The schemaManager
        directoryService.setSchemaManager( schemaManager );

        // MUST attributes
        // DirectoryService ID
        directoryService.setInstanceId( directoryServiceBean.getDirectoryServiceId() );

        // Replica ID
        directoryService.setReplicaId( directoryServiceBean.getDsReplicaId() );

        // WorkingDirectory
        directoryService.setInstanceLayout( instanceLayout );

        // Interceptors
        List<Interceptor> interceptors = createInterceptors( directoryServiceBean.getInterceptors() );
        directoryService.setInterceptors( interceptors );

        // Partitions
        Map<String, Partition> partitions = createPartitions( directoryService, directoryServiceBean.getPartitions() );

        Partition systemPartition = partitions.remove( "system" );

        if ( systemPartition == null )
        {
            //throw new Exception( I18n.err( I18n.ERR_505 ) );
        }

        directoryService.setSystemPartition( systemPartition );
        directoryService.setPartitions( new HashSet<Partition>( partitions.values() ) );

        // MAY attributes
        // AccessControlEnabled
        directoryService.setAccessControlEnabled( directoryServiceBean.isDsAccessControlEnabled() );

        // AllowAnonymousAccess
        directoryService.setAllowAnonymousAccess( directoryServiceBean.isDsAllowAnonymousAccess() );

        // ChangeLog
        ChangeLog cl = createChangeLog( directoryServiceBean.getChangeLog() );

        if ( cl != null )
        {
            directoryService.setChangeLog( cl );
        }

        // DenormalizedOpAttrsEnabled
        directoryService.setDenormalizeOpAttrsEnabled( directoryServiceBean.isDsDenormalizeOpAttrsEnabled() );

        // Journal
        Journal journal = createJournal( directoryServiceBean.getJournal() );

        if ( journal != null )
        {
            directoryService.setJournal( journal );
        }

        // MaxPDUSize
        directoryService.setMaxPDUSize( directoryServiceBean.getDsMaxPDUSize() );

        // PasswordHidden
        directoryService.setPasswordHidden( directoryServiceBean.isDsPasswordHidden() );

        // SyncPeriodMillis
        directoryService.setSyncPeriodMillis( directoryServiceBean.getDsSyncPeriodMillis() );

        // testEntries
        String entryFilePath = directoryServiceBean.getDsTestEntries();

        if ( entryFilePath != null )
        {
            directoryService.setTestEntries( readTestEntries( entryFilePath ) );
        }

        // Enabled
        if ( !directoryServiceBean.isEnabled() )
        {
View Full Code Here

    initKDCServer();
  }

  @SuppressWarnings("unchecked")
  private void initDirectoryService() throws Exception {
    ds = new DefaultDirectoryService();
    ds.setInstanceLayout(new InstanceLayout(workDir));

    CacheService cacheService = new CacheService();
    ds.setCacheService(cacheService);
View Full Code Here

        directoryService = ldapServer.getDirectoryService();

        if ( directoryService == null )
        {
            directoryService = new DefaultDirectoryService();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.DefaultDirectoryService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.