Examples of LdifPartition


Examples of org.apache.directory.server.core.partition.ldif.LdifPartition

        }

        directoryService.setSchemaManager( schemaManager );

        // Init the LdifPartition
        LdifPartition ldifPartition = new LdifPartition( schemaManager, directoryService.getDnFactory() );
        ldifPartition.setPartitionPath( new File( workingDirectory, "schema" ).toURI() );
        SchemaPartition schemaPartition = new SchemaPartition( schemaManager );
        schemaPartition.setWrappedPartition( ldifPartition );
        directoryService.setSchemaPartition( schemaPartition );

        List<Throwable> errors = schemaManager.getErrors();
View Full Code Here

Examples of org.apache.directory.server.core.partition.ldif.LdifPartition

    public LdifPartition createPartition( SchemaManager schemaManager, DnFactory dnFactory, String id, String suffix,
        int cacheSize,
        File workingDirectory )
        throws Exception
    {
        LdifPartition partition = new LdifPartition( schemaManager, dnFactory );
        partition.setId( id );
        partition.setSuffixDn( new Dn( suffix ) );
        partition.setCacheSize( 500 );
        partition.setPartitionPath( workingDirectory.toURI() );

        return partition;
    }
View Full Code Here

Examples of org.apache.directory.server.core.partition.ldif.LdifPartition

        if ( !( partition instanceof LdifPartition ) )
        {
            throw new IllegalArgumentException( "Partition must be a LdifPartition" );
        }

        LdifPartition ldifPartition = ( LdifPartition ) partition;
        Set<Index<?, String>> indexedAttributes = ldifPartition.getIndexedAttributes();

        AvlIndex<Object> index = new AvlIndex<Object>( attributeId, false );
        //index.setCacheSize( cacheSize );

        indexedAttributes.add( index );
        ldifPartition.setIndexedAttributes( indexedAttributes );
    }
View Full Code Here

Examples of org.apache.directory.server.core.partition.ldif.LdifPartition

        SchemaLoader loader = new LdifSchemaLoader( schemaRepository );
        SchemaManager schemaManager = new DefaultSchemaManager( loader );
        directoryService.setSchemaManager( schemaManager );

        // Init the LdifPartition
        LdifPartition ldifPartition = new LdifPartition( schemaManager, directoryService.getDnFactory() );
        ldifPartition.setPartitionPath( new File( workingDirectory, "schema" ).toURI() );

        schemaPartition.setWrappedPartition( ldifPartition );

        // We have to load the schema now, otherwise we won't be able
        // to initialize the Partitions, as we won't be able to parse
View Full Code Here

Examples of org.apache.directory.server.core.partition.ldif.LdifPartition

    private void initSchema( DirectoryService service ) throws Exception
    {
        SchemaPartition schemaPartition = service.getSchemaService().getSchemaPartition();

        // Init the LdifPartition
        LdifPartition ldifPartition = new LdifPartition();
        String workingDirectory = service.getWorkingDirectory().getPath();
        ldifPartition.setWorkingDirectory( workingDirectory + "/schema" );

        // Extract the schema on disk (a brand new one) and load the registries
        File schemaRepository = new File( workingDirectory, "schema" );
        SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor( new File( workingDirectory ) );
        extractor.extractOrCopy( true );
View Full Code Here

Examples of org.apache.directory.server.core.partition.ldif.LdifPartition

        }

        directoryService.setSchemaManager( schemaManager );

        // Init the LdifPartition
        LdifPartition ldifPartition = new LdifPartition( schemaManager );
        ldifPartition.setPartitionPath( new File( workingDirectory, "schema" ).toURI() );
        SchemaPartition schemaPartition = new SchemaPartition( schemaManager );
        schemaPartition.setWrappedPartition( ldifPartition );
        directoryService.setSchemaPartition( schemaPartition );

        List<Throwable> errors = schemaManager.getErrors();
View Full Code Here

Examples of org.apache.directory.server.core.partition.ldif.LdifPartition

        wkdir = new File( wkdir.getParentFile(), getClass().getSimpleName() );
        wkdir.mkdirs();

        // initialize the store
        // initialize the partition
        partition = new LdifPartition();
        partition.setId( "test-ldif" );
        partition.setSuffix( "ou=test,ou=system" );
        partition.setSchemaManager( schemaManager );
        partition.setWorkingDirectory( wkdir.getAbsolutePath() );
       
View Full Code Here

Examples of org.apache.directory.server.core.partition.ldif.LdifPartition

            throw new Exception( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
        }

        LdifConfigExtractor.extract( workDir, true );

        LdifPartition configPartition = new LdifPartition();
        configPartition.setId( "config" );
        configPartition.setSuffix( "ou=config" );
        configPartition.setSchemaManager( schemaManager );
        configPartition.setWorkingDirectory( workingDirectory + "/config" );
        configPartition.setPartitionDir( new File( configPartition.getWorkingDirectory() ) );

        configPartition.initialize();

        ConfigPartitionReader cpReader = new ConfigPartitionReader( configPartition );
        dirService = cpReader.getDirectoryService();

        SchemaPartition schemaPartition = dirService.getSchemaService().getSchemaPartition();

        // Init the schema partition's wrapped LdifPartition
        LdifPartition wrappedPartition = new LdifPartition();
        wrappedPartition.setWorkingDirectory( new File( workDir, schemaPartition.getId() ).getAbsolutePath() );
        schemaPartition.setWrappedPartition( wrappedPartition );
        schemaPartition.setSchemaManager( schemaManager );

        dirService.setWorkingDirectory( workDir );
        dirService.setSchemaManager( schemaManager );
View Full Code Here

Examples of org.apache.directory.server.core.partition.ldif.LdifPartition

    private void initSchema() throws Exception
    {
        SchemaPartition schemaPartition = directoryService.getSchemaService().getSchemaPartition();

        // Init the LdifPartition
        LdifPartition ldifPartition = new LdifPartition();
        String workingDirectory = directoryService.getWorkingDirectory().getPath();
        ldifPartition.setWorkingDirectory( workingDirectory + "/schema" );

        // Extract the schema on disk (a brand new one) and load the registries
        File schemaRepository = new File( workingDirectory, "schema" );
        SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor( new File( workingDirectory ) );
        extractor.extractOrCopy();
View Full Code Here

Examples of org.apache.directory.server.core.partition.ldif.LdifPartition

    private void initSchema() throws Exception
    {
        SchemaPartition schemaPartition = dirService.getSchemaService().getSchemaPartition();

        // Init the LdifPartition
        LdifPartition ldifPartition = new LdifPartition();
        String workingDirectory = dirService.getWorkingDirectory().getPath();
        ldifPartition.setWorkingDirectory( workingDirectory + "/schema" );

        // Extract the schema on disk (a brand new one) and load the registries
        File schemaRepository = new File( workingDirectory, "schema" );
        SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor( new File( workingDirectory ) );
        extractor.extractOrCopy( true );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.