byte[] value = response.getResponseValue();
ByteBuffer buffer = ByteBuffer.wrap( value );
WhoAmIResponseContainer container = new WhoAmIResponseContainer();
WhoAmIResponse whoAmIResponse = null;
try
{
decoder.decode( buffer, container );
whoAmIResponse = container.getWhoAmIResponse();
// Now, update the created response with what we got from the extendedResponse
whoAmIResponse.getLdapResult().setResultCode( response.getLdapResult().getResultCode() );
whoAmIResponse.getLdapResult().setDiagnosticMessage( response.getLdapResult().getDiagnosticMessage() );
whoAmIResponse.getLdapResult().setMatchedDn( response.getLdapResult().getMatchedDn() );
whoAmIResponse.getLdapResult().setReferral( response.getLdapResult().getReferral() );
}
catch ( DecoderException de )
{
StringWriter sw = new StringWriter();
de.printStackTrace( new PrintWriter( sw ) );