Package org.apache.directory.server.core.partition

Examples of org.apache.directory.server.core.partition.Partition


        // change the working directory to something that is unique
        // on the system and somewhere either under target directory
        // or somewhere in a temp area of the machine.

        // Inject the System Partition
        Partition systemPartition = new JdbmPartition();
        systemPartition.setId( "system" );
        ( ( JdbmPartition ) systemPartition ).setCacheSize( 500 );
        systemPartition.setSuffix( ServerDNConstants.SYSTEM_DN );
        systemPartition.setSchemaManager( service.getSchemaManager() );
        ( ( JdbmPartition ) systemPartition ).setPartitionDir( new File( service.getWorkingDirectory(), "system" ) );

        // Add objectClass attribute for the system partition
        Set<Index<?, Entry, Long>> indexedAttrs = new HashSet<Index<?, Entry, Long>>();
        indexedAttrs.add( new JdbmIndex<Object, Entry>( SchemaConstants.OBJECT_CLASS_AT ) );
View Full Code Here


        DN partitionsDN = new DN( dsEntry.get( "ads-dsPartitions" ).getString() );
        partitionsDN.normalize( configPartition.getSchemaManager().getNormalizerMapping() );

        Map<String, Partition> partitions = getPartitions( partitionsDN );

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

        if ( systemPartition == null )
        {
            throw new Exception( I18n.err( I18n.ERR_505 ) );
        }
View Full Code Here

            ModificationItem[] mods = new ModificationItem[]
                { new ModificationItem( DirContext.REMOVE_ATTRIBUTE, disabled ) };
            schemaRoot.modifyAttributes( "cn=nis", mods );
        }

        Partition systemPartition = service.getSystemPartition();
        Set<Index<? extends Object, ServerEntry, Long>> indexedAtributes = ( ( JdbmPartition ) systemPartition )
            .getIndexedAttributes();
        indexedAtributes.add( new JdbmIndex<String, ServerEntry>( "gidNumber" ) );

        // -------------------------------------------------------------------
View Full Code Here

        // change the working directory to something that is unique
        // on the system and somewhere either under target directory
        // or somewhere in a temp area of the machine.

        // Inject the System Partition
        Partition systemPartition = new JdbmPartition();
        systemPartition.setId( "system" );
        ( ( JdbmPartition ) systemPartition ).setCacheSize( 500 );
        systemPartition.setSuffix( ServerDNConstants.SYSTEM_DN );
        systemPartition.setSchemaManager( directoryService.getSchemaManager() );
        ( ( JdbmPartition ) systemPartition ).setPartitionDir( new File( directoryService.getWorkingDirectory(),
            "system" ) );

        // Add objectClass attribute for the system partition
        Set<Index<?, ServerEntry, Long>> indexedAttrs = new HashSet<Index<?, ServerEntry, Long>>();
View Full Code Here

    }


    public void initJdbmPartition( String name, String suffix ) throws Exception
    {
        Partition partition = new JdbmPartition();
        partition.setId( name );
        partition.setSuffix( suffix );
        partition.setSchemaManager( directoryService.getSchemaManager() );
        ( ( JdbmPartition ) partition ).setPartitionDir( new File( directoryService.getWorkingDirectory(), name ) );
        directoryService.addPartition( partition );
    }
View Full Code Here

        // Process the Partition, if any.
        for ( CreatePartition createPartition : dsBuilder.partitions() )
        {
            // Create the partition
            Partition partition = createPartition.type().newInstance();
            partition.setId( createPartition.name() );
            partition.setSuffix( createPartition.suffix() );
            partition.setSchemaManager( service.getSchemaManager() );

            if ( partition instanceof BTreePartition<?> )
            {
                BTreePartition<Object> btreePartition = ( BTreePartition<Object> ) partition;
                btreePartition.setCacheSize( createPartition.cacheSize() );
                btreePartition.setPartitionDir( new File( service.getWorkingDirectory(), createPartition.name() ) );

                // Process the indexes if any
                CreateIndex[] indexes = createPartition.indexes();

                for ( CreateIndex createIndex : indexes )
                {
                    Index<? extends Object, ServerEntry, Object> index = createIndex.type().newInstance();
                    index.setAttributeId( createIndex.attribute() );
                    index.setCacheSize( createIndex.cacheSize() );
                    btreePartition.addIndexedAttributes( index );
                }
            }

            partition.setSchemaManager( service.getSchemaManager() );

            // Inject the partition into the DirectoryService
            service.addPartition( partition );

            // Last, process the context entry
View Full Code Here

        // change the working directory to something that is unique
        // on the system and somewhere either under target directory
        // or somewhere in a temp area of the machine.

        // Inject the System Partition
        Partition systemPartition = new JdbmPartition();
        systemPartition.setId( "system" );
        ( ( JdbmPartition ) systemPartition ).setCacheSize( 500 );
        systemPartition.setSuffix( ServerDNConstants.SYSTEM_DN );
        systemPartition.setSchemaManager( dirService.getSchemaManager() );
        ( ( JdbmPartition ) systemPartition ).setPartitionDir( new File( dirService.getWorkingDirectory(), "system" ) );

        // Add objectClass attribute for the system partition
        Set<Index<?, ServerEntry>> indexedAttrs = new HashSet<Index<?, ServerEntry>>();
        indexedAttrs.add( new JdbmIndex<Object, ServerEntry>( SchemaConstants.OBJECT_CLASS_AT ) );
View Full Code Here

        int launchedWindowCount = 0;
           
        for ( String suffix:suffixes )
        {
            DN dn = new DN( suffix );
            Partition partition = nexus.getPartition( dn );
           
            if ( partition instanceof BTreePartition )
            {
                try
                {
View Full Code Here

            {
                TaggableSearchableChangeLogStore tmp = ( TaggableSearchableChangeLogStore ) store;
               
                tmp.createPartition( partitionSuffix, revContainerName, tagContainerName );
               
                Partition partition = tmp.getPartition();
                partition.initialize( );

                service.addPartition( partition );
            }
        }
       
View Full Code Here

    public void testImportContextEntryRefreshesRootDSE() throws Exception
    {
        final SWTBotTree browserTree = SWTBotUtils.getLdapBrowserTree( eBot );

        // add a new partition
        Partition partition = new JdbmPartition();
        partition.setId( "example" );
        partition.setSuffix( "dc=example,dc=com" );
        ldapServer.getDirectoryService().addPartition( partition );

        // refresh root DSE and ensure that the partition is in root DSE
        SWTBotTreeItem rootDSE = SWTBotUtils.selectEntry( eBot, browserTree, false, "DIT", "Root DSE" );
        ContextMenuHelper.clickContextMenu( browserTree, "Reload Entry" );
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.partition.Partition

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.