public class DeviceId extends Object implements Distributable, ElementId, Serializable
Modifier and Type | Field and Description |
---|---|
static DeviceId |
NONE
A static value used to indicate an unknown/unnecessary device ID.
|
Modifier and Type | Method and Description |
---|---|
DataPathId |
dpid()
Returns the value of this device ID as a datapath ID, if this
device is an OpenFlow switch.
|
boolean |
equals(Object o) |
String |
fingerprint()
Returns the fingerprint for this device ID.
|
int |
hashCode() |
String |
toString() |
static DeviceId |
valueOf(DataPathId dpid)
Returns the value of the given datapath ID as a device ID.
|
static DeviceId |
valueOf(String fingerprint)
Returns the value of the given fingerprint as a device ID.
|
public static final DeviceId NONE
public static DeviceId valueOf(String fingerprint)
fingerprint
- the given fingerprintpublic static DeviceId valueOf(DataPathId dpid)
dpid
- the given datapath IDpublic DataPathId dpid()
Returns the value of this device ID as a datapath ID, if this device is an OpenFlow switch. If this device is not an OpenFlow switch, then null is returned.
Devices discovered via OpenFlow will return a valid DataPathId, but devices discovered via other methods (IP/manual discovery) will return null.
Note that the translation from DeviceId to DPID can be expensive in both ways: deviceId.dpid() or DataPathId.valueOf(deviceId.toString()). This is because DataPathId.valueOf(dpid) has internal synchronized block. The developer should be careful when calling this method in highly concurrency context.
public String fingerprint()
Copyright © 2016. All Rights Reserved.