Examples of Partition


Examples of org.apache.directory.server.core.api.partition.Partition

    /**
     * {@inheritDoc}
     */
    public void rename( RenameOperationContext renameContext ) throws LdapException
    {
        Partition partition = getPartition( renameContext.getDn() );
        partition.rename( renameContext );
    }
View Full Code Here

Examples of org.apache.directory.server.core.api.partition.Partition

        // Not sure we need this code...
        base.apply( schemaManager );

        // Normal case : do a search on the specific partition
        Partition backend = getPartition( base );

        return backend.search( searchContext );
    }
View Full Code Here

Examples of org.apache.directory.server.core.api.partition.Partition

    {
        Dn unbindContextDn = unbindContext.getDn();

        if ( !Dn.isNullOrEmpty( unbindContextDn ) )
        {
            Partition partition = getPartition( unbindContext.getDn() );
            partition.unbind( unbindContext );
        }
    }
View Full Code Here

Examples of org.apache.directory.server.core.api.partition.Partition

    {
        // Get the Partition name. It's a Dn.
        String key = partitionDn.getNormName();

        // Retrieve this partition from the aprtition's table
        Partition partition = partitions.get( key );

        if ( partition == null )
        {
            String msg = I18n.err( I18n.ERR_34, key );
            LOG.error( msg );
            throw new LdapNoSuchObjectException( msg );
        }

        String partitionSuffix = partition.getSuffixDn().getName();

        // Retrieve the namingContexts from the RootDSE : the partition
        // suffix must be present in those namingContexts
        Attribute namingContexts = rootDse.get( SchemaConstants.NAMING_CONTEXTS_AT );

        if ( namingContexts != null )
        {
            if ( namingContexts.contains( partitionSuffix ) )
            {
                namingContexts.remove( partitionSuffix );
            }
            else
            {
                String msg = I18n.err( I18n.ERR_35, key );
                LOG.error( msg );
                throw new LdapNoSuchObjectException( msg );
            }
        }

        // Update the partition tree
        synchronized ( partitionLookupTree )
        {
            partitionLookupTree.remove( partition.getSuffixDn() );
        }

        partitions.remove( key );

        try
        {
            partition.destroy();
        }
        catch ( Exception e )
        {
            throw new LdapOperationErrorException( e.getMessage(), e );
        }
View Full Code Here

Examples of org.apache.directory.server.core.api.partition.Partition

    /**
     * {@inheritDoc}
     */
    public Partition getPartition( Dn dn ) throws LdapException
    {
        Partition parent = null;

        if ( !dn.isSchemaAware() )
        {
           dn.apply( schemaManager );
        }
View Full Code Here

Examples of org.apache.directory.server.core.api.partition.Partition

    /**
     * {@inheritDoc}
     */
    public Dn getSuffixDn( Dn dn ) throws LdapException
    {
        Partition partition = getPartition( dn );

        return partition.getSuffixDn();
    }
View Full Code Here

Examples of org.apache.directory.server.core.api.partition.Partition

            if ( partitionBean.isDisabled() )
            {
                continue;
            }

            Partition partition = createPartition( directoryService, partitionBean );

            if ( partition != null )
            {
                partitions.put( partitionBean.getPartitionId(), partition );
            }
View Full Code Here

Examples of org.apache.directory.server.core.api.partition.Partition

        directoryService.setInterceptors( interceptors );

        // Partitions
        Map<String, Partition> partitions = createPartitions( directoryService, directoryServiceBean.getPartitions() );

        Partition systemPartition = partitions.remove( "system" );

        if ( systemPartition == null )
        {
            //throw new Exception( I18n.err( I18n.ERR_505 ) );
        }
View Full Code Here

Examples of org.apache.directory.server.core.api.partition.Partition

    {
        super.init( directoryService );
       
        numberHolder = new Dn( schemaManager, "ou=autoIncDataHolder,ou=system" );
       
        Partition systemPartition = directoryService.getSystemPartition();
       
        LookupOperationContext lookupContext = new LookupOperationContext( directoryService.getAdminSession(), numberHolder, SchemaConstants.ALL_ATTRIBUTES_ARRAY );
        Entry entry = systemPartition.lookup( lookupContext );
       
        if ( entry == null )
        {
            //FIXME make sure this entry addition gets replicated
            entry = new DefaultEntry( schemaManager );
            entry.setDn( numberHolder );
            entry.add( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.ORGANIZATIONAL_UNIT_OC );
            entry.add( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.EXTENSIBLE_OBJECT_OC );
            entry.add( SchemaConstants.OU_AT, numberHolder.getRdn().getValue().getString() );
            entry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
            entry.add( SchemaConstants.ENTRY_CSN_AT, directoryService.getCSN().toString() );
           
            AddOperationContext addContext = new AddOperationContext( directoryService.getAdminSession() );
            addContext.setDn( numberHolder );
            addContext.setEntry( new ClonedServerEntry( entry ) );
           
            LOG.debug( "Adding container entry to hold numeric attribute values" );
            systemPartition.add( addContext );
        }
        else
        {
            for ( Attribute at : entry )
            {
View Full Code Here

Examples of org.apache.directory.server.core.partition.Partition

        // 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( service.getSchemaManager() );
        ( ( JdbmPartition ) systemPartition ).setPartitionDir( new File( service.getWorkingDirectory(), "system" ) );

        // Add objectClass attribute for the system partition
        Set<Index<?, Entry, Long>> indexedAttrs = new HashSet<Index<?, Entry, Long>>();
        indexedAttrs.add( new JdbmIndex<Object, Entry>( SchemaConstants.OBJECT_CLASS_AT ) );
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.