ONOS-7867 FlowRuleProgrammable driver for OpenConfig Cassini
* Minor update of Transceiver and DescriptionDiscovery to support newly added Optical-Channel component
* Add OpenConfig config/state sample which can be used for initial value of emulator
Change-Id: I9497ec55965be6f3cc0f5b4b6270c77ebe50b4a8
diff --git a/apps/odtn/api/src/main/java/org/onosproject/odtn/behaviour/CassiniTransceiver.java b/apps/odtn/api/src/main/java/org/onosproject/odtn/behaviour/CassiniTransceiver.java
index 0a23450..8f89807 100755
--- a/apps/odtn/api/src/main/java/org/onosproject/odtn/behaviour/CassiniTransceiver.java
+++ b/apps/odtn/api/src/main/java/org/onosproject/odtn/behaviour/CassiniTransceiver.java
@@ -36,7 +36,7 @@
import java.util.Collections;
import java.util.List;
-import static org.onosproject.odtn.behaviour.OdtnDeviceDescriptionDiscovery.OC_NAME;
+import static org.onosproject.odtn.behaviour.OdtnDeviceDescriptionDiscovery.OC_LOGICAL_CHANNEL;
import static org.slf4j.LoggerFactory.getLogger;
/**
@@ -52,16 +52,15 @@
@Override
public List<CharSequence> enable(PortNumber client, PortNumber line, boolean enable) {
- log.debug("enable() cassini route");
DeviceId did = this.data().deviceId();
Port clientPort = handler().get(DeviceService.class).getPort(did, client);
if (clientPort == null) {
log.warn("{} does not exist on {}", client, did);
return Collections.emptyList();
}
- String clientName = clientPort.annotations().value(OC_NAME);
+ String clientName = clientPort.annotations().value(OC_LOGICAL_CHANNEL);
if (Strings.isNullOrEmpty(clientName)) {
- log.warn("{} annotations not exist on {}@{}", OC_NAME, client, did);
+ log.warn("{} annotations not exist on {}@{}", OC_LOGICAL_CHANNEL, client, did);
return Collections.emptyList();
}
@@ -70,9 +69,9 @@
log.warn("{} does not exist on {}", line, did);
return Collections.emptyList();
}
- String lineName = linePort.annotations().value(OC_NAME);
+ String lineName = linePort.annotations().value(OC_LOGICAL_CHANNEL);
if (Strings.isNullOrEmpty(lineName)) {
- log.warn("{} annotations not exist on {}@{}", OC_NAME, line, did);
+ log.warn("{} annotations not exist on {}@{}", OC_LOGICAL_CHANNEL, line, did);
return Collections.emptyList();
}
diff --git a/apps/odtn/api/src/main/java/org/onosproject/odtn/behaviour/OdtnDeviceDescriptionDiscovery.java b/apps/odtn/api/src/main/java/org/onosproject/odtn/behaviour/OdtnDeviceDescriptionDiscovery.java
index 96d3b4e..d511ca0 100644
--- a/apps/odtn/api/src/main/java/org/onosproject/odtn/behaviour/OdtnDeviceDescriptionDiscovery.java
+++ b/apps/odtn/api/src/main/java/org/onosproject/odtn/behaviour/OdtnDeviceDescriptionDiscovery.java
@@ -48,6 +48,14 @@
String OC_TYPE = "oc-type";
/**
+ * Annotations key intended for a Port, which stores OpenConfig logical channel
+ * associated the port.
+ * <p>
+ * Optional; only for purpose of debugging.
+ */
+ String OC_LOGICAL_CHANNEL = "oc-logical-channel";
+
+ /**
* Annotations key intended for a Port,
* which stores string identifier used to
* logically group Ports corresponding to a transponder, etc.