Package org.onosproject.ui.model.topo
Class UiTopology
- java.lang.Object
-
- org.onosproject.ui.model.topo.UiElement
-
- org.onosproject.ui.model.topo.UiTopology
-
public class UiTopology extends UiElement
Represents the overall network topology.
-
-
Constructor Summary
Constructors Constructor Description UiTopology(ServiceBundle services)Creates a new UI topology backed by the specified service bundle.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(UiClusterMember member)Adds the given cluster member to the topology model.voidadd(UiDevice uiDevice)Adds the given device to the topology model.voidadd(UiDeviceLink uiDeviceLink)Adds the given UI device link to the topology model.voidadd(UiEdgeLink uiEdgeLink)Adds the given UI edge link to the topology model.voidadd(UiHost uiHost)Adds the given host to the topology model.voidadd(UiRegion uiRegion)Adds the given region to the topology model.List<UiClusterMember>allClusterMembers()Returns all the cluster members, sorted by their ID.Set<UiDeviceLink>allDeviceLinks()Returns all device links in the model.Set<UiDevice>allDevices()Returns all devices in the model.Set<UiHost>allHosts()Returns all hosts in the model.Set<UiRegion>allRegions()Returns all regions in the model (except thenull region).voidclear()Clears the topology state; that is, drops all regions, devices, hosts, links, and cluster members.intclusterMemberCount()Returns the number of members in the cluster.voidcomputeSynthLinks()Uses the device-device links and data about the regions to compute the set of synthetic links that are required per region.intdeviceCount()Returns the number of devices configured in the topology.intdeviceLinkCount()Returns the number of device links configured in the topology.StringdumpString()Returns a detailed (multi-line) string showing the contents of the topology.intedgeLinkCount()Returns the number of edge links configured in the topology.UiClusterMemberfindClusterMember(NodeId id)Returns the cluster member with the given identifier, or null if no such member exists.UiDevicefindDevice(DeviceId id)Returns the device with the specified identifier, or null if no such device exists.UiDeviceLinkfindDeviceLink(UiLinkId id)Returns the device link with the specified identifier, or null if no such link exists.UiEdgeLinkfindEdgeLink(UiLinkId id)Returns the edge link with the specified identifier, or null if no such link exists.UiHostfindHost(HostId id)Returns the host with the specified identifier, or null if no such host exists.UiRegionfindRegion(RegionId id)Returns the region with the specified identifier, or null if no such region exists.List<UiSynthLink>findSynthLinks(RegionId regionId)Returns the synthetic links associated with the specified region.inthostCount()Returns the number of hosts configured in the topology.StringidAsString()Returns a string representation of the element identifier.UiRegionnullRegion()Returns a reference to the null-region.intregionCount()Returns the number of regions configured in the topology.voidremove(UiClusterMember member)Removes the given cluster member from the topology model.voidremove(UiDevice uiDevice)Removes the given device from the topology model.voidremove(UiDeviceLink uiDeviceLink)Removes the given UI device link from the model.voidremove(UiEdgeLink uiEdgeLink)Removes the given UI edge link from the model.voidremove(UiHost uiHost)Removes the given host from the topology model.voidremove(UiRegion uiRegion)Removes the given region from the topology model.intsynthLinkCount()Returns the number of synthetic links in the topology.StringtoString()
-
-
-
Constructor Detail
-
UiTopology
public UiTopology(ServiceBundle services)
Creates a new UI topology backed by the specified service bundle.- Parameters:
services- service bundle
-
-
Method Detail
-
idAsString
public String idAsString()
Description copied from class:UiElementReturns a string representation of the element identifier.- Specified by:
idAsStringin classUiElement- Returns:
- the element unique identifier
-
clear
public void clear()
Clears the topology state; that is, drops all regions, devices, hosts, links, and cluster members.
-
allClusterMembers
public List<UiClusterMember> allClusterMembers()
Returns all the cluster members, sorted by their ID.- Returns:
- all cluster members
-
findClusterMember
public UiClusterMember findClusterMember(NodeId id)
Returns the cluster member with the given identifier, or null if no such member exists.- Parameters:
id- cluster node identifier- Returns:
- corresponding UI cluster member
-
add
public void add(UiClusterMember member)
Adds the given cluster member to the topology model.- Parameters:
member- cluster member to add
-
remove
public void remove(UiClusterMember member)
Removes the given cluster member from the topology model.- Parameters:
member- cluster member to remove
-
clusterMemberCount
public int clusterMemberCount()
Returns the number of members in the cluster.- Returns:
- number of cluster members
-
allRegions
public Set<UiRegion> allRegions()
Returns all regions in the model (except thenull region).- Returns:
- all regions
-
nullRegion
public UiRegion nullRegion()
Returns a reference to the null-region. That is, the container for devices, hosts, and links that belong to no region.- Returns:
- the null-region
-
findRegion
public UiRegion findRegion(RegionId id)
Returns the region with the specified identifier, or null if no such region exists.- Parameters:
id- region identifier- Returns:
- corresponding UI region
-
add
public void add(UiRegion uiRegion)
Adds the given region to the topology model.- Parameters:
uiRegion- region to add
-
remove
public void remove(UiRegion uiRegion)
Removes the given region from the topology model.- Parameters:
uiRegion- region to remove
-
regionCount
public int regionCount()
Returns the number of regions configured in the topology.- Returns:
- number of regions
-
findDevice
public UiDevice findDevice(DeviceId id)
Returns the device with the specified identifier, or null if no such device exists.- Parameters:
id- device identifier- Returns:
- corresponding UI device
-
add
public void add(UiDevice uiDevice)
Adds the given device to the topology model.- Parameters:
uiDevice- device to add
-
remove
public void remove(UiDevice uiDevice)
Removes the given device from the topology model.- Parameters:
uiDevice- device to remove
-
deviceCount
public int deviceCount()
Returns the number of devices configured in the topology.- Returns:
- number of devices
-
allDeviceLinks
public Set<UiDeviceLink> allDeviceLinks()
Returns all device links in the model.- Returns:
- all device links
-
findDeviceLink
public UiDeviceLink findDeviceLink(UiLinkId id)
Returns the device link with the specified identifier, or null if no such link exists.- Parameters:
id- the canonicalized link identifier- Returns:
- corresponding UI device link
-
findEdgeLink
public UiEdgeLink findEdgeLink(UiLinkId id)
Returns the edge link with the specified identifier, or null if no such link exists.- Parameters:
id- the canonicalized link identifier- Returns:
- corresponding UI edge link
-
add
public void add(UiDeviceLink uiDeviceLink)
Adds the given UI device link to the topology model.- Parameters:
uiDeviceLink- link to add
-
add
public void add(UiEdgeLink uiEdgeLink)
Adds the given UI edge link to the topology model.- Parameters:
uiEdgeLink- link to add
-
remove
public void remove(UiDeviceLink uiDeviceLink)
Removes the given UI device link from the model.- Parameters:
uiDeviceLink- link to remove
-
remove
public void remove(UiEdgeLink uiEdgeLink)
Removes the given UI edge link from the model.- Parameters:
uiEdgeLink- link to remove
-
deviceLinkCount
public int deviceLinkCount()
Returns the number of device links configured in the topology.- Returns:
- number of device links
-
edgeLinkCount
public int edgeLinkCount()
Returns the number of edge links configured in the topology.- Returns:
- number of edge links
-
findHost
public UiHost findHost(HostId id)
Returns the host with the specified identifier, or null if no such host exists.- Parameters:
id- host identifier- Returns:
- corresponding UI host
-
add
public void add(UiHost uiHost)
Adds the given host to the topology model.- Parameters:
uiHost- host to add
-
remove
public void remove(UiHost uiHost)
Removes the given host from the topology model.- Parameters:
uiHost- host to remove
-
hostCount
public int hostCount()
Returns the number of hosts configured in the topology.- Returns:
- number of hosts
-
computeSynthLinks
public void computeSynthLinks()
Uses the device-device links and data about the regions to compute the set of synthetic links that are required per region.
-
findSynthLinks
public List<UiSynthLink> findSynthLinks(RegionId regionId)
Returns the synthetic links associated with the specified region.- Parameters:
regionId- the region ID- Returns:
- synthetic links for this region
-
synthLinkCount
public int synthLinkCount()
Returns the number of synthetic links in the topology.- Returns:
- the synthetic link count
-
dumpString
public String dumpString()
Returns a detailed (multi-line) string showing the contents of the topology.- Returns:
- detailed string
-
-