Adding server-side code for sending device/host details to the client.
Change-Id: I02e15db996a848fc064ccaa14f0274275020d6be
Showing
2 changed files
with
4 additions
and
5 deletions
... | @@ -350,7 +350,6 @@ public abstract class TopologyMessages { | ... | @@ -350,7 +350,6 @@ public abstract class TopologyMessages { |
350 | new Prop("Longitude", annot.value("longitude")))); | 350 | new Prop("Longitude", annot.value("longitude")))); |
351 | } | 351 | } |
352 | 352 | ||
353 | - | ||
354 | // Produces a path message to the client. | 353 | // Produces a path message to the client. |
355 | protected ObjectNode pathMessage(Path path, String type) { | 354 | protected ObjectNode pathMessage(Path path, String type) { |
356 | ObjectNode payload = mapper.createObjectNode(); | 355 | ObjectNode payload = mapper.createObjectNode(); | ... | ... |
... | @@ -110,8 +110,8 @@ public class TopologyWebSocket | ... | @@ -110,8 +110,8 @@ public class TopologyWebSocket |
110 | try { | 110 | try { |
111 | ObjectNode event = (ObjectNode) mapper.reader().readTree(data); | 111 | ObjectNode event = (ObjectNode) mapper.reader().readTree(data); |
112 | String type = string(event, "event", "unknown"); | 112 | String type = string(event, "event", "unknown"); |
113 | - if (type.equals("showDetails")) { | 113 | + if (type.equals("requestDetails")) { |
114 | - showDetails(event); | 114 | + requestDetails(event); |
115 | } else if (type.equals("updateMeta")) { | 115 | } else if (type.equals("updateMeta")) { |
116 | updateMetaUi(event); | 116 | updateMetaUi(event); |
117 | } else if (type.equals("requestPath")) { | 117 | } else if (type.equals("requestPath")) { |
... | @@ -165,9 +165,9 @@ public class TopologyWebSocket | ... | @@ -165,9 +165,9 @@ public class TopologyWebSocket |
165 | } | 165 | } |
166 | 166 | ||
167 | // Sends back device or host details. | 167 | // Sends back device or host details. |
168 | - private void showDetails(ObjectNode event) { | 168 | + private void requestDetails(ObjectNode event) { |
169 | ObjectNode payload = payload(event); | 169 | ObjectNode payload = payload(event); |
170 | - String type = string(payload, "type", "unknown"); | 170 | + String type = string(payload, "class", "unknown"); |
171 | if (type.equals("device")) { | 171 | if (type.equals("device")) { |
172 | sendMessage(deviceDetails(deviceId(string(payload, "id")), | 172 | sendMessage(deviceDetails(deviceId(string(payload, "id")), |
173 | number(event, "sid"))); | 173 | number(event, "sid"))); | ... | ... |
-
Please register or login to post a comment