Package org.onosproject.ui.model.topo
Class UiDeviceLink
- java.lang.Object
-
- org.onosproject.ui.model.topo.UiElement
-
- org.onosproject.ui.model.topo.UiLink
-
- org.onosproject.ui.model.topo.UiDeviceLink
-
public class UiDeviceLink extends UiLink
Represents a link between two devices; that is, an infrastructure link.
-
-
Constructor Summary
Constructors Constructor Description UiDeviceLink(UiTopology topology, UiLinkId id)Creates a device to device UI link.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattachBackingLink(Link link)Attaches the given backing link to this UI link.protected voiddestroy()Removes all external references, and prepares the instance for garbage collection.booleandetachBackingLink(Link link)Detaches the given backing link from this UI link, returning true if the reverse link is still attached, or false otherwise.DeviceIddeviceA()Returns the identity of device A.DeviceIddeviceB()Returns the identity of device B.StringendPointA()Returns the identifier of end-point A in string form.StringendPointB()Returns the identifier of end-point B in string form.StringendPortA()Returns the port number (as a string) for end-point A, if applicable.StringendPortB()Returns the port number (as a string) for end-point B, if applicable.LinklinkAtoB()Returns backing link from A to B.LinklinkBtoA()Returns backing link from B to A.PortNumberportA()Returns the port number of device A.PortNumberportB()Returns the port number of device B.-
Methods inherited from class org.onosproject.ui.model.topo.UiLink
id, idAsString, toString, type
-
-
-
-
Constructor Detail
-
UiDeviceLink
public UiDeviceLink(UiTopology topology, UiLinkId id)
Creates a device to device UI link.- Parameters:
topology- parent topologyid- canonicalized link identifier
-
-
Method Detail
-
endPointA
public String endPointA()
Description copied from class:UiLinkReturns the identifier of end-point A in string form.
-
endPointB
public String endPointB()
Description copied from class:UiLinkReturns the identifier of end-point B in string form.
-
endPortA
public String endPortA()
Description copied from class:UiLinkReturns 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.
-
endPortB
public String endPortB()
Description copied from class:UiLinkReturns 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.
-
destroy
protected void destroy()
Description copied from class:UiElementRemoves all external references, and prepares the instance for garbage collection. This default implementation does nothing.
-
attachBackingLink
public void attachBackingLink(Link link)
Attaches the given backing link to this UI link. This method will throw an exception if this UI link is not representative of the supplied link.- Parameters:
link- backing link to attach- Throws:
IllegalArgumentException- if the link is not appropriate
-
detachBackingLink
public boolean detachBackingLink(Link link)
Detaches the given backing link from this UI link, returning true if the reverse link is still attached, or false otherwise.- Parameters:
link- the backing link to detach- Returns:
- true if other link still attached, false otherwise
- Throws:
IllegalArgumentException- if the link is not appropriate
-
deviceA
public DeviceId deviceA()
Returns the identity of device A.- Returns:
- device A ID
-
portA
public PortNumber portA()
Returns the port number of device A.- Returns:
- port A
-
deviceB
public DeviceId deviceB()
Returns the identity of device B.- Returns:
- device B ID
-
portB
public PortNumber portB()
Returns the port number of device B.- Returns:
- port B
-
linkAtoB
public Link linkAtoB()
Returns backing link from A to B.- Returns:
- backing link A to B
-
linkBtoA
public Link linkBtoA()
Returns backing link from B to A.- Returns:
- backing link B to A
-
-