Update of discovery for TAPI OLS based on ADVA testing
Change-Id: I1037fa877c88164a805d15f265fd918ec9c1d33d
diff --git a/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/tapi/TapiDeviceHelper.java b/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/tapi/TapiDeviceHelper.java
index dee318c..efbc12d 100644
--- a/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/tapi/TapiDeviceHelper.java
+++ b/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/tapi/TapiDeviceHelper.java
@@ -38,6 +38,7 @@
private static final Logger log = getLogger(TapiDeviceHelper.class);
public static final String SERVICE_INTERFACE_POINT = "service-interface-point";
+ public static final String TAPI_COMMON = "tapi-common";
public static final String CONTEXT = "tapi-common:context";
public static final String UUID = "uuid";
public static final String MEDIA_CHANNEL_SERVICE_INTERFACE_POINT_SPEC =
diff --git a/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/tapi/TapiDeviceLambdaQuery.java b/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/tapi/TapiDeviceLambdaQuery.java
index 5f0f52e..7076583 100644
--- a/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/tapi/TapiDeviceLambdaQuery.java
+++ b/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/tapi/TapiDeviceLambdaQuery.java
@@ -39,6 +39,8 @@
import static com.google.common.base.Preconditions.checkNotNull;
import static org.onosproject.drivers.odtn.tapi.TapiDeviceHelper.MC_POOL;
import static org.onosproject.drivers.odtn.tapi.TapiDeviceHelper.MEDIA_CHANNEL_SERVICE_INTERFACE_POINT_SPEC;
+import static org.onosproject.drivers.odtn.tapi.TapiDeviceHelper.SERVICE_INTERFACE_POINT;
+import static org.onosproject.drivers.odtn.tapi.TapiDeviceHelper.TAPI_COMMON;
import static org.onosproject.drivers.odtn.tapi.TapiDeviceHelper.UUID;
import static org.slf4j.LoggerFactory.getLogger;
@@ -84,7 +86,8 @@
MediaType.APPLICATION_JSON_TYPE);
log.debug("Service interface point UUID: {}", uuid);
JsonNode sipAttributes = new ObjectMapper().readTree(inputStream);
- JsonNode mcPool = sipAttributes.get(MEDIA_CHANNEL_SERVICE_INTERFACE_POINT_SPEC).get(MC_POOL);
+ JsonNode mcPool = sipAttributes.get(TAPI_COMMON + ":" + SERVICE_INTERFACE_POINT).get(0)
+ .get(MEDIA_CHANNEL_SERVICE_INTERFACE_POINT_SPEC).get(MC_POOL);
//This creates a hashset of OChSignals representing the spectrum availability at the target port.
return TapiDeviceHelper.getOchSignal(mcPool);
diff --git a/drivers/odtn-driver/src/main/resources/odtn-drivers.xml b/drivers/odtn-driver/src/main/resources/odtn-drivers.xml
index c4f2faa..4586a75 100644
--- a/drivers/odtn-driver/src/main/resources/odtn-drivers.xml
+++ b/drivers/odtn-driver/src/main/resources/odtn-drivers.xml
@@ -16,6 +16,8 @@
-->
<drivers>
<driver name="ols" manufacturer="tapi-swagger" hwVersion="0" swVersion="2.1">
+ <behaviour api ="org.onosproject.net.optical.OpticalDevice"
+ impl="org.onosproject.net.optical.DefaultOpticalDevice"/>
<behaviour api="org.onosproject.net.device.DeviceDescriptionDiscovery"
impl="org.onosproject.drivers.odtn.tapi.TapiDeviceDescriptionDiscovery"/>
<behaviour api ="org.onosproject.net.behaviour.LambdaQuery"