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

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


     * @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


public class Partition {
    private String id;
    private String baseDn;

    public JdbmPartition createJdbmPartition() {
        JdbmPartition partition = new JdbmPartition();

        partition.setId(id);
        partition.setSuffix(baseDn);

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

    return partition;
  }


  private static Partition createRootParition( String dn ) {
    JdbmPartition partition = new JdbmPartition();
    partition.setId( "root" );
    partition.setSuffix( dn );
    return partition;
  }
View Full Code Here

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

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

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

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

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

        assertNotNull( partitionLookupTree );
       
View Full Code Here

{

    @Test
    public void testAddAndRemove() throws Exception
    {
        JdbmPartition partition = new JdbmPartition();
        partition.setId( "removable" );
        partition.setSuffix( "ou=removable" );
        partition.setPartitionDir( service.getWorkingDirectory() );
       
        // Test AddContextPartition
        service.addPartition( partition );
       
        DN suffixDn = new DN( "ou=removable" );
        suffixDn.normalize( service.getSchemaManager().getNormalizerMapping() );
        ServerEntry ctxEntry = new DefaultServerEntry( service.getSchemaManager(), 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", UUID.randomUUID().toString() );
        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

     * @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

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.