diff options
| author | Robert Gemmell <robbie@apache.org> | 2009-08-09 21:06:47 +0000 |
|---|---|---|
| committer | Robert Gemmell <robbie@apache.org> | 2009-08-09 21:06:47 +0000 |
| commit | e78fb963c19eaa78108ad2c54798627bb53eca6d (patch) | |
| tree | 245e850390a03abfebe0bd0e67f1159a841cde33 /qpid/java/management/common/src/main | |
| parent | 089d51ee5466df900348ea405c17d1d09541898b (diff) | |
| download | qpid-python-e78fb963c19eaa78108ad2c54798627bb53eca6d.tar.gz | |
QPID-2015: Add 2 new methods to the VirtualHostManager to retrieve attribute names/values for every Queue in the vhost in a single call. Remove previous viewQueueNamesDepths() method. Add new ManagedQueue attribute names constants, and a test to ensure any attributes added to the Queue MBeans in future are also added to the constants.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@802601 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/management/common/src/main')
2 files changed, 46 insertions, 7 deletions
diff --git a/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java b/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java index e376033bad..dcf77ca2ed 100644 --- a/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java +++ b/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java @@ -22,12 +22,10 @@ package org.apache.qpid.management.common.mbeans; import java.io.IOException; -import java.util.Map; +import java.util.List; import javax.management.JMException; import javax.management.MBeanOperationInfo; -import javax.management.openmbean.OpenDataException; -import javax.management.openmbean.TabularData; import org.apache.qpid.management.common.mbeans.annotations.MBeanAttribute; import org.apache.qpid.management.common.mbeans.annotations.MBeanOperation; @@ -55,13 +53,23 @@ public interface ManagedBroker String[] getExchangeTypes() throws IOException; /** - * Returns a Map keyed by QueueName, detailing its associated QueueDepth in bytes. + * Returns a list containing the names of the attributes available for the Queue mbeans. * @since Qpid JMX API 1.3 * @throws IOException */ - @MBeanOperation(name = "viewQueueNamesDepths", description = "View the queue names and depths in this virtualhost", - impact = MBeanOperationInfo.INFO) - Map<String,Long> viewQueueNamesDepths() throws IOException; + @MBeanOperation(name = "retrieveQueueAttributeNames", description = "Retrieve the attribute names for queues in this virtualhost", + impact = MBeanOperationInfo.INFO) + List<String> retrieveQueueAttributeNames() throws IOException; + + /** + * Returns a List of Object Lists containing the requested attribute values (in the same sequence requested) for each queue in the virtualhost. + * If a particular attribute cant be found or raises an mbean/reflection exception whilst being gathered its value is substituted with the String "-". + * @since Qpid JMX API 1.3 + * @throws IOException + */ + @MBeanOperation(name = "retrieveQueueAttributeValues", description = "Retrieve the indicated attributes for queues in this virtualhost", + impact = MBeanOperationInfo.INFO) + List<List<Object>> retrieveQueueAttributeValues(@MBeanOperationParameter(name="attributes", description="Attributes to retrieve") String[] attributes) throws IOException; /** * Creates a new Exchange. diff --git a/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java b/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java index 9046d7fcb7..abcbaa8693 100644 --- a/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java +++ b/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java @@ -54,6 +54,37 @@ public interface ManagedQueue String[] VIEW_MSG_CONTENT_COMPOSITE_ITEM_NAMES = { "AMQ MessageId", "MimeType", "Encoding", "Content" }; String[] VIEW_MSG_CONTENT_COMPOSITE_ITEM_DESCRIPTIONS = { "AMQ MessageId", "MimeType", "Encoding", "Content" }; + //Individual attribute name constants + String ATTR_NAME = "Name"; + String ATTR_OWNER = "Owner"; + String ATTR_MAX_MSG_AGE = "MaximumMessageAge"; + String ATTR_MAX_MSG_COUNT = "MaximumMessageCount"; + String ATTR_MAX_QUEUE_DEPTH = "MaximumQueueDepth"; + String ATTR_MAX_MSG_SIZE = "MaximumMessageSize"; + String ATTR_DURABLE = "Durable"; + String ATTR_AUTODELETE = "AutoDelete"; + String ATTR_CONSUMER_COUNT = "ConsumerCount"; + String ATTR_ACTIVE_CONSUMER_COUNT = "ActiveConsumerCount"; + String ATTR_MSG_COUNT = "MessageCount"; + String ATTR_QUEUE_DEPTH = "QueueDepth"; + String ATTR_RCVD_MSG_COUNT = "ReceivedMessageCount"; + + //All attribute names constant + String[] QUEUE_ATTRIBUTES = new String[]{ + ATTR_NAME, + ATTR_OWNER, + ATTR_MAX_MSG_AGE, + ATTR_MAX_MSG_COUNT, + ATTR_MAX_QUEUE_DEPTH, + ATTR_MAX_MSG_SIZE, + ATTR_DURABLE, + ATTR_AUTODELETE, + ATTR_CONSUMER_COUNT, + ATTR_ACTIVE_CONSUMER_COUNT, + ATTR_MSG_COUNT, + ATTR_QUEUE_DEPTH, + ATTR_RCVD_MSG_COUNT + }; /** * Returns the Name of the ManagedQueue. |
