From 4367ec40a6561eb6d9a93c778d3141db5d8959bb Mon Sep 17 00:00:00 2001 From: Justin Bertram Date: Tue, 26 Oct 2021 12:35:16 -0500 Subject: [PATCH] ARTEMIS-649 deprecate the HTML based JMX reports The HTML output methods are hold-overs from way back when the code-base started off as JBoss Messaging 2 and the broker mainly ran in JBoss AS 4 and 5 which leveraged an HTML-based JMX console where these methods would be executed and spit out nicely formatted data. That stuff has all long since been retired so this commit deprecates the HTML-based management methods so they can be removed completely in a future release. JSON is a better structured output format for this and most of the deprecated methods have JSON alternatives. --- .../artemis/api/core/management/ActiveMQServerControl.java | 1 + .../activemq/artemis/api/core/management/QueueControl.java | 1 + .../apache/activemq/artemis/jms/server/JMSServerManager.java | 1 + .../activemq/artemis/jms/server/impl/JMSServerManagerImpl.java | 1 + .../artemis/core/management/impl/ActiveMQServerControlImpl.java | 2 ++ .../activemq/artemis/core/management/impl/QueueControlImpl.java | 2 ++ .../artemis/core/messagecounter/impl/MessageCounterHelper.java | 2 ++ 7 files changed, 10 insertions(+) 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 0e0f0808f4..59b142c23c 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 @@ -1139,6 +1139,7 @@ public interface ActiveMQServerControl { * List all the prepared transaction, sorted by date, * oldest first, with details, in HTML format */ + @Deprecated @Operation(desc = "List all the prepared transaction, sorted by date, oldest first, with details, in HTML format") String listPreparedTransactionDetailsAsHTML() throws Exception; 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 cbca467d3b..a3b132637e 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 @@ -632,6 +632,7 @@ public interface QueueControl { /** * Lists the message counter history for this queue as a HTML table. */ + @Deprecated @Operation(desc = "List the message counters history HTML", impact = MBeanOperationInfo.INFO) String listMessageCounterHistoryAsHTML() throws Exception; diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/JMSServerManager.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/JMSServerManager.java index 163b418ac1..c89c392d28 100644 --- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/JMSServerManager.java +++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/JMSServerManager.java @@ -337,6 +337,7 @@ public interface JMSServerManager extends ActiveMQComponent { String listPreparedTransactionDetailsAsJSON() throws Exception; + @Deprecated String listPreparedTransactionDetailsAsHTML() throws Exception; ActiveMQServer getActiveMQServer(); diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java index 6284dec136..160817824f 100644 --- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java +++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java @@ -1324,6 +1324,7 @@ public class JMSServerManagerImpl extends CleaningActivateCallback implements JM return server.getActiveMQServerControl().listPreparedTransactionDetailsAsJSON((xid, tx, creation) -> new JMSTransactionDetail(xid, tx, creation)); } + @Deprecated @Override public String listPreparedTransactionDetailsAsHTML() throws Exception { return server.getActiveMQServerControl().listPreparedTransactionDetailsAsHTML((xid, tx, creation) -> new JMSTransactionDetail(xid, tx, creation)); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java index dbc721675a..70f8a2d49e 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java @@ -1985,11 +1985,13 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active } } + @Deprecated @Override public String listPreparedTransactionDetailsAsHTML() throws Exception { return listPreparedTransactionDetailsAsHTML((xid, tx, creation) -> new CoreTransactionDetail(xid, tx, creation)); } + @Deprecated public String listPreparedTransactionDetailsAsHTML(TransactionDetailFactory factory) throws Exception { if (AuditLogger.isBaseLoggingEnabled()) { AuditLogger.listPreparedTransactionDetailsAsHTML(this.server, factory); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java index 62008af104..fe19ff76f0 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java @@ -1416,6 +1416,7 @@ public class QueueControlImpl extends AbstractControl implements QueueControl { } } + @Deprecated @Override public String listMessageCounterAsHTML() { if (AuditLogger.isBaseLoggingEnabled()) { @@ -1446,6 +1447,7 @@ public class QueueControlImpl extends AbstractControl implements QueueControl { } } + @Deprecated @Override public String listMessageCounterHistoryAsHTML() { if (AuditLogger.isBaseLoggingEnabled()) { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/impl/MessageCounterHelper.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/impl/MessageCounterHelper.java index 22103f5634..9a5cd6172f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/impl/MessageCounterHelper.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/impl/MessageCounterHelper.java @@ -44,6 +44,7 @@ public class MessageCounterHelper { return DayCounterInfo.toJSON(infos); } + @Deprecated public static String listMessageCounterAsHTML(final MessageCounter[] counters) { if (counters == null) { return null; @@ -84,6 +85,7 @@ public class MessageCounterHelper { return ret.toString(); } + @Deprecated public static String listMessageCounterHistoryAsHTML(final MessageCounter[] counters) { if (counters == null) { return null;