Package org.apache.directory.api.ldap.model.filter

Examples of org.apache.directory.api.ldap.model.filter.SubstringNode


    {
        SubstringCursor cursor = null;

        try
        {
            SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "cn" ), "j", null );
            SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
            cursor = new SubstringCursor( store, evaluator );
            cursor.get();
        }
        finally
View Full Code Here


    {
        SubstringCursor cursor = null;

        try
        {
            SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "j", null );
            SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
            cursor = new SubstringCursor( store, evaluator );

            // test before()
            IndexEntry<String, String> entry = new IndexEntry<String, String>();
View Full Code Here

    {
        SubstringCursor cursor = null;

        try
        {
            SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "j", null );
            SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
            cursor = new SubstringCursor( store, evaluator );

            // test before()
            IndexEntry<String, String> entry = new IndexEntry<String, String>();
View Full Code Here

                                newLeaf = new ExtensibleNode( descendant, extensibleNode.getValue(),
                                    extensibleNode.getMatchingRuleId(), extensibleNode.hasDnAttributes() );
                            }
                            else if ( leaf instanceof SubstringNode )
                            {
                                SubstringNode substringNode = ( SubstringNode ) leaf;
                                newLeaf = new SubstringNode( descendant, substringNode.getInitial(),
                                    substringNode.getFinal() );
                            }
                            else
                            {
                                throw new IllegalStateException( I18n.err( I18n.ERR_260, leaf ) );
                            }
View Full Code Here

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

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

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

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

        OrNode orNode = new OrNode();

        ExprNode exprNode = new SubstringNode( schemaManager.getAttributeType( "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 );

        //        try
        //        {
        //            new OrCursor( cursors, evaluators );
        //            fail( "should throw IllegalArgumentException" );
        //        }
        //        catch( IllegalArgumentException ie ){ }

        exprNode = new SubstringNode( schemaManager.getAttributeType( "sn" ), "W", null );
        eval = new SubstringEvaluator( ( SubstringNode ) exprNode, store, schemaManager );
        evaluators.add( eval );
        Cursor subStrCursor2 = new SubstringCursor( store, ( SubstringEvaluator ) eval );
        cursors.add( subStrCursor2 );
View Full Code Here

                        {
                            anyString.add( any );
                        }
                    }

                    branch = new SubstringNode( anyString, substrFilter.getType(), initialString, finalString );
                }
                else if ( filter instanceof ExtensibleMatchFilter )
                {
                    // Transform Extensible Match Filter
                    ExtensibleMatchFilter extFilter = ( ExtensibleMatchFilter ) filter;
View Full Code Here

        // SUBSTRING FILTER
        else if ( filter instanceof SubstringNode )
        {
            Element newElement = element.addElement( "substrings" );

            SubstringNode substringFilter = ( SubstringNode ) filter;

            newElement.addAttribute( "name", substringFilter.getAttribute() );

            String initial = substringFilter.getInitial();

            if ( ( initial != null ) && ( !"".equals( initial ) ) )
            {
                newElement.addElement( "initial" ).setText( initial );
            }

            List<String> anyList = substringFilter.getAny();

            for ( int i = 0; i < anyList.size(); i++ )
            {
                newElement.addElement( "any" ).setText( anyList.get( i ) );
            }

            String finalString = substringFilter.getFinal();

            if ( ( finalString != null ) && ( !"".equals( finalString ) ) )
            {
                newElement.addElement( "final" ).setText( finalString );
            }
View Full Code Here

     * Initialize classesItem instances
     */
    @Before
    public void initNames() throws Exception
    {
        classesItemA = new ClassesItem( new SubstringNode( "aa" ) );
        classesItemACopy = new ClassesItem( new SubstringNode( "aa" ) );
        classesItemB = new ClassesItem( new SubstringNode( "aa" ) );
        classesItemC = new ClassesItem( new SubstringNode( "cc" ) );
    }
View Full Code Here

        assertEquals( 1000, searchRequest.getTimeLimit() );
        assertEquals( true, searchRequest.getTypesOnly() );

        // (objectclass=t*)
        ExprNode node = searchRequest.getFilter();
        SubstringNode substringNode = ( SubstringNode ) node;
        assertNotNull( substringNode );

        assertEquals( "objectclass", substringNode.getAttribute() );
        assertEquals( "t", substringNode.getInitial() );

        // The attributes
        List<String> attributes = searchRequest.getAttributes();

        for ( String attribute : attributes )
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.model.filter.SubstringNode

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.