Examples of JdbmPartition


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

     * {@inheritDoc}
     */
    public JdbmPartition createPartition( SchemaManager schemaManager, String id, String suffix, int cacheSize, File workingDirectory )
        throws Exception
    {
        JdbmPartition partition = new JdbmPartition( schemaManager );
        partition.setId( id );
        partition.setSuffixDn( new Dn( suffix ) );
        partition.setCacheSize( 500 );
        partition.setPartitionPath( workingDirectory.toURI() );
        partition.initialize();
       
        return partition;
    }
View Full Code Here

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

        if ( !( partition instanceof JdbmPartition ) )
        {
            throw new IllegalArgumentException( "Partition must be a JdbmPartition" );
        }

        JdbmPartition jdbmPartition = ( JdbmPartition ) partition;
        Set<Index<?, Entry, Long>> indexedAttributes = jdbmPartition.getIndexedAttributes();

        JdbmIndex<Object, Entry> index = new JdbmIndex<Object, Entry>( attributeId );
        index.setCacheSize( cacheSize );

        indexedAttributes.add( index );
        jdbmPartition.setIndexedAttributes( indexedAttributes );
    }
View Full Code Here

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

     */
    public void addPartition(PartitionInfo partitionInformation)
            throws DirectoryServerException {

        try {
            JdbmPartition partition = createNewPartition(partitionInformation.getPartitionId(),
                                                         partitionInformation.getRootDN());
            this.directoryService.addPartition(partition);

            CoreSession adminSession = this.directoryService.getAdminSession();

            if (!adminSession.exists(partition.getSuffixDn())) {

                addPartitionAttributes(partitionInformation.getRootDN(), partitionInformation.
                        getObjectClasses(), partitionInformation.getRealm(),
                                       partitionInformation.getPreferredDomainComponent());

                // Create user ou
                addUserStoreToPartition(partition.getSuffix());

                // Create group ou
                addGroupStoreToPartition(partition.getSuffix());
                // create tenant administrator entry at the time of tenant-partition created.
                addAdmin(partitionInformation.getPartitionAdministrator(), partition.
                        getSuffix(), partitionInformation.getRealm(), partitionInformation.
                        isKdcEnabled());
                addAdminGroup(partitionInformation.getPartitionAdministrator(), partition.
                        getSuffix());

                addAdminACLEntry(partitionInformation.getPartitionAdministrator().getAdminUID(),
                                 partition.getSuffix());

                this.directoryService.sync();
            }


View Full Code Here

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

    }

    private JdbmPartition createNewPartition(String partitionId, String partitionSuffix)
            throws DirectoryServerException {
        try {
            JdbmPartition partition = new JdbmPartition();
            String partitionDirectoryName = this.workingDirectory + File.separator + partitionId;
            File partitionDirectory = new File(partitionDirectoryName);

            partition.setId(partitionId);
            partition.setSuffix(partitionSuffix);
            partition.setPartitionDir(partitionDirectory);

            Set<Index<?, ServerEntry, Long>> indexedAttrs =
                    new HashSet<Index<?, ServerEntry, Long>>();

            indexedAttrs.add(new JdbmIndex<String, ServerEntry>("1.3.6.1.4.1.18060.0.4.1.2.1"));
            indexedAttrs.add(new JdbmIndex<String, ServerEntry>("1.3.6.1.4.1.18060.0.4.1.2.2"));
            indexedAttrs.add(new JdbmIndex<String, ServerEntry>("1.3.6.1.4.1.18060.0.4.1.2.3"));
            indexedAttrs.add(new JdbmIndex<String, ServerEntry>("1.3.6.1.4.1.18060.0.4.1.2.4"));
            indexedAttrs.add(new JdbmIndex<String, ServerEntry>("1.3.6.1.4.1.18060.0.4.1.2.5"));
            indexedAttrs.add(new JdbmIndex<String, ServerEntry>("1.3.6.1.4.1.18060.0.4.1.2.6"));
            indexedAttrs.add(new JdbmIndex<String, ServerEntry>("1.3.6.1.4.1.18060.0.4.1.2.7"));

            indexedAttrs.add(new JdbmIndex<String, ServerEntry>("ou"));
            indexedAttrs.add(new JdbmIndex<String, ServerEntry>("dc"));
            indexedAttrs.add(new JdbmIndex<String, ServerEntry>("objectClass"));
            indexedAttrs.add(new JdbmIndex<String, ServerEntry>("cn"));
            indexedAttrs.add(new JdbmIndex<String, ServerEntry>("uid"));
            partition.setIndexedAttributes(indexedAttrs);

            String message = MessageFormat.format(
                    "Partition created with following attributes, partition id - {0}, Partition " +
                    "domain - {1}, Partition working directory {2}", partitionId,
                    partitionSuffix, partitionDirectoryName);
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>();
       
        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

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>();
       
        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

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>();
       
        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

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>();
       
        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

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

     * {@inheritDoc}
     */
    public JdbmPartition createPartition( String id, String suffix, int cacheSize, File workingDirectory )
        throws Exception
    {
        JdbmPartition partition = new JdbmPartition();
        partition.setId( id );
        partition.setSuffix( suffix );
        partition.setCacheSize( 500 );
        partition.setPartitionDir( workingDirectory );
        return partition;
    }
View Full Code Here

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

        if ( !( partition instanceof JdbmPartition ) )
        {
            throw new IllegalArgumentException( "Partition must be a JdbmPartition" );
        }

        JdbmPartition jdbmPartition = ( JdbmPartition ) partition;
        Set<Index<? extends Object, ServerEntry, Long>> indexedAttributes = jdbmPartition.getIndexedAttributes();

        JdbmIndex<Object, ServerEntry> index = new JdbmIndex<Object, ServerEntry>( attributeId );
        index.setCacheSize( cacheSize );

        indexedAttributes.add( index );
        jdbmPartition.setIndexedAttributes( indexedAttributes );
    }
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.