Class ConnectPoint

  • All Implemented Interfaces:
    java.lang.Comparable<ConnectPoint>
    Direct Known Subclasses:
    HostLocation

    public class ConnectPoint
    extends java.lang.Object
    implements java.lang.Comparable<ConnectPoint>
    Abstraction of a network connection point expressed as a pair of the network element identifier and port number.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(ConnectPoint o)  
      static ConnectPoint deviceConnectPoint​(java.lang.String string)
      Parse a device connect point from a string.
      DeviceId deviceId()
      Returns the identifier of the infrastructure device if the connection point belongs to a network element which is indeed an infrastructure device.
      ElementId elementId()
      Returns the network element identifier.
      boolean equals​(java.lang.Object obj)  
      static ConnectPoint fromString​(java.lang.String string)
      Parse a device connect point from a string.
      int hashCode()  
      static ConnectPoint hostConnectPoint​(java.lang.String string)
      Parse a host connect point from a string.
      HostId hostId()
      Returns the identifier of the infrastructure device if the connection point belongs to a network element which is indeed an end-station host.
      IpElementId ipElementId()
      Returns the identifier of the infrastructure device if the connection point belongs to a network element which is indeed an ip of pcc client identifier.
      PortNumber port()
      Returns the connection port number.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • ConnectPoint

        public ConnectPoint​(ElementId elementId,
                            PortNumber portNumber)
        Creates a new connection point.
        Parameters:
        elementId - network element identifier
        portNumber - port number
    • Method Detail

      • elementId

        public ElementId elementId()
        Returns the network element identifier.
        Returns:
        element identifier
      • deviceId

        public DeviceId deviceId()
        Returns the identifier of the infrastructure device if the connection point belongs to a network element which is indeed an infrastructure device.
        Returns:
        network element identifier as a device identifier
        Throws:
        java.lang.IllegalStateException - if connection point is not associated with a device
      • hostId

        public HostId hostId()
        Returns the identifier of the infrastructure device if the connection point belongs to a network element which is indeed an end-station host.
        Returns:
        network element identifier as a host identifier
        Throws:
        java.lang.IllegalStateException - if connection point is not associated with a host
      • ipElementId

        public IpElementId ipElementId()
        Returns the identifier of the infrastructure device if the connection point belongs to a network element which is indeed an ip of pcc client identifier.
        Returns:
        network element identifier as a pcc client identifier
        Throws:
        java.lang.IllegalStateException - if connection point is not associated with a pcc client
      • port

        public PortNumber port()
        Returns the connection port number.
        Returns:
        port number
      • deviceConnectPoint

        public static ConnectPoint deviceConnectPoint​(java.lang.String string)
        Parse a device connect point from a string. The connect point should be in the format "deviceUri/portNumber".
        Parameters:
        string - string to parse
        Returns:
        a ConnectPoint based on the information in the string.
      • hostConnectPoint

        public static ConnectPoint hostConnectPoint​(java.lang.String string)
        Parse a host connect point from a string. The connect point should be in the format "hostId/vlanId/portNumber".
        Parameters:
        string - string to parse
        Returns:
        a ConnectPoint based on the information in the string.
      • fromString

        public static ConnectPoint fromString​(java.lang.String string)
        Parse a device connect point from a string. The connect point should be in the same format as toString output.
        Parameters:
        string - string to parse
        Returns:
        a ConnectPoint based on the information in the string.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(ConnectPoint o)
        Specified by:
        compareTo in interface java.lang.Comparable<ConnectPoint>