mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-11-01 00:31:01 +01:00
Merge "Adding server-side code for sending device/host details to the client."
This commit is contained in:
commit
b6a67d5aed
@ -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")));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user