Package org.onosproject.mastership
Interface MastershipStore
- 
- All Superinterfaces:
- Store<MastershipEvent,MastershipStoreDelegate>
 
 public interface MastershipStore extends Store<MastershipEvent,MastershipStoreDelegate> Manages inventory of mastership roles for devices, across controller instances; not intended for direct use.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description Set<DeviceId>getDevices(NodeId nodeId)Returns the devices that a controller instance is master of.NodeIdgetMaster(DeviceId deviceId)Returns the master for a device.MastershipInfogetMastership(DeviceId deviceId)Returns the mastership info for the given device.RoleInfogetNodes(DeviceId deviceId)Returns the master and backup nodes for a device.MastershipRolegetRole(NodeId nodeId, DeviceId deviceId)Returns the role of a device for a specific controller instance.MastershipTermgetTermFor(DeviceId deviceId)Returns the current master and number of past mastership hand-offs (terms) for a device.voidrelinquishAllRole(NodeId nodeId)Removes all the roles for the specified controller instance.CompletableFuture<MastershipEvent>relinquishRole(NodeId nodeId, DeviceId deviceId)Allows a controller instance to give up its current role for a device.CompletableFuture<MastershipRole>requestRole(DeviceId deviceId)Requests role of the local node for the specified device.CompletableFuture<MastershipEvent>setMaster(NodeId nodeId, DeviceId deviceId)Sets a device's role for a specified controller instance.CompletableFuture<MastershipEvent>setStandby(NodeId nodeId, DeviceId deviceId)Sets a controller instance's mastership role to STANDBY for a device.- 
Methods inherited from interface org.onosproject.store.StorehasDelegate, setDelegate, unsetDelegate
 
- 
 
- 
- 
- 
Method Detail- 
requestRoleCompletableFuture<MastershipRole> requestRole(DeviceId deviceId) Requests role of the local node for the specified device.- Parameters:
- deviceId- device identifier
- Returns:
- established or newly negotiated mastership role
 
 - 
getRoleMastershipRole getRole(NodeId nodeId, DeviceId deviceId) Returns the role of a device for a specific controller instance.- Parameters:
- nodeId- the instance identifier
- deviceId- the device identifiers
- Returns:
- the role
 
 - 
getMasterNodeId getMaster(DeviceId deviceId) Returns the master for a device.- Parameters:
- deviceId- the device identifier
- Returns:
- the instance identifier of the master
 
 - 
getNodesRoleInfo getNodes(DeviceId deviceId) Returns the master and backup nodes for a device.- Parameters:
- deviceId- the device identifier
- Returns:
- a RoleInfo containing controller IDs
 
 - 
getDevicesSet<DeviceId> getDevices(NodeId nodeId) Returns the devices that a controller instance is master of.- Parameters:
- nodeId- the instance identifier
- Returns:
- a set of device identifiers
 
 - 
setMasterCompletableFuture<MastershipEvent> setMaster(NodeId nodeId, DeviceId deviceId) Sets a device's role for a specified controller instance.- Parameters:
- nodeId- controller instance identifier
- deviceId- device identifier
- Returns:
- a mastership event
 
 - 
getTermForMastershipTerm getTermFor(DeviceId deviceId) Returns the current master and number of past mastership hand-offs (terms) for a device.- Parameters:
- deviceId- the device identifier
- Returns:
- the current master's ID and the term value for device, or null
 
 - 
getMastershipMastershipInfo getMastership(DeviceId deviceId) Returns the mastership info for the given device.- Parameters:
- deviceId- the device for which to return the mastership info
- Returns:
- the mastership info for the given device
 
 - 
setStandbyCompletableFuture<MastershipEvent> setStandby(NodeId nodeId, DeviceId deviceId) Sets a controller instance's mastership role to STANDBY for a device. If the role is MASTER, another controller instance will be selected as a candidate master.- Parameters:
- nodeId- the controller instance identifier
- deviceId- device to revoke mastership role for
- Returns:
- a mastership event
 
 - 
relinquishRoleCompletableFuture<MastershipEvent> relinquishRole(NodeId nodeId, DeviceId deviceId) Allows a controller instance to give up its current role for a device. If the role is MASTER, another controller instance will be selected as a candidate master.- Parameters:
- nodeId- the controller instance identifier
- deviceId- device to revoke mastership role for
- Returns:
- a mastership event
 
 - 
relinquishAllRolevoid relinquishAllRole(NodeId nodeId) Removes all the roles for the specified controller instance. If the role was MASTER, another controller instance will be selected as a candidate master.- Parameters:
- nodeId- the controller instance identifier
 
 
- 
 
-