CORD-537 Implemented ServiceNetworkService with XOS VTN APIs
Change-Id: If2ece511400c0720dc425f7ad9acd9b11d64d566
diff --git a/src/main/java/org/opencord/cordvtn/api/net/NetworkId.java b/src/main/java/org/opencord/cordvtn/api/net/NetworkId.java
index 8bdafee..9129053 100644
--- a/src/main/java/org/opencord/cordvtn/api/net/NetworkId.java
+++ b/src/main/java/org/opencord/cordvtn/api/net/NetworkId.java
@@ -15,8 +15,11 @@
*/
package org.opencord.cordvtn.api.net;
+import com.google.common.base.Strings;
import org.onlab.util.Identifier;
+import static com.google.common.base.Preconditions.checkArgument;
+
/**
* Representation of the network identifier.
*/
@@ -38,6 +41,7 @@
* @return network identifier
*/
public static NetworkId of(String id) {
+ checkArgument(!Strings.isNullOrEmpty(id));
return new NetworkId(id);
}
}
diff --git a/src/main/java/org/opencord/cordvtn/api/net/PortId.java b/src/main/java/org/opencord/cordvtn/api/net/PortId.java
index 10c9e8d..4a3d36e 100644
--- a/src/main/java/org/opencord/cordvtn/api/net/PortId.java
+++ b/src/main/java/org/opencord/cordvtn/api/net/PortId.java
@@ -15,8 +15,11 @@
*/
package org.opencord.cordvtn.api.net;
+import com.google.common.base.Strings;
import org.onlab.util.Identifier;
+import static com.google.common.base.Preconditions.checkArgument;
+
/**
* Representation of the port identifier.
*/
@@ -38,6 +41,7 @@
* @return port identifier
*/
public static PortId of(String id) {
+ checkArgument(!Strings.isNullOrEmpty(id));
return new PortId(id);
}
}