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 SummaryConstructors
- 
Method SummaryModifier 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- 
ProtobufMessageBodyProducerpublic ProtobufMessageBodyProducer()
 
- 
- 
Method Details- 
isWriteablepublic boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType mediaType) - Specified by:
- isWriteablein interface- org.apache.hbase.thirdparty.javax.ws.rs.ext.MessageBodyWriter<ProtobufMessageHandler>
 
- 
getSizepublic long getSize(ProtobufMessageHandler m, Class<?> type, Type genericType, Annotation[] annotations, org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType mediaType) - Specified by:
- getSizein interface- org.apache.hbase.thirdparty.javax.ws.rs.ext.MessageBodyWriter<ProtobufMessageHandler>
 
- 
writeTopublic 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 interface- org.apache.hbase.thirdparty.javax.ws.rs.ext.MessageBodyWriter<ProtobufMessageHandler>
- Throws:
- IOException
- org.apache.hbase.thirdparty.javax.ws.rs.WebApplicationException
 
 
-