Thomas Vachuska

Adding server-side code for sending device/host details to the client.

Change-Id: I02e15db996a848fc064ccaa14f0274275020d6be
......@@ -350,7 +350,6 @@ public abstract class TopologyMessages {
new Prop("Longitude", annot.value("longitude"))));
}
// Produces a path message to the client.
protected ObjectNode pathMessage(Path path, String type) {
ObjectNode payload = mapper.createObjectNode();
......
......@@ -110,8 +110,8 @@ public class TopologyWebSocket
try {
ObjectNode event = (ObjectNode) mapper.reader().readTree(data);
String type = string(event, "event", "unknown");
if (type.equals("showDetails")) {
showDetails(event);
if (type.equals("requestDetails")) {
requestDetails(event);
} else if (type.equals("updateMeta")) {
updateMetaUi(event);
} else if (type.equals("requestPath")) {
......@@ -165,9 +165,9 @@ public class TopologyWebSocket
}
// Sends back device or host details.
private void showDetails(ObjectNode event) {
private void requestDetails(ObjectNode event) {
ObjectNode payload = payload(event);
String type = string(payload, "type", "unknown");
String type = string(payload, "class", "unknown");
if (type.equals("device")) {
sendMessage(deviceDetails(deviceId(string(payload, "id")),
number(event, "sid")));
......