blob: 2445b764bd9b8aa230c2e3ba0aab42b9eb0a69f4 [file] [log] [blame]
Pavlin Radoslavov695f8952014-07-23 16:57:01 -07001package net.onrc.onos.api.registry;
2
3// TODO: The "Role" enums should be moved to this file
4import net.floodlightcontroller.core.IFloodlightProviderService.Role;
5import net.onrc.onos.core.util.Dpid;
6
7/**
8 * Switch mastership listener interface for controller role changes for
9 * local switches.
10 * <p/>
11 * The interface can be used to track only switches that are connected
12 * to this ONOS instance.
13 */
14public interface ILocalSwitchMastershipListener {
15 /**
16 * The role of this controller has changed for a switch.
17 * <p/>
18 * This is the method that is called when the switch connects to the
19 * controller, and when the role of the controller has changed.
20 *
21 * @param dpid the DPID of the switch.
22 * @param role the new role of this controller for the switch.
23 */
24 void controllerRoleChanged(Dpid dpid, Role role);
25
26 /**
27 * The switch has disconnected, and it is not tracked anymore.
28 *
29 * @param dpid the DPID of the switch.
30 */
31 void switchDisconnected(Dpid dpid);
32}