Class UiDeviceLink


  • public class UiDeviceLink
    extends UiLink
    Represents a link between two devices; that is, an infrastructure link.
    • Field Summary

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void attachBackingLink​(Link link)
      Attaches the given backing link to this UI link.
      protected void destroy()
      Removes all external references, and prepares the instance for garbage collection.
      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.
      DeviceId deviceA()
      Returns the identity of device A.
      DeviceId deviceB()
      Returns the identity of device B.
      java.lang.String endPointA()
      Returns the identifier of end-point A in string form.
      java.lang.String endPointB()
      Returns the identifier of end-point B in string form.
      java.lang.String endPortA()
      Returns the port number (as a string) for end-point A, if applicable.
      java.lang.String endPortB()
      Returns the port number (as a string) for end-point B, if applicable.
      Link linkAtoB()
      Returns backing link from A to B.
      Link linkBtoA()
      Returns backing link from B to A.
      PortNumber portA()
      Returns the port number of device A.
      PortNumber portB()
      Returns the port number of device B.
      • Methods inherited from class org.onosproject.ui.model.topo.UiElement

        name
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • UiDeviceLink

        public UiDeviceLink​(UiTopology topology,
                            UiLinkId id)
        Creates a device to device UI link.
        Parameters:
        topology - parent topology
        id - canonicalized link identifier
    • Method Detail

      • endPointA

        public java.lang.String endPointA()
        Description copied from class: UiLink
        Returns the identifier of end-point A in string form.
        Specified by:
        endPointA in class UiLink
        Returns:
        end point A identifier
      • endPointB

        public java.lang.String endPointB()
        Description copied from class: UiLink
        Returns the identifier of end-point B in string form.
        Specified by:
        endPointB in class UiLink
        Returns:
        end point B identifier
      • endPortA

        public java.lang.String endPortA()
        Description copied from class: UiLink
        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.
        Overrides:
        endPortA in class UiLink
        Returns:
        port number for end-point A
      • endPortB

        public java.lang.String endPortB()
        Description copied from class: UiLink
        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.
        Overrides:
        endPortB in class UiLink
        Returns:
        port number for end-point B
      • destroy

        protected void destroy()
        Description copied from class: UiElement
        Removes all external references, and prepares the instance for garbage collection. This default implementation does nothing.
        Overrides:
        destroy in class UiElement
      • 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:
        java.lang.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:
        java.lang.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