From 0ce173dcb50476c87397caacb98d238070873599 Mon Sep 17 00:00:00 2001 From: Andy Taylor Date: Mon, 17 Feb 2020 10:20:19 +0000 Subject: [PATCH] ARTEMIS-2838 - migrate to HawtIO 2 https://issues.apache.org/jira/browse/ARTEMIS-2838 --- .../activemq/artemis/cli/commands/Run.java | 30 +- .../artemis/cli/factory/BrokerFactory.java | 5 +- .../artemis/cli/factory/BrokerHandler.java | 3 +- .../cli/factory/FileBrokerHandler.java | 5 +- .../artemis/integration/FileBroker.java | 7 +- .../activemq/cli/test/FileBrokerTest.java | 8 +- .../management/ActiveMQServerControl.java | 3 + .../core/management/ObjectNameBuilder.java | 4 + .../api/core/management/QueueControl.java | 5 + .../api/core/management/ResourceNames.java | 2 + artemis-hawtio/activemq-branding/pom.xml | 13 + .../src/main/webapp/plugin/css/activemq.css | 378 ++++---- .../src/main/webapp/plugin/doc/welcome.md | 0 .../src/main/webapp/plugin/img/activemq.png | Bin 25694 -> 22865 bytes .../main/webapp/plugin/js/brandingPlugin.js | 93 ++ .../src/main/webapp/plugin/js/plugin.js | 97 -- artemis-hawtio/artemis-console/pom.xml | 60 +- .../src/main/webapp/app/core/doc/about.md | 53 -- .../src/main/webapp/app/jvm/html/connect.html | 104 --- .../src/main/webapp/hawtconfig.json | 26 + .../src/main/webapp/img/img_avatar.svg | 49 + artemis-hawtio/artemis-plugin/pom.xml | 4 + .../artemis-plugin/src/main/webapp/index.html | 27 + .../main/webapp/plugin/html/addresses.html | 54 -- .../webapp/plugin/html/artemisLayout.html | 42 - .../webapp/plugin/html/brokerDiagram.html | 313 ------- .../main/webapp/plugin/html/browseQueue.html | 156 ---- .../main/webapp/plugin/html/connections.html | 72 -- .../main/webapp/plugin/html/consumers.html | 75 -- .../webapp/plugin/html/createAddress.html | 44 - .../main/webapp/plugin/html/createQueue.html | 77 -- .../webapp/plugin/html/deleteAddress.html | 48 - .../main/webapp/plugin/html/deleteQueue.html | 65 -- .../main/webapp/plugin/html/preferences.html | 87 +- .../main/webapp/plugin/html/producers.html | 54 -- .../src/main/webapp/plugin/html/queues.html | 54 -- .../main/webapp/plugin/html/sendMessage.html | 135 --- .../src/main/webapp/plugin/html/sessions.html | 74 -- .../webapp/plugin/html/tree/content.html} | 22 +- .../main/webapp/plugin/html/tree/header.html | 41 + .../src/main/webapp/plugin/js/address.js | 120 --- .../src/main/webapp/plugin/js/addresses.js | 234 ----- .../main/webapp/plugin/js/artemisHelpers.js | 150 +--- .../main/webapp/plugin/js/artemisPlugin.js | 386 +------- .../main/webapp/plugin/js/artemisService.js | 44 - .../main/webapp/plugin/js/brokerDiagram.js | 687 -------------- .../src/main/webapp/plugin/js/browse.js | 593 ------------ .../webapp/plugin/js/components/addresses.js | 217 +++++ .../webapp/plugin/js/components/browse.js | 849 ++++++++++++++++++ .../plugin/js/components/connections.js | 229 +++++ .../webapp/plugin/js/components/consumers.js | 248 +++++ .../plugin/js/components/createAddress.js | 139 +++ .../plugin/js/components/createQueue.js | 206 +++++ .../plugin/js/components/deleteAddress.js | 126 +++ .../plugin/js/components/deleteQueue.js | 172 ++++ .../webapp/plugin/js/components/diagram.js | 434 +++++++++ .../main/webapp/plugin/js/components/help.js | 51 ++ .../webapp/plugin/js/components/navigation.js | 238 +++++ .../plugin/js/components/preferences.js | 113 +++ .../webapp/plugin/js/components/producers.js | 194 ++++ .../webapp/plugin/js/components/queues.js | 255 ++++++ .../plugin/js/components/sendMessage.js | 246 +++++ .../webapp/plugin/js/components/sessions.js | 251 ++++++ .../webapp/plugin/js/components/status.js | 160 ++++ .../main/webapp/plugin/js/components/tree.js | 191 ++++ .../src/main/webapp/plugin/js/connections.js | 265 ------ .../src/main/webapp/plugin/js/consumers.js | 294 ------ .../main/webapp/plugin/js/jmsHeaderSchema.js | 62 -- .../src/main/webapp/plugin/js/preferences.js | 54 -- .../src/main/webapp/plugin/js/producers.js | 254 ------ .../src/main/webapp/plugin/js/queue.js | 152 ---- .../src/main/webapp/plugin/js/queues.js | 345 ------- .../src/main/webapp/plugin/js/send.js | 210 ----- .../webapp/plugin/js/services/pagination.js | 97 ++ .../webapp/plugin/js/services/resource.js} | 49 +- .../main/webapp/plugin/js/services/toolbar.js | 116 +++ .../src/main/webapp/plugin/js/sessions.js | 284 ------ .../src/main/webapp/plugin/js/tree.js | 76 -- .../main/webapp/plugin/lib/artemis-console.js | 92 -- artemis-hawtio/pom.xml | 2 +- .../artemis/jms/client/ActiveMQMessage.java | 2 +- .../config/impl/FileJMSConfiguration.java | 3 +- .../activemq/artemis/osgi/OsgiBroker.java | 2 +- .../core/config/FileDeploymentManager.java | 5 +- .../core/config/HAPolicyConfiguration.java | 22 +- .../core/config/impl/FileConfiguration.java | 9 +- .../config/impl/LegacyJMSConfiguration.java | 3 +- .../artemis/core/deployers/Deployable.java | 3 +- .../impl/ActiveMQServerControlImpl.java | 7 +- .../management/impl/QueueControlImpl.java | 6 +- .../core/server/ActiveMQServerLogger.java | 10 + .../management/ArtemisMBeanServerGuard.java | 35 +- .../management/HawtioSecurityControl.java | 39 + .../server/management/ManagementContext.java | 20 +- .../server/management/ManagementService.java | 4 + .../impl/HawtioSecurityControlImpl.java | 155 ++++ .../impl/ManagementServiceImpl.java | 17 + .../impl/FileConfigurationParserTest.java | 2 +- .../group/impl/ClusteredResetMockTest.java | 11 + pom.xml | 3 +- .../ActiveMQServerControlUsingCoreTest.java | 10 + .../management/QueueControlUsingCoreTest.java | 9 + 102 files changed, 5561 insertions(+), 6090 deletions(-) delete mode 100644 artemis-hawtio/activemq-branding/src/main/webapp/plugin/doc/welcome.md create mode 100644 artemis-hawtio/activemq-branding/src/main/webapp/plugin/js/brandingPlugin.js delete mode 100644 artemis-hawtio/activemq-branding/src/main/webapp/plugin/js/plugin.js delete mode 100644 artemis-hawtio/artemis-console/src/main/webapp/app/core/doc/about.md delete mode 100644 artemis-hawtio/artemis-console/src/main/webapp/app/jvm/html/connect.html create mode 100644 artemis-hawtio/artemis-console/src/main/webapp/hawtconfig.json create mode 100644 artemis-hawtio/artemis-console/src/main/webapp/img/img_avatar.svg create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/index.html delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/addresses.html delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/artemisLayout.html delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/brokerDiagram.html delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/browseQueue.html delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/connections.html delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/consumers.html delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/createAddress.html delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/createQueue.html delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/deleteAddress.html delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/deleteQueue.html delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/producers.html delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/queues.html delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/sendMessage.html delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/sessions.html rename artemis-hawtio/{artemis-console/src/main/webapp/app/core/html/help.html => artemis-plugin/src/main/webapp/plugin/html/tree/content.html} (62%) create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/tree/header.html delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/address.js delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/addresses.js delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/artemisService.js delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/brokerDiagram.js delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/browse.js create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/addresses.js create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/browse.js create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/connections.js create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/consumers.js create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/createAddress.js create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/createQueue.js create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/deleteAddress.js create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/deleteQueue.js create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/diagram.js create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/help.js create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/navigation.js create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/preferences.js create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/producers.js create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/queues.js create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/sendMessage.js create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/sessions.js create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/status.js create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/tree.js delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/connections.js delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/consumers.js delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/jmsHeaderSchema.js delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/preferences.js delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/producers.js delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/queue.js delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/queues.js delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/send.js create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/services/pagination.js rename artemis-hawtio/{activemq-branding/src/main/webapp/plugin/css/branding.css => artemis-plugin/src/main/webapp/plugin/js/services/resource.js} (53%) create mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/services/toolbar.js delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/sessions.js delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/tree.js delete mode 100644 artemis-hawtio/artemis-plugin/src/main/webapp/plugin/lib/artemis-console.js create mode 100644 artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/HawtioSecurityControl.java create mode 100644 artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/HawtioSecurityControlImpl.java diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java index 366f0c0f9d..552f7ef3a0 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java @@ -30,6 +30,8 @@ import org.apache.activemq.artemis.cli.factory.BrokerFactory; import org.apache.activemq.artemis.cli.factory.jmx.ManagementFactory; import org.apache.activemq.artemis.cli.factory.security.SecurityManagerFactory; import org.apache.activemq.artemis.components.ExternalComponent; +import org.apache.activemq.artemis.core.server.ActivateCallback; +import org.apache.activemq.artemis.core.server.ActiveMQServerLogger; import org.apache.activemq.artemis.core.server.management.ManagementContext; import org.apache.activemq.artemis.dto.BrokerDTO; import org.apache.activemq.artemis.dto.ComponentDTO; @@ -81,7 +83,33 @@ public class Run extends LockAbstract { ActiveMQSecurityManager security = SecurityManagerFactory.create(broker.security); - server = BrokerFactory.createServer(broker.server, security); + ActivateCallback activateCallback = new ActivateCallback() { + @Override + public void preActivate() { + try { + managementContext.start(); + } catch (Exception e) { + ActiveMQServerLogger.LOGGER.unableStartManagementContext(e); + return; + } + try { + server.getServer().getManagementService().registerHawtioSecurity(managementContext.getArtemisMBeanServerGuard()); + } catch (Exception e) { + ActiveMQServerLogger.LOGGER.unableToDeployHawtioMBean(e); + } + } + + @Override + public void deActivate() { + try { + server.getServer().getManagementService().unregisterHawtioSecurity(); + } catch (Exception e) { + //ok to ignore + } + } + }; + + server = BrokerFactory.createServer(broker.server, security, activateCallback); managementContext.start(); server.createComponents(); diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/factory/BrokerFactory.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/factory/BrokerFactory.java index dc9b9e14b3..5a1a28c48c 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/factory/BrokerFactory.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/factory/BrokerFactory.java @@ -20,6 +20,7 @@ import java.io.IOException; import java.net.URI; import org.apache.activemq.artemis.cli.ConfigurationException; +import org.apache.activemq.artemis.core.server.ActivateCallback; import org.apache.activemq.artemis.dto.BrokerDTO; import org.apache.activemq.artemis.dto.ServerDTO; import org.apache.activemq.artemis.integration.Broker; @@ -53,7 +54,7 @@ public class BrokerFactory { return createBrokerConfiguration(new URI(configuration), artemisHome, artemisInstance, artemisURIInstance); } - public static Broker createServer(ServerDTO brokerDTO, ActiveMQSecurityManager security) throws Exception { + public static Broker createServer(ServerDTO brokerDTO, ActiveMQSecurityManager security, ActivateCallback activateCallback) throws Exception { if (brokerDTO.configuration != null) { BrokerHandler handler; URI configURI = brokerDTO.getConfigurationURI(); @@ -65,7 +66,7 @@ public class BrokerFactory { throw new ConfigurationException("Invalid configuration URI, can't find configuration scheme: " + configURI.getScheme()); } - return handler.createServer(brokerDTO, security); + return handler.createServer(brokerDTO, security, activateCallback); } return null; } diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/factory/BrokerHandler.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/factory/BrokerHandler.java index df874a77de..513206c1ea 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/factory/BrokerHandler.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/factory/BrokerHandler.java @@ -16,11 +16,12 @@ */ package org.apache.activemq.artemis.cli.factory; +import org.apache.activemq.artemis.core.server.ActivateCallback; import org.apache.activemq.artemis.dto.ServerDTO; import org.apache.activemq.artemis.integration.Broker; import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager; public interface BrokerHandler { - Broker createServer(ServerDTO brokerDTO, ActiveMQSecurityManager security); + Broker createServer(ServerDTO brokerDTO, ActiveMQSecurityManager security, ActivateCallback activateCallback); } diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/factory/FileBrokerHandler.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/factory/FileBrokerHandler.java index 74d1eb77ba..2b5faecd75 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/factory/FileBrokerHandler.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/factory/FileBrokerHandler.java @@ -16,6 +16,7 @@ */ package org.apache.activemq.artemis.cli.factory; +import org.apache.activemq.artemis.core.server.ActivateCallback; import org.apache.activemq.artemis.dto.ServerDTO; import org.apache.activemq.artemis.integration.Broker; import org.apache.activemq.artemis.integration.FileBroker; @@ -24,7 +25,7 @@ import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager; public class FileBrokerHandler implements BrokerHandler { @Override - public Broker createServer(ServerDTO brokerDTO, ActiveMQSecurityManager security) { - return new FileBroker(brokerDTO, security); + public Broker createServer(ServerDTO brokerDTO, ActiveMQSecurityManager security, ActivateCallback activateCallback) { + return new FileBroker(brokerDTO, security, activateCallback); } } diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/integration/FileBroker.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/integration/FileBroker.java index 9d66778f12..6d911ddd65 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/integration/FileBroker.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/integration/FileBroker.java @@ -23,6 +23,7 @@ import java.util.Map; import org.apache.activemq.artemis.core.config.FileDeploymentManager; import org.apache.activemq.artemis.core.config.impl.FileConfiguration; import org.apache.activemq.artemis.core.config.impl.LegacyJMSConfiguration; +import org.apache.activemq.artemis.core.server.ActivateCallback; import org.apache.activemq.artemis.core.server.ActiveMQComponent; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ServiceComponent; @@ -33,6 +34,7 @@ import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager; public class FileBroker implements Broker { private final String configurationUrl; + private ActivateCallback activateCallback; private boolean started; @@ -40,9 +42,10 @@ public class FileBroker implements Broker { private Map components; - public FileBroker(ServerDTO broker, ActiveMQSecurityManager security) { + public FileBroker(ServerDTO broker, ActiveMQSecurityManager security, ActivateCallback activateCallback) { this.securityManager = security; this.configurationUrl = broker.configuration; + this.activateCallback = activateCallback; } @Override @@ -116,7 +119,7 @@ public class FileBroker implements Broker { createDirectories(configuration); - components = fileDeploymentManager.buildService(securityManager, ManagementFactory.getPlatformMBeanServer()); + components = fileDeploymentManager.buildService(securityManager, ManagementFactory.getPlatformMBeanServer(), activateCallback); } /* diff --git a/artemis-cli/src/test/java/org/apache/activemq/cli/test/FileBrokerTest.java b/artemis-cli/src/test/java/org/apache/activemq/cli/test/FileBrokerTest.java index e1a28793bb..59d1e89b00 100644 --- a/artemis-cli/src/test/java/org/apache/activemq/cli/test/FileBrokerTest.java +++ b/artemis-cli/src/test/java/org/apache/activemq/cli/test/FileBrokerTest.java @@ -50,7 +50,7 @@ public class FileBrokerTest { serverDTO.configuration = "broker-nojms.xml"; FileBroker broker = null; try { - broker = new FileBroker(serverDTO, new ActiveMQJAASSecurityManager()); + broker = new FileBroker(serverDTO, new ActiveMQJAASSecurityManager(), null); broker.start(); JMSServerManagerImpl jmsServerManager = (JMSServerManagerImpl) broker.getComponents().get("jms"); Assert.assertNull(jmsServerManager); @@ -70,8 +70,8 @@ public class FileBrokerTest { ServerDTO serverDTO2 = new ServerDTO(); serverDTO1.configuration = "FileBrokerTest-broker1.xml"; serverDTO2.configuration = "FileBrokerTest-broker2.xml"; - FileBroker broker1 = new FileBroker(serverDTO1, new ActiveMQJAASSecurityManager()); - FileBroker broker2 = new FileBroker(serverDTO2, new ActiveMQJAASSecurityManager()); + FileBroker broker1 = new FileBroker(serverDTO1, new ActiveMQJAASSecurityManager(), null); + FileBroker broker2 = new FileBroker(serverDTO2, new ActiveMQJAASSecurityManager(), null); try { broker1.start(); Assert.assertTrue(broker1.isStarted()); @@ -115,7 +115,7 @@ public class FileBrokerTest { securityConfiguration.addUser("myUser", "myPass"); securityConfiguration.addRole("myUser", "guest"); ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager(InVMLoginModule.class.getName(), securityConfiguration); - broker = new FileBroker(serverDTO, securityManager); + broker = new FileBroker(serverDTO, securityManager, null); broker.start(); ActiveMQServerImpl activeMQServer = (ActiveMQServerImpl) broker.getComponents().get("core"); Assert.assertNotNull(activeMQServer); 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 ea739cd38e..ae8e2668cc 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 @@ -460,6 +460,9 @@ public interface ActiveMQServerControl { @Attribute(desc = ADDRESS_MEMORY_USAGE_PERCENTAGE_DESCRIPTION) int getAddressMemoryUsagePercentage(); + @Attribute(desc = "Returns the HA Policy of this broker as a String") + String getHAPolicy(); + /** * Returns the runtime size of the authentication cache */ diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java index dbebec218d..5fe0d73590 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java @@ -160,4 +160,8 @@ public final class ObjectNameBuilder { return ""; } } + + public ObjectName getManagementContextObjectName() throws Exception { + return ObjectName.getInstance(String.format("hawtio:type=security,area=jmx,name=ArtemisJMXSecurity")); + } } 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 4b09a5f11f..b6ba1e1865 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 @@ -627,6 +627,11 @@ public interface QueueControl { CompositeData[] browse(@Parameter(name = "page", desc = "Current page") int page, @Parameter(name = "pageSize", desc = "Page size") int pageSize) throws Exception; + @Operation(desc = "Browse Messages", impact = MBeanOperationInfo.ACTION) + CompositeData[] browse(@Parameter(name = "page", desc = "Current page") int page, + @Parameter(name = "pageSize", desc = "Page size") int pageSize, + @Parameter(name = "filter", desc = "filter") String filter) throws Exception; + /** * Resets the MessagesAdded property */ diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ResourceNames.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ResourceNames.java index 410ee9364e..7aaa54d517 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ResourceNames.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ResourceNames.java @@ -28,6 +28,8 @@ import org.apache.activemq.artemis.api.core.SimpleString; public final class ResourceNames { public static final String BROKER = "broker"; + public static final String MANAGEMENT_SECURITY = "managementsecurity"; + public static final String QUEUE = "queue."; public static final String ADDRESS = "address."; diff --git a/artemis-hawtio/activemq-branding/pom.xml b/artemis-hawtio/activemq-branding/pom.xml index 48583a423f..b4184b4785 100644 --- a/artemis-hawtio/activemq-branding/pom.xml +++ b/artemis-hawtio/activemq-branding/pom.xml @@ -153,6 +153,9 @@ Files: ${plugin-scripts} + com.google.guava guava @@ -97,7 +97,7 @@ true src/main/webapp - **/*.md + **/*.svg @@ -105,54 +105,12 @@ io.hawt - hawtio-web + hawtio-war - bower_components/bootstrap/docs/build/**/* - bower_components/bootstrap/docs/examples/**/* - bower_components/bootstrap/docs/templates/**/* - bower_components/bootstrap/docs/assets/img/examples/**/* - bower_components/bootstrap/docs/assets/img/example-sites/**/* - bower_components/bootstrap/js/tests/**/* - bower_components/bootstrap/docs/**/*.html - bower_components/Font-Awesome/src/**/* - bower_components/d3/src/**/* - bower_components/d3/test/**/* - bower_components/elastic.js/src/**/* - bower_components/elastic.js/tests/**/* - bower_components/elastic.js/examples/**/* - bower_components/jquery/src/**/* - bower_components/jquery/test/**/* - bower_components/js-logger/src/**/* - WEB-INF/lib/guava*.jar - WEB-INF/lib/slf4j-api*.jar - lib/camelModel.js - app/activemq/**/* - app/api/**/* - app/apm/**/* - app/camel/**/* - app/camin/**/* - app/datatable/**/* - app/dozer/**/* - app/elasticsearch/**/* - app/fabric/**/* - app/fabric-deploy/**/* - app/fabric-requirements/**/* - app/forcegraph/**/* - app/git/**/* - app/health/**/* - app/ide/**/* - app/infinispan/**/* - app/jboss/**/* - app/jclouds/**/* - app/junit/**/* - app/maven/**/* - app/openejb/**/* - app/quartz/**/* - app/site/**/* - app/springbatch/**/* - app/springBoot/**/* - app/tomcat/**/* - app/wiki-drop/**/* + hawtconfig.json + img/icons/**/* + img/**/* + fonts/glyphicons** diff --git a/artemis-hawtio/artemis-console/src/main/webapp/app/core/doc/about.md b/artemis-hawtio/artemis-console/src/main/webapp/app/core/doc/about.md deleted file mode 100644 index 8d36813d87..0000000000 --- a/artemis-hawtio/artemis-console/src/main/webapp/app/core/doc/about.md +++ /dev/null @@ -1,53 +0,0 @@ -

About Apache ActiveMQ Artemis

- -
-
-

Apache ActiveMQ Artemis is an open source project to build a multi-protocol, embeddable, very high performance, clustered, asynchronous messaging system.

-

Apache ActiveMQ Artemis has a proven non blocking architecture. It delivers outstanding performance.

-

A full guide on features and usage can be found in the User Manual

-

{{branding.appName}} is powered by hawtio

-

Features

-
    -
  • AMQP protocol support
  • -
  • OpenWire support for ActiveMQ 5 clients
  • -
  • MQTT support
  • -
  • STOMP protocol support
  • -
  • HornetQ Core protocol support for HornetQ 2.4,2.5 clients
  • -
  • JMS 2.0 and 1.1 support
  • -
  • High availability with shared store and non shared store (replication)
  • -
  • Flexible Clustering
  • -
  • High performance journal for message persistence
  • -
  • Queue memory limitation
  • -
  • SSL support
  • -
  • Management over JMX, JMS and core protocol
  • -
  • Large message support
  • -
  • Topic hierarchies
  • -
  • Producer flow control
  • -
  • Consumer flow control
  • -
  • Diverts
  • -
  • Last value queue
  • -
  • Message Groups
  • -
  • OSGi support
  • -
- - -
-
- - -

Versions

- - **artemis** version: ${project.version} - - **hawtio** version: {{hawtioVersion}} - - **jolokia** version: {{jolokiaVersion}} - -
- server version: {{serverVendor}} {{serverProduct}} {{serverVersion}} -
\ No newline at end of file diff --git a/artemis-hawtio/artemis-console/src/main/webapp/app/jvm/html/connect.html b/artemis-hawtio/artemis-console/src/main/webapp/app/jvm/html/connect.html deleted file mode 100644 index 06f8d8a5ce..0000000000 --- a/artemis-hawtio/artemis-console/src/main/webapp/app/jvm/html/connect.html +++ /dev/null @@ -1,104 +0,0 @@ - -
- -
- -
-
-

- This page allows you to connect to remote processes which already have a jolokia agent running inside them. You will need to know the - host name, port and path of the jolokia agent to be able to connect. -

- -

- If the process you wish to connect to does not have a jolokia agent inside, please refer to the jolokia documentation for how to add a JVM, servlet or OSGi - based agent inside it. -

- -

- Use the Local Tab to connect to processes locally on this machine (which will install a jolokia agent automatically if required). -

- -

- The Local Tab is not currently enabled because either the server side hawtio-local-jvm-mbean plugin is not installed or this - JVM cannot find the com.sun.tools.attach.VirtualMachine API usually found in the tool.jar. - Please see the FAQ entry for more details. -

-
-
- -
- -
-
Saved Connections
-
-
-
-
- -
- - - - -
-
-
-
-
-
- -
-
Connection Settings
-
-
- -
- - -
-
-
- -
- -
- -
\ No newline at end of file diff --git a/artemis-hawtio/artemis-console/src/main/webapp/hawtconfig.json b/artemis-hawtio/artemis-console/src/main/webapp/hawtconfig.json new file mode 100644 index 0000000000..84fe7796a2 --- /dev/null +++ b/artemis-hawtio/artemis-console/src/main/webapp/hawtconfig.json @@ -0,0 +1,26 @@ +{ + "branding": { + "appName": "Artemis Console", + "appLogoUrl": "/activemq-branding/plugin/img/activemq.png", + "companyLogoUrl": "/activemq-branding/plugin/img/activemq.png", + "css": "/activemq-branding/plugin/css/activemq.css", + "favicon": "/activemq-branding/plugin/img/favicon.png" + }, + "login": { + "description": "ActiveMQ Artemis Management Console", + "links": [ + { + "url": "/user_manual/index.html", + "text": "User Manual" + } + ] + }, + "about": { + "title": "ActiveMQ Artemis Management Console", + "productInfo": [], + "additionalInfo": "", + "copyright": "", + "imgSrc": "/activemq-branding/plugin/img/activemq.png" + }, + "disabledRoutes": [] +} \ No newline at end of file diff --git a/artemis-hawtio/artemis-console/src/main/webapp/img/img_avatar.svg b/artemis-hawtio/artemis-console/src/main/webapp/img/img_avatar.svg new file mode 100644 index 0000000000..457b95d8ea --- /dev/null +++ b/artemis-hawtio/artemis-console/src/main/webapp/img/img_avatar.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/artemis-hawtio/artemis-plugin/pom.xml b/artemis-hawtio/artemis-plugin/pom.xml index 8e2e062cdc..23d52ea67b 100644 --- a/artemis-hawtio/artemis-plugin/pom.xml +++ b/artemis-hawtio/artemis-plugin/pom.xml @@ -62,6 +62,10 @@ ${basedir}/src/main/webapp/lib ${webapp-outdir}/app/app.js + + diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/index.html b/artemis-hawtio/artemis-plugin/src/main/webapp/index.html new file mode 100644 index 0000000000..fe036f6ab7 --- /dev/null +++ b/artemis-hawtio/artemis-plugin/src/main/webapp/index.html @@ -0,0 +1,27 @@ + + + + + + Artemis plugin + + +

Hawtio :: Artemis plugin example

+ + diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/addresses.html b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/addresses.html deleted file mode 100644 index f6ca987019..0000000000 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/addresses.html +++ /dev/null @@ -1,54 +0,0 @@ - -
- - -
-
-
-
-  Filter -    - - - - -    - -
-
-
-
- -
-
-
- -
\ No newline at end of file diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/artemisLayout.html b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/artemisLayout.html deleted file mode 100644 index eb254c971d..0000000000 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/artemisLayout.html +++ /dev/null @@ -1,42 +0,0 @@ - - - -
-
-
-
-
- -
-
diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/brokerDiagram.html b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/brokerDiagram.html deleted file mode 100644 index f97ecdd53b..0000000000 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/brokerDiagram.html +++ /dev/null @@ -1,313 +0,0 @@ - - - - -
- -
-
- -
- - -
- -
- - View   - - - - -
-
-
- - -
-
-
-
- -
-
-
-
-
-
-
-
-
{{property.key}}:
-
-
-
-
-
- -
- -
- - diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/browseQueue.html b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/browseQueue.html deleted file mode 100644 index 650972c22c..0000000000 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/browseQueue.html +++ /dev/null @@ -1,156 +0,0 @@ - -
-
-
- -
-
-
-
- - - - - - -
-
-
-
- -
-
-
- -
-
- -
-
-
- -
- - - - - - - -
-
-
- -
- -
- -
-
Displaying body as
-
-
- -
-
- -
-
-

You are about to delete - - -

-

This operation cannot be undone so please be careful.

-
-
- -
-
-

Move - - to:

-

- You cannot undo this operation.
- Though after the move you can always move the - - back again. -

-
-
- -
- diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/connections.html b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/connections.html deleted file mode 100644 index d9539f88f4..0000000000 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/connections.html +++ /dev/null @@ -1,72 +0,0 @@ - -
- -
-
-
-
-  Filter -    - - - - -    - -
-
- -
-
- -     -
-
-
-
- -
-
-

You are about to close the selected connection: {{gridOptions.selectedItems[0].connectionID}} -

-

Are you sure you want to continue.

-
-
-
-
-
- -
\ No newline at end of file diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/consumers.html b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/consumers.html deleted file mode 100644 index 64de3b2ceb..0000000000 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/consumers.html +++ /dev/null @@ -1,75 +0,0 @@ - -
- - -
-
-
-
-  Filter -    - - - - -    - -
-
- -
-
- -     -
-
-
-
- -
-
-

You are about to close the selected consumer: {{gridOptions.selectedItems[0].id}} -

-

Are you sure you want to continue.

-
-
- -
-
-
- -
\ No newline at end of file diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/createAddress.html b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/createAddress.html deleted file mode 100644 index 0eb2d0af0f..0000000000 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/createAddress.html +++ /dev/null @@ -1,44 +0,0 @@ - -
-
- -
- -
-
- -
- - -
- -
-
- -
-
- -
-
-
diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/createQueue.html b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/createQueue.html deleted file mode 100644 index 1d294faa8b..0000000000 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/createQueue.html +++ /dev/null @@ -1,77 +0,0 @@ - -
- -
- -
- -
-
- -
- - -
- -
-
- - -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
-
- -
-
-
diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/deleteAddress.html b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/deleteAddress.html deleted file mode 100644 index afa3172338..0000000000 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/deleteAddress.html +++ /dev/null @@ -1,48 +0,0 @@ - -
-
- -
-
- - Warning: these operations cannot be undone. Please be careful! -
-
-
-
-
-
- - -
-
-
- -
-
-

You are about to delete the {{name().unescapeHTML()}} address

-

This operation cannot be undone so please be careful.

-
-
- - - -
diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/deleteQueue.html b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/deleteQueue.html deleted file mode 100644 index 3f881c68db..0000000000 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/deleteQueue.html +++ /dev/null @@ -1,65 +0,0 @@ - -
-
- -
-
- - Warning: these operations cannot be undone. Please be careful! -
-
-

Queue '{{name().unescapeHTML()}}'

-
-
-
-
-
Purge queue
-

Purge all the current messages on the queue.

- -
-
-
-
-
-
Delete queue
-

Remove the queue completely.

- -
-
- -
-
-

You are about to delete the {{name().unescapeHTML()}} queue

-

This operation cannot be undone so please be careful.

-
-
- -
-
-

You are about to purge the {{name().unescapeHTML()}} queue

-

This operation cannot be undone so please be careful.

-
-
- - -
diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/preferences.html b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/preferences.html index 10fb619a65..c619263e98 100644 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/preferences.html +++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/preferences.html @@ -15,55 +15,60 @@ limitations under the License. Architecture --> -
-
+ -
- - -
- -
+
+ +
+
-
- +
-
- -
+
+ +
+
+
-
- - -
- -
+
+ +
+
+
-
- - -
- -
+
+ +
+
+
-
- - -
- - Browsing byte messages should display the message body as -
+ - -
+ diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/producers.html b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/producers.html deleted file mode 100644 index 12bfe0c659..0000000000 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/producers.html +++ /dev/null @@ -1,54 +0,0 @@ - -
- - -
-
-
-
-  Filter -    - - - - -    - -
-
-
-
- -
-
-
- -
\ No newline at end of file diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/queues.html b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/queues.html deleted file mode 100644 index d5d03fe167..0000000000 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/queues.html +++ /dev/null @@ -1,54 +0,0 @@ - -
- - -
-
-
-
-  Filter -    - - - - -    - -
-
-
-
- -
-
-
- -
\ No newline at end of file diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/sendMessage.html b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/sendMessage.html deleted file mode 100644 index 002b558467..0000000000 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/sendMessage.html +++ /dev/null @@ -1,135 +0,0 @@ - -
- -
- -
- - -
- - No credentials set for endpoint! Please set your username and password in the Preferences page - - -
-
-
- - -
- - - -
- -
-
    -
    -
  1. -
    - -
    -
    - -
    -
    - - -
    -
  2. -
    -
-
- -
-
-
- - - - -
-
-
- -
- -
-
- - -
-
-
- -
- - No credentials set for endpoint! Please set your username and password in the Preferences page - - -
- -

Choose which files to send from the profile configuration:

- -
- -
- -
    -
  • - {{fileName}} -
  • -
-
-
- -
- -
-
diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/sessions.html b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/sessions.html deleted file mode 100644 index 0144e50628..0000000000 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/sessions.html +++ /dev/null @@ -1,74 +0,0 @@ - -
- -
-
-
-
-  Filter -    - - - - -    - -
-
-
-
- -     -
-
-
-
-
-
-

You are about to close the selected session: {{gridOptions.selectedItems[0].id}} -

-

Are you sure you want to continue.

-
-
-
-
-
- -
- - - diff --git a/artemis-hawtio/artemis-console/src/main/webapp/app/core/html/help.html b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/tree/content.html similarity index 62% rename from artemis-hawtio/artemis-console/src/main/webapp/app/core/html/help.html rename to artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/tree/content.html index 55ffad8059..be06f47f05 100644 --- a/artemis-hawtio/artemis-console/src/main/webapp/app/core/html/help.html +++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/html/tree/content.html @@ -15,24 +15,6 @@ limitations under the License. Architecture --> - - -
-
-