qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eal...@apache.org
Subject qpid-dispatch git commit: DISPATCH-272: Use the connectionId attribute to associate links with connections
Date Wed, 27 Apr 2016 17:57:29 GMT
Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 159444b28 -> 0441ea300


DISPATCH-272: Use the connectionId attribute to associate links with connections


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/0441ea30
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/0441ea30
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/0441ea30

Branch: refs/heads/master
Commit: 0441ea300ab2376baf3745c1ca897201c8dbe844
Parents: 159444b
Author: Ernest Allen <eallen@redhat.com>
Authored: Wed Apr 27 13:57:03 2016 -0400
Committer: Ernest Allen <eallen@redhat.com>
Committed: Wed Apr 27 13:57:03 2016 -0400

----------------------------------------------------------------------
 .../simpleplugin/PluginContextListener.java     | 37 --------------------
 .../qpid/dispatch/PluginContextListener.java    | 37 ++++++++++++++++++++
 .../hawtio/src/main/resources/WEB-INF/web.xml   |  2 +-
 .../src/main/webapp/plugin/js/qdrTopology.js    | 11 ++++--
 console/stand-alone/index.html                  |  2 ++
 console/stand-alone/plugin/js/qdrTopology.js    | 12 ++++---
 6 files changed, 56 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/0441ea30/console/hawtio/src/main/java/io/hawt/example/simpleplugin/PluginContextListener.java
----------------------------------------------------------------------
diff --git a/console/hawtio/src/main/java/io/hawt/example/simpleplugin/PluginContextListener.java
b/console/hawtio/src/main/java/io/hawt/example/simpleplugin/PluginContextListener.java
deleted file mode 100644
index a417786..0000000
--- a/console/hawtio/src/main/java/io/hawt/example/simpleplugin/PluginContextListener.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package io.hawt.dispatch;
-
-import io.hawt.web.plugin.HawtioPlugin;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-
-public class PluginContextListener implements ServletContextListener {
-
-  private static final Logger LOG = LoggerFactory.getLogger(PluginContextListener.class);
-
-  HawtioPlugin plugin = null;
-
-  @Override
-  public void contextInitialized(ServletContextEvent servletContextEvent) {
-
-    ServletContext context = servletContextEvent.getServletContext();
-
-    plugin = new HawtioPlugin();
-    plugin.setContext((String)context.getInitParameter("plugin-context"));
-    plugin.setName(context.getInitParameter("plugin-name"));
-    plugin.setScripts(context.getInitParameter("plugin-scripts"));
-    plugin.setDomain(null);
-    plugin.init();
-
-    LOG.info("Initialized {} plugin", plugin.getName());
-  }
-
-  @Override
-  public void contextDestroyed(ServletContextEvent servletContextEvent) {
-    plugin.destroy();
-    LOG.info("Destroyed {} plugin", plugin.getName());
-  }
-}

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/0441ea30/console/hawtio/src/main/java/org/apache/qpid/dispatch/PluginContextListener.java
----------------------------------------------------------------------
diff --git a/console/hawtio/src/main/java/org/apache/qpid/dispatch/PluginContextListener.java
b/console/hawtio/src/main/java/org/apache/qpid/dispatch/PluginContextListener.java
new file mode 100644
index 0000000..7905ac0
--- /dev/null
+++ b/console/hawtio/src/main/java/org/apache/qpid/dispatch/PluginContextListener.java
@@ -0,0 +1,37 @@
+package org.apache.qpid.dispatch;
+
+import io.hawt.web.plugin.HawtioPlugin;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+public class PluginContextListener implements ServletContextListener {
+
+  private static final Logger LOG = LoggerFactory.getLogger(PluginContextListener.class);
+
+  HawtioPlugin plugin = null;
+
+  @Override
+  public void contextInitialized(ServletContextEvent servletContextEvent) {
+
+    ServletContext context = servletContextEvent.getServletContext();
+
+    plugin = new HawtioPlugin();
+    plugin.setContext((String)context.getInitParameter("plugin-context"));
+    plugin.setName(context.getInitParameter("plugin-name"));
+    plugin.setScripts(context.getInitParameter("plugin-scripts"));
+    plugin.setDomain(null);
+    plugin.init();
+
+    LOG.info("Initialized {} plugin", plugin.getName());
+  }
+
+  @Override
+  public void contextDestroyed(ServletContextEvent servletContextEvent) {
+    plugin.destroy();
+    LOG.info("Destroyed {} plugin", plugin.getName());
+  }
+}

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/0441ea30/console/hawtio/src/main/resources/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/console/hawtio/src/main/resources/WEB-INF/web.xml b/console/hawtio/src/main/resources/WEB-INF/web.xml
index 30ae7f0..66e8dba 100644
--- a/console/hawtio/src/main/resources/WEB-INF/web.xml
+++ b/console/hawtio/src/main/resources/WEB-INF/web.xml
@@ -33,7 +33,7 @@
   </context-param>
 
   <listener>
-    <listener-class>io.hawt.dispatch.PluginContextListener</listener-class>
+    <listener-class>org.apache.qpid.dispatch.PluginContextListener</listener-class>
   </listener>
 
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/0441ea30/console/hawtio/src/main/webapp/plugin/js/qdrTopology.js
----------------------------------------------------------------------
diff --git a/console/hawtio/src/main/webapp/plugin/js/qdrTopology.js b/console/hawtio/src/main/webapp/plugin/js/qdrTopology.js
index 7acbe0f..4f0f3e7 100644
--- a/console/hawtio/src/main/webapp/plugin/js/qdrTopology.js
+++ b/console/hawtio/src/main/webapp/plugin/js/qdrTopology.js
@@ -901,13 +901,18 @@ var QDR = (function (QDR) {
 
 					// find router.links where link.remoteContainer is d.source.name
 					var links = nodeInfo[d.source.key]['.router.link'];
-					containerIndex = links.attributeNames.indexOf('remoteContainer');
+					var identityIndex = connections.attributeNames.indexOf('identity')
+					var roleIndex = connections.attributeNames.indexOf('role')
+					var connectionIdIndex = links.attributeNames.indexOf('connectionId');
+					var linkTypeIndex = links.attributeNames.indexOf('linkType');
 					var nameIndex = links.attributeNames.indexOf('name');
 					var linkDirIndex = links.attributeNames.indexOf('linkDir');
-					if (containerIndex < 0 || nameIndex < 0 || linkDirIndex < 0)
+
+					if (roleIndex < 0 || identityIndex < 0 || connectionIdIndex < 0
+						|| linkTypeIndex < 0 || nameIndex < 0 || linkDirIndex < 0)
 						return;
 					links.results.forEach ( function (link) {
-						if (link[containerIndex] == d.target.containerName)
+						if (link[connectionIdIndex] == root.obj[identityIndex] && link[linkTypeIndex]
== root.obj[roleIndex])
 							root.children.push (
 								{ name: "(" + link[linkDirIndex] + ") " + link[nameIndex],
 								size: 100,

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/0441ea30/console/stand-alone/index.html
----------------------------------------------------------------------
diff --git a/console/stand-alone/index.html b/console/stand-alone/index.html
index f719a04..166d89a 100644
--- a/console/stand-alone/index.html
+++ b/console/stand-alone/index.html
@@ -27,6 +27,7 @@ under the License.
 
     <link rel="stylesheet" href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery.tipsy/1.0.2/jquery.tipsy.css"
type="text/css"/>
+
     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-grid/3.0.7/ui-grid.css"
type="text/css"/>
     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery.fancytree/2.15.0/skin-win8/ui.fancytree.css"
type="text/css">
 
@@ -96,6 +97,7 @@ under the License.
     <script src="https://code.angularjs.org/1.4.8/angular-animate.js"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/1.1.0/ui-bootstrap-tpls.min.js"></script>
     <script src="https://cdn.rawgit.com/jaz303/tipsy/master/src/javascripts/jquery.tipsy.js"></script>
+    <script src="https://cdn.rawgit.com/briancray/tooltipsy/master/tooltipsy.min.js"></script>
     <script src="https://cdn.rawgit.com/angular-ui/ui-slider/master/src/slider.js"></script>
     <script src="https://cdn.rawgit.com/mohsen1/json-formatter/master/dist/json-formatter.min.js"></script>
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/0441ea30/console/stand-alone/plugin/js/qdrTopology.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/qdrTopology.js b/console/stand-alone/plugin/js/qdrTopology.js
index 72741ee..a410753 100644
--- a/console/stand-alone/plugin/js/qdrTopology.js
+++ b/console/stand-alone/plugin/js/qdrTopology.js
@@ -1131,13 +1131,18 @@ var QDR = (function (QDR) {
 
 					// find router.links where link.remoteContainer is d.source.name
 					var links = nodeInfo[d.source.key]['.router.link'];
-					containerIndex = links.attributeNames.indexOf('remoteContainer');
+					var identityIndex = connections.attributeNames.indexOf('identity')
+					var roleIndex = connections.attributeNames.indexOf('role')
+					var connectionIdIndex = links.attributeNames.indexOf('connectionId');
+					var linkTypeIndex = links.attributeNames.indexOf('linkType');
 					var nameIndex = links.attributeNames.indexOf('name');
 					var linkDirIndex = links.attributeNames.indexOf('linkDir');
-					if (containerIndex < 0 || nameIndex < 0 || linkDirIndex < 0)
+
+					if (roleIndex < 0 || identityIndex < 0 || connectionIdIndex < 0
+						|| linkTypeIndex < 0 || nameIndex < 0 || linkDirIndex < 0)
 						return;
 					links.results.forEach ( function (link) {
-						if (link[containerIndex] == d.target.containerName)
+						if (link[connectionIdIndex] == root.obj[identityIndex] && link[linkTypeIndex]
== root.obj[roleIndex])
 							root.children.push (
 								{ name: "(" + link[linkDirIndex] + ") " + link[nameIndex],
 								size: 100,
@@ -1168,7 +1173,6 @@ var QDR = (function (QDR) {
 	                node.append("circle")
 	                      .attr("r", function(d) { return d.r; });
 
-//	                node.filter(function(d) { return !d.children; }).append("text")
 	                node.append("text")
 	                      .attr("dy", function (d) { return d.children ? "-10em" : ".3em"})
 	                      .style("text-anchor", "middle")


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message