public class HybridThriftOverHttpServiceImpl<ThriftRequest extends org.apache.thrift.TBase<?,?>,ThriftResponse extends org.apache.thrift.TBase<?,?>> extends Object implements HybridThriftOverHttpService<ThriftRequest,ThriftResponse>
Modifier and Type | Field and Description |
---|---|
static okhttp3.MediaType |
HYBRID_THRIFT_STREAM_CONTENT_TYPE |
static String |
PROTOCOL_HEADER |
Constructor and Description |
---|
HybridThriftOverHttpServiceImpl(HybridThriftOverHttpServiceImplArgs args)
New instances.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
com.google.common.util.concurrent.ListenableFuture<ThriftResponse> |
makeRequest(HybridThriftRequestHandler<ThriftRequest> request,
HybridThriftResponseHandler<ThriftResponse> responseHandler)
Asynchronously make a request.
|
void |
makeRequest(ThriftRequest thriftRequest,
ThriftResponse thriftResponse) |
ThriftResponse |
makeRequestSync(HybridThriftRequestHandler<ThriftRequest> request,
HybridThriftResponseHandler<ThriftResponse> responseHandler)
Synchronously make a request.
|
static <ThriftResponse extends org.apache.thrift.TBase<?,?>> |
readFromStream(DataInputStream rawBodyStream,
ThriftProtocol protocol,
HybridThriftResponseHandler<ThriftResponse> responseHandler)
Reads a HTTP body stream in Hybrid Thrift over HTTP format.
|
static <ThriftRequest extends org.apache.thrift.TBase<?,?>> |
writeToStream(DataOutputStream outputStream,
byte[] serializedThriftData,
HybridThriftRequestHandler<ThriftRequest> request)
Writes the HTTP body into a stream in Hybrid Thrift over HTTP format.
|
public static final okhttp3.MediaType HYBRID_THRIFT_STREAM_CONTENT_TYPE
public static final String PROTOCOL_HEADER
public HybridThriftOverHttpServiceImpl(HybridThriftOverHttpServiceImplArgs args)
public com.google.common.util.concurrent.ListenableFuture<ThriftResponse> makeRequest(HybridThriftRequestHandler<ThriftRequest> request, HybridThriftResponseHandler<ThriftResponse> responseHandler)
HybridThriftOverHttpService
makeRequest
in interface HybridThriftOverHttpService<ThriftRequest extends org.apache.thrift.TBase<?,?>,ThriftResponse extends org.apache.thrift.TBase<?,?>>
public ThriftResponse makeRequestSync(HybridThriftRequestHandler<ThriftRequest> request, HybridThriftResponseHandler<ThriftResponse> responseHandler) throws IOException
HybridThriftOverHttpService
makeRequestSync
in interface HybridThriftOverHttpService<ThriftRequest extends org.apache.thrift.TBase<?,?>,ThriftResponse extends org.apache.thrift.TBase<?,?>>
IOException
public static <ThriftRequest extends org.apache.thrift.TBase<?,?>> void writeToStream(DataOutputStream outputStream, byte[] serializedThriftData, HybridThriftRequestHandler<ThriftRequest> request) throws IOException
IOException
public static <ThriftResponse extends org.apache.thrift.TBase<?,?>> ThriftResponse readFromStream(DataInputStream rawBodyStream, ThriftProtocol protocol, HybridThriftResponseHandler<ThriftResponse> responseHandler) throws IOException
IOException
public void makeRequest(ThriftRequest thriftRequest, ThriftResponse thriftResponse) throws IOException
makeRequest
in interface ThriftService<ThriftRequest extends org.apache.thrift.TBase<?,?>,ThriftResponse extends org.apache.thrift.TBase<?,?>>
IOException
public void close()
close
in interface Closeable
close
in interface AutoCloseable