Class ProtobufMessageBodyProducer
java.lang.Object
org.apache.hadoop.hbase.rest.provider.producer.ProtobufMessageBodyProducer
- All Implemented Interfaces:
org.apache.hbase.thirdparty.javax.ws.rs.ext.MessageBodyWriter<ProtobufMessageHandler>
@Provider
@Produces({"application/x-protobuf","application/protobuf"})
@Private
public class ProtobufMessageBodyProducer
extends Object
implements org.apache.hbase.thirdparty.javax.ws.rs.ext.MessageBodyWriter<ProtobufMessageHandler>
An adapter between Jersey and ProtobufMessageHandler implementors. Hooks up protobuf output
producing methods to the Jersey content handling framework. Jersey will first call getSize() to
learn the number of bytes that will be sent, then writeTo to perform the actual I/O.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetSize(ProtobufMessageHandler m, Class<?> type, Type genericType, Annotation[] annotations, org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType mediaType) booleanisWriteable(Class<?> type, Type genericType, Annotation[] annotations, org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType mediaType) voidwriteTo(ProtobufMessageHandler m, Class<?> type, Type genericType, Annotation[] annotations, org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType mediaType, org.apache.hbase.thirdparty.javax.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream)
-
Constructor Details
-
ProtobufMessageBodyProducer
public ProtobufMessageBodyProducer()
-
-
Method Details
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType mediaType) - Specified by:
isWriteablein interfaceorg.apache.hbase.thirdparty.javax.ws.rs.ext.MessageBodyWriter<ProtobufMessageHandler>
-
getSize
public long getSize(ProtobufMessageHandler m, Class<?> type, Type genericType, Annotation[] annotations, org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType mediaType) - Specified by:
getSizein interfaceorg.apache.hbase.thirdparty.javax.ws.rs.ext.MessageBodyWriter<ProtobufMessageHandler>
-
writeTo
public void writeTo(ProtobufMessageHandler m, Class<?> type, Type genericType, Annotation[] annotations, org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType mediaType, org.apache.hbase.thirdparty.javax.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, org.apache.hbase.thirdparty.javax.ws.rs.WebApplicationException- Specified by:
writeToin interfaceorg.apache.hbase.thirdparty.javax.ws.rs.ext.MessageBodyWriter<ProtobufMessageHandler>- Throws:
IOExceptionorg.apache.hbase.thirdparty.javax.ws.rs.WebApplicationException
-