public interface RoleService
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(RoleListener roleListener)
Subscribe to Role change notifications by supplying a
RoleListener
callback implementation. |
ControllerRole |
getCurrentRole(ControllerNode controller,
IpAddress deviceIp)
Returns the role that the given controller is playing in relation to the
specified network element.
|
ControllerNode |
getMaster(DataPathId dpid)
Returns the controller which is playing the role of MASTER to the given
controlled entity.
|
ControllerNode |
getMaster(DataPathId dpid,
boolean teamAware)
Returns the controller which is playing the MASTER role in relation to
the given datapath, which need not be necessarily of the local controller.
|
ControllerNode |
getMaster(IpAddress deviceIp)
Returns the controller which is playing the role of MASTER to the given
controlled entity(switch etc).
|
Set<IpAddress> |
getMasterElements(ControllerNode controller)
Returns list of controlled entities to which the given controller is
playing the role of MASTER.
|
Set<IpAddress> |
getSlaveElements(ControllerNode controller)
Returns list of controlled entities to which the given controller is
playing the role of SLAVE.
|
Set<ControllerNode> |
getSlaves(IpAddress deviceIp)
Returns the controller which are playing the role of SLAVE to the given
controlled entity(switch etc).
|
Boolean |
isMaster(DataPathId dpid)
Indicates if the LOCAL system is the master for the given datapath.
|
boolean |
isSelfEqual(IpAddress deviceIp) |
void |
removeListener(RoleListener roleListener)
Express withdrawal from the Role change notification by specifying the
RoleListener implementation that was used while subscribing.
|
ControllerRole getCurrentRole(ControllerNode controller, IpAddress deviceIp)
controller - the controller whose role has to be determineddeviceIp - the IpAddress of switch to which the controller is
associated withControllerNode getMaster(IpAddress deviceIp)
deviceIp - representing the IpAddress of the switch
which the respective controller playing the ControllerRole.MASTER role is
to be determinedControllerNode getMaster(DataPathId dpid)
isMaster.dpid - representing the controlled entity in relation to which the
respective controller playing the ControllerRole.MASTER role is to be
determinedControllerNode getMaster(DataPathId dpid, boolean teamAware)
isMaster. If however
the consumer is not knowledgeable about the given DataPathId being of
local or of a peer controller, which can be the case for NB REST
consumers like TCS, then use this API.
NOTE: This should NOT be called from fast-path workflow. There are
overheads incurred in answering this query due to team-interactions.dpid - datapath for which the master controller is to be determinedteamAware - indicates its a controller-cluster wide lookup.Boolean isMaster(DataPathId dpid)
getMaster. The answer
from this API is expected to be optimized for fast-path, with a constant
O(1) time characterization.dpid - datapath for which the local controller is assessed onSet<ControllerNode> getSlaves(IpAddress deviceIp)
deviceIp - representing the IpAddress of the device.
which the controller playing the ControllerRole.SLAVE role is to be
determinedSet<IpAddress> getMasterElements(ControllerNode controller)
controller - ip of controller whose MASTER list is solicitedSet<IpAddress> getSlaveElements(ControllerNode controller)
controller - ip of controller whose SLAVE list is solicitedvoid addListener(RoleListener roleListener)
RoleListener
callback implementation.roleListener - a concrete RoleListener implementation.void removeListener(RoleListener roleListener)
roleListener - the concrete RoleListener implementationboolean isSelfEqual(IpAddress deviceIp)
Copyright © 2014. All Rights Reserved.