ONOS-6258: UiTopo2Overlay et al.
- revert DriverMatrix app.
- simplify overlay base class to be consistent with classic topo
- add topo2overlay and topo2traffic (skeleton code for now)
Change-Id: I88fda4d7b75807bd08637d846a869846a364c1f8
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/UiExtensionManager.java b/web/gui/src/main/java/org/onosproject/ui/impl/UiExtensionManager.java
index 02d0808..6bab13e 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/UiExtensionManager.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/UiExtensionManager.java
@@ -50,12 +50,14 @@
import org.onosproject.ui.UiExtensionService;
import org.onosproject.ui.UiMessageHandlerFactory;
import org.onosproject.ui.UiPreferencesService;
+import org.onosproject.ui.UiTopo2OverlayFactory;
import org.onosproject.ui.UiTopoMap;
import org.onosproject.ui.UiTopoMapFactory;
import org.onosproject.ui.UiTopoOverlayFactory;
import org.onosproject.ui.UiView;
import org.onosproject.ui.UiViewHidden;
import org.onosproject.ui.impl.topo.Topo2ViewMessageHandler;
+import org.onosproject.ui.impl.topo.Traffic2Overlay;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -172,6 +174,11 @@
new ProtectedIntentOverlay()
);
+ UiTopo2OverlayFactory topo2OverlayFactory =
+ () -> ImmutableList.of(
+ new Traffic2Overlay()
+ );
+
UiTopoMapFactory topoMapFactory =
() -> ImmutableList.of(
new UiTopoMap("australia", "Australia", "*australia", 1.0),
@@ -194,6 +201,7 @@
return new UiExtension.Builder(CL, coreViews)
.messageHandlerFactory(messageHandlerFactory)
.topoOverlayFactory(topoOverlayFactory)
+ .topo2OverlayFactory(topo2OverlayFactory)
.topoMapFactory(topoMapFactory)
.resourcePath(CORE)
.build();
@@ -202,11 +210,11 @@
@Activate
public void activate() {
Serializer serializer = Serializer.using(KryoNamespaces.API,
- ObjectNode.class, ArrayNode.class,
- JsonNodeFactory.class, LinkedHashMap.class,
- TextNode.class, BooleanNode.class,
- LongNode.class, DoubleNode.class, ShortNode.class,
- IntNode.class, NullNode.class);
+ ObjectNode.class, ArrayNode.class,
+ JsonNodeFactory.class, LinkedHashMap.class,
+ TextNode.class, BooleanNode.class,
+ LongNode.class, DoubleNode.class, ShortNode.class,
+ IntNode.class, NullNode.class);
prefsConsistentMap = storageService.<String, ObjectNode>consistentMapBuilder()
.withName(ONOS_USER_PREFERENCES)
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/topo/Topo2OverlayCache.java b/web/gui/src/main/java/org/onosproject/ui/impl/topo/Topo2OverlayCache.java
index 1c05acf..b95aeaf 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/topo/Topo2OverlayCache.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/topo/Topo2OverlayCache.java
@@ -135,12 +135,7 @@
// overlay instance representing "no overlay selected"
private static class NullOverlay extends UiTopo2Overlay {
NullOverlay() {
- super(EMPTY, NO_OVERLAY);
- }
-
- @Override
- public String glyphId() {
- return UNKNOWN;
+ super(EMPTY);
}
}
}
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/topo/Topo2ViewMessageHandler.java b/web/gui/src/main/java/org/onosproject/ui/impl/topo/Topo2ViewMessageHandler.java
index 1763048..b30ff11 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/topo/Topo2ViewMessageHandler.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/topo/Topo2ViewMessageHandler.java
@@ -16,14 +16,12 @@
package org.onosproject.ui.impl.topo;
-import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.collect.ImmutableSet;
import org.onlab.osgi.ServiceDirectory;
import org.onosproject.ui.RequestHandler;
import org.onosproject.ui.UiConnection;
import org.onosproject.ui.UiMessageHandler;
-import org.onosproject.ui.UiTopo2Overlay;
import org.onosproject.ui.impl.UiWebSocket;
import org.onosproject.ui.model.topo.UiClusterMember;
import org.onosproject.ui.model.topo.UiNode;
@@ -129,23 +127,6 @@
return peersPayload;
}
- private ObjectNode mkOverlaysMessage() {
- ArrayNode a = arrayNode();
- for (UiTopo2Overlay ov : overlay2Cache.list()) {
- a.add(json(ov));
- }
- ObjectNode payload = objectNode();
- payload.set("overlays", a);
- return payload;
- }
-
- private ObjectNode json(UiTopo2Overlay ov) {
- return objectNode()
- .put("id", ov.id())
- .put("name", ov.name())
- .put("gid", ov.glyphId());
- }
-
// ==================================================================
@@ -186,9 +167,6 @@
// these are the regions/devices that are siblings to this region
sendMessage(PEER_REGIONS, mkPeersMessage(currentLayout));
-
- // these are the registered overlays
- sendMessage(OVERLAYS, mkOverlaysMessage());
}
}
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/topo/Traffic2Overlay.java b/web/gui/src/main/java/org/onosproject/ui/impl/topo/Traffic2Overlay.java
new file mode 100644
index 0000000..a4dba20
--- /dev/null
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/topo/Traffic2Overlay.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.onosproject.ui.impl.topo;
+
+import org.onosproject.ui.UiTopo2Overlay;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Traffic overlay for topology 2 view.
+ */
+public class Traffic2Overlay extends UiTopo2Overlay {
+
+ private final Logger log = LoggerFactory.getLogger(getClass());
+
+ // NOTE: this must match the ID defined in topo2TrafficOverlay.js
+ private static final String OVERLAY_ID = "traffic-2-overlay";
+
+ /**
+ * Creates a traffic overlay instance.
+ */
+ public Traffic2Overlay() {
+ super(OVERLAY_ID);
+ }
+
+ @Override
+ public void highlightingCallback() {
+ log.debug("highlightingCallback() invoked");
+ // TODO: implement
+ }
+}