Pushed Switch Mastership Events into the Topology event channel.
Needed for ONOS-1729
For now those events are not used.

Also, added new TopologyElement attribute type: TYPE_ALL_LAYERS
which applies to the Mastership Events.

NOTE: Currently, those events are intercepted within the
Floodlight Controller.java class. The interception point might be moved
once it becomes clear whether the event origin should be the mastership
election mechanism or the "role change request" accepted by the switch.
In addition, the interception point needs to be moved/ported as appropriate
once we move to the newer 1.3 OpenFlow driver implementation and eventloop.

Change-Id: Iff06ed5aee867c428a8378e31f9d51dbe3e6b978
diff --git a/src/main/java/net/onrc/onos/api/registry/ILocalSwitchMastershipListener.java b/src/main/java/net/onrc/onos/api/registry/ILocalSwitchMastershipListener.java
new file mode 100644
index 0000000..2445b76
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/registry/ILocalSwitchMastershipListener.java
@@ -0,0 +1,32 @@
+package net.onrc.onos.api.registry;
+
+// TODO: The "Role" enums should be moved to this file
+import net.floodlightcontroller.core.IFloodlightProviderService.Role;
+import net.onrc.onos.core.util.Dpid;
+
+/**
+ * Switch mastership listener interface for controller role changes for
+ * local switches.
+ * <p/>
+ * The interface can be used to track only switches that are connected
+ * to this ONOS instance.
+ */
+public interface ILocalSwitchMastershipListener {
+    /**
+     * The role of this controller has changed for a switch.
+     * <p/>
+     * This is the method that is called when the switch connects to the
+     * controller, and when the role of the controller has changed.
+     *
+     * @param dpid the DPID of the switch.
+     * @param role the new role of this controller for the switch.
+     */
+    void controllerRoleChanged(Dpid dpid, Role role);
+
+    /**
+     * The switch has disconnected, and it is not tracked anymore.
+     *
+     * @param dpid the DPID of the switch.
+     */
+    void switchDisconnected(Dpid dpid);
+}