org.alfresco.http
Interface HttpRequestCallback<T>

All Known Implementing Classes:
AbstractHttpRequestCallback, JSONArrayCallback, JSONObjectCallback, SimpleHttpRequestCallback

public interface HttpRequestCallback<T>

Callback used when executing HTTP-request. After this has been called, the response-stream is closed automatically.

Author:
Frederik Heremans, Michael Suzuki

Method Summary
 T onCallException(org.apache.http.HttpResponse response, Throwable t)
          Called when an error occurs when sending the request.
 T onCallSuccess(org.apache.http.HttpResponse response)
          Called when call was successful.
 

Method Detail

onCallSuccess

T onCallSuccess(org.apache.http.HttpResponse response)
Called when call was successful.

Parameters:
method - the method executed which can be used to extract response from.
Returns:
any result extracted from the response body.

onCallException

T onCallException(org.apache.http.HttpResponse response,
                  Throwable t)
Called when an error occurs when sending the request. Implementations can choose to propogate the error, generate a new one or process the and return a result.

Parameters:
method - the method executed
t - optional exception that caused the error
Returns:
any result extracted from the response or error


Copyright © 2012. All Rights Reserved.