summaryrefslogtreecommitdiff
path: root/qpid/java/broker-plugins
diff options
context:
space:
mode:
authorKeith Wall <kwall@apache.org>2014-08-03 18:05:16 +0000
committerKeith Wall <kwall@apache.org>2014-08-03 18:05:16 +0000
commit20beab35b19f246a88ec79828f788e512628252c (patch)
treedf020e25320a3e974b8c01b960cd5c77f13e4327 /qpid/java/broker-plugins
parent6ff0bc6c8a2b191519b3186ab997f9eb9aa309cb (diff)
downloadqpid-python-20beab35b19f246a88ec79828f788e512628252c.tar.gz
QPID-5957: [Java Broker] Extend the Session model object to expose transaction start and update times
* Expose the same information on the Connection tab within the Web Management UI. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1615424 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-plugins')
-rw-r--r--qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSession.java28
-rw-r--r--qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java28
-rw-r--r--qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Session_1_0.java13
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Connection.js38
4 files changed, 99 insertions, 8 deletions
diff --git a/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSession.java b/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSession.java
index 187b2bf569..3fe1515b18 100644
--- a/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSession.java
+++ b/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSession.java
@@ -1020,6 +1020,34 @@ public class ServerSession extends Session
return _modelObject;
}
+ @Override
+ public long getTransactionStartTime()
+ {
+ ServerTransaction serverTransaction = _transaction;
+ if (serverTransaction.isTransactional())
+ {
+ return serverTransaction.getTransactionStartTime();
+ }
+ else
+ {
+ return 0L;
+ }
+ }
+
+ @Override
+ public long getTransactionUpdateTime()
+ {
+ ServerTransaction serverTransaction = _transaction;
+ if (serverTransaction.isTransactional())
+ {
+ return serverTransaction.getTransactionUpdateTime();
+ }
+ else
+ {
+ return 0L;
+ }
+ }
+
private void consumerAdded(Consumer<?> consumer)
{
for(ConsumerListener l : _consumerListeners)
diff --git a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
index ae6d607102..b6e1b7dd6a 100644
--- a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
+++ b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
@@ -1764,4 +1764,32 @@ public class AMQChannel<T extends AMQProtocolSession<T>>
{
return _modelObject;
}
+
+ @Override
+ public long getTransactionStartTime()
+ {
+ ServerTransaction serverTransaction = _transaction;
+ if (serverTransaction.isTransactional())
+ {
+ return serverTransaction.getTransactionStartTime();
+ }
+ else
+ {
+ return 0L;
+ }
+ }
+
+ @Override
+ public long getTransactionUpdateTime()
+ {
+ ServerTransaction serverTransaction = _transaction;
+ if (serverTransaction.isTransactional())
+ {
+ return serverTransaction.getTransactionUpdateTime();
+ }
+ else
+ {
+ return 0L;
+ }
+ }
}
diff --git a/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Session_1_0.java b/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Session_1_0.java
index b870eaf630..379dcb01f2 100644
--- a/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Session_1_0.java
+++ b/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Session_1_0.java
@@ -95,7 +95,6 @@ public class Session_1_0 implements SessionEventListener, AMQSessionModel<Sessio
private static final Logger _logger = Logger.getLogger(Session_1_0.class);
private static final Symbol LIFETIME_POLICY = Symbol.valueOf("lifetime-policy");
private final SessionEndpoint _endpoint;
- private VirtualHostImpl _vhost;
private AutoCommitTransaction _transaction;
private final LinkedHashMap<Integer, ServerTransaction> _openTransactions =
@@ -866,6 +865,18 @@ public class Session_1_0 implements SessionEventListener, AMQSessionModel<Sessio
return _modelObject;
}
+ @Override
+ public long getTransactionStartTime()
+ {
+ return 0L;
+ }
+
+ @Override
+ public long getTransactionUpdateTime()
+ {
+ return 0L;
+ }
+
private void consumerAdded(Consumer<?> consumer)
{
for(ConsumerListener l : _consumerListeners)
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Connection.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Connection.js
index e2c73a5d41..8836f6a40c 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Connection.js
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Connection.js
@@ -27,9 +27,10 @@ define(["dojo/_base/xhr",
"qpid/common/util",
"qpid/common/formatter",
"qpid/common/UpdatableStore",
+ "qpid/management/UserPreferences",
"dojox/html/entities",
"dojo/domReady!"],
- function (xhr, parser, query, connect, properties, updater, util, formatter, UpdatableStore, entities) {
+ function (xhr, parser, query, connect, properties, updater, util, formatter, UpdatableStore, UserPreferences, entities) {
function Connection(name, parent, controller) {
this.name = name;
@@ -105,12 +106,35 @@ define(["dojo/_base/xhr",
that.updateHeader();
that.sessionsGrid = new UpdatableStore(that.connectionData.sessions, findNode("sessions"),
- [ { name: "Name", field: "name", width: "70px"},
- { name: "Mode", field: "distributionMode", width: "70px"},
- { name: "Msgs Rate", field: "msgRate",
- width: "150px"},
- { name: "Bytes Rate", field: "bytesRate",
- width: "100%"}
+ [ { name: "Name", field: "name", width: "70px"},
+ { name: "Consumers", field: "consumerCount", width: "90px"},
+ { name: "Unacknowledged messages", field: "unacknowledgedMessages", width: "110px"},
+ { name: "Current store transaction start", field: "transactionStartTime", width: "200px",
+ formatter: function (transactionStartTime)
+ {
+ if (transactionStartTime > 0)
+ {
+ return UserPreferences.formatDateTime(transactionStartTime, {selector: "time", addOffset: true, appendTimeZone: true});
+ }
+ else
+ {
+ return "N/A";
+ }
+ }
+ },
+ { name: "Current store transaction update", field: "transactionUpdateTime", width: "100%",
+ formatter: function (transactionUpdateTime)
+ {
+ if (transactionUpdateTime > 0)
+ {
+ return UserPreferences.formatDateTime(transactionUpdateTime, {selector: "time", addOffset: true, appendTimeZone: true});
+ }
+ else
+ {
+ return "N/A";
+ }
+ }
+ }
]);