org.fisco.bcos.sdk.service.GroupService Maven / Gradle / Ivy
/**
* Copyright 2014-2020 [fisco-dev]
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of the License at
*
*
http://www.apache.org/licenses/LICENSE-2.0
*
*
Unless required by applicable law or agreed to in writing, software distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.fisco.bcos.sdk.service;
import java.math.BigInteger;
import java.util.Set;
public interface GroupService {
/**
* Get the node information of the group
*
* @return Nodes' ip and port list
*/
Set getGroupNodesInfo();
/**
* remove node from the group
*
* @param nodeAddress the ip and port of the removed node
* @return if nodes in the original list that needed to be removed return True, else false.
*/
boolean removeNode(String nodeAddress);
/**
* add nodeInfo to the group
*
* @param nodeAddress the node ip and port
* @return if nodes in the original list that needed to be inserted return True, else false.
*/
boolean insertNode(String nodeAddress);
/**
* update the latest block number of the specified group
*
* @param peerIpAndPort the node that notify the block number info
* @param blockNumber the notified block number
*/
void updatePeersBlockNumberInfo(String peerIpAndPort, BigInteger blockNumber);
BigInteger getLatestBlockNumber();
String getNodeWithTheLatestBlockNumber();
boolean existPeer(String peer);
}