Added management service and renamed dummy to default
Change-Id: I9df13c359f04c413a8c5a01cafccd882a5e9583c
(cherry picked from commit 91ba41a2881c6f936fb857db6ee87bf5b2f8fbc0)
diff --git a/apps/xosclient/src/main/java/org/onosproject/xosclient/api/VtnService.java b/apps/xosclient/src/main/java/org/onosproject/xosclient/api/VtnService.java
index b7d1c9c..ec33b9f 100644
--- a/apps/xosclient/src/main/java/org/onosproject/xosclient/api/VtnService.java
+++ b/apps/xosclient/src/main/java/org/onosproject/xosclient/api/VtnService.java
@@ -19,6 +19,8 @@
import com.google.common.collect.Sets;
import org.onlab.packet.IpAddress;
import org.onlab.packet.IpPrefix;
+import org.onosproject.xosclient.api.VtnServiceApi.NetworkType;
+import org.onosproject.xosclient.api.VtnServiceApi.ServiceType;
import java.util.Objects;
import java.util.Set;
@@ -30,18 +32,6 @@
*/
public final class VtnService {
- public enum NetworkType {
- PRIVATE,
- PUBLIC,
- MANAGEMENT
- }
-
- public enum ServiceType {
- VSG,
- OLT_AGENT,
- DUMMY
- }
-
private final VtnServiceId id;
private final String name;
private final ServiceType serviceType;
diff --git a/apps/xosclient/src/main/java/org/onosproject/xosclient/api/VtnServiceApi.java b/apps/xosclient/src/main/java/org/onosproject/xosclient/api/VtnServiceApi.java
index 11687f7..47162db 100644
--- a/apps/xosclient/src/main/java/org/onosproject/xosclient/api/VtnServiceApi.java
+++ b/apps/xosclient/src/main/java/org/onosproject/xosclient/api/VtnServiceApi.java
@@ -22,6 +22,20 @@
*/
public interface VtnServiceApi {
+ // TODO move network type to VtnNetwork later
+ enum NetworkType {
+ PRIVATE,
+ PUBLIC,
+ MANAGEMENT
+ }
+
+ enum ServiceType {
+ VSG,
+ OLT_AGENT,
+ MANAGEMENT,
+ DEFAULT
+ }
+
/**
* Returns all services list.
*
diff --git a/apps/xosclient/src/main/java/org/onosproject/xosclient/impl/DefaultVtnServiceApi.java b/apps/xosclient/src/main/java/org/onosproject/xosclient/impl/DefaultVtnServiceApi.java
index b83333c..aec3a84 100644
--- a/apps/xosclient/src/main/java/org/onosproject/xosclient/impl/DefaultVtnServiceApi.java
+++ b/apps/xosclient/src/main/java/org/onosproject/xosclient/impl/DefaultVtnServiceApi.java
@@ -22,8 +22,6 @@
import org.onlab.packet.IpAddress;
import org.onlab.packet.IpPrefix;
import org.onosproject.xosclient.api.OpenStackAccess;
-import org.onosproject.xosclient.api.VtnService.NetworkType;
-import org.onosproject.xosclient.api.VtnService.ServiceType;
import org.onosproject.xosclient.api.VtnServiceApi;
import org.onosproject.xosclient.api.XosAccess;
import org.onosproject.xosclient.api.VtnService;
@@ -41,8 +39,12 @@
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkArgument;
-import static org.onosproject.xosclient.api.VtnService.NetworkType.*;
-import static org.onosproject.xosclient.api.VtnService.ServiceType.*;
+import static org.onosproject.xosclient.api.VtnServiceApi.NetworkType.PRIVATE;
+import static org.onosproject.xosclient.api.VtnServiceApi.NetworkType.PUBLIC;
+import static org.onosproject.xosclient.api.VtnServiceApi.NetworkType.MANAGEMENT;
+import static org.onosproject.xosclient.api.VtnServiceApi.ServiceType.DEFAULT;
+import static org.onosproject.xosclient.api.VtnServiceApi.ServiceType.OLT_AGENT;
+import static org.onosproject.xosclient.api.VtnServiceApi.ServiceType.VSG;
/**
* Provides CORD VTN service and service dependency APIs.
@@ -176,9 +178,9 @@
checkArgument(!Strings.isNullOrEmpty(netName));
String name = netName.toUpperCase();
- if (name.contains(PUBLIC.toString())) {
+ if (name.contains(PUBLIC.name())) {
return PUBLIC;
- } else if (name.contains(MANAGEMENT.toString())) {
+ } else if (name.contains(MANAGEMENT.name())) {
return MANAGEMENT;
} else {
return PRIVATE;
@@ -190,12 +192,14 @@
checkArgument(!Strings.isNullOrEmpty(netName));
String name = netName.toUpperCase();
- if (name.contains(VSG.toString())) {
+ if (name.contains(VSG.name())) {
return VSG;
- } else if (name.contains(OLT_AGENT.toString())) {
+ } else if (name.contains(OLT_AGENT.name())) {
return OLT_AGENT;
+ } else if (name.contains(ServiceType.MANAGEMENT.name())) {
+ return ServiceType.MANAGEMENT;
} else {
- return DUMMY;
+ return DEFAULT;
}
}
}