ONOS-2186 - GUI Topo Overlay - (WIP)
- Moved TopoJson to core ui API, so it is accessible to external apps
- Added highlightsMessage() to TopoJson
- Pulled sendMessage() up to UiMessageHandler
Change-Id: Iacab5b69e3b2a6db98be8391274695247ba5526d
diff --git a/core/api/src/main/java/org/onosproject/ui/UiMessageHandler.java b/core/api/src/main/java/org/onosproject/ui/UiMessageHandler.java
index e27f5d9..9b9a406 100644
--- a/core/api/src/main/java/org/onosproject/ui/UiMessageHandler.java
+++ b/core/api/src/main/java/org/onosproject/ui/UiMessageHandler.java
@@ -190,4 +190,18 @@
protected ArrayNode arrayNode() {
return mapper.createArrayNode();
}
+
+ /**
+ * Sends the specified data to the client.
+ * It is expected that the data is in the prescribed JSON format for
+ * events to the client.
+ *
+ * @param data data to be sent
+ */
+ protected synchronized void sendMessage(ObjectNode data) {
+ UiConnection connection = connection();
+ if (connection != null) {
+ connection.sendMessage(data);
+ }
+ }
}