Package org.onosproject.net
Class ConnectPoint
- java.lang.Object
-
- org.onosproject.net.ConnectPoint
-
- All Implemented Interfaces:
Comparable<ConnectPoint>
- Direct Known Subclasses:
HostLocation
public class ConnectPoint extends Object implements Comparable<ConnectPoint>
Abstraction of a network connection point expressed as a pair of the network element identifier and port number.
-
-
Constructor Summary
Constructors Constructor Description ConnectPoint(ElementId elementId, PortNumber portNumber)
Creates a new connection point.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(ConnectPoint o)
static ConnectPoint
deviceConnectPoint(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(Object obj)
static ConnectPoint
fromString(String string)
Parse a device connect point from a string.int
hashCode()
static ConnectPoint
hostConnectPoint(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.String
toString()
-
-
-
Constructor Detail
-
ConnectPoint
public ConnectPoint(ElementId elementId, PortNumber portNumber)
Creates a new connection point.- Parameters:
elementId
- network element identifierportNumber
- 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:
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:
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:
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(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(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(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.
-
compareTo
public int compareTo(ConnectPoint o)
- Specified by:
compareTo
in interfaceComparable<ConnectPoint>
-
-