Class ChannelMsgHandler

java.lang.Object
org.fisco.bcos.sdk.channel.ChannelMsgHandler
All Implemented Interfaces:
MsgHandler

public class ChannelMsgHandler
extends java.lang.Object
implements MsgHandler
An implementation of channel.
  • Constructor Details

  • Method Details

    • getAvailablePeer

      public java.util.Map<java.lang.String,​io.netty.channel.ChannelHandlerContext> getAvailablePeer()
    • addConnectHandler

      public void addConnectHandler​(MsgHandler handler)
    • addEstablishHandler

      public void addEstablishHandler​(MsgHandler handler)
    • addMessageHandler

      public void addMessageHandler​(MsgType type, MsgHandler handler)
    • addDisconnectHandler

      public void addDisconnectHandler​(MsgHandler handler)
    • addSeq2CallBack

      public void addSeq2CallBack​(java.lang.String seq, ResponseCallback callback)
    • removeSeq

      public void removeSeq​(java.lang.String seq)
    • onConnect

      public void onConnect​(io.netty.channel.ChannelHandlerContext ctx)
      Description copied from interface: MsgHandler
      OnConnect action. Called when connect success.
      Specified by:
      onConnect in interface MsgHandler
      Parameters:
      ctx - ChannelHandlerContext of the connection from netty
    • onMessage

      public void onMessage​(io.netty.channel.ChannelHandlerContext ctx, Message msg)
      Description copied from interface: MsgHandler
      OnMessage action. Called when one message comes from the network.
      Specified by:
      onMessage in interface MsgHandler
      Parameters:
      ctx - ChannelHandlerContext of the connection from netty
      msg - Message from the network
    • onDisconnect

      public void onDisconnect​(io.netty.channel.ChannelHandlerContext ctx)
      Description copied from interface: MsgHandler
      OnDisconnect action Called when one connection disconnect.
      Specified by:
      onDisconnect in interface MsgHandler
      Parameters:
      ctx - ChannelHandlerContext of the connection from netty