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
-
Method Summary
Modifier and TypeMethodDescriptionlong
getSize
(ProtobufMessageHandler m, Class<?> type, Type genericType, Annotation[] annotations, org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType mediaType) boolean
isWriteable
(Class<?> type, Type genericType, Annotation[] annotations, org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType mediaType) 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)
-
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:
isWriteable
in 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:
getSize
in 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:
writeTo
in interfaceorg.apache.hbase.thirdparty.javax.ws.rs.ext.MessageBodyWriter<ProtobufMessageHandler>
- Throws:
IOException
org.apache.hbase.thirdparty.javax.ws.rs.WebApplicationException
-