Class WebsocketGatewayClientCodec

    • Constructor Summary

      Constructors 
      Constructor Description
      WebsocketGatewayClientCodec​(io.scalecube.services.transport.api.DataCodec dataCodec)
      Constructor for codec which encode/decode client message to/from websocket gateway message represented by json and transformed in ByteBuf.
      WebsocketGatewayClientCodec​(io.scalecube.services.transport.api.DataCodec dataCodec, boolean releaseDataOnEncode)
      Constructor for codec which encode/decode client message to/from websocket gateway message represented by json and transformed in ByteBuf.
    • Constructor Detail

      • WebsocketGatewayClientCodec

        public WebsocketGatewayClientCodec​(io.scalecube.services.transport.api.DataCodec dataCodec)
        Constructor for codec which encode/decode client message to/from websocket gateway message represented by json and transformed in ByteBuf.
        Parameters:
        dataCodec - data message codec.
      • WebsocketGatewayClientCodec

        public WebsocketGatewayClientCodec​(io.scalecube.services.transport.api.DataCodec dataCodec,
                                           boolean releaseDataOnEncode)
        Constructor for codec which encode/decode client message to/from websocket gateway message represented by json and transformed in ByteBuf.
        Parameters:
        dataCodec - data message codec.
        releaseDataOnEncode - release data on encode flag.
    • Method Detail

      • encode

        public io.netty.buffer.ByteBuf encode​(io.scalecube.services.api.ServiceMessage message)
        Description copied from interface: GatewayClientCodec
        Encodes ServiceMessage to GatewayClientCodec type.
        Specified by:
        encode in interface GatewayClientCodec<io.netty.buffer.ByteBuf>
        Parameters:
        message - client message to encode
        Returns:
        encoded message represented by GatewayClientCodec type
      • decode

        public io.scalecube.services.api.ServiceMessage decode​(io.netty.buffer.ByteBuf encodedMessage)
        Description copied from interface: GatewayClientCodec
        Decodes message represented by GatewayClientCodec type to ServiceMessage object.
        Specified by:
        decode in interface GatewayClientCodec<io.netty.buffer.ByteBuf>
        Parameters:
        encodedMessage - message to decode
        Returns:
        decoded message represented by ServiceMessage type