类 GroupManagerServiceImpl

java.lang.Object
org.fisco.bcos.sdk.service.GroupManagerServiceImpl
所有已实现的接口:
GroupManagerService

public class GroupManagerServiceImpl
extends java.lang.Object
implements GroupManagerService
  • 字段详细资料

    • SM_CRYPTO_STR

      public static final java.lang.String SM_CRYPTO_STR
      另请参阅:
      常量字段值
  • 构造器详细资料

    • GroupManagerServiceImpl

      public GroupManagerServiceImpl​(Channel channel, ConfigOption configOption)
  • 方法详细资料

    • getConfig

      public ConfigOption getConfig()
      从接口复制的说明: GroupManagerService
      Get configuration
      指定者:
      getConfig 在接口中 GroupManagerService
      返回:
      ConfigOption
    • getCryptoType

      public java.lang.Integer getCryptoType​(java.lang.String peerInfo)
      从接口复制的说明: GroupManagerService
      Get the crypto type
      指定者:
      getCryptoType 在接口中 GroupManagerService
      参数:
      peerInfo - ip and port
      返回:
      ECDSA_TYPE or SM_TYPE
    • getNodeVersion

      public NodeVersion getNodeVersion​(java.lang.String peerInfo)
      从接口复制的说明: GroupManagerService
      Get node version of a specific peer
      指定者:
      getNodeVersion 在接口中 GroupManagerService
      参数:
      peerInfo - ip and port
      返回:
      NodeVersion
    • updateNodeVersion

      public void updateNodeVersion()
      从接口复制的说明: GroupManagerService
      Update node version
      指定者:
      updateNodeVersion 在接口中 GroupManagerService
    • registerGetNodeVersionHandler

      public void registerGetNodeVersionHandler()
    • registerBlockNumberNotifyHandler

      public void registerBlockNumberNotifyHandler()
    • registerTransactionNotifyHandler

      public void registerTransactionNotifyHandler()
    • onReceiveBlockNotifyImpl

      protected void onReceiveBlockNotifyImpl​(EnumChannelProtocolVersion version, java.lang.String peerIpAndPort, Message blockNumberNotifyMessage)
      Get the blockNumber notify message from the AMOP module, parse the package and update the latest block height of each group
      参数:
      version - the EnumChannelProtocolVersion instance
      peerIpAndPort - Node ip and port
      blockNumberNotifyMessage - the blockNumber notify message
    • registerBlockNotifyCallback

      public java.lang.String registerBlockNotifyCallback​(BlockNumberNotifyCallback callback)
      从接口复制的说明: GroupManagerService
      Register block notify callback
      指定者:
      registerBlockNotifyCallback 在接口中 GroupManagerService
      参数:
      callback - the BlockNumberNotifyCallback type callback objct
      返回:
      register id
    • eraseBlockNotifyCallback

      public void eraseBlockNotifyCallback​(java.lang.String registerId)
      从接口复制的说明: GroupManagerService
      Remove block notify callback
      指定者:
      eraseBlockNotifyCallback 在接口中 GroupManagerService
      参数:
      registerId - the specific register id
    • onReceiveTransactionNotify

      protected void onReceiveTransactionNotify​(Message message)
      calls the transaction callback when receive the transaction notify
      参数:
      message - the message contains the transactionReceipt
    • asyncSendTransaction

      public void asyncSendTransaction​(java.lang.Integer groupId, Message transactionMessage, TransactionCallback callback, ResponseCallback responseCallback)
      从接口复制的说明: GroupManagerService
      Send transaction in async
      指定者:
      asyncSendTransaction 在接口中 GroupManagerService
      参数:
      groupId - the group id
      transactionMessage - message object contain transaction data
      callback - the transaction callback
      responseCallback - the response callback
    • eraseTransactionSeq

      public void eraseTransactionSeq​(java.lang.String seq)
      从接口复制的说明: GroupManagerService
      Remove the target transaction callback of a specific seq number
      指定者:
      eraseTransactionSeq 在接口中 GroupManagerService
    • getChannel

      public Channel getChannel()
      指定者:
      getChannel 在接口中 GroupManagerService
    • stop

      public void stop()
      Stop group list fetching thread
      指定者:
      stop 在接口中 GroupManagerService
    • start

      protected void start()
      start the thread to obtain group list information periodically
    • updateGroupInfo

      public void updateGroupInfo​(java.lang.String peerIpAndPort, java.util.List<java.lang.String> groupList)
      从接口复制的说明: GroupManagerService
      Update the group list information of the node
      指定者:
      updateGroupInfo 在接口中 GroupManagerService
      参数:
      peerIpAndPort - Node ip and port information
      groupList - Group list of nodes
    • updateBlockNumberInfo

      public void updateBlockNumberInfo​(java.lang.Integer groupId, java.lang.String peerInfo, java.math.BigInteger currentBlockNumber)
      从接口复制的说明: GroupManagerService
      update the block number information for the specified group
      指定者:
      updateBlockNumberInfo 在接口中 GroupManagerService
      参数:
      groupId - the specified groupId
      peerInfo - the info of the peers
      currentBlockNumber - the current blockNumber
    • getBlockLimitByGroup

      public java.math.BigInteger getBlockLimitByGroup​(java.lang.Integer groupId)
      从接口复制的说明: GroupManagerService
      Get block limit of specified group
      指定者:
      getBlockLimitByGroup 在接口中 GroupManagerService
      参数:
      groupId - The specified groupId
      返回:
      the blockLimit(needed by the transaction module)
    • getLatestBlockNumberByGroup

      public java.math.BigInteger getLatestBlockNumberByGroup​(java.lang.Integer groupId)
      从接口复制的说明: GroupManagerService
      Get the latest block number of a specific group
      指定者:
      getLatestBlockNumberByGroup 在接口中 GroupManagerService
      返回:
      BlockNumber
    • getGroupNodeList

      public java.util.Set<java.lang.String> getGroupNodeList​(java.lang.Integer groupId)
      从接口复制的说明: GroupManagerService
      Get the node list of the specified group
      指定者:
      getGroupNodeList 在接口中 GroupManagerService
      参数:
      groupId - The group id
      返回:
      The node list that started the group
    • getGroupInfoByNodeInfo

      public java.util.List<java.lang.String> getGroupInfoByNodeInfo​(java.lang.String nodeAddress)
      从接口复制的说明: GroupManagerService
      Get the group list of specified node
      指定者:
      getGroupInfoByNodeInfo 在接口中 GroupManagerService
      参数:
      nodeAddress - The ip and port info of the node
      返回:
      List of groups started by the node
    • sendMessageToGroup

      public Response sendMessageToGroup​(java.lang.Integer groupId, Message message)
      从接口复制的说明: GroupManagerService
      Send a message to a node in the group and select the node with the highest block height in the group
      指定者:
      sendMessageToGroup 在接口中 GroupManagerService
      参数:
      groupId - The group the message is sent to
      message - The message to be sent
      返回:
      response of the node located in the specified group
    • asyncSendMessageToGroup

      public void asyncSendMessageToGroup​(java.lang.Integer groupId, Message message, ResponseCallback callback)
      从接口复制的说明: GroupManagerService
      Send a message to a node in the group and select the node with the highest block height in the group
      指定者:
      asyncSendMessageToGroup 在接口中 GroupManagerService
      参数:
      groupId - The group the message is sent to
      message - The message to be sent
      callback - callback to be called after receiving response
    • sendMessageToGroupByRule

      public Response sendMessageToGroupByRule​(java.lang.Integer groupId, Message message, PeerSelectRule rule)
      从接口复制的说明: GroupManagerService
      Send messages to nodes in the group according to specified rules (If multiple nodes are filtered out, only select one of them to send the message)
      指定者:
      sendMessageToGroupByRule 在接口中 GroupManagerService
      参数:
      groupId - The group the message is sent to
      message - The message to be sent
      rule - Rule for filtering the target nodes
      返回:
      callback to be called after receiving response
    • getGroupConnectionInfo

      public java.util.List<ConnectionInfo> getGroupConnectionInfo​(java.lang.Integer groupId)
      指定者:
      getGroupConnectionInfo 在接口中 GroupManagerService
    • getGroupAvailablePeers

      public java.util.List<java.lang.String> getGroupAvailablePeers​(java.lang.Integer groupId)
      从接口复制的说明: GroupManagerService
      get available ip and port info of specified group
      指定者:
      getGroupAvailablePeers 在接口中 GroupManagerService
      参数:
      groupId - get the connection info of the group
      返回:
      the available ip and port info of the group
    • asyncSendMessageToGroupByRule

      public void asyncSendMessageToGroupByRule​(java.lang.Integer groupId, Message message, PeerSelectRule rule, ResponseCallback callback)
      从接口复制的说明: GroupManagerService
      Send messages to nodes in the group according to specified rules (If multiple nodes are filtered out, only select one of them to send the message)
      指定者:
      asyncSendMessageToGroupByRule 在接口中 GroupManagerService
      参数:
      groupId - The group the message is sent to
      message - The message to be sent
      rule - Rules for filtering the target nodes
      callback - Function to be called after receiving response
    • broadcastMessageToGroup

      public void broadcastMessageToGroup​(java.lang.Integer groupId, Message message)
      从接口复制的说明: GroupManagerService
      Broadcast messages to all the nodes of the specified group
      指定者:
      broadcastMessageToGroup 在接口中 GroupManagerService
      参数:
      groupId - The group the message is sent to
      message - The message to be sent
    • fetchGroupList

      public void fetchGroupList()
      从接口复制的说明: GroupManagerService
      Fetch group list from node connected
      指定者:
      fetchGroupList 在接口中 GroupManagerService
    • getGroupList

      public java.util.Set<java.lang.Integer> getGroupList()
      从接口复制的说明: GroupManagerService
      Get the group list of the nodes connected
      指定者:
      getGroupList 在接口中 GroupManagerService
      返回:
      the set of group ids
    • updateBlockNotify

      protected void updateBlockNotify​(java.lang.String peer, java.util.List<java.lang.String> groupList)
    • setAmop

      public void setAmop​(Amop amop)
      从接口复制的说明: GroupManagerService
      Set the amop module which used to register notification
      指定者:
      setAmop 在接口中 GroupManagerService
      参数:
      amop - Amop instance