Class GraphBinaryMessageSerializerV1
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.driver.ser.AbstractMessageSerializer<GraphBinaryMapper>
-
- org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1
-
- All Implemented Interfaces:
MessageSerializer<GraphBinaryMapper>
,MessageTextSerializer<GraphBinaryMapper>
public class GraphBinaryMessageSerializerV1 extends AbstractMessageSerializer<GraphBinaryMapper> implements MessageTextSerializer<GraphBinaryMapper>
-
-
Field Summary
Fields Modifier and Type Field Description static String
TOKEN_BUILDER
static String
TOKEN_CUSTOM
static String
TOKEN_SERIALIZE_RESULT_TO_STRING
-
Fields inherited from class org.apache.tinkerpop.gremlin.driver.ser.AbstractMessageSerializer
TOKEN_IO_REGISTRIES
-
Fields inherited from interface org.apache.tinkerpop.gremlin.driver.MessageSerializer
logger
-
-
Constructor Summary
Constructors Constructor Description GraphBinaryMessageSerializerV1()
Creates a new instance of the message serializer using the default type serializers.GraphBinaryMessageSerializerV1(TypeSerializerRegistry registry)
GraphBinaryMessageSerializerV1(TypeSerializerRegistry.Builder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(Map<String,Object> config, Map<String,Graph> graphs)
Configure the serializer with mapper settings as required.RequestMessage
deserializeRequest(io.netty.buffer.ByteBuf msg)
Deserialize a NettyByteBuf
into aRequestMessage
.RequestMessage
deserializeRequest(String msg)
ResponseMessage
deserializeResponse(io.netty.buffer.ByteBuf msg)
Deserialize a NettyByteBuf
into aResponseMessage
.ResponseMessage
deserializeResponse(String msg)
GraphBinaryMapper
getMapper()
Gets the "mapper" that performs the underlying serialization work.String[]
mimeTypesSupported()
The list of mime types that the serializer supports.io.netty.buffer.ByteBuf
serializeRequestAsBinary(RequestMessage requestMessage, io.netty.buffer.ByteBufAllocator allocator)
Serialize aResponseMessage
to a NettyByteBuf
.String
serializeRequestAsString(RequestMessage requestMessage, io.netty.buffer.ByteBufAllocator allocator)
io.netty.buffer.ByteBuf
serializeResponseAsBinary(ResponseMessage responseMessage, io.netty.buffer.ByteBufAllocator allocator)
Serialize aResponseMessage
to a NettyByteBuf
.String
serializeResponseAsString(ResponseMessage responseMessage, io.netty.buffer.ByteBufAllocator allocator)
-
Methods inherited from class org.apache.tinkerpop.gremlin.driver.ser.AbstractMessageSerializer
addIoRegistries, getListStringFromConfig, tryInstanceMethod
-
-
-
-
Field Detail
-
TOKEN_CUSTOM
public static final String TOKEN_CUSTOM
- See Also:
- Constant Field Values
-
TOKEN_BUILDER
public static final String TOKEN_BUILDER
- See Also:
- Constant Field Values
-
TOKEN_SERIALIZE_RESULT_TO_STRING
public static final String TOKEN_SERIALIZE_RESULT_TO_STRING
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GraphBinaryMessageSerializerV1
public GraphBinaryMessageSerializerV1()
Creates a new instance of the message serializer using the default type serializers.
-
GraphBinaryMessageSerializerV1
public GraphBinaryMessageSerializerV1(TypeSerializerRegistry registry)
-
GraphBinaryMessageSerializerV1
public GraphBinaryMessageSerializerV1(TypeSerializerRegistry.Builder builder)
-
-
Method Detail
-
getMapper
public GraphBinaryMapper getMapper()
Description copied from interface:MessageSerializer
Gets the "mapper" that performs the underlying serialization work.- Specified by:
getMapper
in interfaceMessageSerializer<GraphBinaryMapper>
-
configure
public void configure(Map<String,Object> config, Map<String,Graph> graphs)
Description copied from interface:MessageSerializer
Configure the serializer with mapper settings as required. The default implementation does not perform any function and it is up to the interface implementation to determine how the configuration will be executed and what its requirements are. An implementation may choose to use the list of available graphs to help initialize a serializer. The implementation should account for the possibility of a null value being provided for that parameter.- Specified by:
configure
in interfaceMessageSerializer<GraphBinaryMapper>
-
serializeResponseAsBinary
public io.netty.buffer.ByteBuf serializeResponseAsBinary(ResponseMessage responseMessage, io.netty.buffer.ByteBufAllocator allocator) throws SerializationException
Description copied from interface:MessageSerializer
Serialize aResponseMessage
to a NettyByteBuf
.- Specified by:
serializeResponseAsBinary
in interfaceMessageSerializer<GraphBinaryMapper>
- Parameters:
responseMessage
- The response message to serialize to bytes.allocator
- The Netty allocator for theByteBuf
to return back.- Throws:
SerializationException
-
serializeRequestAsBinary
public io.netty.buffer.ByteBuf serializeRequestAsBinary(RequestMessage requestMessage, io.netty.buffer.ByteBufAllocator allocator) throws SerializationException
Description copied from interface:MessageSerializer
Serialize aResponseMessage
to a NettyByteBuf
.- Specified by:
serializeRequestAsBinary
in interfaceMessageSerializer<GraphBinaryMapper>
- Parameters:
requestMessage
- The request message to serialize to bytes.allocator
- The Netty allocator for theByteBuf
to return back.- Throws:
SerializationException
-
deserializeRequest
public RequestMessage deserializeRequest(io.netty.buffer.ByteBuf msg) throws SerializationException
Description copied from interface:MessageSerializer
Deserialize a NettyByteBuf
into aRequestMessage
.- Specified by:
deserializeRequest
in interfaceMessageSerializer<GraphBinaryMapper>
- Throws:
SerializationException
-
deserializeResponse
public ResponseMessage deserializeResponse(io.netty.buffer.ByteBuf msg) throws SerializationException
Description copied from interface:MessageSerializer
Deserialize a NettyByteBuf
into aResponseMessage
.- Specified by:
deserializeResponse
in interfaceMessageSerializer<GraphBinaryMapper>
- Throws:
SerializationException
-
mimeTypesSupported
public String[] mimeTypesSupported()
Description copied from interface:MessageSerializer
The list of mime types that the serializer supports. They should be ordered in preferred ordered where the greatest fidelity match is first.- Specified by:
mimeTypesSupported
in interfaceMessageSerializer<GraphBinaryMapper>
-
serializeResponseAsString
public String serializeResponseAsString(ResponseMessage responseMessage, io.netty.buffer.ByteBufAllocator allocator) throws SerializationException
- Specified by:
serializeResponseAsString
in interfaceMessageTextSerializer<GraphBinaryMapper>
- Throws:
SerializationException
-
serializeRequestAsString
public String serializeRequestAsString(RequestMessage requestMessage, io.netty.buffer.ByteBufAllocator allocator) throws SerializationException
- Specified by:
serializeRequestAsString
in interfaceMessageTextSerializer<GraphBinaryMapper>
- Throws:
SerializationException
-
deserializeRequest
public RequestMessage deserializeRequest(String msg) throws SerializationException
- Specified by:
deserializeRequest
in interfaceMessageTextSerializer<GraphBinaryMapper>
- Throws:
SerializationException
-
deserializeResponse
public ResponseMessage deserializeResponse(String msg) throws SerializationException
- Specified by:
deserializeResponse
in interfaceMessageTextSerializer<GraphBinaryMapper>
- Throws:
SerializationException
-
-