Class TextPlainMessageSerializer
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.util.ser.AbstractMessageSerializer<Function<Object,String>>
-
- org.apache.tinkerpop.gremlin.server.util.TextPlainMessageSerializer
-
- All Implemented Interfaces:
MessageSerializer<Function<Object,String>>
public class TextPlainMessageSerializer extends AbstractMessageSerializer<Function<Object,String>>
A highly use-case specific serializer that only has context for HTTP where results simply need to be converted to string in a line by line fashion for text based returns.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.util.MessageSerializer
MessageSerializer.MessageParts
-
-
Field Summary
-
Fields inherited from class org.apache.tinkerpop.gremlin.util.ser.AbstractMessageSerializer
TOKEN_IO_REGISTRIES
-
Fields inherited from interface org.apache.tinkerpop.gremlin.util.MessageSerializer
logger
-
-
Constructor Summary
Constructors Constructor Description TextPlainMessageSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RequestMessagedeserializeBinaryRequest(io.netty.buffer.ByteBuf msg)Deserialize a NettyByteBufinto aRequestMessage.ResponseMessagedeserializeBinaryResponse(io.netty.buffer.ByteBuf msg)Deserialize a NettyByteBufinto aRequestMessage.Function<Object,String>getMapper()Gets the "mapper" that performs the underlying serialization work.String[]mimeTypesSupported()The list of mime types that the serializer supports.ResponseMessagereadChunk(io.netty.buffer.ByteBuf byteBuf, boolean isFirstChunk)io.netty.buffer.ByteBufserializeRequestAsBinary(RequestMessage requestMessage, io.netty.buffer.ByteBufAllocator allocator)Serialize aResponseMessageto a NettyByteBuf.io.netty.buffer.ByteBufserializeResponseAsBinary(ResponseMessage responseMessage, io.netty.buffer.ByteBufAllocator allocator)Serialize aResponseMessageto a NettyByteBuf.io.netty.buffer.ByteBufwriteChunk(Object aggregate, io.netty.buffer.ByteBufAllocator allocator)io.netty.buffer.ByteBufwriteErrorFooter(ResponseMessage responseMessage, io.netty.buffer.ByteBufAllocator allocator)io.netty.buffer.ByteBufwriteFooter(ResponseMessage responseMessage, io.netty.buffer.ByteBufAllocator allocator)io.netty.buffer.ByteBufwriteHeader(ResponseMessage responseMessage, io.netty.buffer.ByteBufAllocator allocator)-
Methods inherited from class org.apache.tinkerpop.gremlin.util.ser.AbstractMessageSerializer
addIoRegistries, getListStringFromConfig, tryInstanceMethod
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.tinkerpop.gremlin.util.MessageSerializer
configure
-
-
-
-
Method Detail
-
getMapper
public Function<Object,String> getMapper()
Description copied from interface:MessageSerializerGets the "mapper" that performs the underlying serialization work.
-
serializeResponseAsBinary
public io.netty.buffer.ByteBuf serializeResponseAsBinary(ResponseMessage responseMessage, io.netty.buffer.ByteBufAllocator allocator)
Description copied from interface:MessageSerializerSerialize aResponseMessageto a NettyByteBuf.- Parameters:
responseMessage- The response message to serialize to bytes.allocator- The Netty allocator for theByteBufto return back.
-
writeHeader
public io.netty.buffer.ByteBuf writeHeader(ResponseMessage responseMessage, io.netty.buffer.ByteBufAllocator allocator)
-
writeChunk
public io.netty.buffer.ByteBuf writeChunk(Object aggregate, io.netty.buffer.ByteBufAllocator allocator)
-
writeFooter
public io.netty.buffer.ByteBuf writeFooter(ResponseMessage responseMessage, io.netty.buffer.ByteBufAllocator allocator)
-
writeErrorFooter
public io.netty.buffer.ByteBuf writeErrorFooter(ResponseMessage responseMessage, io.netty.buffer.ByteBufAllocator allocator)
-
readChunk
public ResponseMessage readChunk(io.netty.buffer.ByteBuf byteBuf, boolean isFirstChunk)
-
serializeRequestAsBinary
public io.netty.buffer.ByteBuf serializeRequestAsBinary(RequestMessage requestMessage, io.netty.buffer.ByteBufAllocator allocator)
Description copied from interface:MessageSerializerSerialize aResponseMessageto a NettyByteBuf.- Parameters:
requestMessage- The request message to serialize to bytes.allocator- The Netty allocator for theByteBufto return back.
-
deserializeBinaryRequest
public RequestMessage deserializeBinaryRequest(io.netty.buffer.ByteBuf msg)
Description copied from interface:MessageSerializerDeserialize a NettyByteBufinto aRequestMessage.
-
deserializeBinaryResponse
public ResponseMessage deserializeBinaryResponse(io.netty.buffer.ByteBuf msg)
Description copied from interface:MessageSerializerDeserialize a NettyByteBufinto aRequestMessage.
-
mimeTypesSupported
public String[] mimeTypesSupported()
Description copied from interface:MessageSerializerThe list of mime types that the serializer supports. They should be ordered in preferred ordered where the greatest fidelity match is first.
-
-