Madan Jampani
Committed by Gerrit Code Review

Fix PartitionedAsyncLeaderElector to ensure status change listeners are properly handled

Change-Id: I9fa1268ba07734130ab7618e2110c053499bf1f1
(cherry picked from commit a82b2171)
......@@ -28,7 +28,6 @@ import org.onosproject.cluster.NodeId;
import org.onosproject.cluster.PartitionId;
import org.onosproject.event.Change;
import org.onosproject.store.service.AsyncLeaderElector;
import com.google.common.collect.Maps;
/**
......@@ -126,4 +125,19 @@ public class PartitionedAsyncLeaderElector implements AsyncLeaderElector {
private Collection<AsyncLeaderElector> getLeaderElectors() {
return partitions.values();
}
@Override
public void addStatusChangeListener(Consumer<Status> listener) {
partitions.values().forEach(elector -> elector.addStatusChangeListener(listener));
}
@Override
public void removeStatusChangeListener(Consumer<Status> listener) {
partitions.values().forEach(elector -> elector.removeStatusChangeListener(listener));
}
@Override
public Collection<Consumer<Status>> statusChangeListeners() {
throw new UnsupportedOperationException();
}
}
\ No newline at end of file
......