Rename MastershipEvent -> MastershipData
Change-Id: I24a290d65972cad0eaa1a1e687dc00adf5890cce
diff --git a/src/main/java/net/onrc/onos/core/topology/ImmutableTopologySnapshot.java b/src/main/java/net/onrc/onos/core/topology/ImmutableTopologySnapshot.java
index 20b3c48..e115127 100644
--- a/src/main/java/net/onrc/onos/core/topology/ImmutableTopologySnapshot.java
+++ b/src/main/java/net/onrc/onos/core/topology/ImmutableTopologySnapshot.java
@@ -52,7 +52,7 @@
// Mastership info
// Dpid -> [ (InstanceID, Role) ]
- private final Map<Dpid, SortedSet<MastershipEvent>> mastership;
+ private final Map<Dpid, SortedSet<MastershipData>> mastership;
// DPID -> Switch
private final Map<Dpid, SwitchData> switches;
@@ -354,18 +354,18 @@
/**
* Puts a mastership change event.
*
- * @param master MastershipEvent
+ * @param master MastershipData
* @return Builder
*/
- public Builder putSwitchMastershipEvent(MastershipEvent master) {
+ public Builder putSwitchMastershipData(MastershipData master) {
checkNotNull(master);
- SortedSet<MastershipEvent> candidates
+ SortedSet<MastershipData> candidates
= current.mastership.get(master.getDpid());
if (candidates == null) {
- // SortedSet, customized so that MASTER MastershipEvent appear
+ // SortedSet, customized so that MASTER MastershipData appear
// earlier during iteration.
- candidates = new TreeSet<>(new MastershipEvent.MasterFirstComparator());
+ candidates = new TreeSet<>(new MastershipData.MasterFirstComparator());
current.mastership.put(master.getDpid(), candidates);
}
@@ -379,15 +379,15 @@
* Removes a mastership change event.
* <p>
* Note: Only Dpid and OnosInstanceId will be used to identify the
- * {@link MastershipEvent} to remove.
+ * {@link MastershipData} to remove.
*
- * @param master {@link MastershipEvent} to remove. (Role is ignored)
+ * @param master {@link MastershipData} to remove. (Role is ignored)
* @return Builder
*/
- public Builder removeSwitchMastershipEvent(MastershipEvent master) {
+ public Builder removeSwitchMastershipData(MastershipData master) {
checkNotNull(master);
- SortedSet<MastershipEvent> candidates
+ SortedSet<MastershipData> candidates
= current.mastership.get(master.getDpid());
if (candidates == null) {
// nothing to do
@@ -429,7 +429,7 @@
// shallow copy Set in Map
this.mastership = new HashMap<>(builder.current.mastership.size());
- for (Entry<Dpid, SortedSet<MastershipEvent>> e
+ for (Entry<Dpid, SortedSet<MastershipData>> e
: builder.current.mastership.entrySet()) {
this.mastership.put(e.getKey(), new TreeSet<>(e.getValue()));
}
@@ -475,7 +475,7 @@
// shallow copy Set in Map
this.mastership = new HashMap<>(original.mastership.size());
- for (Entry<Dpid, SortedSet<MastershipEvent>> e
+ for (Entry<Dpid, SortedSet<MastershipData>> e
: original.mastership.entrySet()) {
this.mastership.put(e.getKey(), new TreeSet<>(e.getValue()));
}
@@ -672,11 +672,11 @@
*/
@Override
public OnosInstanceId getSwitchMaster(Dpid dpid) {
- final SortedSet<MastershipEvent> candidates = mastership.get(dpid);
+ final SortedSet<MastershipData> candidates = mastership.get(dpid);
if (candidates == null) {
return null;
}
- for (MastershipEvent candidate : candidates) {
+ for (MastershipData candidate : candidates) {
if (candidate.getRole() == Role.MASTER) {
return candidate.getOnosInstanceId();
}