Package org.apache.ldap.common.filter

Examples of org.apache.ldap.common.filter.ScopeNode


     * @throws NamingException if any system indices fail
     * @see org.apache.ldap.server.partition.impl.btree.Enumerator#enumerate(ExprNode)
     */
    public NamingEnumeration enumerate( ExprNode node ) throws NamingException
    {
        final ScopeNode snode = ( ScopeNode ) node;
        final BigInteger id = db.getEntryId( snode.getBaseDn() );

        switch( snode.getScope() )
        {
        case( SearchControls.OBJECT_SCOPE ):
            final IndexRecord record = new IndexRecord();
            record.setEntryId( id );
            record.setIndexKey( snode.getBaseDn() );
            return new SingletonEnumeration( record );
        case( SearchControls.ONELEVEL_SCOPE ):
            return enumerateChildren( snode.getBaseDn(),
                snode.getDerefAliases().derefInSearching() );
        case( SearchControls.SUBTREE_SCOPE ):
            return enumerateDescendants( snode );
        default:
            throw new NamingException( "Unrecognized search scope!" );
        }
View Full Code Here


            effectiveBase = base;
        }

        // Add the scope node using the eective base to the ilter
        BranchNode root = new BranchNode( AbstractExprNode.AND );
        ExprNode node = new ScopeNode( env, effectiveBase.toString(),
            searchCtls.getSearchScope() );
        root.getChildren().add( node );
        root.getChildren().add( filter );

        // Annotate the node with the optimizer and return search enumeration.
View Full Code Here

     * @see org.apache.ldap.server.partition.impl.btree.Evaluator#evaluate(ExprNode, org.apache.ldap.server.partition.impl.btree.IndexRecord)
     */
    public boolean evaluate( ExprNode node, IndexRecord record )
        throws NamingException
    {
        ScopeNode snode = ( ScopeNode ) node;
       
        switch( snode.getScope() )
        {
        case( SearchControls.OBJECT_SCOPE ):
            String dn = db.getEntryDn( record.getEntryId() );
            return dn.equals( snode.getBaseDn() );
        case( SearchControls.ONELEVEL_SCOPE ):
            return assertOneLevelScope( snode, record.getEntryId() );
        case( SearchControls.SUBTREE_SCOPE ):
            return assertSubtreeScope( snode, record.getEntryId() );
        default:
View Full Code Here

     * @throws NamingException if any system indices fail
     * @see org.apache.ldap.server.partition.impl.btree.Enumerator#enumerate(ExprNode)
     */
    public NamingEnumeration enumerate( ExprNode node ) throws NamingException
    {
        final ScopeNode snode = ( ScopeNode ) node;
        final BigInteger id = db.getEntryId( snode.getBaseDn() );

        switch( snode.getScope() )
        {
        case( SearchControls.OBJECT_SCOPE ):
            final IndexRecord record = new IndexRecord();
            record.setEntryId( id );
            record.setIndexKey( snode.getBaseDn() );
            return new SingletonEnumeration( record );
        case( SearchControls.ONELEVEL_SCOPE ):
            return enumerateChildren( snode.getBaseDn(),
                snode.getDerefAliases().derefInSearching() );
        case( SearchControls.SUBTREE_SCOPE ):
            return enumerateDescendants( snode );
        default:
            throw new NamingException( "Unrecognized search scope!" );
        }
View Full Code Here

TOP

Related Classes of org.apache.ldap.common.filter.ScopeNode

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.