Examples of JdbmPartition


Examples of org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition

       
        // --------------------------------------------------------------------
        // Initialize schema partition
        // --------------------------------------------------------------------

        schemaPartition = new JdbmPartition();
        schemaPartition.setId( "schema" );
        schemaPartition.setCacheSize( 1000 );

        Set<Index<?, ServerEntry>> indexedAttributes = new HashSet<Index<?, ServerEntry>>();
        for ( String attributeId : extractor.getDbFileListing().getIndexedAttributes() )
View Full Code Here

Examples of org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition

    {
        /** A structure to hold all the partitions */
        DnBranchNode<Partition> partitionLookupTree = new DnBranchNode<Partition>();
       
        LdapDN suffix = new LdapDN( "dc=example, dc=com" );
        Partition partition = new JdbmPartition();
        partition.setSuffix( suffix.getUpName() );
       
        partitionLookupTree.add( suffix, partition );
       
        assertNotNull( partitionLookupTree );
        assertTrue( partitionLookupTree instanceof DnBranchNode );
View Full Code Here

Examples of org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition

    {
        /** A structure to hold all the partitions */
        DnBranchNode<Partition> partitionLookupTree = new DnBranchNode<Partition>();
       
        LdapDN suffix1 = new LdapDN( "dc=example, dc=com" );
        Partition partition1 = new JdbmPartition();
        partition1.setSuffix( suffix1.getUpName() );
       
        partitionLookupTree.add( suffix1, partition1 );
       
        LdapDN suffix2 = new LdapDN( "ou=system" );
        Partition partition2 = new JdbmPartition();
        partition2.setSuffix( suffix2.getUpName() );
       
        partitionLookupTree.add( suffix2, partition2 );

        assertNotNull( partitionLookupTree );
        assertTrue( partitionLookupTree instanceof DnBranchNode );
View Full Code Here

Examples of org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition

    {
        /** A structure to hold all the partitions */
        DnBranchNode<Partition> partitionLookupTree = new DnBranchNode<Partition>();
       
        LdapDN suffix1 = new LdapDN( "dc=com" );
        Partition partition1 = new JdbmPartition();
        partition1.setSuffix( suffix1.getUpName() );
       
        partitionLookupTree.add( suffix1, partition1 );
       
        LdapDN suffix2 = new LdapDN( "dc=example, dc=com" );
        Partition partition2 = new JdbmPartition();
        partition2.setSuffix( suffix2.getUpName() );
       
        try
        {
            partitionLookupTree.add( suffix2, partition2 );
            fail();
View Full Code Here

Examples of org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition

    {
        /** A structure to hold all the partitions */
        DnBranchNode<Partition> partitionLookupTree = new DnBranchNode<Partition>();
       
        LdapDN suffix1 = new LdapDN( "dc=example1, dc=com" );
        Partition partition1 = new JdbmPartition();
        partition1.setSuffix( suffix1.getUpName() );
       
        partitionLookupTree.add( suffix1, partition1 );
       
        LdapDN suffix2 = new LdapDN( "dc=example2, dc=com" );
        Partition partition2 = new JdbmPartition();
        partition2.setSuffix( suffix2.getUpName() );
       
        partitionLookupTree.add( suffix2, partition2 );

        assertNotNull( partitionLookupTree );
       
View Full Code Here

Examples of org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition


    @Test
    public void testAddAndRemove() throws Exception
    {
        Partition partition = new JdbmPartition();
        partition.setId( "removable" );
        partition.setSuffix( "ou=removable" );
       
        // Test AddContextPartition
        service.addPartition( partition );
       
        LdapDN suffixDn = new LdapDN( "ou=removable" );
        suffixDn.normalize( service.getRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
        ServerEntry ctxEntry = new DefaultServerEntry( service.getRegistries(), suffixDn );
        ctxEntry.put( "objectClass", "top" );
        ctxEntry.get( "objectClass" ).add( "organizationalUnit" );
        ctxEntry.put( "ou", "removable" );
        ctxEntry.put( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
        ctxEntry.put( "entryUUID", SchemaUtils.uuidToBytes( UUID.randomUUID() ) );
        partition.add( new AddOperationContext( service.getAdminSession(), ctxEntry ) );
       
        Hashtable<String,Object> env = new Hashtable<String,Object>();
        env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
        env.put( DirectoryService.JNDI_KEY, service );
        env.put( Context.SECURITY_CREDENTIALS, "secret" );
View Full Code Here

Examples of org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition

        public DirectoryService newInstance() throws Exception
        {
            DirectoryService service = new DefaultDirectoryService();
            service.getChangeLog().setEnabled( true );
           
            Partition foo = new JdbmPartition();
            foo.setId( "foo" );
            foo.setSuffix( "dc=foo,dc=com" );
            service.addPartition( foo );
           
            Partition bar = new JdbmPartition();
            bar.setId( "bar" );
            bar.setSuffix( "dc=bar,dc=com" );
            service.addPartition( bar );
           
            return service;
        }
View Full Code Here

Examples of org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition

            system = override;
        }
        else
        {
            system = new JdbmPartition();
            system.setId( "system" );
            system.setCacheSize( 500 );
            system.setSuffix( ServerDNConstants.SYSTEM_DN );
   
            // Add objectClass attribute for the system partition
View Full Code Here

Examples of org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition

            }
            EntryAttribute ocAttr = partitionEntry.get( "objectClass" );

            if ( ocAttr.contains( "ads-jdbmPartition" ) )
            {
                JdbmPartition partition = getJdbmPartition( partitionEntry );
                partitions.put( partition.getId(), partition );
            }
            else
            {
                throw new NotImplementedException( I18n.err( I18n.ERR_506 ) );
            }
View Full Code Here

Examples of org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition

    }


    private JdbmPartition getJdbmPartition( ServerEntry partitionEntry ) throws Exception
    {
        JdbmPartition partition = new JdbmPartition();
        partition.setSchemaManager( schemaManager );

        partition.setId( getString( "ads-partitionId", partitionEntry ) );
        partition.setPartitionDir( new File( workDir, partition.getId() ) );

        partition.setSuffix( getString( "ads-partitionSuffix", partitionEntry ) );

        EntryAttribute cacheAttr = partitionEntry.get( "ads-partitionCacheSize" );

        if ( cacheAttr != null )
        {
            partition.setCacheSize( Integer.parseInt( cacheAttr.getString() ) );
        }

        EntryAttribute optimizerAttr = partitionEntry.get( "ads-jdbmPartitionOptimizerEnabled" );

        if ( optimizerAttr != null )
        {
            partition.setOptimizerEnabled( Boolean.parseBoolean( optimizerAttr.getString() ) );
        }

        EntryAttribute syncAttr = partitionEntry.get( "ads-partitionSyncOnWrite" );

        if ( syncAttr != null )
        {
            partition.setSyncOnWrite( Boolean.parseBoolean( syncAttr.getString() ) );
        }

        String indexesDN = partitionEntry.get( "ads-partitionIndexedAttributes" ).getString();

        Set<Index<?, ServerEntry, Long>> indexedAttributes = getIndexes( new DN( indexesDN ) );
        partition.setIndexedAttributes( indexedAttributes );

        return partition;
    }
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.