io.airlift.http.client
Class JsonResponseHandler<T>

java.lang.Object
  extended by io.airlift.http.client.JsonResponseHandler<T>
All Implemented Interfaces:
ResponseHandler<T,RuntimeException>

public class JsonResponseHandler<T>
extends Object
implements ResponseHandler<T,RuntimeException>


Method Summary
static
<T> JsonResponseHandler<T>
createJsonResponseHandler(JsonCodec<T> jsonCodec)
           
static
<T> JsonResponseHandler<T>
createJsonResponseHandler(JsonCodec<T> jsonCodec, int firstSuccessfulResponseCode, int... otherSuccessfulResponseCodes)
           
 T handle(Request request, Response response)
           
 RuntimeException handleException(Request request, Exception exception)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createJsonResponseHandler

public static <T> JsonResponseHandler<T> createJsonResponseHandler(JsonCodec<T> jsonCodec)

createJsonResponseHandler

public static <T> JsonResponseHandler<T> createJsonResponseHandler(JsonCodec<T> jsonCodec,
                                                                   int firstSuccessfulResponseCode,
                                                                   int... otherSuccessfulResponseCodes)

handleException

public RuntimeException handleException(Request request,
                                        Exception exception)
Specified by:
handleException in interface ResponseHandler<T,RuntimeException>

handle

public T handle(Request request,
                Response response)
Specified by:
handle in interface ResponseHandler<T,RuntimeException>


Copyright © 2010-2012 Airlift. All Rights Reserved.