Class AmopMsgHandler

java.lang.Object
org.fisco.bcos.sdk.amop.topic.AmopMsgHandler
All Implemented Interfaces:
MsgHandler

public class AmopMsgHandler
extends java.lang.Object
implements MsgHandler
  • Constructor Summary

    Constructors 
    Constructor Description
    AmopMsgHandler​(Channel channel, TopicManager topicManager)  
  • Method Summary

    Modifier and Type Method Description
    void addCallback​(java.lang.String seq, ResponseCallback callback)  
    int checkSignature​(java.lang.String topic, byte[] randomValue, byte[] signature)  
    static boolean isPrivateTopic​(java.lang.String topic)  
    void onAmopMsg​(io.netty.channel.ChannelHandlerContext ctx, AmopMsg amopMsg)  
    void onAmopResponse​(io.netty.channel.ChannelHandlerContext ctx, Message msg)  
    void onConnect​(io.netty.channel.ChannelHandlerContext ctx)
    OnConnect action.
    void onDisconnect​(io.netty.channel.ChannelHandlerContext ctx)
    OnDisconnect action Called when one connection disconnect.
    void onMessage​(io.netty.channel.ChannelHandlerContext ctx, Message msg)
    OnMessage action.
    void onPrivateTopicRandomValue​(io.netty.channel.ChannelHandlerContext ctx, AmopMsg msg)  
    void onVerifyRequest​(io.netty.channel.ChannelHandlerContext ctx, Message msg)  
    static java.lang.String removePrivateTopicPrefix​(java.lang.String topic)  
    void responseVerifyRequest​(io.netty.channel.ChannelHandlerContext ctx, Message msg)  
    void sendUpdateTopicStatus​(int valid, java.lang.String topic, java.lang.String nodeId, io.netty.channel.ChannelHandlerContext ctx)  
    void setIsRunning​(boolean isRunning)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • setIsRunning

      public void setIsRunning​(boolean isRunning)
    • 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
    • onVerifyRequest

      public void onVerifyRequest​(io.netty.channel.ChannelHandlerContext ctx, Message msg)
    • responseVerifyRequest

      public void responseVerifyRequest​(io.netty.channel.ChannelHandlerContext ctx, Message msg)
    • checkSignature

      public int checkSignature​(java.lang.String topic, byte[] randomValue, byte[] signature)
    • isPrivateTopic

      public static boolean isPrivateTopic​(java.lang.String topic)
    • removePrivateTopicPrefix

      public static java.lang.String removePrivateTopicPrefix​(java.lang.String topic)
    • onPrivateTopicRandomValue

      public void onPrivateTopicRandomValue​(io.netty.channel.ChannelHandlerContext ctx, AmopMsg msg)
    • onAmopMsg

      public void onAmopMsg​(io.netty.channel.ChannelHandlerContext ctx, AmopMsg amopMsg)
    • onAmopResponse

      public void onAmopResponse​(io.netty.channel.ChannelHandlerContext ctx, Message msg)
    • sendUpdateTopicStatus

      public void sendUpdateTopicStatus​(int valid, java.lang.String topic, java.lang.String nodeId, io.netty.channel.ChannelHandlerContext ctx) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • addCallback

      public void addCallback​(java.lang.String seq, ResponseCallback callback)