Package org.onosproject.ui.model.topo
Class UiLink
- java.lang.Object
-
- org.onosproject.ui.model.topo.UiElement
-
- org.onosproject.ui.model.topo.UiLink
-
- Direct Known Subclasses:
UiDeviceLink
,UiEdgeLink
,UiRegionDeviceLink
,UiRegionLink
public abstract class UiLink extends UiElement
Represents a link (line between two elements). This may be one of several concrete subclasses:- An infrastructure link: two backing unidirectional links between two devices.
- An edge link: representing the connection between a host and a device.
- An aggregation link: representing multiple underlying UI link instances, for example the link between two sub-regions in a region (layout).
-
-
Field Summary
Fields Modifier and Type Field Description protected UiLinkId
id
protected UiTopology
topology
-
Constructor Summary
Constructors Constructor Description UiLink(UiTopology topology, UiLinkId id)
Creates a UI link.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract String
endPointA()
Returns the identifier of end-point A in string form.abstract String
endPointB()
Returns the identifier of end-point B in string form.String
endPortA()
Returns the port number (as a string) for end-point A, if applicable.String
endPortB()
Returns the port number (as a string) for end-point B, if applicable.UiLinkId
id()
Returns the canonicalized link identifier for this link.String
idAsString()
Returns a string representation of the element identifier.String
toString()
String
type()
Returns the implementing class name as the type of link.
-
-
-
Field Detail
-
topology
protected final UiTopology topology
-
id
protected final UiLinkId id
-
-
Constructor Detail
-
UiLink
public UiLink(UiTopology topology, UiLinkId id)
Creates a UI link.- Parameters:
topology
- parent topologyid
- canonicalized link identifier
-
-
Method Detail
-
id
public UiLinkId id()
Returns the canonicalized link identifier for this link.- Returns:
- the link 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
-
type
public String type()
Returns the implementing class name as the type of link.- Returns:
- link type
-
endPointA
public abstract String endPointA()
Returns the identifier of end-point A in string form.- Returns:
- end point A identifier
-
endPointB
public abstract String endPointB()
Returns the identifier of end-point B in string form.- Returns:
- end point B identifier
-
endPortA
public String endPortA()
Returns the port number (as a string) for end-point A, if applicable. This default implementation returns null, indicating not-applicable. Subclasses only need to override this method if end-point A has an associated port.- Returns:
- port number for end-point A
-
endPortB
public String endPortB()
Returns the port number (as a string) for end-point B, if applicable. This default implementation returns null, indicating not-applicable. Subclasses only need to override this method if end-point B has an associated port.- Returns:
- port number for end-point B
-
-