[SDFAB-933] Integrate atomix-3.1.12 and expose demote API
Additionally, this patch adds unit tests for demote and
updates a bunch of testing tools
Change-Id: I9636078b08486c9167ae253f0251f72239ad2802
diff --git a/core/api/src/main/java/org/onosproject/cluster/LeadershipStore.java b/core/api/src/main/java/org/onosproject/cluster/LeadershipStore.java
index 0953e38..ebc6b4c 100644
--- a/core/api/src/main/java/org/onosproject/cluster/LeadershipStore.java
+++ b/core/api/src/main/java/org/onosproject/cluster/LeadershipStore.java
@@ -16,6 +16,7 @@
package org.onosproject.cluster;
import java.util.Map;
+
import org.onosproject.store.Store;
/**
@@ -79,4 +80,15 @@
* @return topic to leadership mapping
*/
Map<String, Leadership> getLeaderships();
+
+ /**
+ * Attempts to demote a node to the bottom of the candidate list. It is not allowed
+ * to demote the current leader
+ *
+ * @param topic leadership topic
+ * @param nodeId identifier of node to be demoted
+ * @return {@code true} if nodeId is now the bottom candidate. This method returns {@code false}
+ * if {@code nodeId} is not one of the candidates for the topic or if it is the leader.
+ */
+ boolean demote(String topic, NodeId nodeId);
}
\ No newline at end of file