blob: b3ddda5d224921c88f702a6b58b2b0cd4113eed1 [file] [log] [blame]
Umesh Krishnaswamyb56bb292013-02-12 20:28:27 -08001package net.floodlightcontroller.mastership;
2
3import net.floodlightcontroller.core.module.IFloodlightService;
4
5public interface IMastershipService extends IFloodlightService {
6
Jonathan Hartbd181b62013-02-17 16:05:38 -08007 // Callback for all mastership changes.
8 // Change callback is called when mastership is acquired or released
9 public interface MastershipCallback {
10 public void changeCallback(long dpid, boolean isMaster);
11 }
12
Umesh Krishnaswamyb56bb292013-02-12 20:28:27 -080013 // Acquire mastership for a switch.
Jonathan Hartbd181b62013-02-17 16:05:38 -080014 public void acquireMastership(long dpid, MastershipCallback cb);
Umesh Krishnaswamyb56bb292013-02-12 20:28:27 -080015
16 // Release mastership for a switch
17 public void releaseMastership(long dpid);
18
19 // Check if I am the master of a switch. This is a nonblocking call that checks if the caller is a
20 public boolean amMaster(long dpid);
21
22 // Set/Get mastership identifier.
23 // This is typically a unique identifier of the controller that does not change across restarts
24 public void setMastershipId (String id);
25 public String getMastershipId ();
26
27}