Add OTN device and ports

Change-Id: I18f3376d1466077e95d7324a27a660302f0123b3
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 2320672..36ad2a4 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
@@ -31,6 +31,7 @@
 import org.onosproject.net.device.OchPortDescription;
 import org.onosproject.net.device.OduCltPortDescription;
 import org.onosproject.net.device.OmsPortDescription;
+import org.onosproject.net.device.OtuPortDescription;
 import org.onosproject.net.device.PortDescription;
 import org.onosproject.store.Timestamp;
 import org.onosproject.store.impl.Timestamped;
@@ -123,6 +124,13 @@
                                     ocDesc, ocDesc.signalType(), merged),
                             newDesc.timestamp());
                     break;
+                case OTU:
+                    OtuPortDescription otuDesc = (OtuPortDescription) (newDesc.value());
+                    newOne = new Timestamped<>(
+                            new OtuPortDescription(
+                                    otuDesc, otuDesc.signalType(), merged),
+                            newDesc.timestamp());
+                    break;
                 default:
                     newOne = new Timestamped<>(
                             new DefaultPortDescription(newDesc.value(), merged),
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 53809d1..a10b79d 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
@@ -48,6 +48,7 @@
 import org.onosproject.net.OchPort;
 import org.onosproject.net.OduCltPort;
 import org.onosproject.net.OmsPort;
+import org.onosproject.net.OtuPort;
 import org.onosproject.net.Port;
 import org.onosproject.net.PortNumber;
 import org.onosproject.net.device.DefaultPortStatistics;
@@ -59,6 +60,7 @@
 import org.onosproject.net.device.OchPortDescription;
 import org.onosproject.net.device.OduCltPortDescription;
 import org.onosproject.net.device.OmsPortDescription;
+import org.onosproject.net.device.OtuPortDescription;
 import org.onosproject.net.device.PortDescription;
 import org.onosproject.net.device.PortStatistics;
 import org.onosproject.net.provider.ProviderId;
@@ -1095,6 +1097,9 @@
             case ODUCLT:
                 OduCltPortDescription oduDesc = (OduCltPortDescription) description;
                 return new OduCltPort(device, number, isEnabled, oduDesc.signalType(), annotations);
+            case OTU:
+                OtuPortDescription otuDesc = (OtuPortDescription) description;
+                return new OtuPort(device, number, isEnabled, otuDesc.signalType(), annotations);
             default:
                 return new DefaultPort(device, number, isEnabled, description.type(),
                         description.portSpeed(), annotations);
diff --git a/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java b/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java
index d5a73c0..9d8a0b2 100644
--- a/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java
+++ b/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java
@@ -77,6 +77,8 @@
 import org.onosproject.net.OduSignalId;
 import org.onosproject.net.OduSignalType;
 import org.onosproject.net.OmsPort;
+import org.onosproject.net.OtuPort;
+import org.onosproject.net.OtuSignalType;
 import org.onosproject.net.Port;
 import org.onosproject.net.PortNumber;
 import org.onosproject.net.TributarySlot;
@@ -85,6 +87,7 @@
 import org.onosproject.net.device.DefaultPortStatistics;
 import org.onosproject.net.device.OchPortDescription;
 import org.onosproject.net.device.OduCltPortDescription;
+import org.onosproject.net.device.OtuPortDescription;
 import org.onosproject.net.device.OmsPortDescription;
 import org.onosproject.net.device.PortStatistics;
 import org.onosproject.net.flow.CompletedBatchOperation;
@@ -511,6 +514,9 @@
             .register(OchPortDescription.class)
             .register(OmsPortDescription.class)
             .register(TributarySlot.class)
+            .register(OtuPort.class)
+            .register(OtuSignalType.class)
+            .register(OtuPortDescription.class)
             .register(
                     MplsIntent.class,
                     MplsPathIntent.class,
diff --git a/core/store/serializers/src/test/java/org/onosproject/store/serializers/KryoSerializerTest.java b/core/store/serializers/src/test/java/org/onosproject/store/serializers/KryoSerializerTest.java
index 9a0e94f..b6ece78 100644
--- a/core/store/serializers/src/test/java/org/onosproject/store/serializers/KryoSerializerTest.java
+++ b/core/store/serializers/src/test/java/org/onosproject/store/serializers/KryoSerializerTest.java
@@ -52,6 +52,8 @@
 import org.onosproject.net.OchSignal;
 import org.onosproject.net.OduCltPort;
 import org.onosproject.net.OmsPort;
+import org.onosproject.net.OtuPort;
+import org.onosproject.net.OtuSignalType;
 import org.onosproject.net.PortNumber;
 import org.onosproject.net.OduSignalType;
 import org.onosproject.net.SparseAnnotations;
@@ -225,6 +227,11 @@
     }
 
     @Test
+    public void testOtuPort() {
+        testSerializedEquals(new OtuPort(DEV1, P1, true, OtuSignalType.OTU2));
+        testSerializedEquals(new OtuPort(DEV1, P1, true, OtuSignalType.OTU2, A1_2));
+    }
+    @Test
     public void testDeviceId() {
         testSerializedEquals(DID1);
     }