summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java18
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java17
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/protocol/ManagedConnection.java9
3 files changed, 40 insertions, 4 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java
index 1c741ead1e..fd8fb2d5cb 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java
@@ -74,6 +74,8 @@ public class AMQMinaProtocolSession implements AMQProtocolSession,
private AMQShortString _contextKey;
+ private AMQShortString _clientVersion = null;
+
private VirtualHost _virtualHost;
private final Map<Integer, AMQChannel> _channelMap = new HashMap<Integer, AMQChannel>();
@@ -667,9 +669,16 @@ public class AMQMinaProtocolSession implements AMQProtocolSession,
public void setClientProperties(FieldTable clientProperties)
{
_clientProperties = clientProperties;
- if ((_clientProperties != null) && (_clientProperties.getString(CLIENT_PROPERTIES_INSTANCE) != null))
+ if (_clientProperties != null)
{
- setContextKey(new AMQShortString(_clientProperties.getString(CLIENT_PROPERTIES_INSTANCE)));
+ if (_clientProperties.getString(CLIENT_PROPERTIES_INSTANCE) != null)
+ {
+ setContextKey(new AMQShortString(_clientProperties.getString(CLIENT_PROPERTIES_INSTANCE)));
+ }
+ if (_clientProperties.getString(ClientProperties.version.toString()) != null)
+ {
+ _clientVersion = new AMQShortString(_clientProperties.getString(ClientProperties.version.toString()));
+ }
}
}
@@ -745,5 +754,8 @@ public class AMQMinaProtocolSession implements AMQProtocolSession,
{
return _authorizedID;
}
-
+ public String getClientVersion()
+ {
+ return _clientVersion == null ? null : _clientVersion.toString();
+ }
}
diff --git a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java
index d2a20cdf57..5eebd4c524 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java
@@ -56,6 +56,7 @@ public class AMQProtocolSessionMBean extends AMQManagedObject implements Managed
{
private AMQMinaProtocolSession _session = null;
private String _name = null;
+
//openmbean data types for representing the channel attributes
private final static String[] _channelAtttibuteNames = {"Channel Id", "Transactional", "Default Queue", "Unacknowledged Message Count"};
private final static String[] _indexNames = {_channelAtttibuteNames[0]};
@@ -95,12 +96,26 @@ public class AMQProtocolSessionMBean extends AMQManagedObject implements Managed
*/
private static void init() throws OpenDataException
{
-
_channelType = new CompositeType("Channel", "Channel Details", _channelAtttibuteNames,
_channelAtttibuteNames, _channelAttributeTypes);
_channelsType = new TabularType("Channels", "Channels", _channelType, _indexNames);
}
+ public String getClientId()
+ {
+ return _session.getContextKey() == null ? null : _session.getContextKey().toString();
+ }
+
+ public String getAuthorizedId()
+ {
+ return _session.getAuthorizedID();
+ }
+
+ public String getVersion()
+ {
+ return _session.getClientVersion() == null ? null : _session.getClientVersion().toString();
+ }
+
public Date getLastIoTime()
{
return new Date(_session.getIOSession().getLastIoTime());
diff --git a/java/broker/src/main/java/org/apache/qpid/server/protocol/ManagedConnection.java b/java/broker/src/main/java/org/apache/qpid/server/protocol/ManagedConnection.java
index f9a0c4d18f..990c4c0794 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/protocol/ManagedConnection.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/protocol/ManagedConnection.java
@@ -41,6 +41,15 @@ public interface ManagedConnection
{
static final String TYPE = "Connection";
+ @MBeanAttribute(name = "ClientId", description = "Client Id")
+ String getClientId();
+
+ @MBeanAttribute(name = "AuthorizedId", description = "User Name")
+ String getAuthorizedId();
+
+ @MBeanAttribute(name = "Version", description = "Client Version")
+ String getVersion();
+
/**
* Tells the remote address of this connection.
* @return remote address