request.setCredentials( type1response );
request.setSaslMechanism( mechanism );
request.setVersion3( true );
// Setup the ASN1 Encoder and Decoder
LdapDecoder decoder = new LdapDecoder();
// Send encoded request to server
LdapEncoder encoder = new LdapEncoder( getLdapServer().getDirectoryService().getLdapCodecService() );
ByteBuffer bb = encoder.encodeMessage( request );
bb.flip();
_output_.write( bb.array() );
_output_.flush();
while ( _input_.available() <= 0 )
{
Thread.sleep( 100 );
}
// Retrieve the response back from server to my last request.
LdapMessageContainer<MessageDecorator<? extends Message>> container = new LdapMessageContainer(
ldapServer.getDirectoryService().getLdapCodecService() );
return ( BindResponse ) decoder.decode( _input_, container );
}