Examples of PagedResultsDecorator


Examples of org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsDecorator

                control = new ManageDsaITDecorator( getDirectoryService().getLdapCodecService(), new ManageDsaITImpl() );

                break;

            case PAGED_RESULTS_CONTROL:
                control = new PagedResultsDecorator( getDirectoryService().getLdapCodecService() );

                break;

            case PASSWORD_POLICY_REQUEST_CONTROL:
                if ( isRequest )
View Full Code Here

Examples of org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsDecorator

        Control control = controls.get( "1.2.840.113556.1.4.319" );
        assertEquals( "1.2.840.113556.1.4.319", control.getOid() );
        assertTrue( control instanceof PagedResultsDecorator );

        PagedResultsDecorator pagedSearchControl = ( PagedResultsDecorator ) control;

        assertEquals( 5, pagedSearchControl.getSize() );
        assertTrue( Arrays.equals( "abcdef".getBytes(), pagedSearchControl.getCookie() ) );

        // Check the encoding
        try
        {
            ByteBuffer bb = encoder.encodeMessage( bindResponse );
View Full Code Here

Examples of org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsDecorator

                's',
                't' // cookie OCTET STRING,
        } );
        bb.flip();

        PagedResultsDecorator decorator = new PagedResultsDecorator( codec );

        PagedResults pagedSearch = ( PagedResults ) decorator.decode( bb.array() );

        assertEquals( 32, pagedSearch.getSize() );
        assertTrue( Arrays.equals( Strings.getBytesUtf8( "test" ),
            pagedSearch.getCookie() ) );

        bb.flip();

        PagedResultsDecorator ctrl = new PagedResultsDecorator( codec );
        ctrl.setSize( 32 );
        ctrl.setCookie( Strings.getBytesUtf8( "test" ) );

        ByteBuffer buffer = ctrl.encode( ByteBuffer.allocate( ctrl.computeLength() ) );
        String decoded = Strings.dumpBytes( buffer.array() );
        String expected = Strings.dumpBytes( bb.array() );
        assertEquals( expected, decoded );
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsDecorator

                0x01,
                0x20 // size INTEGER,
        } );
        bb.flip();

        PagedResultsDecorator decorator = new PagedResultsDecorator( codec );

        decorator.decode( bb.array() );
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsDecorator

                's',
                't' // cookie OCTET STRING,
        } );
        bb.flip();

        PagedResultsDecorator decorator = new PagedResultsDecorator( codec );

        decorator.decode( bb.array() );
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsDecorator

            {
                0x30, 0x00, // realSearchControlValue ::= SEQUENCE
            } );
        bb.flip();

        PagedResultsDecorator decorator = new PagedResultsDecorator( codec );

        decorator.decode( bb.array() );
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsDecorator

                's',
                't' // cookie OCTET STRING,
        } );
        bb.flip();

        PagedResultsDecorator decorator = new PagedResultsDecorator( codec );

        PagedResults pagedSearch = ( PagedResults ) decorator.decode( bb.array() );

        assertEquals( Integer.MAX_VALUE, pagedSearch.getSize() );
        assertTrue( Arrays.equals( Strings.getBytesUtf8( "test" ),
            pagedSearch.getCookie() ) );

        bb.flip();

        PagedResultsDecorator ctrl = new PagedResultsDecorator( codec );
        ctrl.setSize( -1 );
        ctrl.setCookie( Strings.getBytesUtf8( "test" ) );

        ByteBuffer buffer = ctrl.encode( ByteBuffer.allocate( ctrl.computeLength() ) );
        String decoded = Strings.dumpBytes( buffer.array() );
        String expected = Strings.dumpBytes( bb.array() );
        assertEquals( expected, decoded );
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsDecorator

                's',
                't' // cookie OCTET STRING,
        } );
        bb.flip();

        PagedResultsDecorator decorator = new PagedResultsDecorator( codec );

        decorator.decode( bb.array() );
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsDecorator

                0x04,
                0x00 // cookie OCTET STRING,
        } );
        bb.flip();

        PagedResultsDecorator decorator = new PagedResultsDecorator( codec );

        PagedResults pagedSearch = ( PagedResults ) decorator.decode( bb.array() );

        assertEquals( 32, pagedSearch.getSize() );
        assertNull( pagedSearch.getCookie() );

        PagedResultsDecorator ctrl = new PagedResultsDecorator( codec );
        ctrl.setSize( 32 );
        ctrl.setCookie( null );

        ByteBuffer buffer = ctrl.encode( ByteBuffer.allocate( ctrl.computeLength() ) );
        String decoded = Strings.dumpBytes( buffer.array() );
        String expected = Strings.dumpBytes( bb.array() );
        assertEquals( expected, decoded );
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.codec.controls.search.pagedSearch.PagedResultsDecorator

        Control control = controls.get( "1.2.840.113556.1.4.319" );
        assertEquals( "1.2.840.113556.1.4.319", control.getOid() );
        assertTrue( control instanceof PagedResultsDecorator );

        PagedResultsDecorator pagedSearchControl = ( PagedResultsDecorator ) control;

        assertEquals( 5, pagedSearchControl.getSize() );
        assertTrue( Arrays.equals( "abcdef".getBytes(), pagedSearchControl.getCookie() ) );

        // Check the encoding
        try
        {
            ByteBuffer bb = encoder.encodeMessage( bindResponse );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.