Examples of encode()


Examples of org.apache.directory.shared.ldap.codec.add.AddRequestCodec.encode()

        }

        addRequest.setMessageId( messageId );

        // Encode and send the addRequest message
        ByteBuffer bb = addRequest.encode();
        bb.flip();

        sendMessage( bb );

        bb.clear();

Examples of org.apache.directory.shared.ldap.codec.bind.BindRequestCodec.encode()

        bindRequest.setVersion( 3 );

        bindRequest.setMessageId( messageId );

        // Encode and send the bind request
        ByteBuffer bb = bindRequest.encode();
        bb.flip();

        connect();
        sendMessage( bb );

Examples of org.apache.directory.shared.ldap.codec.controls.search.entryChange.EntryChangeDecorator.encode()

        EntryChange entryChange = (EntryChange) decorator.getDecorated();
        entryChange.setChangeType( ChangeType.MODDN );
        entryChange.setChangeNumber( 16 );
        entryChange.setPreviousDn( new Dn( "a=b" ) );
        bb = decorator.encode( ByteBuffer.allocate( decorator.computeLength() ) );
        String decoded = Strings.dumpBytes( bb.array() );
        assertEquals( expected, decoded );
    }

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

        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 );
    }
   

Examples of org.apache.directory.shared.ldap.codec.controls.search.persistentSearch.PersistentSearchDecorator.encode()

        PersistentSearchDecorator decorator = new PersistentSearchDecorator( codec );
        PersistentSearch ctrl = ( PersistentSearch ) decorator.getDecorated();
        ctrl.setChangesOnly( false );
        ctrl.setReturnECs( false );
        ctrl.setChangeTypes( 1 );
        bb = decorator.encode(ByteBuffer.allocate( decorator.computeLength() ) );
        String decoded = Strings.dumpBytes(bb.array());
        assertEquals( expected, decoded );
    }

    /**
 

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

        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 )

Examples of org.apache.directory.shared.ldap.codec.del.DelRequestCodec.encode()

        delRequest.setEntry( new DN( dn ) );

        delRequest.setMessageId( messageId );

        // Encode and send the delete request
        ByteBuffer bb = delRequest.encode();
        bb.flip();

        sendMessage( bb );

        bb.clear();

Examples of org.apache.directory.shared.ldap.codec.modify.ModifyRequestCodec.encode()

        }

        modifyRequest.setMessageId( messageId );

        // Encode and send the delete request
        ByteBuffer bb = modifyRequest.encode();
        bb.flip();

        sendMessage( bb );

        bb.clear();

Examples of org.apache.directory.shared.ldap.codec.modifyDn.ModifyDNRequestCodec.encode()

        }

        modifyDNRequest.setMessageId( messageId );

        // Encode and send the delete request
        ByteBuffer bb = modifyDNRequest.encode();
        bb.flip();

        sendMessage( bb );

        bb.clear();

Examples of org.apache.directory.shared.ldap.codec.unbind.UnBindRequestCodec.encode()

    private void unbind( int messageId ) throws InvalidNameException, EncoderException, DecoderException, IOException
    {
        UnBindRequestCodec unbindRequest = new UnBindRequestCodec();

        unbindRequest.setMessageId( messageId );
        ByteBuffer bb = unbindRequest.encode();
        bb.flip();

        sendMessage( bb );

        if ( isDebugEnabled() )
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.