Examples of JdbmPartition


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

        // 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

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

    }


    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

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

            ldapServer = new LdapServer();
            ldapServer.setTransports( new TcpTransport( consumerPort ) );
            ldapServer.setDirectoryService( dirService );

            LdapDN suffix = new LdapDN( config.getBaseDn() );
            JdbmPartition partition = new JdbmPartition();
            partition.setSuffix( suffix.getName() );
            partition.setId( "syncrepl" );
            partition.setPartitionDir( new File( workDir, partition.getId() ) );
            partition.setSyncOnWrite( true );
            partition.setSchemaManager( dirService.getSchemaManager() );
           
            // Add objectClass attribute for the system partition
            Set<Index<?, ServerEntry>> indexedAttrs = new HashSet<Index<?, ServerEntry>>();
            indexedAttrs.add( new JdbmIndex<Object, ServerEntry>( SchemaConstants.ENTRY_UUID_AT ) );
            ( ( JdbmPartition ) partition ).setIndexedAttributes( indexedAttrs );

            partition.initialize();

            dirService.addPartition( partition );

            dirService.startup();
View Full Code Here

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

        // 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

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

//        list.add( new EventInterceptor() );
//        list.add( new TriggerInterceptor() );
//        list.add( new JournalInterceptor() );

        service.setInterceptors( list );
        partition =  new JdbmPartition();
        partition.setId("rootPartition");
        partition.setSuffix(root);
        this.root = root;
        service.addPartition(partition);
        service.setExitVmOnShutdown(false);
View Full Code Here

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

    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

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

      service.getAdminSession().add(entry);
    }
  }

  protected Partition createPartition(String partitionId, String partitionDn) throws Exception {
    Partition partition = new JdbmPartition();
    partition.setId(partitionId);
    partition.setSuffix(partitionDn);
    service.addPartition(partition);
    return partition;
  }
View Full Code Here

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

     */
    @Test
    public void testImportContextEntryRefreshesRootDSE() throws Exception
    {
        // 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
        browserViewBot.selectEntry( "DIT", "Root DSE" );
        browserViewBot.refresh();
View Full Code Here

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

    // The schema partition
    SchemaPartition schemaPartition = new SchemaPartition(schemaManager);
    schemaPartition.setWrappedPartition(schemaLdifPartition);
    ds.setSchemaPartition(schemaPartition);

    JdbmPartition systemPartition = new JdbmPartition(ds.getSchemaManager());
    systemPartition.setId("system");
    systemPartition.setPartitionPath(new File(
            ds.getInstanceLayout().getPartitionsDirectory(),
            systemPartition.getId()).toURI());
    systemPartition.setSuffixDn(new Dn(ServerDNConstants.SYSTEM_DN));
    systemPartition.setSchemaManager(ds.getSchemaManager());
    ds.setSystemPartition(systemPartition);

    ds.getChangeLog().setEnabled(false);
    ds.setDenormalizeOpAttrsEnabled(true);
    ds.addLast(new KeyDerivationInterceptor());

    // create one partition
    String orgName= conf.getProperty(ORG_NAME).toLowerCase();
    String orgDomain = conf.getProperty(ORG_DOMAIN).toLowerCase();

    JdbmPartition partition = new JdbmPartition(ds.getSchemaManager());
    partition.setId(orgName);
    partition.setPartitionPath(new File(
            ds.getInstanceLayout().getPartitionsDirectory(), orgName).toURI());
    partition.setSuffixDn(new Dn("dc=" + orgName + ",dc=" + orgDomain));
    ds.addPartition(partition);
    // indexes
    Set<Index<?, ?, String>> indexedAttributes = new HashSet<Index<?, ?, String>>();
    indexedAttributes.add(new JdbmIndex<String, Entry>("objectClass", false));
    indexedAttributes.add(new JdbmIndex<String, Entry>("dc", false));
    indexedAttributes.add(new JdbmIndex<String, Entry>("ou", false));
    partition.setIndexedAttributes(indexedAttributes);

    // And start the ds
    ds.setInstanceId(conf.getProperty(INSTANCE));
    ds.startup();
    // context entry, after ds.startup()
View Full Code Here

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

        if ( ( jdbmPartitionBean == null ) || jdbmPartitionBean.isDisabled() )
        {
            return null;
        }
       
        JdbmPartition jdbmPartition = new JdbmPartition( directoryService.getSchemaManager() );
       
        jdbmPartition.setCacheSize( jdbmPartitionBean.getPartitionCacheSize() );
        jdbmPartition.setId( jdbmPartitionBean.getPartitionId() );
        jdbmPartition.setOptimizerEnabled( jdbmPartitionBean.isJdbmPartitionOptimizerEnabled() );
        File partitionPath = new File( directoryService.getInstanceLayout().getPartitionsDirectory(), jdbmPartitionBean.getPartitionId() );
        jdbmPartition.setPartitionPath( partitionPath.toURI() );
       
        try
        {
            jdbmPartition.setSuffixDn( jdbmPartitionBean.getPartitionSuffix() );
        }
        catch ( LdapInvalidDnException lide )
        {
            String message = "Cannot set the Dn " + jdbmPartitionBean.getPartitionSuffix() + ", " + lide.getMessage();
            LOG.error( message );
            throw new ConfigurationException( message );
        }
       
        jdbmPartition.setSyncOnWrite( jdbmPartitionBean.isPartitionSyncOnWrite() );
        jdbmPartition.setIndexedAttributes( createJdbmIndexes( jdbmPartition, jdbmPartitionBean.getIndexes(), directoryService ) );
       
        String contextEntry = jdbmPartitionBean.getContextEntry();
       
        if ( contextEntry != null )
        {
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.