类 GroupManagerServiceImpl
java.lang.Object
org.fisco.bcos.sdk.service.GroupManagerServiceImpl
- 所有已实现的接口:
GroupManagerService
public class GroupManagerServiceImpl extends java.lang.Object implements GroupManagerService
-
字段概要
字段 修饰符和类型 字段 说明 static java.lang.String
SM_CRYPTO_STR
从接口继承的字段 org.fisco.bcos.sdk.service.GroupManagerService
BLOCK_LIMIT
-
构造器概要
构造器 构造器 说明 GroupManagerServiceImpl(Channel channel, ConfigOption configOption)
-
方法概要
修饰符和类型 方法 说明 void
asyncSendMessageToGroup(java.lang.Integer groupId, Message message, ResponseCallback callback)
Send a message to a node in the group and select the node with the highest block height in the groupvoid
asyncSendMessageToGroupByRule(java.lang.Integer groupId, Message message, PeerSelectRule rule, ResponseCallback callback)
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)void
asyncSendTransaction(java.lang.Integer groupId, Message transactionMessage, TransactionCallback callback, ResponseCallback responseCallback)
Send transaction in asyncvoid
broadcastMessageToGroup(java.lang.Integer groupId, Message message)
Broadcast messages to all the nodes of the specified groupvoid
eraseBlockNotifyCallback(java.lang.String registerId)
Remove block notify callbackvoid
eraseTransactionSeq(java.lang.String seq)
Remove the target transaction callback of a specific seq numbervoid
fetchGroupList()
Fetch group list from node connectedjava.math.BigInteger
getBlockLimitByGroup(java.lang.Integer groupId)
Get block limit of specified groupChannel
getChannel()
ConfigOption
getConfig()
Get configurationjava.lang.Integer
getCryptoType(java.lang.String peerInfo)
Get the crypto typejava.util.List<java.lang.String>
getGroupAvailablePeers(java.lang.Integer groupId)
get available ip and port info of specified groupjava.util.List<ConnectionInfo>
getGroupConnectionInfo(java.lang.Integer groupId)
java.util.List<java.lang.String>
getGroupInfoByNodeInfo(java.lang.String nodeAddress)
Get the group list of specified nodejava.util.Set<java.lang.Integer>
getGroupList()
Get the group list of the nodes connectedjava.util.Set<java.lang.String>
getGroupNodeList(java.lang.Integer groupId)
Get the node list of the specified groupjava.math.BigInteger
getLatestBlockNumberByGroup(java.lang.Integer groupId)
Get the latest block number of a specific groupNodeVersion
getNodeVersion(java.lang.String peerInfo)
Get node version of a specific peerprotected 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 groupprotected void
onReceiveTransactionNotify(Message message)
calls the transaction callback when receive the transaction notifyjava.lang.String
registerBlockNotifyCallback(BlockNumberNotifyCallback callback)
Register block notify callbackvoid
registerBlockNumberNotifyHandler()
void
registerGetNodeVersionHandler()
void
registerTransactionNotifyHandler()
Response
sendMessageToGroup(java.lang.Integer groupId, Message message)
Send a message to a node in the group and select the node with the highest block height in the groupResponse
sendMessageToGroupByRule(java.lang.Integer groupId, Message message, PeerSelectRule rule)
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)void
setAmop(Amop amop)
Set the amop module which used to register notificationprotected void
start()
start the thread to obtain group list information periodicallyvoid
stop()
Stop group list fetching threadprotected void
updateBlockNotify(java.lang.String peer, java.util.List<java.lang.String> groupList)
void
updateBlockNumberInfo(java.lang.Integer groupId, java.lang.String peerInfo, java.math.BigInteger currentBlockNumber)
update the block number information for the specified groupvoid
updateGroupInfo(java.lang.String peerIpAndPort, java.util.List<java.lang.String> groupList)
Update the group list information of the nodevoid
updateNodeVersion()
Update node version从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
字段详细资料
-
SM_CRYPTO_STR
public static final java.lang.String SM_CRYPTO_STR- 另请参阅:
- 常量字段值
-
-
构造器详细资料
-
GroupManagerServiceImpl
-
-
方法详细资料
-
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
从接口复制的说明: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 instancepeerIpAndPort
- Node ip and portblockNumberNotifyMessage
- the blockNumber notify message
-
registerBlockNotifyCallback
从接口复制的说明: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
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 idtransactionMessage
- message object contain transaction datacallback
- the transaction callbackresponseCallback
- 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
- 指定者:
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 informationgroupList
- 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 groupIdpeerInfo
- the info of the peerscurrentBlockNumber
- 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
从接口复制的说明: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 tomessage
- 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 tomessage
- The message to be sentcallback
- 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 tomessage
- The message to be sentrule
- Rule for filtering the target nodes- 返回:
- callback to be called after receiving response
-
getGroupConnectionInfo
- 指定者:
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 tomessage
- The message to be sentrule
- Rules for filtering the target nodescallback
- Function to be called after receiving response
-
broadcastMessageToGroup
从接口复制的说明:GroupManagerService
Broadcast messages to all the nodes of the specified group- 指定者:
broadcastMessageToGroup
在接口中GroupManagerService
- 参数:
groupId
- The group the message is sent tomessage
- 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
从接口复制的说明:GroupManagerService
Set the amop module which used to register notification- 指定者:
setAmop
在接口中GroupManagerService
- 参数:
amop
- Amop instance
-