org.qi4j.library.rest.client.api
Class ErrorHandler

java.lang.Object
  extended by org.qi4j.library.rest.client.api.ErrorHandler
All Implemented Interfaces:
ResponseHandler

public class ErrorHandler
extends java.lang.Object
implements ResponseHandler

Implements a chained list of specification->handler. Add the most specific handlers first, and the most generic last.


Field Summary
static Specification<org.restlet.Response> AUTHENTICATION_REQUIRED
           
static Specification<org.restlet.Response> RECOVERABLE_ERROR
           
 
Constructor Summary
ErrorHandler()
           
 
Method Summary
 HandlerCommand handleResponse(org.restlet.Response response, ContextResourceClient client)
           
 ErrorHandler onError(ResponseHandler handler)
           
 ErrorHandler onError(Specification<org.restlet.Response> responseSpecification, ResponseHandler handler)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUTHENTICATION_REQUIRED

public static Specification<org.restlet.Response> AUTHENTICATION_REQUIRED

RECOVERABLE_ERROR

public static Specification<org.restlet.Response> RECOVERABLE_ERROR
Constructor Detail

ErrorHandler

public ErrorHandler()
Method Detail

onError

public ErrorHandler onError(Specification<org.restlet.Response> responseSpecification,
                            ResponseHandler handler)

onError

public ErrorHandler onError(ResponseHandler handler)

handleResponse

public HandlerCommand handleResponse(org.restlet.Response response,
                                     ContextResourceClient client)
Specified by:
handleResponse in interface ResponseHandler