Package org.apache.directory.server.core.partition.impl.btree.jdbm

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


    {
        /** A structure to hold all the partitions */
        DnNode<Partition> partitionLookupTree = new DnNode<Partition>();

        Dn suffix1 = new Dn( schemaManager, "dc=example, dc=com" );
        Partition partition1 = new JdbmPartition( schemaManager );
        partition1.setSuffixDn( suffix1 );

        partitionLookupTree.add( suffix1, partition1 );

        Dn suffix2 = new Dn( schemaManager, "ou=system" );
        Partition partition2 = new JdbmPartition( schemaManager );
        partition2.setSuffixDn( suffix2 );

        partitionLookupTree.add( suffix2, partition2 );

        assertNotNull( partitionLookupTree );
        assertTrue( partitionLookupTree.hasChildren() );
View Full Code Here


    {
        /** A structure to hold all the partitions */
        DnNode<Partition> partitionLookupTree = new DnNode<Partition>();

        Dn suffix1 = new Dn( schemaManager, "dc=example1, dc=com" );
        Partition partition1 = new JdbmPartition( schemaManager );
        partition1.setSuffixDn( suffix1 );

        partitionLookupTree.add( suffix1, partition1 );

        Dn suffix2 = new Dn( schemaManager, "dc=example2, dc=com" );
        Partition partition2 = new JdbmPartition( schemaManager );
        partition2.setSuffixDn( suffix2 );

        partitionLookupTree.add( suffix2, partition2 );

        assertNotNull( partitionLookupTree );

View Full Code Here

            list.add(new AuthenticationInterceptor());
            list.add(new ReferralInterceptor());
            list.add(new ExceptionInterceptor());
            list.add(new OperationalAttributeInterceptor());
            list.add(new SubentryInterceptor());
            final JdbmPartition partition = new JdbmPartition();
            partition.setId("rootPartition");
            partition.setSuffix(root);
            service.setWorkingDirectory(workingDirectory);
            service.addPartition(partition);
            service.setExitVmOnShutdown(false);
            service.setShutdownHookEnabled(false);
            service.getChangeLog().setEnabled(false);
View Full Code Here

        LOGGER.info("Starting apacheDS server...");
        int port = Integer.valueOf(getParameter(LDAP_PORT, DEFAULT_LDAP_PORT));
        long start = System.currentTimeMillis();
        try
        {
            JdbmPartition partition = getDefaultPartition();
            reset(new File(getParameter(LDAP_WORKING_DIR, DEFAULT_WORKING_DIRECTORY)));
            service.addPartition(partition);
            configureLdapServer(port);
            configureLdifDirectory(new File(getParameter(LDAP_LDIF_DIR, DEFAULT_LDIF_DIRECTORY)));
            apacheDs.startup();
View Full Code Here

        LOGGER.info("ApacheDS started in {} milliseconds", System.currentTimeMillis() - start);
    }

    private JdbmPartition getDefaultPartition() throws LdapInvalidDnException
    {
        JdbmPartition partition = new JdbmPartition();

        partition.setId("springframework.org");
        partition.setSuffix("dc=springframework,dc=org");
        return partition;
    }
View Full Code Here

    private JdbmPartition createSystemPartition(final DefaultDirectoryService service,
        final File workingDirectory) throws Exception
    {
        JdbmPartitionFactory partitionFactory = new JdbmPartitionFactory();
        JdbmPartition systemPartition =
            partitionFactory.createPartition("system", ServerDNConstants.SYSTEM_DN, 500,
                new File(workingDirectory, "system"));
        partitionFactory.addIndex(systemPartition, SchemaConstants.OBJECT_CLASS_AT, 100);

        systemPartition.setSchemaManager(service.getSchemaManager());
        return systemPartition;
    }
View Full Code Here

     */
    @Test
    public void testImportContextEntryRefreshesRootDSE() throws Exception
    {
        // add a new partition
        Partition partition = new JdbmPartition();
        partition.setId( "example" );
        partition.setSuffix( new Dn( "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

    * @throws Exception If the partition can't be added
    */
   private Partition addPartition( String partitionId, String partitionDn ) throws Exception
   {
       // Create a new partition named 'foo'.
       JdbmPartition partition = new JdbmPartition();
       partition.setId( partitionId );
       partition.setPartitionDir( new File( service.getWorkingDirectory(), partitionId ) );
       partition.setSuffix( partitionDn );
       service.addPartition( partition );

       return partition;
   }
View Full Code Here

     * @return The newly added partition
     * @throws Exception If the partition can't be added
     */
    private Partition addPartition(final String partitionId, final String partitionDn) throws Exception {
        // Create a new partition named 'foo'.
        final JdbmPartition partition = new JdbmPartition();
        partition.setId(partitionId);
        partition.setPartitionDir(new File(service.getWorkingDirectory(), partitionId));
        partition.setSuffix(partitionDn);
        service.addPartition(partition);

        return partition;
    }
View Full Code Here

    private static File workingDir = new File("target/ldapServer");

    private Partition addPartition(String partitionId, String partitionDn) throws Exception {
        // Create a new partition named 'ippon'.
        Partition partition = new JdbmPartition();
        partition.setId(partitionId);
        partition.setSuffix(partitionDn);
        service.addPartition(partition);

        return partition;
    }
View Full Code Here

TOP

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

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.