public class UiTopology extends UiElement
Constructor and Description |
---|
UiTopology(ServiceBundle services)
Creates a new UI topology backed by the specified service bundle.
|
Modifier and Type | Method and Description |
---|---|
void |
add(UiClusterMember member)
Adds the given cluster member to the topology model.
|
void |
add(UiDevice uiDevice)
Adds the given device to the topology model.
|
void |
add(UiDeviceLink uiDeviceLink)
Adds the given UI device link to the topology model.
|
void |
add(UiEdgeLink uiEdgeLink)
Adds the given UI edge link to the topology model.
|
void |
add(UiHost uiHost)
Adds the given host to the topology model.
|
void |
add(UiRegion uiRegion)
Adds the given region to the topology model.
|
java.util.List<UiClusterMember> |
allClusterMembers()
Returns all the cluster members, sorted by their ID.
|
java.util.Set<UiDeviceLink> |
allDeviceLinks()
Returns all device links in the model.
|
java.util.Set<UiDevice> |
allDevices()
Returns all devices in the model.
|
java.util.Set<UiHost> |
allHosts()
Returns all hosts in the model.
|
java.util.Set<UiRegion> |
allRegions()
Returns all regions in the model (except the
null region ). |
void |
clear()
Clears the topology state; that is, drops all regions, devices, hosts,
links, and cluster members.
|
int |
clusterMemberCount()
Returns the number of members in the cluster.
|
void |
computeSynthLinks()
Uses the device-device links and data about the regions to compute the
set of synthetic links that are required per region.
|
int |
deviceCount()
Returns the number of devices configured in the topology.
|
int |
deviceLinkCount()
Returns the number of device links configured in the topology.
|
java.lang.String |
dumpString()
Returns a detailed (multi-line) string showing the contents of the
topology.
|
int |
edgeLinkCount()
Returns the number of edge links configured in the topology.
|
UiClusterMember |
findClusterMember(NodeId id)
Returns the cluster member with the given identifier, or null if no
such member exists.
|
UiDevice |
findDevice(DeviceId id)
Returns the device with the specified identifier, or null if
no such device exists.
|
UiDeviceLink |
findDeviceLink(UiLinkId id)
Returns the device link with the specified identifier, or null if no
such link exists.
|
UiEdgeLink |
findEdgeLink(UiLinkId id)
Returns the edge link with the specified identifier, or null if no
such link exists.
|
UiHost |
findHost(HostId id)
Returns the host with the specified identifier, or null if no such
host exists.
|
UiRegion |
findRegion(RegionId id)
Returns the region with the specified identifier, or null if
no such region exists.
|
java.util.List<UiSynthLink> |
findSynthLinks(RegionId regionId)
Returns the synthetic links associated with the specified region.
|
int |
hostCount()
Returns the number of hosts configured in the topology.
|
java.lang.String |
idAsString()
Returns a string representation of the element identifier.
|
UiRegion |
nullRegion()
Returns a reference to the null-region.
|
int |
regionCount()
Returns the number of regions configured in the topology.
|
void |
remove(UiClusterMember member)
Removes the given cluster member from the topology model.
|
void |
remove(UiDevice uiDevice)
Removes the given device from the topology model.
|
void |
remove(UiDeviceLink uiDeviceLink)
Removes the given UI device link from the model.
|
void |
remove(UiEdgeLink uiEdgeLink)
Removes the given UI edge link from the model.
|
void |
remove(UiHost uiHost)
Removes the given host from the topology model.
|
void |
remove(UiRegion uiRegion)
Removes the given region from the topology model.
|
int |
synthLinkCount()
Returns the number of synthetic links in the topology.
|
java.lang.String |
toString() |
public UiTopology(ServiceBundle services)
services
- service bundlepublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String idAsString()
UiElement
idAsString
in class UiElement
public void clear()
public java.util.List<UiClusterMember> allClusterMembers()
public UiClusterMember findClusterMember(NodeId id)
id
- cluster node identifierpublic void add(UiClusterMember member)
member
- cluster member to addpublic void remove(UiClusterMember member)
member
- cluster member to removepublic int clusterMemberCount()
public java.util.Set<UiRegion> allRegions()
null region
).public UiRegion nullRegion()
public UiRegion findRegion(RegionId id)
id
- region identifierpublic void add(UiRegion uiRegion)
uiRegion
- region to addpublic void remove(UiRegion uiRegion)
uiRegion
- region to removepublic int regionCount()
public java.util.Set<UiDevice> allDevices()
public UiDevice findDevice(DeviceId id)
id
- device identifierpublic void add(UiDevice uiDevice)
uiDevice
- device to addpublic void remove(UiDevice uiDevice)
uiDevice
- device to removepublic int deviceCount()
public java.util.Set<UiDeviceLink> allDeviceLinks()
public UiDeviceLink findDeviceLink(UiLinkId id)
id
- the canonicalized link identifierpublic UiEdgeLink findEdgeLink(UiLinkId id)
id
- the canonicalized link identifierpublic void add(UiDeviceLink uiDeviceLink)
uiDeviceLink
- link to addpublic void add(UiEdgeLink uiEdgeLink)
uiEdgeLink
- link to addpublic void remove(UiDeviceLink uiDeviceLink)
uiDeviceLink
- link to removepublic void remove(UiEdgeLink uiEdgeLink)
uiEdgeLink
- link to removepublic int deviceLinkCount()
public int edgeLinkCount()
public java.util.Set<UiHost> allHosts()
public UiHost findHost(HostId id)
id
- host identifierpublic void add(UiHost uiHost)
uiHost
- host to addpublic void remove(UiHost uiHost)
uiHost
- host to removepublic int hostCount()
public void computeSynthLinks()
public java.util.List<UiSynthLink> findSynthLinks(RegionId regionId)
regionId
- the region IDpublic int synthLinkCount()
public java.lang.String dumpString()