* {@inheritDoc}
*/
public void action( LdapMessageContainer<MessageDecorator<? extends Message>> container ) throws DecoderException
{
// Get the Value and store it in the BindResponse
TLV tlv = container.getCurrentTLV();
Dn matchedDn = null;
ResultCodeEnum resultCode = null;
ResultResponse response = ( ResultResponse ) container.getMessage();
LdapResult ldapResult = response.getLdapResult();
resultCode = ldapResult.getResultCode();
// We have to handle the special case of a 0 length matched
// Dn
if ( tlv.getLength() == 0 )
{
matchedDn = Dn.EMPTY_DN;
}
else
{
// A not null matchedDn is valid for resultCodes
// NoSuchObject, AliasProblem, InvalidDNSyntax and
// AliasDreferencingProblem.
switch ( resultCode )
{
case NO_SUCH_OBJECT:
case ALIAS_PROBLEM:
case INVALID_DN_SYNTAX:
case ALIAS_DEREFERENCING_PROBLEM:
byte[] dnBytes = tlv.getValue().getData();
String dnStr = Strings.utf8ToString( dnBytes );
try
{
matchedDn = new Dn( dnStr );