Package org.onosproject.ui.model.topo
Class UiLinkId
- java.lang.Object
- 
- org.onosproject.ui.model.topo.UiLinkId
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classUiLinkId.DirectionDesignates the directionality of an underlying (uni-directional) link.static classUiLinkId.TypeDesignates the type of link the identifier represents.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ElementIdelementA()Returns the identifier of the first element.ElementIdelementB()Returns the identifier of the second element.booleanequals(Object o)inthashCode()StringidA()String representation of endpoint A.StringidB()String representation of endpoint B.booleanisDeviceDevice()Returns true if this identifier represents a device-device (infrastructure) link.booleanisHostDevice()Returns true if this identifier represents a host-device (edge) link.booleanisRegionDevice()Returns true if this identifier represents a region-device link.booleanisRegionRegion()Returns true if this identifier represents a region-region link.PortNumberportA()Returns the port of the first element.PortNumberportB()Returns the port of the second element.RegionIdregionA()Returns the identity of the first region.RegionIdregionB()Returns the identity of the second region.StringtoString()UiLinkId.Typetype()Returns the type of link this identifier represents.static UiLinkIduiLinkId(DeviceId a, PortNumber pa, DeviceId b, PortNumber pb)Generates an identifier for a link between two devices.static UiLinkIduiLinkId(HostId h, DeviceId d, PortNumber p)Generates an identifier for an edge link.static UiLinkIduiLinkId(Link link)Generates the canonical link identifier for the given link.static UiLinkIduiLinkId(LinkKey lk)Creates the canonical link identifier from the given link key.static UiLinkIduiLinkId(RegionId regionId, DeviceId deviceId, PortNumber portNumber)Generates the canonical link identifier for a link between the specified region and device/port.static UiLinkIduiLinkId(RegionId one, RegionId two)Generates the canonical link identifier for a link between the specified region nodes.
 
- 
- 
- 
Method Detail- 
idApublic String idA() String representation of endpoint A.- Returns:
- string rep of endpoint A
 
 - 
idBpublic String idB() String representation of endpoint B.- Returns:
- string rep of endpoint B
 
 - 
elementApublic ElementId elementA() Returns the identifier of the first element. Note that the returned value will be null if this identifier is for a region-region link.- Returns:
- first element identity
 
 - 
portApublic PortNumber portA() Returns the port of the first element. Note that the returned value will be null if this identifier is for a region-region link.- Returns:
- first element port
 
 - 
elementBpublic ElementId elementB() Returns the identifier of the second element. Note that the returned value will be null if this identifier is for a region-region link.- Returns:
- second element identity
 
 - 
portBpublic PortNumber portB() Returns the port of the second element. Note that the returned value will be null if this identifier is for a region-region link.- Returns:
- second element port
 
 - 
regionApublic RegionId regionA() Returns the identity of the first region. Note that the returned value will be null if this identifier is for a device-device or device-host link.- Returns:
- first region ID
 
 - 
regionBpublic RegionId regionB() Returns the identity of the second region. Note that the returned value will be null if this identifier is for a device-device or device-host link.- Returns:
- second region ID
 
 - 
typepublic UiLinkId.Type type() Returns the type of link this identifier represents.- Returns:
- the link identifier type
 
 - 
isRegionRegionpublic boolean isRegionRegion() Returns true if this identifier represents a region-region link.- Returns:
- true if region-region link identifier; false otherwise
 
 - 
isRegionDevicepublic boolean isRegionDevice() Returns true if this identifier represents a region-device link.- Returns:
- true if region-device link identifier; false otherwise
 
 - 
isDeviceDevicepublic boolean isDeviceDevice() Returns true if this identifier represents a device-device (infrastructure) link.- Returns:
- true if device-device link identifier; false otherwise
 
 - 
isHostDevicepublic boolean isHostDevice() Returns true if this identifier represents a host-device (edge) link.- Returns:
- true if host-device link identifier; false otherwise
 
 - 
uiLinkIdpublic static UiLinkId uiLinkId(Link link) Generates the canonical link identifier for the given link.- Parameters:
- link- link for which the identifier is required
- Returns:
- link identifier
- Throws:
- NullPointerException- if src or dst connect point is null
 
 - 
uiLinkIdpublic static UiLinkId uiLinkId(LinkKey lk) Creates the canonical link identifier from the given link key.- Parameters:
- lk- link key
- Returns:
- equivalent link identifier
- Throws:
- NullPointerException- if src or dst connect point is null
 
 - 
uiLinkIdpublic static UiLinkId uiLinkId(RegionId one, RegionId two) Generates the canonical link identifier for a link between the specified region nodes.- Parameters:
- one- the first region ID
- two- the second region ID
- Returns:
- link identifier
- Throws:
- NullPointerException- if any of the required fields are null
- IllegalArgumentException- if the identifiers are identical
 
 - 
uiLinkIdpublic static UiLinkId uiLinkId(RegionId regionId, DeviceId deviceId, PortNumber portNumber) Generates the canonical link identifier for a link between the specified region and device/port.- Parameters:
- regionId- region ID
- deviceId- device ID
- portNumber- port number
- Returns:
- link identifier
- Throws:
- NullPointerException- if any of the required fields are null
 
 - 
uiLinkIdpublic static UiLinkId uiLinkId(DeviceId a, PortNumber pa, DeviceId b, PortNumber pb) Generates an identifier for a link between two devices.- Parameters:
- a- device A
- pa- port A
- b- device B
- pb- port B
- Returns:
- link identifier
- Throws:
- NullPointerException- if any of the required fields are null
 
 - 
uiLinkIdpublic static UiLinkId uiLinkId(HostId h, DeviceId d, PortNumber p) Generates an identifier for an edge link. Note that host is always element A.- Parameters:
- h- host
- d- device
- p- port
- Returns:
- link identifier
- Throws:
- NullPointerException- if any of the required fields are null
 
 
- 
 
-