mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-11-05 18:51:25 +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"))));
|
new Prop("Longitude", annot.value("longitude"))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Produces a path message to the client.
|
// Produces a path message to the client.
|
||||||
protected ObjectNode pathMessage(Path path, String type) {
|
protected ObjectNode pathMessage(Path path, String type) {
|
||||||
ObjectNode payload = mapper.createObjectNode();
|
ObjectNode payload = mapper.createObjectNode();
|
||||||
|
|||||||
@ -110,8 +110,8 @@ public class TopologyWebSocket
|
|||||||
try {
|
try {
|
||||||
ObjectNode event = (ObjectNode) mapper.reader().readTree(data);
|
ObjectNode event = (ObjectNode) mapper.reader().readTree(data);
|
||||||
String type = string(event, "event", "unknown");
|
String type = string(event, "event", "unknown");
|
||||||
if (type.equals("showDetails")) {
|
if (type.equals("requestDetails")) {
|
||||||
showDetails(event);
|
requestDetails(event);
|
||||||
} else if (type.equals("updateMeta")) {
|
} else if (type.equals("updateMeta")) {
|
||||||
updateMetaUi(event);
|
updateMetaUi(event);
|
||||||
} else if (type.equals("requestPath")) {
|
} else if (type.equals("requestPath")) {
|
||||||
@ -165,9 +165,9 @@ public class TopologyWebSocket
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Sends back device or host details.
|
// Sends back device or host details.
|
||||||
private void showDetails(ObjectNode event) {
|
private void requestDetails(ObjectNode event) {
|
||||||
ObjectNode payload = payload(event);
|
ObjectNode payload = payload(event);
|
||||||
String type = string(payload, "type", "unknown");
|
String type = string(payload, "class", "unknown");
|
||||||
if (type.equals("device")) {
|
if (type.equals("device")) {
|
||||||
sendMessage(deviceDetails(deviceId(string(payload, "id")),
|
sendMessage(deviceDetails(deviceId(string(payload, "id")),
|
||||||
number(event, "sid")));
|
number(event, "sid")));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user