Package org.apache.directory.shared.ldap.codec.controls.search.subentries

Examples of org.apache.directory.shared.ldap.codec.controls.search.subentries.SubentriesDecorator


            {
              0x01, 0x01, ( byte ) 0xFF // Visibility ::= BOOLEAN
            } );
        bb.flip();

        SubentriesDecorator decorator = new SubentriesDecorator( codec );
       
        Subentries subentries = (Subentries)decorator.decode( bb.array() );

        assertTrue( subentries.isVisible() );
       
        // test encoding
        try
        {
            ByteBuffer buffer = decorator.encode( ByteBuffer.allocate( decorator.computeLength() ) );
            String expected = Strings.dumpBytes( bb.array() );
            String decoded = Strings.dumpBytes( buffer.array() );
            assertEquals( expected, decoded );
        }
        catch( EncoderException e )
View Full Code Here


            {
              0x01, 0x01, 0x00 // Visibility ::= BOOLEAN
            } );
        bb.flip();

        SubentriesDecorator decorator = new SubentriesDecorator( codec );
       
        Subentries subentries = (Subentries)decorator.decode( bb.array() );

        assertFalse( subentries.isVisible() );
       
        // test encoding
        try
        {
            ByteBuffer buffer = decorator.encode( ByteBuffer.allocate( decorator.computeLength() ) );
            String expected = Strings.dumpBytes( bb.array() );
            String decoded = Strings.dumpBytes( buffer.array() );
            assertEquals( expected, decoded );
        }
        catch( EncoderException e )
View Full Code Here

            } );

        bb.flip();

        // Allocate a LdapMessage Container
        SubentriesDecorator decorator = new SubentriesDecorator( codec );
       
        decorator.decode( bb.array() );
    }
View Full Code Here

            } );

        bb.flip();

        // Allocate a LdapMessage Container
        SubentriesDecorator decorator = new SubentriesDecorator( codec );
       
        decorator.decode( bb.array() );
    }
View Full Code Here

                control = new PersistentSearchDecorator( getDirectoryService().getLdapCodecService() );

                break;

            case SUBENTRIES_CONTROL:
                control = new SubentriesDecorator( getDirectoryService().getLdapCodecService() );
               
                break;

            case SYNC_DONE_VALUE_CONTROL:
                control = new SyncDoneValueDecorator( getDirectoryService().getLdapCodecService() );
View Full Code Here

        }

        // found the subentry request control so we return its value
        if ( opContext.hasRequestControl( SUBENTRY_CONTROL ) )
        {
            SubentriesDecorator subentriesDecorator = ( SubentriesDecorator ) opContext.getRequestControl( SUBENTRY_CONTROL );
            return ( ( Subentries ) subentriesDecorator.getDecorated() ).isVisible();
        }

        return false;
    }
View Full Code Here

                control = new PersistentSearchDecorator( getDirectoryService().getLdapCodecService() );

                break;

            case SUBENTRIES_CONTROL:
                control = new SubentriesDecorator( getDirectoryService().getLdapCodecService() );

                break;

            case SYNC_DONE_VALUE_CONTROL:
                control = new SyncDoneValueDecorator( getDirectoryService().getLdapCodecService() );
View Full Code Here

        // now add the control with visibility set to true where all entries
        // except subentries disappear
        LdapApiService codec = LdapApiServiceFactory.getSingleton();

        SubentriesDecorator decorator = new SubentriesDecorator( codec );
        Subentries ctl = decorator.getDecorated();
        ctl.setVisibility( true );
        decorator.getValue();
        sysRoot.setRequestControls( JndiUtils.toJndiControls( codec, new Control[]
            { ctl } ) );
        list = sysRoot.search( "", "(objectClass=*)", searchControls );
        SearchResult result = list.next();
        assertFalse( list.hasMore() );
View Full Code Here

        addAdministrativeRole( "collectiveAttributeSpecificArea" );
        connection.add( getTestSubentryWithExclusion( "cn=testsubentry,ou=system" ) );

        Entry result = connection.lookup( "cn=testsubentry,ou=system", new Control[]
            {
            new SubentriesDecorator( connection.getCodecService() ) }, "subtreeSpecification" );

        assertNotNull( result );
        String ss = result.get( "SubtreeSpecification" ).getString();
        assertNotNull( ss );
    }
View Full Code Here

            {
              0x01, 0x01, ( byte ) 0xFF // Visibility ::= BOOLEAN
            } );
        bb.flip();

        SubentriesDecorator decorator = new SubentriesDecorator( codec );
       
        Subentries subentries = (Subentries)decorator.decode( bb.array() );

        assertTrue( subentries.isVisible() );
       
        // test encoding
        try
        {
            ByteBuffer buffer = decorator.encode( ByteBuffer.allocate( decorator.computeLength() ) );
            String expected = Strings.dumpBytes( bb.array() );
            String decoded = Strings.dumpBytes( buffer.array() );
            assertEquals( expected, decoded );
        }
        catch( EncoderException e )
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.codec.controls.search.subentries.SubentriesDecorator

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.