Interface MessageSerializer<M>

    • Field Detail

      • logger

        static final org.slf4j.Logger logger
    • Method Detail

      • getMapper

        M getMapper()
        Gets the "mapper" that performs the underlying serialization work.
      • serializeResponseAsBinary

        io.netty.buffer.ByteBuf serializeResponseAsBinary​(ResponseMessage responseMessage,
                                                          io.netty.buffer.ByteBufAllocator allocator)
                                                   throws SerializationException
        Serialize a ResponseMessage to a Netty ByteBuf.
        Parameters:
        responseMessage - The response message to serialize to bytes.
        allocator - The Netty allocator for the ByteBuf to return back.
        Throws:
        SerializationException
      • serializeRequestAsBinary

        io.netty.buffer.ByteBuf serializeRequestAsBinary​(RequestMessage requestMessage,
                                                         io.netty.buffer.ByteBufAllocator allocator)
                                                  throws SerializationException
        Serialize a ResponseMessage to a Netty ByteBuf.
        Parameters:
        requestMessage - The request message to serialize to bytes.
        allocator - The Netty allocator for the ByteBuf to return back.
        Throws:
        SerializationException
      • mimeTypesSupported

        String[] mimeTypesSupported()
        The list of mime types that the serializer supports. They should be ordered in preferred ordered where the greatest fidelity match is first.
      • configure

        default void configure​(Map<String,​Object> config,
                               Map<String,​Graph> graphs)
        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.