public interface DeviceOwnerService
Modifier and Type | Method and Description |
---|---|
void |
addDevice(UUID regionUid,
IpAddress deviceIp)
|
void |
addListener(DeviceOwnerListener listener)
Add a
DeviceOwnerListener to hear about ownership change events. |
void |
addRegion(Region region)
Add the specified
Region . |
Map<UUID,Set<OwnerState>> |
getOwners()
Returns a
Map of region UIDs to Set s of run-time OwnerState s for all devices configured in each corresponding region. |
Region |
getRegion(IpAddress deviceIp)
|
List<Region> |
getRegions()
|
void |
handleAddDevice(UUID regionUid,
IpAddress deviceIp)
|
void |
handleAddRegion(Region region)
Called when a peer needs to notify us that a
Region was added. |
void |
handlePeerOwnerChange(OwnerChangeData data)
Called when a peer needs to update our local cache.
|
void |
handleRemoveDevice(UUID regionUid,
IpAddress deviceIp)
|
void |
handleRemoveRegion(UUID regionUid)
Called when a peer needs to notify us that a
Region was removed. |
boolean |
isEnforcingRegions()
Returns
true if the service is enforcing the region policy. |
boolean |
isOwner(DataPathId dataPathId)
Returns
true if the local controller is the current device owner
for the specified DataPathId . |
boolean |
isValidRegionAddress(IpAddress ip)
Returns
true if the given address is defined in a region. |
List<OwnerListenerData> |
listeners()
Returns a
List of OwnerListenerData objects that
represent the current state of the registered listeners. |
List<OwnerState> |
ownedByController(IpAddress controllerIp)
Returns a
List of per-datapath OwnerState s for which the
specified controller IpAddress is the owner. |
OwnerState |
ownerStateFor(DataPathId dataPathId)
Returns the
OwnerState for the specified DataPathId . |
List<OwnerState> |
ownerStatesFor(IpAddress deviceIp)
Returns the per-datapath
OwnerState s corresponding to the device
IpAddress . |
void |
postHandshake(DataPathId dataPathId,
IpAddress deviceIp,
ProtocolVersion negotiated,
Runnable task,
Runnable ownerOnlyTask)
Called to inform the service of a post-handshake.
|
void |
preDisconnected(DataPathId dataPathId,
IpAddress deviceIp,
ProtocolVersion negotiated)
Called to inform the service of a disconnection.
|
void |
removeDevice(UUID regionUid,
IpAddress deviceIp)
|
void |
removeListener(DeviceOwnerListener listener)
Remove a previously-added
DeviceOwnerListener . |
void |
removeRegion(UUID regionUid)
|
void addListener(DeviceOwnerListener listener)
DeviceOwnerListener
to hear about ownership change events.listener
- DeviceOwnerListener
to addvoid removeListener(DeviceOwnerListener listener)
DeviceOwnerListener
.listener
- DeviceOwnerListener
to removeMap<UUID,Set<OwnerState>> getOwners()
Map
of region UIDs to Set
s of run-time OwnerState
s for all devices configured in each corresponding region.Map
containing OwnerState
s for all configured
devices, keyed by region UIDvoid handlePeerOwnerChange(OwnerChangeData data)
data
- owner change databoolean isEnforcingRegions()
true
if the service is enforcing the region policy.true
if the service is enforcing regionsboolean isOwner(DataPathId dataPathId)
true
if the local controller is the current device owner
for the specified DataPathId
.dataPathId
- DataPathId
to check ownership fortrue
if the local controller is the current ownerList<OwnerListenerData> listeners()
List
of OwnerListenerData
objects that
represent the current state of the registered listeners.List
of OwnerListenerData
objectsList<OwnerState> ownedByController(IpAddress controllerIp)
List
of per-datapath OwnerState
s for which the
specified controller IpAddress
is the owner.controllerIp
- controller IpAddress
List
of OwnerState
objectsOwnerState ownerStateFor(DataPathId dataPathId)
OwnerState
for the specified DataPathId
.dataPathId
- DataPathId
of interestOwnerState
for the specified DataPathId
List<OwnerState> ownerStatesFor(IpAddress deviceIp)
OwnerState
s corresponding to the device
IpAddress
.deviceIp
- device IpAddress
of interestList
of OwnerState
svoid postHandshake(DataPathId dataPathId, IpAddress deviceIp, ProtocolVersion negotiated, Runnable task, Runnable ownerOnlyTask)
DeviceOwnerEvent.Type.OWNERSHIP_ACQUIRED
event.dataPathId
- DataPathId
of the connectiondeviceIp
- device IpAddress
of the connectionnegotiated
- ProtocolVersion
that was negotiatedtask
- post-handshake task to runownerOnlyTask
- addition post-handshake task to run if ownervoid preDisconnected(DataPathId dataPathId, IpAddress deviceIp, ProtocolVersion negotiated)
postHandshake(com.hp.of.lib.dt.DataPathId, com.hp.util.ip.IpAddress, com.hp.of.lib.ProtocolVersion, java.lang.Runnable, java.lang.Runnable)
. When
not enforcing regions this simply results in a
DeviceOwnerEvent.Type.OWNERSHIP_LOST
event.dataPathId
- DataPathId
of the connectiondeviceIp
- device IpAddress
of the connectionnegotiated
- ProtocolVersion
that was negotiatedboolean isValidRegionAddress(IpAddress ip)
true
if the given address is defined in a region.true
if the given address is defined in a region.void handleAddRegion(Region region)
Region
was added.region
- Region
to addCopyright © 2015. All Rights Reserved.