Package org.onosproject.ui.model.topo
Class UiHost
- java.lang.Object
-
- org.onosproject.ui.model.topo.UiElement
-
- org.onosproject.ui.model.topo.UiNode
-
- org.onosproject.ui.model.topo.UiHost
-
public class UiHost extends UiNode
Represents an end-station host.
-
-
Field Summary
-
Fields inherited from class org.onosproject.ui.model.topo.UiNode
LAYER_DEFAULT, LAYER_OPTICAL, LAYER_PACKET
-
-
Constructor Summary
Constructors Constructor Description UiHost(UiTopology topology, Host host)
Creates a new UI host.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Host
backingHost()
Returns the host instance backing this UI host.UiLinkId
edgeLinkId()
Returns the identifier for the edge link between this host and the device to which it is connected.HostId
id()
Returns the identity of the host.String
idAsString()
Returns a string representation of the element identifier.DeviceId
locationDevice()
Returns the identifier of the device to which the host is connected.PortNumber
locationPort()
Returns the port number of the device to which the host is connected.RegionId
regionId()
Returns the identifier of the region to which this device belongs.void
setEdgeLinkId(UiLinkId id)
Sets the ID of the edge link between this host and the device to which it connects.void
setLocation(DeviceId deviceId, PortNumber port)
Sets the host's current location.void
setRegionId(RegionId regionId)
Sets the ID of the region to which this device belongs.String
toString()
-
-
-
Constructor Detail
-
UiHost
public UiHost(UiTopology topology, Host host)
Creates a new UI host.- Parameters:
topology
- parent topologyhost
- backing host
-
-
Method Detail
-
id
public HostId id()
Returns the identity of the host.- Returns:
- host ID
-
regionId
public RegionId regionId()
Returns the identifier of the region to which this device belongs. This will be null if the device does not belong to any region.- Returns:
- region ID
-
setRegionId
public void setRegionId(RegionId regionId)
Sets the ID of the region to which this device belongs.- Parameters:
regionId
- region identifier
-
idAsString
public String idAsString()
Description copied from class:UiElement
Returns a string representation of the element identifier.- Specified by:
idAsString
in classUiElement
- Returns:
- the element unique identifier
-
setLocation
public void setLocation(DeviceId deviceId, PortNumber port)
Sets the host's current location.- Parameters:
deviceId
- ID of deviceport
- port number
-
setEdgeLinkId
public void setEdgeLinkId(UiLinkId id)
Sets the ID of the edge link between this host and the device to which it connects.- Parameters:
id
- edge link identifier to set
-
backingHost
public Host backingHost()
Returns the host instance backing this UI host.- Returns:
- the backing host instance
-
edgeLinkId
public UiLinkId edgeLinkId()
Returns the identifier for the edge link between this host and the device to which it is connected.- Returns:
- edge link identifier
-
locationDevice
public DeviceId locationDevice()
Returns the identifier of the device to which the host is connected.- Returns:
- device identifier
-
locationPort
public PortNumber locationPort()
Returns the port number of the device to which the host is connected.- Returns:
- port number
-
-