mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-18 10:51:04 +02:00
PCEP to support Device ID
Change-Id: I451da663c8a89499bad8dc78d687f418fdcbaafe
This commit is contained in:
parent
7d96d6ab7a
commit
bbb3dd58eb
@ -19,12 +19,14 @@ import java.net.URI;
|
|||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
|
|
||||||
import org.onosproject.pcep.tools.PcepTools;
|
import org.onosproject.pcep.tools.PcepTools;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The class representing a network switch PCEPDid. This class is immutable.
|
* The class representing a network switch PCEPDid. This class is immutable.
|
||||||
*/
|
*/
|
||||||
public final class PcepDpid {
|
public final class PcepDpid {
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(PcepDpid.class);
|
||||||
private static final String SCHEME = "l3";
|
private static final String SCHEME = "l3";
|
||||||
private static final long UNKNOWN = 0;
|
private static final long UNKNOWN = 0;
|
||||||
private long nodeId;
|
private long nodeId;
|
||||||
@ -64,6 +66,21 @@ public final class PcepDpid {
|
|||||||
return uri(dpid.nodeId);
|
return uri(dpid.nodeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Produces pcep URI.
|
||||||
|
*
|
||||||
|
* @param value string to get URI
|
||||||
|
* @return pcep URI, otherwise null
|
||||||
|
*/
|
||||||
|
public static URI uri(String value) {
|
||||||
|
try {
|
||||||
|
return new URI(SCHEME, value, null);
|
||||||
|
} catch (URISyntaxException e) {
|
||||||
|
log.debug("Exception PcepId URI: " + e.toString());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Produces device long from the given string which comes from the uri
|
* Produces device long from the given string which comes from the uri
|
||||||
* method.
|
* method.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user