Added mechanism for apps to easily add their own custom link/node/host highlighting wihout having to create a new UI extensions
Change-Id: Iefa21d76190c60db79a4b07a8b22e301d29fe58e
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandler.java b/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandler.java
index 455b0f3..cae4760 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandler.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandler.java
@@ -113,6 +113,7 @@
private static final String REQ_SEL_INTENT_TRAFFIC = "requestSelectedIntentTraffic";
private static final String SEL_INTENT = "selectIntent";
private static final String REQ_ALL_TRAFFIC = "requestAllTraffic";
+ private static final String REQ_CUSTOM_TRAFFIC = "requestCustomTraffic";
private static final String REQ_DEV_LINK_FLOWS = "requestDeviceLinkFlows";
private static final String CANCEL_TRAFFIC = "cancelTraffic";
private static final String REQ_SUMMARY = "requestSummary";
@@ -246,6 +247,7 @@
new RemoveIntents(),
new ReqAllTraffic(),
+ new ReqCustomTraffic(),
new ReqDevLinkFlows(),
new ReqRelatedIntents(),
new ReqNextIntent(),
@@ -623,6 +625,17 @@
}
}
+ private final class ReqCustomTraffic extends RequestHandler {
+ private ReqCustomTraffic() {
+ super(REQ_CUSTOM_TRAFFIC);
+ }
+
+ @Override
+ public void process(ObjectNode payload) {
+ traffic.monitor((int) number(payload, "index"));
+ }
+ }
+
private NodeSelection makeNodeSelection(ObjectNode payload) {
return new NodeSelection(payload, services.device(), services.host(),
services.link());