public class TopologyServiceAdapter extends Object implements TopologyService
TopologyService
API, provided
specifically for unit tests and implementers to use, to insulate from
changes in the API.Constructor and Description |
---|
TopologyServiceAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(TopologyListener listener)
Registers a listener for only topology-related events.
|
TopologyCluster |
getCluster(DeviceId deviceId)
Retrieves the cluster in which the specified infrastructure devices is
located.
|
Set<DeviceId> |
getClusterDevices(TopologyCluster cluster)
Returns the set of devices contained within the specified cluster.
|
Set<TopologyCluster> |
getClusters()
Returns the set of clusters in the current topology.
|
Set<TopologyListener> |
getListeners()
Returns the set of listeners for topology-related events.
|
Set<Path> |
getPaths(DeviceId src,
DeviceId dst)
Returns all shortest paths between the specified source and destination
infrastructure devices, measuring link edge weight using hop count.
|
Set<Path> |
getPaths(DeviceId src,
DeviceId dst,
LinkWeight weight)
Returns all shortest paths between the specified source and destination
infrastructure devices using the supplied link edge weight function.
|
Topology |
getTopology()
Returns the current topology information.
|
boolean |
isBroadcastAllowed(ConnectionPoint point)
Indicates whether or not the specified connection point is allowed to
be used for traffic broadcast.
|
boolean |
isInfrastructure(ConnectionPoint point)
Indicates whether or not the specified connection point is part of
the infrastructure.
|
boolean |
pathExists(DeviceId src,
DeviceId dst)
Indicates, whether a path exists or not between two infrastructure devices
|
void |
removeListener(TopologyListener listener)
Unregisters a listener from topology-related events, regardless of which
topology-related events the listener was registered to receive.
|
public Topology getTopology()
TopologyService
getTopology
in interface TopologyService
public boolean pathExists(DeviceId src, DeviceId dst)
TopologyService
pathExists
in interface TopologyService
src
- id of the source devicedst
- if of the destination devicepublic Set<Path> getPaths(DeviceId src, DeviceId dst)
TopologyService
getPaths
in interface TopologyService
src
- id of the source devicedst
- if of the destination devicepublic Set<Path> getPaths(DeviceId src, DeviceId dst, LinkWeight weight)
TopologyService
The LinkWeight.weight(com.hp.sdn.model.Link)
may return a
negative number to indicate that any path traversing that link should
be considered as not viable.
getPaths
in interface TopologyService
src
- id of the source devicedst
- if of the destination deviceweight
- link edge weight functionpublic boolean isInfrastructure(ConnectionPoint point)
TopologyService
isInfrastructure
in interface TopologyService
point
- connection point to testpublic boolean isBroadcastAllowed(ConnectionPoint point)
TopologyService
isBroadcastAllowed
in interface TopologyService
point
- connection point to testpublic Set<TopologyCluster> getClusters()
TopologyService
getClusters
in interface TopologyService
TopologyCluster
public TopologyCluster getCluster(DeviceId deviceId)
TopologyService
getCluster
in interface TopologyService
deviceId
- id of the infrastructure devicepublic Set<DeviceId> getClusterDevices(TopologyCluster cluster)
TopologyService
getClusterDevices
in interface TopologyService
cluster
- topology clusterpublic void addListener(TopologyListener listener)
TopologyService
addListener
in interface TopologyService
listener
- the event listenerpublic void removeListener(TopologyListener listener)
TopologyService
removeListener
in interface TopologyService
listener
- the event listenerpublic Set<TopologyListener> getListeners()
TopologyService
getListeners
in interface TopologyService
Copyright © 2015. All Rights Reserved.