MasteshipService, store, and CLI commands use RoleInfo
Change-Id: Ibc569498a67d33d088e5c9f89c6bb1f45eadc26e
diff --git a/core/api/src/main/java/org/onlab/onos/mastership/MastershipEvent.java b/core/api/src/main/java/org/onlab/onos/mastership/MastershipEvent.java
index 7b8531c..9f75fc4 100644
--- a/core/api/src/main/java/org/onlab/onos/mastership/MastershipEvent.java
+++ b/core/api/src/main/java/org/onlab/onos/mastership/MastershipEvent.java
@@ -56,7 +56,10 @@
}
/**
- * Returns the NodeID of the node responsible for triggering the event.
+ * Returns the NodeID of the node associated with the event.
+ * For MASTER_CHANGED this is the newly elected master, and for
+ * BACKUPS_CHANGED, this is the node that was newly added, removed, or
+ * whose position was changed in the list.
*
* @return node ID as a subject
*/
diff --git a/core/api/src/main/java/org/onlab/onos/mastership/MastershipService.java b/core/api/src/main/java/org/onlab/onos/mastership/MastershipService.java
index 224bc05..30cb545 100644
--- a/core/api/src/main/java/org/onlab/onos/mastership/MastershipService.java
+++ b/core/api/src/main/java/org/onlab/onos/mastership/MastershipService.java
@@ -1,9 +1,9 @@
package org.onlab.onos.mastership;
-import java.util.List;
import java.util.Set;
import org.onlab.onos.cluster.NodeId;
+import org.onlab.onos.cluster.RoleInfo;
import org.onlab.onos.net.DeviceId;
import org.onlab.onos.net.MastershipRole;
@@ -57,7 +57,7 @@
* @param deviceId the identifier of the device
* @return a list of controller IDs
*/
- List<NodeId> getNodesFor(DeviceId deviceId);
+ RoleInfo getNodesFor(DeviceId deviceId);
/**
* Returns the devices for which a controller is master.
diff --git a/core/api/src/main/java/org/onlab/onos/mastership/MastershipStore.java b/core/api/src/main/java/org/onlab/onos/mastership/MastershipStore.java
index 5e7b0e4..bd7a354 100644
--- a/core/api/src/main/java/org/onlab/onos/mastership/MastershipStore.java
+++ b/core/api/src/main/java/org/onlab/onos/mastership/MastershipStore.java
@@ -1,9 +1,9 @@
package org.onlab.onos.mastership;
-import java.util.List;
import java.util.Set;
import org.onlab.onos.cluster.NodeId;
+import org.onlab.onos.cluster.RoleInfo;
import org.onlab.onos.net.DeviceId;
import org.onlab.onos.net.MastershipRole;
import org.onlab.onos.store.Store;
@@ -42,13 +42,12 @@
NodeId getMaster(DeviceId deviceId);
/**
- * Returns the controllers connected to a device, in mastership-
- * preference order.
+ * Returns the master and backup nodes for a device.
*
* @param deviceId the device identifier
- * @return an ordered list of controller IDs
+ * @return a RoleInfo containing controller IDs
*/
- List<NodeId> getNodes(DeviceId deviceId);
+ RoleInfo getNodes(DeviceId deviceId);
/**
* Returns the devices that a controller instance is master of.