ARTEMIS-1540 Missing management annotations

Some of the management operations are not properly annotated.
Also need to add an Operation to list divert names.


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/2f299334
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/2f299334
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/2f299334

Branch: refs/heads/master
Commit: 2f299334465d6acace1d856079f2f294d8a54914
Parents: de355e9
Author: Howard Gao <[email protected]>
Authored: Wed Dec 6 13:00:42 2017 +0800
Committer: Michael Pearce <[email protected]>
Committed: Fri Dec 8 01:18:29 2017 +0000

----------------------------------------------------------------------
 .../org/apache/activemq/artemis/api/core/Message.java   |  4 +++-
 .../api/core/management/ActiveMQServerControl.java      | 12 ++++++++++++
 .../artemis/api/core/management/QueueControl.java       |  1 +
 3 files changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2f299334/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java
----------------------------------------------------------------------
diff --git 
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java
 
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java
index 61d887e..d7666b5 100644
--- 
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java
+++ 
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java
@@ -631,7 +631,9 @@ public interface Message {
    default Map<String, Object> toPropertyMap() {
       Map map = new HashMap<>();
       for (SimpleString name : getPropertyNames()) {
-         map.put(name.toString(), getObjectProperty(name.toString()));
+         //some property is SimpleString, which is not available for 
management console
+         Object value = getObjectProperty(name.toString());
+         map.put(name.toString(), value == null ? null : value.toString());
       }
       return map;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2f299334/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
----------------------------------------------------------------------
diff --git 
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
 
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
index b5150c9..7c9a40a 100644
--- 
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
+++ 
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
@@ -591,6 +591,7 @@ public interface ActiveMQServerControl {
     * @return a textual summary of the queue
     * @throws Exception
     */
+   @Operation(desc = "Create a queue", impact = MBeanOperationInfo.ACTION)
    String createQueue(@Parameter(name = "address", desc = "Address of the 
queue") String address,
                     @Parameter(name = "routingType", desc = "The routing type 
used for this address, MULTICAST or ANYCAST") String routingType,
                     @Parameter(name = "name", desc = "Name of the queue") 
String name,
@@ -811,6 +812,7 @@ public interface ActiveMQServerControl {
    @Operation(desc = "List all the connection IDs", impact = 
MBeanOperationInfo.INFO)
    String[] listConnectionIDs() throws Exception;
 
+   @Operation(desc = "List all producers", impact = MBeanOperationInfo.INFO)
    String listProducersInfoAsJSON() throws Exception;
 
    /**
@@ -1000,6 +1002,7 @@ public interface ActiveMQServerControl {
                            @Parameter(desc = "allow topics to be created 
automatically", name = "autoCreateAddresses") boolean autoCreateAddresses,
                            @Parameter(desc = "allow auto-created topics to be 
deleted automatically", name = "autoDeleteAddresses") boolean 
autoDeleteAddresses) throws Exception;
 
+   @Operation(desc = "Remove address settings", impact = 
MBeanOperationInfo.ACTION)
    void removeAddressSettings(@Parameter(desc = "an address match", name = 
"addressMatch") String addressMatch) throws Exception;
 
    /**
@@ -1011,6 +1014,15 @@ public interface ActiveMQServerControl {
    @Attribute(desc = "names of the diverts deployed on this server")
    String[] getDivertNames();
 
+   /**
+    * Jon plugin doesn't recognize an Operation whose name is in
+    * form getXXXX(), so add this one.
+    */
+   @Operation(desc = "names of the diverts deployed on this server", impact = 
MBeanOperationInfo.INFO)
+   default String[] listDivertNames() {
+      return getDivertNames();
+   }
+
    @Operation(desc = "Create a Divert", impact = MBeanOperationInfo.ACTION)
    void createDivert(@Parameter(name = "name", desc = "Name of the divert") 
String name,
                      @Parameter(name = "routingName", desc = "Routing name of 
the divert") String routingName,

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2f299334/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/QueueControl.java
----------------------------------------------------------------------
diff --git 
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/QueueControl.java
 
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/QueueControl.java
index 770d12c..2ef8743 100644
--- 
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/QueueControl.java
+++ 
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/QueueControl.java
@@ -493,6 +493,7 @@ public interface QueueControl {
     * any other measure.
     * It is useful if you need the exact number of counts on a message
     */
+   @Operation(desc = "Flush internal executors", impact = 
MBeanOperationInfo.ACTION)
    void flushExecutor();
 
 }

Reply via email to