/** * Creates a new instance of LdapProtocolEncoder. * * @param ldapApiService The Service to use */ public LdapProtocolEncoder( LdapApiService ldapApiService ) { this.encoder = new LdapEncoder( ldapApiService ); }
/** * {@inheritDoc} */ @Override public void encode( IoSession session, Object message, ProtocolEncoderOutput out ) throws Exception { ByteBuffer buffer = encoder.encodeMessage( ( Message ) message ); IoBuffer ioBuffer = IoBuffer.wrap( buffer ); if ( CODEC_LOG.isDebugEnabled() ) { byte[] dumpBuffer = new byte[buffer.limit()]; buffer.get( dumpBuffer ); buffer.flip(); CODEC_LOG.debug( I18n.msg( I18n.MSG_14003_ENCODED_LDAP_MESSAGE, message, Strings.dumpBytes( dumpBuffer ) ) ); } out.write( ioBuffer ); }
int controlLength = computeControlLength( control ); buffer.put( TLV.getBytes( controlLength ) );
int length = computeMessageLength( decorator ); ByteBuffer buffer = ByteBuffer.allocate( length ); encodeControl( buffer, control );
int referralLength = LdapEncoder.computeReferralLength( referral );
LdapEncoder.encodeReferral( buffer, referral );
int controlLength = computeControlLength( control ); buffer.put( TLV.getBytes( controlLength ) );
int length = computeMessageLength( decorator ); ByteBuffer buffer = ByteBuffer.allocate( length ); encodeControl( buffer, control );
int referralLength = LdapEncoder.computeReferralLength( referral );
LdapEncoder.encodeReferral( buffer, referral );
int controlLength = computeControlLength( control ); buffer.put( TLV.getBytes( controlLength ) );
int length = computeMessageLength( decorator ); ByteBuffer buffer = ByteBuffer.allocate( length ); encodeControl( buffer, control );
int referralLength = LdapEncoder.computeReferralLength( referral );
/** * Creates a new instance of LdapProtocolEncoder. * * @param ldapApiService The Service to use */ public LdapProtocolEncoder( LdapApiService ldapApiService ) { this.encoder = new LdapEncoder( ldapApiService ); }
/** * {@inheritDoc} */ @Override public void encode( IoSession session, Object message, ProtocolEncoderOutput out ) throws Exception { ByteBuffer buffer = encoder.encodeMessage( ( Message ) message ); IoBuffer ioBuffer = IoBuffer.wrap( buffer ); if ( CODEC_LOG.isDebugEnabled() ) { byte[] dumpBuffer = new byte[buffer.limit()]; buffer.get( dumpBuffer ); buffer.flip(); CODEC_LOG.debug( I18n.msg( I18n.MSG_14003_ENCODED_LDAP_MESSAGE, message, Strings.dumpBytes( dumpBuffer ) ) ); } out.write( ioBuffer ); }
LdapEncoder.encodeReferral( buffer, referral );
int controlLength = computeControlLength( control );
ldapResultLength += 1 + TLV.getNbBytes( errorMessageBytes.length ) + errorMessageBytes.length; int referralLength = LdapEncoder.computeReferralLength( getReferral() );
/** * Creates a new instance of LdapProtocolEncoder. * * @param ldapApiService The Service to use */ public LdapProtocolEncoder( LdapApiService ldapApiService ) { this.encoder = new LdapEncoder( ldapApiService ); }
/** * {@inheritDoc} */ @Override public void encode( IoSession session, Object message, ProtocolEncoderOutput out ) throws Exception { ByteBuffer buffer = encoder.encodeMessage( ( Message ) message ); IoBuffer ioBuffer = IoBuffer.wrap( buffer ); if ( CODEC_LOG.isDebugEnabled() ) { byte[] dumpBuffer = new byte[buffer.limit()]; buffer.get( dumpBuffer ); buffer.flip(); CODEC_LOG.debug( I18n.msg( I18n.MSG_14003_ENCODED_LDAP_MESSAGE, message, Strings.dumpBytes( dumpBuffer ) ) ); } out.write( ioBuffer ); }