ONOS-4417 Remove OtuPort out of core.
Change-Id: Ibc72ee617b238005585f0bcd873b9123e48ee7fc
diff --git a/core/store/dist/src/main/java/org/onosproject/store/device/impl/DeviceDescriptions.java b/core/store/dist/src/main/java/org/onosproject/store/device/impl/DeviceDescriptions.java
index 12eaa36..c0bd97b 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/device/impl/DeviceDescriptions.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/device/impl/DeviceDescriptions.java
@@ -20,6 +20,7 @@
import static org.onosproject.net.optical.device.OchPortHelper.ochPortDescription;
import static org.onosproject.net.optical.device.OduCltPortHelper.oduCltPortDescription;
import static org.onosproject.net.optical.device.OmsPortHelper.omsPortDescription;
+import static org.onosproject.net.optical.device.OtuPortHelper.otuPortDescription;
import java.util.Collections;
import java.util.Map;
@@ -157,11 +158,19 @@
}
break;
case OTU:
- OtuPortDescription otuDesc = (OtuPortDescription) (newDesc.value());
- newOne = new Timestamped<>(
- new OtuPortDescription(
- otuDesc, otuDesc.signalType(), merged),
- newDesc.timestamp());
+ if (newDesc.value() instanceof OtuPortDescription) {
+ // remove if-block after deprecation is complete
+ OtuPortDescription otuDesc = (OtuPortDescription) (newDesc.value());
+ newOne = new Timestamped<>(
+ otuPortDescription(
+ otuDesc, otuDesc.signalType(), merged),
+ newDesc.timestamp());
+ } else {
+ // same as default case
+ newOne = new Timestamped<>(
+ new DefaultPortDescription(newDesc.value(), merged),
+ newDesc.timestamp());
+ }
break;
default:
newOne = new Timestamped<>(
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 ea25e8c..3af8945 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
@@ -1116,8 +1116,14 @@
return new DefaultPort(device, number, isEnabled, description.type(),
description.portSpeed(), annotations);
case OTU:
- OtuPortDescription otuDesc = (OtuPortDescription) description;
- return new OtuPort(device, number, isEnabled, otuDesc.signalType(), annotations);
+ if (description instanceof OtuPortDescription) {
+ // remove if-block once deprecation is complete
+ OtuPortDescription otuDesc = (OtuPortDescription) description;
+ return new OtuPort(device, number, isEnabled, otuDesc.signalType(), annotations);
+ }
+ // same as default
+ return new DefaultPort(device, number, isEnabled, description.type(),
+ description.portSpeed(), annotations);
default:
return new DefaultPort(device, number, isEnabled, description.type(),
description.portSpeed(), annotations);