Package org.apache.ldap.server.partition.impl.btree

Examples of org.apache.ldap.server.partition.impl.btree.Index


        Iterator list = array.iterator();

        // Sync all user defined indices
        while ( list.hasNext() )
        {
            Index idx = ( Index ) list.next();

            idx.sync();
        }
       
        master.sync();

        try
View Full Code Here


     * @throws Exception if the indices cannot be accessed
     */
    public void showIndexDialog( String idxAttr )
        throws Exception
    {
        Index index = null;
        boolean isSystem = partition.hasSystemIndexOn( idxAttr );
       
        if ( isSystem )
        {
            index = partition.getSystemIndex( idxAttr );
View Full Code Here

        Iterator list = array.iterator();
        MultiException rootCause = null;
       
        while ( list.hasNext() )
        {
            Index index = ( Index ) list.next();

            try
            {
               index.close();
            }
            catch ( Throwable t )
            {
                if ( null == rootCause )
                {
View Full Code Here

        MultiException rootCause = null;

        // Sync all user defined indices
        while ( list.hasNext() )
        {
            Index idx = ( Index ) list.next();

            try
            {
                idx.sync();
            }
            catch ( Throwable t )
            {
                t.printStackTrace();
                if ( null == rootCause )
View Full Code Here

    // ------------------------------------------------------------------------


    public void addIndexOn( AttributeType spec ) throws NamingException
    {
        Index idx = new JdbmIndex( spec, workingDirectory );
        indices.put( spec.getName().toLowerCase(), idx );
    }
View Full Code Here

        {
            String attribute = ( String ) list.next();
           
            if ( hasUserIndexOn( attribute ) )
            {
                Index idx = getUserIndex( attribute );
                NamingEnumeration values = entry.get( attribute ).getAll();
               
                while ( values.hasMore() )
                {
                    idx.add( values.next(), id );
                }

                // Adds only those attributes that are indexed
                existanceIdx.add( attribute.toLowerCase(), id );
            }
View Full Code Here

        {
            String attr = ( ( String ) attrs.next() );

            if ( hasUserIndexOn( attr ) )
            {
                Index index = getUserIndex( attr );
                NamingEnumeration values = entry.get( attr ).getAll();
               
                while ( values.hasMore() )
                {
                    index.drop( values.next(), id );
                }

                existanceIdx.drop( attr.toLowerCase(), id );
            }
        }
View Full Code Here

        // Get all standard index attribute to value mappings
        Iterator idxList = this.indices.values().iterator();
        while ( idxList.hasNext() )
        {
            Index index = ( Index ) idxList.next();
            NamingEnumeration list = index.listReverseIndices( id );
            while ( list.hasMore() )
            {
                IndexRecord rec = ( IndexRecord ) list.next();
                Object val = rec.getIndexKey();
                attributes.put( index.getAttribute().getName(), val );
            }
        }

        // Get all existance mappings for this id creating a special key
        // that looks like so 'existance[attribute]' and the value is set to id
View Full Code Here

    private void add( BigInteger id, Attributes entry, Attribute mods )
        throws NamingException
    {
        if ( hasUserIndexOn( mods.getID() ) )
        {
            Index idx = getUserIndex( mods.getID() );
            idx.add( mods, id );

            // If the attr didn't exist for this id add it to existance index
            if ( ! existanceIdx.hasValue( mods.getID(), id ) )
            {
                idx.add( mods.getID(), id );
            }
        }
       
        entry.put( mods );
View Full Code Here

    private void remove( BigInteger id, Attributes entry, Attribute mods )
        throws NamingException
    {
        if ( hasUserIndexOn( mods.getID() ) )
        {
            Index idx = getUserIndex( mods.getID() );
            idx.drop( mods, id );
   
            /*
             * If no attribute values exist for this entryId in the index then
             * we remove the existance index entry for the removed attribute.
             */
            if ( null == idx.reverseLookup( id ) )
            {
                existanceIdx.drop( mods.getID(), id );
            }
        }

View Full Code Here

TOP

Related Classes of org.apache.ldap.server.partition.impl.btree.Index

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.