ONOS-6259: Topo2 - Implement server-side highlighting model
- Generated highlights message now sent back to the client
  with the event id "topo2Highlights".

Change-Id: I873ebd38a0636a7d9b5c2a6caf98c6b33de2cc87
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/topo/Topo2TrafficMessageHandler.java b/web/gui/src/main/java/org/onosproject/ui/impl/topo/Topo2TrafficMessageHandler.java
index 182fbfb..ce7175b 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/topo/Topo2TrafficMessageHandler.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/topo/Topo2TrafficMessageHandler.java
@@ -25,11 +25,14 @@
 import org.onosproject.ui.UiMessageHandler;
 import org.onosproject.ui.impl.TrafficMonitorBase.Mode;
 import org.onosproject.ui.impl.topo.util.ServicesBundle;
+import org.onosproject.ui.topo.Highlights;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.util.Collection;
 
+import static org.onosproject.ui.topo.TopoJson.topo2HighlightsMessage;
+
 /**
  * Server-side component to handle messages pertaining to topo-2 traffic.
  */
@@ -92,6 +95,15 @@
         traffic.stopMonitoring();
     }
 
+    /**
+     * Sends a highlights message back to the client.
+     *
+     * @param highlights the highlights for transmission
+     */
+    void sendHighlights(Highlights highlights) {
+        sendMessage(topo2HighlightsMessage(highlights));
+    }
+
     // ==================================================================
 
     private final class Topo2AllTraffic extends RequestHandler {
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/topo/Traffic2Monitor.java b/web/gui/src/main/java/org/onosproject/ui/impl/topo/Traffic2Monitor.java
index 0653832..8f056fa 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/topo/Traffic2Monitor.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/topo/Traffic2Monitor.java
@@ -54,33 +54,25 @@
     @Override
     protected void sendAllFlowTraffic() {
         log.debug("TOPO-2-TRAFFIC: sendAllFlowTraffic");
-        Highlights h = trafficSummary(TrafficLink.StatsType.FLOW_STATS);
-
-        // TODO
+        msgHandler.sendHighlights(trafficSummary(TrafficLink.StatsType.FLOW_STATS));
     }
 
     @Override
     protected void sendAllPortTrafficBits() {
         log.debug("TOPO-2-TRAFFIC: sendAllPortTrafficBits");
-        Highlights h = trafficSummary(TrafficLink.StatsType.PORT_STATS);
-
-        // TODO
+        msgHandler.sendHighlights(trafficSummary(TrafficLink.StatsType.PORT_STATS));
     }
 
     @Override
     protected void sendAllPortTrafficPackets() {
         log.debug("TOPO-2-TRAFFIC: sendAllPortTrafficPackets");
-        Highlights h = trafficSummary(TrafficLink.StatsType.PORT_PACKET_STATS);
-
-        // TODO
+        msgHandler.sendHighlights(trafficSummary(TrafficLink.StatsType.PORT_PACKET_STATS));
     }
 
     @Override
     protected void sendClearHighlights() {
         log.debug("TOPO-2-TRAFFIC: sendClearHighlights");
-        Highlights h = new Highlights();
-
-        // TODO
+        msgHandler.sendHighlights(new Highlights());
     }