Adding OLS device Type for ODTN project

Change-Id: Ia3472b47ea12d2f2f44de9cb88f20774881530ee
diff --git a/apps/newoptical/src/main/java/org/onosproject/newoptical/OpticalPathProvisioner.java b/apps/newoptical/src/main/java/org/onosproject/newoptical/OpticalPathProvisioner.java
index 59ee3d9..f39b01a 100644
--- a/apps/newoptical/src/main/java/org/onosproject/newoptical/OpticalPathProvisioner.java
+++ b/apps/newoptical/src/main/java/org/onosproject/newoptical/OpticalPathProvisioner.java
@@ -566,7 +566,8 @@
      * @return true if in packet layer, false otherwise
      */
     private boolean isTransportLayer(Device.Type type) {
-        return type == Device.Type.ROADM || type == Device.Type.OTN || type == Device.Type.ROADM_OTN;
+        return type == Device.Type.ROADM || type == Device.Type.OTN || type == Device.Type.ROADM_OTN ||
+                type == Device.Type.OLS;
     }
 
     /**
diff --git a/apps/optical-model/src/main/java/org/onosproject/net/optical/util/OpticalIntentUtility.java b/apps/optical-model/src/main/java/org/onosproject/net/optical/util/OpticalIntentUtility.java
index 004c302..758db56 100644
--- a/apps/optical-model/src/main/java/org/onosproject/net/optical/util/OpticalIntentUtility.java
+++ b/apps/optical-model/src/main/java/org/onosproject/net/optical/util/OpticalIntentUtility.java
@@ -91,7 +91,8 @@
 
             CltSignalType signalType = ((OduCltPort) srcPort).signalType();
             if (Device.Type.ROADM.equals(srcDevice.type()) ||
-                    Device.Type.ROADM_OTN.equals(srcDevice.type())) {
+                    Device.Type.ROADM_OTN.equals(srcDevice.type()) ||
+                    Device.Type.OLS.equals(srcDevice.type())) {
                 intent = OpticalCircuitIntent.builder()
                         .appId(appId)
                         .key(key)
@@ -173,7 +174,8 @@
 
             CltSignalType signalType = ((OduCltPort) srcPort).signalType();
             if (Device.Type.ROADM.equals(srcDevice.type()) ||
-                    Device.Type.ROADM_OTN.equals(srcDevice.type())) {
+                    Device.Type.ROADM_OTN.equals(srcDevice.type()) ||
+                    Device.Type.OLS.equals(srcDevice.type())) {
                 intent = OpticalCircuitIntent.builder()
                         .appId(appId)
                         .key(key)
diff --git a/core/api/src/main/java/org/onosproject/net/Device.java b/core/api/src/main/java/org/onosproject/net/Device.java
index 4d8bdb0..da9a72e 100644
--- a/core/api/src/main/java/org/onosproject/net/Device.java
+++ b/core/api/src/main/java/org/onosproject/net/Device.java
@@ -27,7 +27,7 @@
      */
     enum Type {
         SWITCH, ROUTER, ROADM, OTN, ROADM_OTN, FIREWALL, BALANCER, IPS, IDS, CONTROLLER,
-        VIRTUAL, FIBER_SWITCH, MICROWAVE, OLT, ONU, OPTICAL_AMPLIFIER, OTHER, SERVER
+        VIRTUAL, FIBER_SWITCH, MICROWAVE, OLT, ONU, OPTICAL_AMPLIFIER, OLS, OTHER, SERVER
     }
 
     /**
diff --git a/core/api/src/main/java/org/onosproject/net/GridType.java b/core/api/src/main/java/org/onosproject/net/GridType.java
index 498b908..1e21fac 100644
--- a/core/api/src/main/java/org/onosproject/net/GridType.java
+++ b/core/api/src/main/java/org/onosproject/net/GridType.java
@@ -25,5 +25,6 @@
 public enum GridType {
     DWDM,               // Dense Wavelength Division Multiplexing
     CWDM,               // Coarse WDM
-    FLEX                // Flex Grid
+    FLEX,               // Flex Grid
+    UNKNOWN             // Unknown
 }
diff --git a/core/net/src/main/java/org/onosproject/net/device/impl/DeviceManager.java b/core/net/src/main/java/org/onosproject/net/device/impl/DeviceManager.java
index 98880db..513e648 100644
--- a/core/net/src/main/java/org/onosproject/net/device/impl/DeviceManager.java
+++ b/core/net/src/main/java/org/onosproject/net/device/impl/DeviceManager.java
@@ -708,7 +708,7 @@
                 return;
             }
             if ((Device.Type.ROADM.equals(device.type())) ||
-                    (Device.Type.OTN.equals(device.type()))) {
+                    (Device.Type.OTN.equals(device.type())) || (Device.Type.OLS.equals(device.type()))) {
                 // FIXME This is ignoring all other info in portDescription given as input??
                 PortDescription storedPortDesc = store.getPortDescription(provider().id(),
                                                                           deviceId,
diff --git a/core/protobuf/models/proto/net/device/DeviceEnumsProto.proto b/core/protobuf/models/proto/net/device/DeviceEnumsProto.proto
index e8713d3..aaecef0 100644
--- a/core/protobuf/models/proto/net/device/DeviceEnumsProto.proto
+++ b/core/protobuf/models/proto/net/device/DeviceEnumsProto.proto
@@ -33,6 +33,7 @@
     VIRTUAL_DEVICE = 11;
     FIBER_SWITCH = 12;
     MICROWAVE = 13;
+    OLS = 14;
 }
 
 enum DeviceEventTypeProto {
diff --git a/core/protobuf/models/src/main/java/org/onosproject/incubator/protobuf/models/net/device/DeviceProtoTranslator.java b/core/protobuf/models/src/main/java/org/onosproject/incubator/protobuf/models/net/device/DeviceProtoTranslator.java
index 90d10f5..6d23334 100644
--- a/core/protobuf/models/src/main/java/org/onosproject/incubator/protobuf/models/net/device/DeviceProtoTranslator.java
+++ b/core/protobuf/models/src/main/java/org/onosproject/incubator/protobuf/models/net/device/DeviceProtoTranslator.java
@@ -115,6 +115,8 @@
                 return Type.ROUTER;
             case SWITCH:
                 return Type.SWITCH;
+            case OLS:
+                return Type.OLS;
             case VIRTUAL_DEVICE:
                 return Type.VIRTUAL;
 
diff --git a/providers/lldp/src/main/java/org/onosproject/provider/lldp/impl/LldpLinkProvider.java b/providers/lldp/src/main/java/org/onosproject/provider/lldp/impl/LldpLinkProvider.java
index e2d45a5..4f44307 100644
--- a/providers/lldp/src/main/java/org/onosproject/provider/lldp/impl/LldpLinkProvider.java
+++ b/providers/lldp/src/main/java/org/onosproject/provider/lldp/impl/LldpLinkProvider.java
@@ -188,7 +188,8 @@
         = new SuppressionRules(EnumSet.of(Device.Type.ROADM,
                                           Device.Type.FIBER_SWITCH,
                                           Device.Type.OPTICAL_AMPLIFIER,
-                                          Device.Type.OTN),
+                                          Device.Type.OTN,
+                                          Device.Type.OLS),
                                ImmutableMap.of(NO_LLDP, SuppressionRules.ANY_VALUE));
 
     private SuppressionRules rules = LldpLinkProvider.DEFAULT_RULES;
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandler.java b/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandler.java
index 1c16a44..021e4e1 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandler.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandler.java
@@ -775,13 +775,14 @@
         // Send optical first, others later for layered rendering
         for (Device device : services.device().getDevices()) {
             if ((device.type() == Device.Type.ROADM) ||
-                    (device.type() == Device.Type.OTN)) {
+                    (device.type() == Device.Type.OTN) || (device.type() == Device.Type.OLS)) {
                 sendMessage(deviceMessage(new DeviceEvent(DEVICE_ADDED, device)));
             }
         }
         for (Device device : services.device().getDevices()) {
             if ((device.type() != Device.Type.ROADM) &&
-                    (device.type() != Device.Type.OTN) && device.type() != Device.Type.CONTROLLER) {
+                    (device.type() != Device.Type.OTN) && (device.type() != Device.Type.OLS) &&
+                    (device.type() != Device.Type.CONTROLLER)) {
                 sendMessage(deviceMessage(new DeviceEvent(DEVICE_ADDED, device)));
             }
         }
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandlerBase.java b/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandlerBase.java
index 5f153f0..6f370b8 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandlerBase.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandlerBase.java
@@ -140,6 +140,7 @@
         DEVICE_GLYPHS.put(Device.Type.SWITCH, "m_switch");
         DEVICE_GLYPHS.put(Device.Type.ROUTER, "m_router");
         DEVICE_GLYPHS.put(Device.Type.ROADM, "m_roadm");
+        DEVICE_GLYPHS.put(Device.Type.OLS, "m_roadm");
         DEVICE_GLYPHS.put(Device.Type.OTN, "m_otn");
         DEVICE_GLYPHS.put(Device.Type.ROADM_OTN, "m_roadm_otn");
         DEVICE_GLYPHS.put(Device.Type.BALANCER, "m_balancer");