Package org.apache.directory.shared.ldap.filter

Examples of org.apache.directory.shared.ldap.filter.ExprNode


    @Test
    public void testNotCursorWithManualFilter() throws Exception
    {
        NotNode notNode = new NotNode();

        ExprNode exprNode = new SubstringNode( "cn", "J", null );
        Evaluator<? extends ExprNode, ServerEntry, Long> eval = new SubstringEvaluator( ( SubstringNode ) exprNode,
            store, schemaManager );
        notNode.addNode( exprNode );

        NotCursor<String, Long> cursor = new NotCursor( store, eval ); //cursorBuilder.build( andNode );
View Full Code Here


    @Test
    public void testOrCursorUsingCursorBuilder() throws Exception
    {
        String filter = "(|(cn=J*)(sn=W*))";

        ExprNode exprNode = FilterParser.parse( filter );

        IndexCursor<?, ServerEntry, Long> cursor = cursorBuilder.build( exprNode );

        cursor.afterLast();

View Full Code Here

        Evaluator<? extends ExprNode, ServerEntry, Long> eval;
        Cursor<IndexEntry<?, ServerEntry, Long>> cursor;

        OrNode orNode = new OrNode();

        ExprNode exprNode = new SubstringNode( "cn", "J", null );
        eval = new SubstringEvaluator( ( SubstringNode ) exprNode, store, schemaManager );
        Cursor subStrCursor1 = new SubstringCursor( store, ( SubstringEvaluator ) eval );
        cursors.add( subStrCursor1 );
        evaluators.add( eval );
        orNode.addNode( exprNode );
View Full Code Here

    @Test
    public void testNestedAndnOr() throws Exception
    {
        String filter = "(|(&(cn=J*)(sn=w*))(ou=apache))";

        ExprNode exprNode = FilterParser.parse( filter );
        exprNode.accept( visitor );
        optimizer.annotate( exprNode );

        IndexCursor<?, ServerEntry, Long> cursor = cursorBuilder.build( exprNode );

        assertTrue( cursor.next() );
View Full Code Here

    @Test
    public void testNestedAndnNot() throws Exception
    {
        String filter = "(&(&(cn=Jo*)(sn=w*))(!(ou=apache)))";

        ExprNode exprNode = FilterParser.parse( filter );
        optimizer.annotate( exprNode );

        IndexCursor<?, ServerEntry, Long> cursor = cursorBuilder.build( exprNode );

        assertTrue( cursor.next() );
View Full Code Here

    @Test
    public void testNestedNotnOrnAnd() throws Exception
    {
        String filter = "(&(|(postalCode=5)(postalCode=6))(!(ou=sales)))";

        ExprNode exprNode = FilterParser.parse( filter );
        optimizer.annotate( exprNode );

        IndexCursor<?, ServerEntry, Long> cursor = cursorBuilder.build( exprNode );

        assertTrue( cursor.next() );
View Full Code Here

    @Test
    public void testNestedOrnNot() throws Exception
    {
        String filter = "(!(|(|(cn=Jo*)(sn=w*))(!(ou=apache))))";

        ExprNode exprNode = FilterParser.parse( filter );
        optimizer.annotate( exprNode );

        IndexCursor<?, ServerEntry, Long> cursor = cursorBuilder.build( exprNode );
    }
View Full Code Here

    @Test
    public void testAndCursorWithCursorBuilder() throws Exception
    {
        String filter = "(&(cn=J*)(sn=*))";

        ExprNode exprNode = FilterParser.parse( filter );

        IndexCursor<?, ServerEntry, Long> cursor = cursorBuilder.build( exprNode );

        cursor.beforeFirst();

View Full Code Here

        AndNode andNode = new AndNode();

        List<Evaluator<? extends ExprNode, ServerEntry, Long>> evaluators = new ArrayList<Evaluator<? extends ExprNode, ServerEntry, Long>>();
        Evaluator<? extends ExprNode, ServerEntry, Long> eval;

        ExprNode exprNode = new SubstringNode( "cn", "J", null );
        eval = new SubstringEvaluator( ( SubstringNode ) exprNode, store, schemaManager );
        IndexCursor<?, ServerEntry, Long> wrapped = new SubstringCursor( store, ( SubstringEvaluator ) eval );

        /* adding this results in NPE  adding Presence evaluator not
         Substring evaluator but adding Substring cursor as wrapped cursor */
 
View Full Code Here


    @Test
    public void testComplexOrRefinement() throws Exception
    {
        ExprNode refinement = null;
        EntryAttribute objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
        String refStr = "(|(objectClass=person)(objectClass=organizationalUnit))";
       
        refinement = FilterParser.parse( refStr );
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.filter.ExprNode

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.