if ( modifyResponse == null )
{
// We didn't received anything : this is an error
LOG.error( "Modify failed : timeout occurred" );
throw new LdapException( TIME_OUT_ERROR );
}
if ( modifyResponse.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS )
{
// Everything is fine, return the response
LOG.debug( "Modify successful : {}", modifyResponse );
}
else
{
if ( modifyResponse instanceof ModifyNoDResponse )
{
// A NoticeOfDisconnect : deserves a special treatment
throw new LdapException( modifyResponse.getLdapResult().getDiagnosticMessage() );
}
// We have had an error
LOG.debug( "Modify failed : {}", modifyResponse );
}
return modifyResponse;
}
catch ( TimeoutException te )
{
// Send an abandon request
if ( !modifyFuture.isCancelled() )
{
abandon( modRequest.getMessageId() );
}
// We didn't received anything : this is an error
LOG.error( "Modify failed : timeout occurred" );
throw new LdapException( TIME_OUT_ERROR, te );
}
catch ( Exception ie )
{
// Catch all other exceptions
LOG.error( NO_RESPONSE_ERROR, ie );
// Send an abandon request
if ( !modifyFuture.isCancelled() )
{
abandon( modRequest.getMessageId() );
}
throw new LdapException( ie.getMessage(), ie );
}
}