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

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


        {
            Index index = ( Index ) idxList.next();
            NamingEnumeration list = index.listReverseIndices( id );
            while ( list.hasMore() )
            {
                IndexRecord rec = ( IndexRecord ) list.next();
                Object val = rec.getIndexKey();
                String attrId = index.getAttribute().getName();
                Attribute attr = attributes.get( attrId );
                if ( attr == null)
                {
                    attr = new LockableAttributeImpl( attrId );
                }
                attr.add( val );
                attributes.put( attr );
            }
        }

        // Get all existance mappings for this id creating a special key
        // that looks like so 'existance[attribute]' and the value is set to id
        NamingEnumeration list = existanceIdx.listReverseIndices( id );
        StringBuffer val = new StringBuffer();
        while ( list.hasMore() )
        {
            IndexRecord rec = ( IndexRecord ) list.next();
            val.append( "_existance[" );
            val.append( rec.getIndexKey() );
            val.append( "]" );

            String valStr = val.toString();
            Attribute attr = attributes.get( valStr );
            if ( attr == null )
            {
                attr = new LockableAttributeImpl( valStr );
            }
            attr.add( rec.getEntryId() );
            attributes.put( attr );
            val.setLength( 0 );
        }

        // Get all parent child mappings for this entry as the parent using the
        // key 'child' with many entries following it.
        list = hierarchyIdx.listIndices( id );
        Attribute childAttr = new LockableAttributeImpl( "_child" );
        attributes.put( childAttr );
        while ( list.hasMore() )
        {
            IndexRecord rec = ( IndexRecord ) list.next();
            childAttr.add( rec.getEntryId() );
        }

        return attributes;
    }
View Full Code Here


       
        NamingEnumeration children = list( id );
        while ( children.hasMore() )
        {
            // Get the child and its id
            IndexRecord rec = ( IndexRecord ) children.next();
            BigInteger childId = rec.getEntryId();
           
            /*
             * Calculate the Dn for the child's new name by copying the parents
             * new name and adding the child's old upRdn to new name as its Rdn
             */
 
View Full Code Here

        NamingEnumeration aliases = new IndexAssertionEnumeration(
            aliasIdx.listIndices( movedBase.toString(), true ),
            isBaseDescendant );
        while ( aliases.hasMore() )
        {
            IndexRecord entry = ( IndexRecord ) aliases.next();
            dropAliasIndices( entry.getEntryId(), movedBase );
        }
    }
View Full Code Here

    try {
            ArrayList records = new ArrayList();
            NamingEnumeration childList = db.list( id );
            while( childList.hasMore() )
            {
                IndexRecord old = ( IndexRecord ) childList.next();
                IndexRecord newRec = new IndexRecord();
                newRec.copy( old );
                records.add( newRec );
            }
            childList.close();

            Iterator list = records.iterator();
           
            while( list.hasNext() )
            {
                IndexRecord rec = ( IndexRecord ) list.next();

                if ( engine != null && exprNode != null )
                {
                    if ( db.getChildCount( rec.getEntryId() ) == 0 )
                    {
                        if( engine.evaluate( exprNode, rec.getEntryId() ) )
                        {
                            Attributes newEntry = db.lookup( rec.getEntryId() );
                            EntryNode child = new EntryNode( rec.getEntryId(),
                                    this, db, newEntry, map, exprNode, engine);
                            children.add(child);
                        }
                        else
                        {
                            continue;
                        }
                    }
                    else
                    {
                        Attributes newEntry = db.lookup( rec.getEntryId() );
                        EntryNode child = new EntryNode( rec.getEntryId(),
                            this, db, newEntry, map, exprNode, engine );
                        children.add( child );
                    }
                }
                else
                {
                    Attributes newEntry = db.lookup( rec.getEntryId() );
                    EntryNode child = new EntryNode( rec.getEntryId(), this,
                        db, newEntry, map );
                    children.add( child );
                }
            }
        }
View Full Code Here

        DefaultTableModel tableModel = new DefaultTableModel( cols, 0 );
        Object [] row = new Object[2];
        int count = 0;
        while ( cursor.hasMore() && count < limitMax )
        {
            IndexRecord rec = ( IndexRecord ) cursor.next();
            row[0] = rec.getEntryId();
            row[1] = partition.getEntryDn( ( BigInteger ) row[0] );
            tableModel.addRow( row );
            count++;
        }
View Full Code Here

            l_cols[1] = "Values ( Entry Id )" ;
            DefaultTableModel l_model = new DefaultTableModel( l_cols, 0 ) ;
            int l_count = 0 ;
            while( l_list.hasMore() )
            {
                IndexRecord l_rec = ( IndexRecord ) l_list.next() ;
                l_row = new Object [2] ;
                l_row[0] = l_rec.getIndexKey() ;
                l_row[1] = l_rec.getEntryId() ;
                l_model.addRow( l_row ) ;
                l_count++ ;
            }

            m_resultsTbl.setModel( l_model ) ;
View Full Code Here

    try {
            ArrayList records = new ArrayList();
            NamingEnumeration childList = db.list( id );
            while( childList.hasMore() )
            {
                IndexRecord old = ( IndexRecord ) childList.next();
                IndexRecord newRec = new IndexRecord();
                newRec.copy( old );
                records.add( newRec );
            }
            childList.close();

            Iterator list = records.iterator();
           
            while( list.hasNext() )
            {
                IndexRecord rec = ( IndexRecord ) list.next();

                if ( engine != null && exprNode != null )
                {
                    if ( db.getChildCount( rec.getEntryId() ) == 0 )
                    {
                        if( engine.evaluate( exprNode, rec.getEntryId() ) )
                        {
                            Attributes newEntry = db.lookup( rec.getEntryId() );
                            EntryNode child = new EntryNode( rec.getEntryId(),
                                    this, db, newEntry, map, exprNode, engine);
                            children.add(child);
                        }
                        else
                        {
                            continue;
                        }
                    }
                    else
                    {
                        Attributes newEntry = db.lookup( rec.getEntryId() );
                        EntryNode child = new EntryNode( rec.getEntryId(),
                            this, db, newEntry, map, exprNode, engine );
                        children.add( child );
                    }
                }
                else
                {
                    Attributes newEntry = db.lookup( rec.getEntryId() );
                    EntryNode child = new EntryNode( rec.getEntryId(), this,
                        db, newEntry, map );
                    children.add( child );
                }
            }
        }
View Full Code Here

            l_cols[1] = "Values ( Entry Id )" ;
            DefaultTableModel l_model = new DefaultTableModel( l_cols, 0 ) ;
            int l_count = 0 ;
            while( l_list.hasMore() )
            {
                IndexRecord l_rec = ( IndexRecord ) l_list.next() ;
                l_row = new Object [2] ;
                l_row[0] = l_rec.getIndexKey() ;
                l_row[1] = l_rec.getEntryId() ;
                l_model.addRow( l_row ) ;
                l_count++ ;
            }

            m_resultsTbl.setModel( l_model ) ;
View Full Code Here

        DefaultTableModel tableModel = new DefaultTableModel( cols, 0 );
        Object [] row = new Object[2];
        int count = 0;
        while ( cursor.hasMore() && count < limitMax )
        {
            IndexRecord rec = ( IndexRecord ) cursor.next();
            row[0] = rec.getEntryId();
            row[1] = partition.getEntryDn( ( BigInteger ) row[0] );
            tableModel.addRow( row );
            count++;
        }
View Full Code Here

        {
            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
        NamingEnumeration list = existanceIdx.listReverseIndices( id );
        StringBuffer val = new StringBuffer();
        while ( list.hasMore() )
        {
            IndexRecord rec = ( IndexRecord ) list.next();
            val.append( "_existance[" );
            val.append( rec.getIndexKey() );
            val.append( "]" );
            attributes.put( val.toString(), rec.getEntryId() );
            val.setLength( 0 );
        }

        // Get all parent child mappings for this entry as the parent using the
        // key 'child' with many entries following it.
        list = hierarchyIdx.listIndices( id );
        while ( list.hasMore() )
        {
            IndexRecord rec = ( IndexRecord ) list.next();
            attributes.put( "_child", rec.getEntryId() );
        }

        return attributes;
    }
View Full Code Here

TOP

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

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.