Add key constants for ODTN
Change-Id: I21cefc09835e3f1d8c393e470889af9ba86d50cd
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 e8657ea..6e5bc81 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
@@ -20,24 +20,42 @@
import org.onosproject.net.device.DeviceDescriptionDiscovery;
import org.onosproject.net.device.PortDescription;
+import com.google.common.annotations.Beta;
+
/**
* DeviceDescriptionDiscovery used in ODTN.
*
* Just declaring certain Annotations will be required.
*/
+@Beta
public interface OdtnDeviceDescriptionDiscovery
extends DeviceDescriptionDiscovery {
/**
- * Annotations key, which stores OpenConfig component name.
+ * Annotations key intended for a Port, which stores OpenConfig component name.
*/
String OC_NAME = "oc-name";
/**
- * Annotations key, which stores OpenConfig component type.
+ * Annotations key intended for a Port, which stores OpenConfig component type.
*/
String OC_TYPE = "oc-type";
+ // will also be used from TAPI model to point to what we want to configure
+ /**
+ * Annotations key intended for a Port,
+ * which stores string identifier used to
+ * logically group Ports corresponding to a transponder.
+ */
+ String TRANSPONDER_NAME = "odtn-transponder-name";
+
+
+ /**
+ * OpenConfig component property name to store,
+ * decimal integer index to be used when creating PortNumber.
+ */
+ String ONOS_PORT_INDEX = "onos-index";
+
// overriding just to make checkstyle happy
@Override
List<PortDescription> discoverPortDetails();
diff --git a/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/OpenConfigDeviceDiscovery.java b/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/OpenConfigDeviceDiscovery.java
index 54e2601..5bd7345 100644
--- a/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/OpenConfigDeviceDiscovery.java
+++ b/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/OpenConfigDeviceDiscovery.java
@@ -170,14 +170,14 @@
props.put(pName, pValue);
});
- if (!props.containsKey("onos-index")) {
+ if (!props.containsKey(ONOS_PORT_INDEX)) {
log.info("DEBUG: Component {} does not include onos-index, skipping", name);
// ODTN: port must have onos-index property
return null;
}
Builder builder = DefaultPortDescription.builder();
- builder.withPortNumber(PortNumber.portNumber(Long.parseLong(props.get("onos-index")), name));
+ builder.withPortNumber(PortNumber.portNumber(Long.parseLong(props.get(ONOS_PORT_INDEX)), name));
switch (type) {
case "oc-platform-types:PORT":