if ( extendedResponse == null )
{
// We didn't received anything : this is an error
LOG.error( "Extended failed : timeout occurred" );
throw new LdapException( TIME_OUT_ERROR );
}
if ( extendedResponse.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS )
{
// Everything is fine, return the response
LOG.debug( "Extended successful : {}", extendedResponse );
}
else
{
// We have had an error
LOG.debug( "Extended failed : {}", extendedResponse );
}
return extendedResponse;
}
catch ( TimeoutException te )
{
// Send an abandon request
if ( !extendedFuture.isCancelled() )
{
abandon( extendedRequest.getMessageId() );
}
// We didn't received anything : this is an error
LOG.error( "Extended 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 ( !extendedFuture.isCancelled() )
{
abandon( extendedRequest.getMessageId() );
}
throw new LdapException( NO_RESPONSE_ERROR, ie );
}
}