Minor fixes derived from OFC ODTN demo
Change-Id: I62afed0000e1a71df7cb0eee0f44b527aef62e4d
diff --git a/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/impl/DeviceConnection.java b/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/impl/DeviceConnection.java
index 290773f..97807ef 100644
--- a/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/impl/DeviceConnection.java
+++ b/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/impl/DeviceConnection.java
@@ -17,6 +17,7 @@
*/
package org.onosproject.drivers.odtn.impl;
+import com.google.common.base.MoreObjects;
import org.onosproject.net.flow.FlowRule;
import java.util.Objects;
@@ -90,4 +91,12 @@
public int hashCode() {
return Objects.hash(id, fr);
}
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(this)
+ .add("id", id)
+ .add("fr", fr)
+ .toString();
+ }
}
diff --git a/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/tapi/TapiFlowRuleProgrammable.java b/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/tapi/TapiFlowRuleProgrammable.java
index d415738..ce09453 100644
--- a/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/tapi/TapiFlowRuleProgrammable.java
+++ b/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/tapi/TapiFlowRuleProgrammable.java
@@ -80,7 +80,7 @@
private static final String CONN_REQ_REMOVE_DATA_API = "/restconf/data/tapi-common:context/" +
"tapi-connectivity:connectivity-context/connectivity-service=";
private static final String CONN_REQ_GET_API = "/restconf/data/tapi-common:context/" +
- "tapi-connectivity:connectivity-context/connectivity-service/";
+ "tapi-connectivity:connectivity-context/";
@Override
@@ -95,7 +95,7 @@
// try {
// jsonNode = reader.readTree(response);
// if (jsonNode == null) {
-// log.debug("JsonNode is null for response {}", response);
+// log.error("JsonNode is null for response {}", response);
// return ImmutableList.of();
// }
// Set<String> uuids = parseTapiGetConnectivityRequest(jsonNode);
@@ -214,7 +214,7 @@
if (tapiConnectivityReply.has(TAPI_CONNECTIVITY_CONNECTIVITY_SERVICE)) {
tapiConnectivityReply.get(TAPI_CONNECTIVITY_CONNECTIVITY_SERVICE).elements()
.forEachRemaining(node -> uuids.add(node.get(TapiDeviceHelper.UUID).asText()));
- } else if (tapiConnectivityReply.size() != 0) {
+ } else {
log.warn("Can't retrieve connectivity UUID from {}", tapiConnectivityReply);
}
//This is only one uuid or empty in case of failures