public interface MastershipStore extends Store<MastershipEvent,MastershipStoreDelegate>
Modifier and Type | Method and Description |
---|---|
java.util.Set<DeviceId> |
getDevices(NodeId nodeId)
Returns the devices that a controller instance is master of.
|
NodeId |
getMaster(DeviceId deviceId)
Returns the master for a device.
|
RoleInfo |
getNodes(DeviceId deviceId)
Returns the master and backup nodes for a device.
|
MastershipRole |
getRole(NodeId nodeId,
DeviceId deviceId)
Returns the role of a device for a specific controller instance.
|
MastershipTerm |
getTermFor(DeviceId deviceId)
Returns the current master and number of past mastership hand-offs
(terms) for a device.
|
void |
relinquishAllRole(NodeId nodeId)
Removes all the roles for the specified controller instance.
|
java.util.concurrent.CompletableFuture<MastershipEvent> |
relinquishRole(NodeId nodeId,
DeviceId deviceId)
Allows a controller instance to give up its current role for a device.
|
java.util.concurrent.CompletableFuture<MastershipRole> |
requestRole(DeviceId deviceId)
Requests role of the local node for the specified device.
|
java.util.concurrent.CompletableFuture<MastershipEvent> |
setMaster(NodeId nodeId,
DeviceId deviceId)
Sets a device's role for a specified controller instance.
|
java.util.concurrent.CompletableFuture<MastershipEvent> |
setStandby(NodeId nodeId,
DeviceId deviceId)
Sets a controller instance's mastership role to STANDBY for a device.
|
hasDelegate, setDelegate, unsetDelegate
java.util.concurrent.CompletableFuture<MastershipRole> requestRole(DeviceId deviceId)
deviceId
- device identifierMastershipRole getRole(NodeId nodeId, DeviceId deviceId)
nodeId
- the instance identifierdeviceId
- the device identifiersNodeId getMaster(DeviceId deviceId)
deviceId
- the device identifierRoleInfo getNodes(DeviceId deviceId)
deviceId
- the device identifierjava.util.Set<DeviceId> getDevices(NodeId nodeId)
nodeId
- the instance identifierjava.util.concurrent.CompletableFuture<MastershipEvent> setMaster(NodeId nodeId, DeviceId deviceId)
nodeId
- controller instance identifierdeviceId
- device identifierMastershipTerm getTermFor(DeviceId deviceId)
deviceId
- the device identifierjava.util.concurrent.CompletableFuture<MastershipEvent> setStandby(NodeId nodeId, DeviceId deviceId)
nodeId
- the controller instance identifierdeviceId
- device to revoke mastership role forjava.util.concurrent.CompletableFuture<MastershipEvent> relinquishRole(NodeId nodeId, DeviceId deviceId)
nodeId
- the controller instance identifierdeviceId
- device to revoke mastership role forvoid relinquishAllRole(NodeId nodeId)
nodeId
- the controller instance identifier