Miscellaneous fixes for reading Linc-OE port types.
- Keep track of created PortDescriptions so that they can be replayed when
configurations don't stick
- Push topology configs to all cluster members (Temporary hack until
Configs are made Mastership-aware)
- Port type consistency for Optical ports - default to FIBER port type
Change-Id: Ib2c9e2839c212d2998206bd0106490b2b38446a9
diff --git a/core/api/src/main/java/org/onosproject/net/DefaultAnnotations.java b/core/api/src/main/java/org/onosproject/net/DefaultAnnotations.java
index 13e74b8..3911d0e 100644
--- a/core/api/src/main/java/org/onosproject/net/DefaultAnnotations.java
+++ b/core/api/src/main/java/org/onosproject/net/DefaultAnnotations.java
@@ -189,6 +189,11 @@
throw new IllegalArgumentException("Expecting HashMap instance");
}
+ @Override
+ public String toString() {
+ return (map == null) ? "null" : map.toString();
+ }
+
/**
* Facility for gradually building model annotations.
*/
diff --git a/core/store/dist/src/main/java/org/onosproject/store/device/impl/GossipDeviceStore.java b/core/store/dist/src/main/java/org/onosproject/store/device/impl/GossipDeviceStore.java
index 7f45343..5ea27af 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/device/impl/GossipDeviceStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/device/impl/GossipDeviceStore.java
@@ -1023,11 +1023,12 @@
continue;
}
annotations = merge(annotations, otherPortDesc.value().annotations());
- switch (otherPortDesc.value().type()) {
+ PortDescription other = otherPortDesc.value();
+ switch (other.type()) {
case OMS:
OmsPortDescription omsPortDesc = (OmsPortDescription) otherPortDesc.value();
updated = new OmsPort(device, number, isEnabled, omsPortDesc.minFrequency(),
- omsPortDesc.maxFrequency(), omsPortDesc.grid());
+ omsPortDesc.maxFrequency(), omsPortDesc.grid(), annotations);
break;
case OCH:
OchPortDescription ochPortDesc = (OchPortDescription) otherPortDesc.value();
@@ -1039,7 +1040,8 @@
updated = new OduCltPort(device, number, isEnabled, oduCltPortDesc.signalType(), annotations);
break;
default:
- updated = new DefaultPort(device, number, isEnabled, annotations);
+ updated = new DefaultPort(
+ device, number, isEnabled, other.type(), other.portSpeed(), annotations);
}
newest = otherPortDesc.timestamp();
}
@@ -1047,7 +1049,10 @@
if (portDesc == null) {
return updated == null ? new DefaultPort(device, number, false, annotations) : updated;
}
- return updated == null ? new DefaultPort(device, number, isEnabled, annotations) : updated;
+ PortDescription current = portDesc.value();
+ return updated == null
+ ? new DefaultPort(device, number, isEnabled, current.type(), current.portSpeed(), annotations)
+ : updated;
}
/**