.classpath
| 1
code-coverage/pom.xml
| 2
modules/cli-tests/pom.xml
| 2
modules/common/ant-bundle/pom.xml
| 2
modules/common/cassandra-auth/pom.xml
| 2
modules/common/cassandra-ccm/cassandra-ccm-arquillian/pom.xml
| 2
modules/common/cassandra-ccm/cassandra-ccm-arquillian/src/main/java/org/rhq/cassandra/ccm/arquillian/CCMSuiteDeploymentExtension.java
| 4
modules/common/cassandra-ccm/cassandra-ccm-core/pom.xml
| 2
modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/conf/rhq.cassandra.yaml
| 26
modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/conf/rhq.log4j-server.properties
| 39 -
modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/CassandraClusterManager.java
| 4
modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/DeploymentOptions.java
| 149 ++---
modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/DeploymentOptionsFactory.java
| 2
modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/cassandra.properties
| 54 -
modules/common/cassandra-ccm/cassandra-ccm-core/src/test/java/org/rhq/cassandra/DeployerITest.java
| 31 -
modules/common/cassandra-ccm/cassandra-ccm-core/src/test/resources/expected.cassandra.yaml
| 2
modules/common/cassandra-ccm/cassandra-ccm-maven-plugin/pom.xml
| 2
modules/common/cassandra-ccm/cassandra-ccm-testng/pom.xml
| 2
modules/common/cassandra-ccm/cassandra-ccm-testng/src/main/java/org/rhq/cassandra/CCMTestNGListener.java
| 11
modules/common/cassandra-ccm/pom.xml
| 2
modules/common/cassandra-installer/pom.xml
| 2
modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
| 230 ++++---
modules/common/cassandra-installer/src/test/java/org/rhq/storage/installer/StorageInstallerTest.java
| 77 +-
modules/common/cassandra-schema/pom.xml
| 2
modules/common/cassandra-schema/src/main/java/org/rhq/cassandra/schema/VersionManager.java
| 3
modules/common/cassandra-util/pom.xml
| 2
modules/common/drift/pom.xml
| 2
modules/common/filetemplate-bundle/pom.xml
| 2
modules/common/jboss-as-dmr-client/pom.xml
| 2
modules/common/jboss-as/pom.xml
| 2
modules/common/pom.xml
| 2
modules/core/arquillian-integration/archive/pom.xml
| 2
modules/core/arquillian-integration/container/pom.xml
| 2
modules/core/arquillian-integration/container/src/main/java/org/rhq/test/arquillian/FakeServerInventory.java
| 31 -
modules/core/arquillian-integration/pom.xml
| 2
modules/core/arquillian-integration/suite-extension/pom.xml
| 2
modules/core/arquillian-integration/test-agent-plugin/pom.xml
| 2
modules/core/client-api/pom.xml
| 2
modules/core/comm-api/pom.xml
| 2
modules/core/dbutils/pom.xml
| 2
modules/core/domain/pom.xml
| 2
modules/core/gui/pom.xml
| 2
modules/core/native-system/pom.xml
| 2
modules/core/plugin-api/pom.xml
| 2
modules/core/plugin-container-itest/pom.xml
| 2
modules/core/plugin-container/pom.xml
| 2
modules/core/plugin-container/src/test/java/org/rhq/core/pc/inventory/ResourceContainerTest.java
| 8
modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
| 31 -
modules/core/plugin-test-api/pom.xml
| 2
modules/core/plugin-test-util/pom.xml
| 2
modules/core/plugin-validator/pom.xml
| 2
modules/core/plugindoc/pom.xml
| 2
modules/core/pom.xml
| 2
modules/core/util/pom.xml
| 2
modules/core/util/src/main/java/org/rhq/core/util/file/FileReverter.java
| 63 ++
modules/enterprise/agent/pom.xml
| 2
modules/enterprise/agentupdate/pom.xml
| 2
modules/enterprise/binding/pom.xml
| 4
modules/enterprise/comm/pom.xml
| 2
modules/enterprise/gui/agentupdate-war/pom.xml
| 153 +++++
modules/enterprise/gui/agentupdate-war/src/main/java/org/rhq/enterprise/gui/agentupdate/AgentUpdateServlet.java
| 273 +++++++++
modules/enterprise/gui/agentupdate-war/src/main/webapp/index.html
| 5
modules/enterprise/gui/content_http-war/pom.xml
| 2
modules/enterprise/gui/coregui/pom.xml
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/DownloadsView.java
| 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/storage/StorageNodeTableView.java
| 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java
| 15
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractD3GraphListView.java
| 17
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/ButtonBarDateTimeRangeEditor.java
| 64 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/StackedBarMetricGraphImpl.java
| 15
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/D3GroupGraphListView.java
| 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupD3GraphListView.java
| 189 +++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupD3MultiLineGraph.java
| 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupMultiLineGraphListView.java
| 79 --
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableView.java
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/D3GraphListView.java
| 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/MetricD3Graph.java
| 101 ---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityD3GraphView.java
| 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
| 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
| 8
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
| 2
modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
| 64 +-
modules/enterprise/gui/downloads-war/pom.xml
| 153 +++++
modules/enterprise/gui/downloads-war/src/main/java/org/rhq/enterprise/gui/download/DownloadServlet.java
| 295 ++++++++++
modules/enterprise/gui/pom.xml
| 5
modules/enterprise/gui/portal-war/pom.xml
| 2
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/agentupdate/AgentUpdateServlet.java
| 271 ---------
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
| 13
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/client/RemoteClientServlet.java
| 196 ------
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/download/DownloadServlet.java
| 293 ---------
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
| 48 -
modules/enterprise/gui/remote-client-war/pom.xml
| 153 +++++
modules/enterprise/gui/remote-client-war/src/main/java/org/rhq/enterprise/gui/client/RemoteClientServlet.java
| 196 ++++++
modules/enterprise/gui/remote-client-war/src/main/webapp/index.html
| 5
modules/enterprise/gui/remoting-war/pom.xml
| 2
modules/enterprise/gui/rest-examples-war/pom.xml
| 2
modules/enterprise/gui/rest-war/pom.xml
| 2
modules/enterprise/pom.xml
| 2
modules/enterprise/remoting/cli/pom.xml
| 2
modules/enterprise/remoting/client-api/pom.xml
| 2
modules/enterprise/remoting/client-deps/pom.xml
| 2
modules/enterprise/remoting/pom.xml
| 2
modules/enterprise/scripting/api/pom.xml
| 4
modules/enterprise/scripting/javascript/pom.xml
| 4
modules/enterprise/scripting/pom.xml
| 4
modules/enterprise/scripting/python/pom.xml
| 4
modules/enterprise/server/appserver/pom.xml
| 10
modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
| 268
+++++++--
modules/enterprise/server/appserver/src/main/scripts/storage_setup.groovy
| 20
modules/enterprise/server/client-api/pom.xml
| 4
modules/enterprise/server/data-migration/pom.xml
| 2
modules/enterprise/server/ear/pom.xml
| 45 +
modules/enterprise/server/installer/pom.xml
| 2
modules/enterprise/server/itests-2/pom.xml
| 2
modules/enterprise/server/jar/intentional-api-changes-since-4.9.0.xml
| 8
modules/enterprise/server/jar/pom.xml
| 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java
| 10
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
| 102 ++-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupLocal.java
| 7
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsService.java
| 3
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerConfiguration.java
| 6
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
| 108 +--
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/StorageClusterInitJob.java
| 49 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
| 12
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClusterMonitor.java
| 18
modules/enterprise/server/plugins/alert-cli/pom.xml
| 4
modules/enterprise/server/plugins/alert-email/pom.xml
| 4
modules/enterprise/server/plugins/alert-irc/pom.xml
| 4
modules/enterprise/server/plugins/alert-log4j/pom.xml
| 4
modules/enterprise/server/plugins/alert-microblog/pom.xml
| 4
modules/enterprise/server/plugins/alert-mobicents/pom.xml
| 4
modules/enterprise/server/plugins/alert-operations/pom.xml
| 4
modules/enterprise/server/plugins/alert-roles/pom.xml
| 4
modules/enterprise/server/plugins/alert-snmp/pom.xml
| 4
modules/enterprise/server/plugins/alert-subject/pom.xml
| 4
modules/enterprise/server/plugins/alertdef-rhq/pom.xml
| 2
modules/enterprise/server/plugins/ant-bundle/pom.xml
| 2
modules/enterprise/server/plugins/cobbler/pom.xml
| 4
modules/enterprise/server/plugins/disk/pom.xml
| 2
modules/enterprise/server/plugins/drift-rhq/pom.xml
| 2
modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
| 2
modules/enterprise/server/plugins/jboss-software/pom.xml
| 2
modules/enterprise/server/plugins/packagetype-cli/pom.xml
| 4
modules/enterprise/server/plugins/pom.xml
| 2
modules/enterprise/server/plugins/url/pom.xml
| 2
modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
| 2
modules/enterprise/server/plugins/yum/pom.xml
| 2
modules/enterprise/server/pom.xml
| 2
modules/enterprise/server/safe-invoker/pom.xml
| 2
modules/enterprise/server/server-control/pom.xml
| 2
modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
| 53 +
modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
| 77 ++
modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
| 160 +++--
modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
| 98 ---
modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
| 53 +
modules/enterprise/server/server-metrics/pom.xml
| 2
modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/DateTimeService.java
| 12
modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
| 44 -
modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/StorageSession.java
| 23
modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/StorageStateListener.java
| 2
modules/enterprise/server/server-metrics/src/test/java/org/rhq/server/metrics/DateTimeServiceTest.java
| 12
modules/enterprise/server/server-metrics/src/test/java/org/rhq/server/metrics/MetricsServerTest.java
| 1
modules/enterprise/server/startup-subsystem/pom.xml
| 2
modules/enterprise/server/xml-schemas/pom.xml
| 2
modules/helpers/bundleGen/pom.xml
| 4
modules/helpers/jeeGen/pom.xml
| 2
modules/helpers/metrics-simulator/pom.xml
| 18
modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementAggregator.java
| 45 -
modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementCollector.java
| 121 +---
modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Metrics.java
| 30 +
modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Schedule.java
| 119 ----
modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Simulator.java
| 191 +-----
modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/SimulatorDateTimeService.java
| 27
modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/StatsCollector.java
| 94 ---
modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/ClusterConfig.java
| 94 ---
modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/ScheduleGroup.java
| 60 --
modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlan.java
| 63 --
modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlanner.java
| 190 ------
modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/stats/Aggregate.java
| 69 --
modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/stats/Stats.java
| 103 ---
modules/helpers/metrics-simulator/src/main/resources/conf/log4j.properties
| 2
modules/helpers/perftest-support/pom.xml
| 4
modules/helpers/pom.xml
| 2
modules/helpers/rest-docs-generator/pom.xml
| 2
modules/helpers/rtfilter-subsystem/pom.xml
| 2
modules/helpers/rtfilter/pom.xml
| 2
modules/integration-tests/apache-plugin-test/pom.xml
| 2
modules/integration-tests/jndi-access/jndi-access-test/pom.xml
| 2
modules/integration-tests/jndi-access/pom.xml
| 2
modules/integration-tests/jndi-access/remote-server/pom.xml
| 2
modules/integration-tests/pom.xml
| 2
modules/integration-tests/rest-api/pom.xml
| 2
modules/plugins/aliases/pom.xml
| 2
modules/plugins/ant-bundle/pom.xml
| 2
modules/plugins/apache/pom.xml
| 2
modules/plugins/augeas/pom.xml
| 2
modules/plugins/byteman/pom.xml
| 2
modules/plugins/cassandra/pom.xml
| 2
modules/plugins/cobbler/pom.xml
| 2
modules/plugins/cron/pom.xml
| 2
modules/plugins/database/pom.xml
| 2
modules/plugins/filetemplate-bundle/pom.xml
| 2
modules/plugins/grub/pom.xml
| 2
modules/plugins/hadoop/pom.xml
| 2
modules/plugins/hibernate/pom.xml
| 2
modules/plugins/hosts/pom.xml
| 2
modules/plugins/hudson/pom.xml
| 4
modules/plugins/iis/pom.xml
| 2
modules/plugins/irc/pom.xml
| 2
modules/plugins/jboss-as-5/pom.xml
| 2
modules/plugins/jboss-as-7/pom.xml
| 2
modules/plugins/jboss-as/pom.xml
| 2
modules/plugins/jboss-cache-v3/pom.xml
| 2
modules/plugins/jboss-cache/pom.xml
| 2
modules/plugins/jmx/pom.xml
| 2
modules/plugins/kickstart/pom.xml
| 2
modules/plugins/mod-cluster/pom.xml
| 2
modules/plugins/mysql/pom.xml
| 2
modules/plugins/netservices/pom.xml
| 2
modules/plugins/noop/pom.xml
| 2
modules/plugins/oracle/pom.xml
| 2
modules/plugins/pattern-generator/pom.xml
| 2
modules/plugins/perftest/pom.xml
| 2
modules/plugins/platform/pom.xml
| 2
modules/plugins/pom.xml
| 2
modules/plugins/postfix/pom.xml
| 2
modules/plugins/postgres/pom.xml
| 2
modules/plugins/rhq-agent/pom.xml
| 2
modules/plugins/rhq-server/pom.xml
| 2
modules/plugins/rhq-storage/pom.xml
| 2
modules/plugins/rhq-storage/src/test/java/org/rhq/plugins/storage/StorageNodeComponentITest.java
| 8
modules/plugins/samba/pom.xml
| 2
modules/plugins/script/pom.xml
| 2
modules/plugins/script2/pom.xml
| 2
modules/plugins/snmptrapd/pom.xml
| 2
modules/plugins/sonarqube/pom.xml
| 2
modules/plugins/sshd/pom.xml
| 2
modules/plugins/sudoers/pom.xml
| 2
modules/plugins/tomcat/pom.xml
| 2
modules/plugins/twitter/pom.xml
| 2
modules/plugins/validate-all-plugins/pom.xml
| 2
modules/plugins/virt/pom.xml
| 2
modules/pom.xml
| 2
modules/test-utils/pom.xml
| 2
pom.xml
| 2
245 files changed, 3200 insertions(+), 3003 deletions(-)
New commits:
commit 985719164fd9652b6c467110ac55fc199c93451e
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Tue Oct 1 02:01:15 2013 -0400
Updating poms for ER3.
diff --git a/code-coverage/pom.xml b/code-coverage/pom.xml
index 9783c17..15ac9c4 100644
--- a/code-coverage/pom.xml
+++ b/code-coverage/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-code-coverage</artifactId>
diff --git a/modules/cli-tests/pom.xml b/modules/cli-tests/pom.xml
index df3c6b7..a49a48e 100644
--- a/modules/cli-tests/pom.xml
+++ b/modules/cli-tests/pom.xml
@@ -8,7 +8,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index e27e9ae..b8159dd 100644
--- a/modules/common/ant-bundle/pom.xml
+++ b/modules/common/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/cassandra-auth/pom.xml
b/modules/common/cassandra-auth/pom.xml
index ad356e9..1641c0f 100644
--- a/modules/common/cassandra-auth/pom.xml
+++ b/modules/common/cassandra-auth/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-cassandra-auth</artifactId>
diff --git a/modules/common/cassandra-ccm/cassandra-ccm-arquillian/pom.xml
b/modules/common/cassandra-ccm/cassandra-ccm-arquillian/pom.xml
index 1ee2365..05a88c3 100644
--- a/modules/common/cassandra-ccm/cassandra-ccm-arquillian/pom.xml
+++ b/modules/common/cassandra-ccm/cassandra-ccm-arquillian/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-cassandra-ccm</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-cassandra-ccm-arquillian</artifactId>
diff --git a/modules/common/cassandra-ccm/cassandra-ccm-core/pom.xml
b/modules/common/cassandra-ccm/cassandra-ccm-core/pom.xml
index 86298a7..ccd6458 100644
--- a/modules/common/cassandra-ccm/cassandra-ccm-core/pom.xml
+++ b/modules/common/cassandra-ccm/cassandra-ccm-core/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-cassandra-ccm</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-cassandra-ccm-core</artifactId>
diff --git a/modules/common/cassandra-ccm/cassandra-ccm-maven-plugin/pom.xml
b/modules/common/cassandra-ccm/cassandra-ccm-maven-plugin/pom.xml
index 4b78cec..d0ed982 100644
--- a/modules/common/cassandra-ccm/cassandra-ccm-maven-plugin/pom.xml
+++ b/modules/common/cassandra-ccm/cassandra-ccm-maven-plugin/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-cassandra-ccm</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-cassandra-ccm-maven-plugin</artifactId>
diff --git a/modules/common/cassandra-ccm/cassandra-ccm-testng/pom.xml
b/modules/common/cassandra-ccm/cassandra-ccm-testng/pom.xml
index 7a5bf61..052b374 100644
--- a/modules/common/cassandra-ccm/cassandra-ccm-testng/pom.xml
+++ b/modules/common/cassandra-ccm/cassandra-ccm-testng/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-cassandra-ccm</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-cassandra-ccm-testng</artifactId>
diff --git a/modules/common/cassandra-ccm/pom.xml b/modules/common/cassandra-ccm/pom.xml
index 44e3f9e..6a9572f 100644
--- a/modules/common/cassandra-ccm/pom.xml
+++ b/modules/common/cassandra-ccm/pom.xml
@@ -5,7 +5,7 @@
<parent>
<artifactId>rhq-common-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/common/cassandra-installer/pom.xml
b/modules/common/cassandra-installer/pom.xml
index 0c341cd..aa49c4b 100644
--- a/modules/common/cassandra-installer/pom.xml
+++ b/modules/common/cassandra-installer/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-cassandra-installer</artifactId>
diff --git a/modules/common/cassandra-schema/pom.xml
b/modules/common/cassandra-schema/pom.xml
index 1a4e928..7bfb004 100644
--- a/modules/common/cassandra-schema/pom.xml
+++ b/modules/common/cassandra-schema/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-cassandra-schema</artifactId>
diff --git a/modules/common/cassandra-util/pom.xml
b/modules/common/cassandra-util/pom.xml
index 18d2ef8..25ca5e0 100644
--- a/modules/common/cassandra-util/pom.xml
+++ b/modules/common/cassandra-util/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-cassandra-util</artifactId>
diff --git a/modules/common/drift/pom.xml b/modules/common/drift/pom.xml
index a97a3f1..bb82384 100644
--- a/modules/common/drift/pom.xml
+++ b/modules/common/drift/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-common-drift</artifactId>
diff --git a/modules/common/filetemplate-bundle/pom.xml
b/modules/common/filetemplate-bundle/pom.xml
index a22d463..115ef8b 100644
--- a/modules/common/filetemplate-bundle/pom.xml
+++ b/modules/common/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-filetemplate-bundle-common</artifactId>
diff --git a/modules/common/jboss-as-dmr-client/pom.xml
b/modules/common/jboss-as-dmr-client/pom.xml
index cf49eb0..61f2830 100644
--- a/modules/common/jboss-as-dmr-client/pom.xml
+++ b/modules/common/jboss-as-dmr-client/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-jboss-as-dmr-client</artifactId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index bff6e36..192beb2 100644
--- a/modules/common/jboss-as/pom.xml
+++ b/modules/common/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-jboss-as-common</artifactId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index 8a4966b..ed3334c 100644
--- a/modules/common/pom.xml
+++ b/modules/common/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/arquillian-integration/archive/pom.xml
b/modules/core/arquillian-integration/archive/pom.xml
index fefcf36..6dc3717 100644
--- a/modules/core/arquillian-integration/archive/pom.xml
+++ b/modules/core/arquillian-integration/archive/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-arquillian-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<!-- Model Version -->
diff --git a/modules/core/arquillian-integration/container/pom.xml
b/modules/core/arquillian-integration/container/pom.xml
index 832fdd3..30a81aa 100644
--- a/modules/core/arquillian-integration/container/pom.xml
+++ b/modules/core/arquillian-integration/container/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-arquillian-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<!-- Model Version -->
diff --git a/modules/core/arquillian-integration/pom.xml
b/modules/core/arquillian-integration/pom.xml
index f6638aa..92fec48 100644
--- a/modules/core/arquillian-integration/pom.xml
+++ b/modules/core/arquillian-integration/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/arquillian-integration/suite-extension/pom.xml
b/modules/core/arquillian-integration/suite-extension/pom.xml
index fd8e278..c422c7f 100644
--- a/modules/core/arquillian-integration/suite-extension/pom.xml
+++ b/modules/core/arquillian-integration/suite-extension/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-arquillian-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<!-- Model Version -->
diff --git a/modules/core/arquillian-integration/test-agent-plugin/pom.xml
b/modules/core/arquillian-integration/test-agent-plugin/pom.xml
index 474988c..2918af2 100644
--- a/modules/core/arquillian-integration/test-agent-plugin/pom.xml
+++ b/modules/core/arquillian-integration/test-agent-plugin/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-arquillian-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index cdb3121..d0a6f08 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index b3bcfd0..ac3416e 100644
--- a/modules/core/comm-api/pom.xml
+++ b/modules/core/comm-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index ce66cca..3379847 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index ab06e9e..e3e1eb1 100644
--- a/modules/core/domain/pom.xml
+++ b/modules/core/domain/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-core-domain</artifactId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index e25a193..c3f3b97 100644
--- a/modules/core/gui/pom.xml
+++ b/modules/core/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index d076cd9..9a5c49d 100644
--- a/modules/core/native-system/pom.xml
+++ b/modules/core/native-system/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index fdf355f..9f8cb29 100644
--- a/modules/core/plugin-api/pom.xml
+++ b/modules/core/plugin-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container-itest/pom.xml
b/modules/core/plugin-container-itest/pom.xml
index 8cb5215..4090121 100644
--- a/modules/core/plugin-container-itest/pom.xml
+++ b/modules/core/plugin-container-itest/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-core-plugin-container-itest</artifactId>
diff --git a/modules/core/plugin-container/pom.xml
b/modules/core/plugin-container/pom.xml
index 57987fd..3c7ae29 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-core-plugin-container</artifactId>
diff --git a/modules/core/plugin-test-api/pom.xml b/modules/core/plugin-test-api/pom.xml
index a619439..32f9675 100644
--- a/modules/core/plugin-test-api/pom.xml
+++ b/modules/core/plugin-test-api/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-core-plugin-test-api</artifactId>
diff --git a/modules/core/plugin-test-util/pom.xml
b/modules/core/plugin-test-util/pom.xml
index 143ce73..be4d1e6 100644
--- a/modules/core/plugin-test-util/pom.xml
+++ b/modules/core/plugin-test-util/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-validator/pom.xml
b/modules/core/plugin-validator/pom.xml
index 72e7d1b..dbe7a5e 100644
--- a/modules/core/plugin-validator/pom.xml
+++ b/modules/core/plugin-validator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml
index 24a00ee..06f4307 100644
--- a/modules/core/plugindoc/pom.xml
+++ b/modules/core/plugindoc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index dcbfd30..66730c1 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index 4935618a..ccb40c6 100644
--- a/modules/core/util/pom.xml
+++ b/modules/core/util/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-core-util</artifactId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index fcd9b26..efffeca 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/agentupdate/pom.xml
b/modules/enterprise/agentupdate/pom.xml
index 20854c9..ba65561 100644
--- a/modules/enterprise/agentupdate/pom.xml
+++ b/modules/enterprise/agentupdate/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/binding/pom.xml b/modules/enterprise/binding/pom.xml
index 8cd2d97..9e94766 100644
--- a/modules/enterprise/binding/pom.xml
+++ b/modules/enterprise/binding/pom.xml
@@ -3,10 +3,10 @@
<parent>
<artifactId>rhq-enterprise-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-script-bindings</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<name>RHQ Script Bindings</name>
<description>Abstraction of different facilities and default configurations for
script bindings</description>
diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml
index 0a1e19b..c0ba581 100644
--- a/modules/enterprise/comm/pom.xml
+++ b/modules/enterprise/comm/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/agentupdate-war/pom.xml
b/modules/enterprise/gui/agentupdate-war/pom.xml
index a6a9182..de527ae 100644
--- a/modules/enterprise/gui/agentupdate-war/pom.xml
+++ b/modules/enterprise/gui/agentupdate-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.10.0-SNAPSHOT</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/content_http-war/pom.xml
b/modules/enterprise/gui/content_http-war/pom.xml
index e3de1bc..7b2d5b4 100644
--- a/modules/enterprise/gui/content_http-war/pom.xml
+++ b/modules/enterprise/gui/content_http-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-gui-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml
b/modules/enterprise/gui/coregui/pom.xml
index 908c109..01f8e8b 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/downloads-war/pom.xml
b/modules/enterprise/gui/downloads-war/pom.xml
index 9d694cb..ad157f8 100644
--- a/modules/enterprise/gui/downloads-war/pom.xml
+++ b/modules/enterprise/gui/downloads-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.10.0-SNAPSHOT</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index a7dbecd..09b7799 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -8,7 +8,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/portal-war/pom.xml
b/modules/enterprise/gui/portal-war/pom.xml
index cf9088d..f959ea4 100644
--- a/modules/enterprise/gui/portal-war/pom.xml
+++ b/modules/enterprise/gui/portal-war/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/remote-client-war/pom.xml
b/modules/enterprise/gui/remote-client-war/pom.xml
index 92ec018..92a363f 100644
--- a/modules/enterprise/gui/remote-client-war/pom.xml
+++ b/modules/enterprise/gui/remote-client-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.10.0-SNAPSHOT</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/remoting-war/pom.xml
b/modules/enterprise/gui/remoting-war/pom.xml
index 4e7d74c..731d7b3 100644
--- a/modules/enterprise/gui/remoting-war/pom.xml
+++ b/modules/enterprise/gui/remoting-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/rest-examples-war/pom.xml
b/modules/enterprise/gui/rest-examples-war/pom.xml
index b946b2b..f159630 100644
--- a/modules/enterprise/gui/rest-examples-war/pom.xml
+++ b/modules/enterprise/gui/rest-examples-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/rest-war/pom.xml
b/modules/enterprise/gui/rest-war/pom.xml
index b6a7a04..c5437b3 100644
--- a/modules/enterprise/gui/rest-war/pom.xml
+++ b/modules/enterprise/gui/rest-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index 1eac425..2a189e8 100644
--- a/modules/enterprise/pom.xml
+++ b/modules/enterprise/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/cli/pom.xml
b/modules/enterprise/remoting/cli/pom.xml
index d8527f8..a18759f 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/client-api/pom.xml
b/modules/enterprise/remoting/client-api/pom.xml
index ed18648..53c3933 100644
--- a/modules/enterprise/remoting/client-api/pom.xml
+++ b/modules/enterprise/remoting/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/client-deps/pom.xml
b/modules/enterprise/remoting/client-deps/pom.xml
index 982d3d3..fad38b5 100644
--- a/modules/enterprise/remoting/client-deps/pom.xml
+++ b/modules/enterprise/remoting/client-deps/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index d445ed7..4fcc5b1 100644
--- a/modules/enterprise/remoting/pom.xml
+++ b/modules/enterprise/remoting/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/scripting/api/pom.xml
b/modules/enterprise/scripting/api/pom.xml
index 575a004..930bf54 100644
--- a/modules/enterprise/scripting/api/pom.xml
+++ b/modules/enterprise/scripting/api/pom.xml
@@ -3,10 +3,10 @@
<parent>
<artifactId>rhq-scripting-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-scripting-api</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<name>RHQ Scripting API</name>
<description>Provides API for adding scripting support to RHQ using different
javax.scripting - based interpreters</description>
diff --git a/modules/enterprise/scripting/javascript/pom.xml
b/modules/enterprise/scripting/javascript/pom.xml
index f469ca5..90555f4 100644
--- a/modules/enterprise/scripting/javascript/pom.xml
+++ b/modules/enterprise/scripting/javascript/pom.xml
@@ -4,10 +4,10 @@
<parent>
<artifactId>rhq-scripting-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-scripting-javascript</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<name>RHQ Javascript support</name>
<description>Provides RHQ scripting in Javascript using
Rhino</description>
diff --git a/modules/enterprise/scripting/pom.xml b/modules/enterprise/scripting/pom.xml
index 50ab4c3..baddc3d 100644
--- a/modules/enterprise/scripting/pom.xml
+++ b/modules/enterprise/scripting/pom.xml
@@ -3,12 +3,12 @@
<parent>
<artifactId>rhq-enterprise-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-scripting-parent</artifactId>
<packaging>pom</packaging>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<name>RHQ Scripting Parent Module</name>
<modules>
diff --git a/modules/enterprise/scripting/python/pom.xml
b/modules/enterprise/scripting/python/pom.xml
index 7ef3212..6cf84b1 100644
--- a/modules/enterprise/scripting/python/pom.xml
+++ b/modules/enterprise/scripting/python/pom.xml
@@ -3,10 +3,10 @@
<parent>
<artifactId>rhq-scripting-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-scripting-python</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<name>RHQ Python support</name>
<description>Provides RHQ scripting in Python using Jython</description>
diff --git a/modules/enterprise/server/appserver/pom.xml
b/modules/enterprise/server/appserver/pom.xml
index 8cf9b7e..098cf67 100644
--- a/modules/enterprise/server/appserver/pom.xml
+++ b/modules/enterprise/server/appserver/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/client-api/pom.xml
b/modules/enterprise/server/client-api/pom.xml
index 91a653b..6aca32f 100644
--- a/modules/enterprise/server/client-api/pom.xml
+++ b/modules/enterprise/server/client-api/pom.xml
@@ -5,13 +5,13 @@
<parent>
<artifactId>rhq-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-server-client-api</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<name>RHQ Enterprise Server Client API</name>
<description>The implementation of the client API when accessing the server
locally</description>
diff --git a/modules/enterprise/server/data-migration/pom.xml
b/modules/enterprise/server/data-migration/pom.xml
index 58a16f2..54083fb 100644
--- a/modules/enterprise/server/data-migration/pom.xml
+++ b/modules/enterprise/server/data-migration/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/ear/pom.xml
b/modules/enterprise/server/ear/pom.xml
index e61cc7d..46c7074 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/installer/pom.xml
b/modules/enterprise/server/installer/pom.xml
index 04dc335..0e497e0 100644
--- a/modules/enterprise/server/installer/pom.xml
+++ b/modules/enterprise/server/installer/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/itests-2/pom.xml
b/modules/enterprise/server/itests-2/pom.xml
index f9f2e6a..aecde5a 100644
--- a/modules/enterprise/server/itests-2/pom.xml
+++ b/modules/enterprise/server/itests-2/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/jar/pom.xml
b/modules/enterprise/server/jar/pom.xml
index 3f7c17a..0343a70 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/alert-cli/pom.xml
b/modules/enterprise/server/plugins/alert-cli/pom.xml
index 44d1b10..f8763ca 100644
--- a/modules/enterprise/server/plugins/alert-cli/pom.xml
+++ b/modules/enterprise/server/plugins/alert-cli/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>alert-cli</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<name>RHQ Enterprise Server CLI Script Alert Plugin</name>
<description>An alert sender able to execute an arbitrary CLI script as a
response to an alert</description>
diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml
b/modules/enterprise/server/plugins/alert-email/pom.xml
index dc9d767..6933cd0 100644
--- a/modules/enterprise/server/plugins/alert-email/pom.xml
+++ b/modules/enterprise/server/plugins/alert-email/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.server</groupId>
<artifactId>alert-email</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<name>RHQ Enterprise Server Email Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml
b/modules/enterprise/server/plugins/alert-irc/pom.xml
index e81935a..ee508ab 100644
--- a/modules/enterprise/server/plugins/alert-irc/pom.xml
+++ b/modules/enterprise/server/plugins/alert-irc/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-irc</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<name>RHQ Enterprise Server IRC Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-log4j/pom.xml
b/modules/enterprise/server/plugins/alert-log4j/pom.xml
index a1a6f8b..0d63856 100644
--- a/modules/enterprise/server/plugins/alert-log4j/pom.xml
+++ b/modules/enterprise/server/plugins/alert-log4j/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-log4j</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<name>RHQ Enterprise Server Log4J Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml
b/modules/enterprise/server/plugins/alert-microblog/pom.xml
index d32dddd..d89c48f 100644
--- a/modules/enterprise/server/plugins/alert-microblog/pom.xml
+++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-microblog</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<name>RHQ Enterprise Server Microblog Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
index eb14068..16d05f9 100644
--- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
+++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-mobicents</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<name>RHQ Enterprise Server Mobicents Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml
b/modules/enterprise/server/plugins/alert-operations/pom.xml
index 3e00528..de7b237 100644
--- a/modules/enterprise/server/plugins/alert-operations/pom.xml
+++ b/modules/enterprise/server/plugins/alert-operations/pom.xml
@@ -2,14 +2,14 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-operations</artifactId>
<packaging>jar</packaging>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<name>RHQ Enterprise Server Opertions Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml
b/modules/enterprise/server/plugins/alert-roles/pom.xml
index 39b5ca5..64061e5 100644
--- a/modules/enterprise/server/plugins/alert-roles/pom.xml
+++ b/modules/enterprise/server/plugins/alert-roles/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-roles</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<name>RHQ Enterprise Server Roles Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml
b/modules/enterprise/server/plugins/alert-snmp/pom.xml
index 12758b4..080bc50 100644
--- a/modules/enterprise/server/plugins/alert-snmp/pom.xml
+++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-snmp</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<name>RHQ Enterprise Server SNMP Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml
b/modules/enterprise/server/plugins/alert-subject/pom.xml
index 6aab82f..a656065 100644
--- a/modules/enterprise/server/plugins/alert-subject/pom.xml
+++ b/modules/enterprise/server/plugins/alert-subject/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-subject</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<name>RHQ Enterprise Server Subject Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alertdef-rhq/pom.xml
b/modules/enterprise/server/plugins/alertdef-rhq/pom.xml
index 56ad7b6..a9e0b74 100644
--- a/modules/enterprise/server/plugins/alertdef-rhq/pom.xml
+++ b/modules/enterprise/server/plugins/alertdef-rhq/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml
b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index 1ef821f..8d24e9a 100644
--- a/modules/enterprise/server/plugins/ant-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml
b/modules/enterprise/server/plugins/cobbler/pom.xml
index 21145a5..2c8ebe4 100644
--- a/modules/enterprise/server/plugins/cobbler/pom.xml
+++ b/modules/enterprise/server/plugins/cobbler/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>rhq-serverplugin-cobbler</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<name>RHQ Enterprise Server Cobbler Plugin</name>
diff --git a/modules/enterprise/server/plugins/disk/pom.xml
b/modules/enterprise/server/plugins/disk/pom.xml
index 82c6669..cc91769 100644
--- a/modules/enterprise/server/plugins/disk/pom.xml
+++ b/modules/enterprise/server/plugins/disk/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/drift-rhq/pom.xml
b/modules/enterprise/server/plugins/drift-rhq/pom.xml
index 7259db3..813638e 100644
--- a/modules/enterprise/server/plugins/drift-rhq/pom.xml
+++ b/modules/enterprise/server/plugins/drift-rhq/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
index e497a9c..2aabcf9 100644
--- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml
b/modules/enterprise/server/plugins/jboss-software/pom.xml
index c7caff8..2c87421 100644
--- a/modules/enterprise/server/plugins/jboss-software/pom.xml
+++ b/modules/enterprise/server/plugins/jboss-software/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/packagetype-cli/pom.xml
b/modules/enterprise/server/plugins/packagetype-cli/pom.xml
index 93fe1f4..7eecd9d 100644
--- a/modules/enterprise/server/plugins/packagetype-cli/pom.xml
+++ b/modules/enterprise/server/plugins/packagetype-cli/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>packagetype-cli</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<name>RHQ Enterprise Server CLI Package Type Plugin</name>
diff --git a/modules/enterprise/server/plugins/pom.xml
b/modules/enterprise/server/plugins/pom.xml
index 7d1797b..72ed1f9 100644
--- a/modules/enterprise/server/plugins/pom.xml
+++ b/modules/enterprise/server/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/url/pom.xml
b/modules/enterprise/server/plugins/url/pom.xml
index 117271d..5032ea9 100644
--- a/modules/enterprise/server/plugins/url/pom.xml
+++ b/modules/enterprise/server/plugins/url/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
index 2449ed8..1fb65c1 100644
--- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
+++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/yum/pom.xml
b/modules/enterprise/server/plugins/yum/pom.xml
index fd56fff..39009fe 100644
--- a/modules/enterprise/server/plugins/yum/pom.xml
+++ b/modules/enterprise/server/plugins/yum/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/pom.xml b/modules/enterprise/server/pom.xml
index 1e9b481..a33c642 100644
--- a/modules/enterprise/server/pom.xml
+++ b/modules/enterprise/server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml
b/modules/enterprise/server/safe-invoker/pom.xml
index 9c2ccf4..fca77dd 100644
--- a/modules/enterprise/server/safe-invoker/pom.xml
+++ b/modules/enterprise/server/safe-invoker/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/server-control/pom.xml
b/modules/enterprise/server/server-control/pom.xml
index 0c9d27c..6b5a4dd 100644
--- a/modules/enterprise/server/server-control/pom.xml
+++ b/modules/enterprise/server/server-control/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/server-metrics/pom.xml
b/modules/enterprise/server/server-metrics/pom.xml
index 7d57760..8e5c8ae 100644
--- a/modules/enterprise/server/server-metrics/pom.xml
+++ b/modules/enterprise/server/server-metrics/pom.xml
@@ -31,7 +31,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/startup-subsystem/pom.xml
b/modules/enterprise/server/startup-subsystem/pom.xml
index 03c2ce5..fb7c1af 100644
--- a/modules/enterprise/server/startup-subsystem/pom.xml
+++ b/modules/enterprise/server/startup-subsystem/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/xml-schemas/pom.xml
b/modules/enterprise/server/xml-schemas/pom.xml
index 6350464..c9c3508 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/bundleGen/pom.xml b/modules/helpers/bundleGen/pom.xml
index 768ec0a..b253169 100644
--- a/modules/helpers/bundleGen/pom.xml
+++ b/modules/helpers/bundleGen/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.helpers</groupId>
<artifactId>bundleGen</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<build>
<plugins>
diff --git a/modules/helpers/jeeGen/pom.xml b/modules/helpers/jeeGen/pom.xml
index dd97e8f..e1e30ae 100644
--- a/modules/helpers/jeeGen/pom.xml
+++ b/modules/helpers/jeeGen/pom.xml
@@ -9,7 +9,7 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/metrics-simulator/pom.xml
b/modules/helpers/metrics-simulator/pom.xml
index 7d35963..ced7e80 100644
--- a/modules/helpers/metrics-simulator/pom.xml
+++ b/modules/helpers/metrics-simulator/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/helpers/perftest-support/pom.xml
b/modules/helpers/perftest-support/pom.xml
index 36e76d8..6847d58 100644
--- a/modules/helpers/perftest-support/pom.xml
+++ b/modules/helpers/perftest-support/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>perftest-support</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<name>Performance Testing Support</name>
<description>To support performance testing, this is a basic tool to support
extracting and later reimporting of
data from/to a database.
diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml
index d5bd8e7..a7cc8b8 100644
--- a/modules/helpers/pom.xml
+++ b/modules/helpers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/rest-docs-generator/pom.xml
b/modules/helpers/rest-docs-generator/pom.xml
index 9630bc8..d6e3fde 100644
--- a/modules/helpers/rest-docs-generator/pom.xml
+++ b/modules/helpers/rest-docs-generator/pom.xml
@@ -24,7 +24,7 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/helpers/rtfilter-subsystem/pom.xml
b/modules/helpers/rtfilter-subsystem/pom.xml
index c31b804..45def54 100644
--- a/modules/helpers/rtfilter-subsystem/pom.xml
+++ b/modules/helpers/rtfilter-subsystem/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index 63f1e62..e975351 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/integration-tests/apache-plugin-test/pom.xml
b/modules/integration-tests/apache-plugin-test/pom.xml
index 77ed069..80a68f4 100644
--- a/modules/integration-tests/apache-plugin-test/pom.xml
+++ b/modules/integration-tests/apache-plugin-test/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-integration-tests</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
b/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
index 0a616d3..6e012eb 100644
--- a/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
+++ b/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>jndi-access-test-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>jndi-access-test</artifactId>
diff --git a/modules/integration-tests/jndi-access/pom.xml
b/modules/integration-tests/jndi-access/pom.xml
index 4510e72..064865d 100644
--- a/modules/integration-tests/jndi-access/pom.xml
+++ b/modules/integration-tests/jndi-access/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-integration-tests</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/integration-tests/jndi-access/remote-server/pom.xml
b/modules/integration-tests/jndi-access/remote-server/pom.xml
index 8038922..e36fa47 100644
--- a/modules/integration-tests/jndi-access/remote-server/pom.xml
+++ b/modules/integration-tests/jndi-access/remote-server/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>jndi-access-test-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>jndi-access-remote-server</artifactId>
diff --git a/modules/integration-tests/pom.xml b/modules/integration-tests/pom.xml
index da1ad51..b8b11ec 100644
--- a/modules/integration-tests/pom.xml
+++ b/modules/integration-tests/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/integration-tests/rest-api/pom.xml
b/modules/integration-tests/rest-api/pom.xml
index 556c1e4..0f6f4e1 100644
--- a/modules/integration-tests/rest-api/pom.xml
+++ b/modules/integration-tests/rest-api/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-integration-tests</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index 523406f..3b60a9e 100644
--- a/modules/plugins/aliases/pom.xml
+++ b/modules/plugins/aliases/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index 167ab67..ce0937d 100644
--- a/modules/plugins/ant-bundle/pom.xml
+++ b/modules/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index a89a568..2cf3b5e 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index f96b173..a4e15ae 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/byteman/pom.xml b/modules/plugins/byteman/pom.xml
index 679f9b3..413f31a 100644
--- a/modules/plugins/byteman/pom.xml
+++ b/modules/plugins/byteman/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cassandra/pom.xml b/modules/plugins/cassandra/pom.xml
index e16b1fd..f878ae9 100644
--- a/modules/plugins/cassandra/pom.xml
+++ b/modules/plugins/cassandra/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index bc7bca1..e214295 100644
--- a/modules/plugins/cobbler/pom.xml
+++ b/modules/plugins/cobbler/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index 0edf971..a484ab5 100644
--- a/modules/plugins/cron/pom.xml
+++ b/modules/plugins/cron/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index 9446a83..68cc2d3 100644
--- a/modules/plugins/database/pom.xml
+++ b/modules/plugins/database/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml
b/modules/plugins/filetemplate-bundle/pom.xml
index 92dace7..f34f482 100644
--- a/modules/plugins/filetemplate-bundle/pom.xml
+++ b/modules/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index ebdb5c0..4b2b980 100644
--- a/modules/plugins/grub/pom.xml
+++ b/modules/plugins/grub/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hadoop/pom.xml b/modules/plugins/hadoop/pom.xml
index a3f17f4..38cc103 100644
--- a/modules/plugins/hadoop/pom.xml
+++ b/modules/plugins/hadoop/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index 44ac23f..ea1f0d1 100644
--- a/modules/plugins/hibernate/pom.xml
+++ b/modules/plugins/hibernate/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<!-- Bypass the jopr-plugins-parent which can not have children. It must build
after the plugins in order to execute integration tests on them. -->
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index a9e7295..1ebacce 100644
--- a/modules/plugins/hosts/pom.xml
+++ b/modules/plugins/hosts/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index 092ac13..b9e3cc4 100644
--- a/modules/plugins/hudson/pom.xml
+++ b/modules/plugins/hudson/pom.xml
@@ -6,12 +6,12 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-hudson-plugin</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<packaging>jar</packaging>
<name>RHQ Hudson Plugin</name>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index 6853c1a..efede6e 100644
--- a/modules/plugins/iis/pom.xml
+++ b/modules/plugins/iis/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/irc/pom.xml b/modules/plugins/irc/pom.xml
index b32ee81..78f4497 100644
--- a/modules/plugins/irc/pom.xml
+++ b/modules/plugins/irc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml
index dc08424..069f513 100644
--- a/modules/plugins/jboss-as-5/pom.xml
+++ b/modules/plugins/jboss-as-5/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-as-7/pom.xml b/modules/plugins/jboss-as-7/pom.xml
index f4a7a88..b9b0914 100644
--- a/modules/plugins/jboss-as-7/pom.xml
+++ b/modules/plugins/jboss-as-7/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index 993a215..49f6c0f 100644
--- a/modules/plugins/jboss-as/pom.xml
+++ b/modules/plugins/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache-v3/pom.xml
b/modules/plugins/jboss-cache-v3/pom.xml
index 44e9ce9..4c29f36 100644
--- a/modules/plugins/jboss-cache-v3/pom.xml
+++ b/modules/plugins/jboss-cache-v3/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index a8e46d8..e389e43 100644
--- a/modules/plugins/jboss-cache/pom.xml
+++ b/modules/plugins/jboss-cache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index 18e79f9..bdd9bee 100644
--- a/modules/plugins/jmx/pom.xml
+++ b/modules/plugins/jmx/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/kickstart/pom.xml b/modules/plugins/kickstart/pom.xml
index c3c0db9..50b2499 100644
--- a/modules/plugins/kickstart/pom.xml
+++ b/modules/plugins/kickstart/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index 206f2d7..e124f9d 100644
--- a/modules/plugins/mod-cluster/pom.xml
+++ b/modules/plugins/mod-cluster/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index c1a9f61..1658fe1 100644
--- a/modules/plugins/mysql/pom.xml
+++ b/modules/plugins/mysql/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index 9678528..0f5c16e 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/noop/pom.xml b/modules/plugins/noop/pom.xml
index 06b5a80..b23f064 100644
--- a/modules/plugins/noop/pom.xml
+++ b/modules/plugins/noop/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index cd0c446..6f4b633 100644
--- a/modules/plugins/oracle/pom.xml
+++ b/modules/plugins/oracle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pattern-generator/pom.xml
b/modules/plugins/pattern-generator/pom.xml
index 2160f12..7799f76 100644
--- a/modules/plugins/pattern-generator/pom.xml
+++ b/modules/plugins/pattern-generator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index 1b10af4..71c7a9c 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index 4e18f5f..905d5e4 100644
--- a/modules/plugins/platform/pom.xml
+++ b/modules/plugins/platform/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index 51af020..f0d8ee8 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index feb87c4..524323c 100644
--- a/modules/plugins/postfix/pom.xml
+++ b/modules/plugins/postfix/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index bb904517..2435c1b 100644
--- a/modules/plugins/postgres/pom.xml
+++ b/modules/plugins/postgres/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index 414a2c4..cddb38b 100644
--- a/modules/plugins/rhq-agent/pom.xml
+++ b/modules/plugins/rhq-agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index f373663..937eb85 100644
--- a/modules/plugins/rhq-server/pom.xml
+++ b/modules/plugins/rhq-server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-storage/pom.xml b/modules/plugins/rhq-storage/pom.xml
index 942836c..2aad5b4 100644
--- a/modules/plugins/rhq-storage/pom.xml
+++ b/modules/plugins/rhq-storage/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 9269350..b866d2f 100644
--- a/modules/plugins/samba/pom.xml
+++ b/modules/plugins/samba/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index c018eed..5d7ef5b 100644
--- a/modules/plugins/script/pom.xml
+++ b/modules/plugins/script/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script2/pom.xml b/modules/plugins/script2/pom.xml
index b2c4587..9ed4854 100644
--- a/modules/plugins/script2/pom.xml
+++ b/modules/plugins/script2/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index 404f7d6..ff2b497 100644
--- a/modules/plugins/snmptrapd/pom.xml
+++ b/modules/plugins/snmptrapd/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sonarqube/pom.xml b/modules/plugins/sonarqube/pom.xml
index fb12b85..ee32fdb 100644
--- a/modules/plugins/sonarqube/pom.xml
+++ b/modules/plugins/sonarqube/pom.xml
@@ -6,7 +6,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>rhq-sonarqube-plugin</artifactId>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index 9f53f6f..bae1ef8 100644
--- a/modules/plugins/sshd/pom.xml
+++ b/modules/plugins/sshd/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 764fe67..b81a49b 100644
--- a/modules/plugins/sudoers/pom.xml
+++ b/modules/plugins/sudoers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index f043ba1..675ca01 100644
--- a/modules/plugins/tomcat/pom.xml
+++ b/modules/plugins/tomcat/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index 67c4519..af40f59 100644
--- a/modules/plugins/twitter/pom.xml
+++ b/modules/plugins/twitter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/validate-all-plugins/pom.xml
b/modules/plugins/validate-all-plugins/pom.xml
index 01d0d24..d8b94f1 100644
--- a/modules/plugins/validate-all-plugins/pom.xml
+++ b/modules/plugins/validate-all-plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/virt/pom.xml b/modules/plugins/virt/pom.xml
index 7fbac03..0190782 100644
--- a/modules/plugins/virt/pom.xml
+++ b/modules/plugins/virt/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index 41280b9..6246923 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index 3d4ed73..709046e 100644
--- a/modules/test-utils/pom.xml
+++ b/modules/test-utils/pom.xml
@@ -7,7 +7,7 @@
<parent>
<artifactId>rhq-modules-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
</parent>
<artifactId>test-utils</artifactId>
diff --git a/pom.xml b/pom.xml
index 1411a96..a32b096 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.9.0.JON320ER2</version>
+ <version>4.9.0.JON320ER3</version>
<packaging>pom</packaging>
<name>RHQ</name>
commit cc93fa01a1c77095ab6034947e0c30746a6001e2
Merge: e24b2f2 2500cea
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Tue Oct 1 01:47:19 2013 -0400
Merge branch 'master' into nightly/rhq.jon
Conflicts:
modules/enterprise/server/jar/intentional-api-changes-since-4.9.0.xml
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
commit 2500ceada45227159402ce9cf9e101f2dc9e8af3
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Mon Sep 30 18:35:01 2013 -0700
[BZ 1003932] Metrics Screen Hovers 'stick' to first graph opened in graph
list. Switched from local svg coordinate system to global page html coordinate system.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/StackedBarMetricGraphImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/StackedBarMetricGraphImpl.java
index abd8dd6..df56937 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/StackedBarMetricGraphImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/StackedBarMetricGraphImpl.java
@@ -323,8 +323,8 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
startDate = new Date(+d.x),
metricGraphTooltipDiv =
$wnd.d3.select("#metricGraphTooltip");
- metricGraphTooltipDiv.style("left", + timeScale(+d.x) + 55 +
"px")
- .style("top", "70px");
+ metricGraphTooltipDiv.style("left", + ($wnd.d3.event.pageX) +15
+ "px")
+ .style("top", ($wnd.d3.event.pageY)+"px");
metricGraphTooltipDiv.select("#metricGraphTooltipTimeLabel")
.text(chartContext.timeLabel);
@@ -368,8 +368,8 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
startDate = new Date(+d.x),
noDataTooltipDiv = $wnd.d3.select("#noDataTooltip");
- noDataTooltipDiv.style("left", + timeScale(+d.x)+55 +
"px")
- .style("top", "70px");
+ noDataTooltipDiv.style("left", + ($wnd.d3.event.pageX) + 15 +
"px")
+ .style("top", ($wnd.d3.event.pageY)+"px");
noDataTooltipDiv.select("#noDataTooltipTimeLabel")
.text(chartContext.timeLabel);
@@ -528,9 +528,10 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
var timeFormatter =
$wnd.d3.time.format(chartContext.chartHoverTimeFormat),
dateFormatter =
$wnd.d3.time.format(chartContext.chartHoverDateFormat),
startDate = new Date(+d.x),
- singleValueGraphTooltipDiv =
$wnd.d3.select("#singleValueTooltip")
- .style("left", + timeScale(+d.x) +55 +
"px")
- .style("top", + yScale(+d.y)+
"px");
+ singleValueGraphTooltipDiv =
$wnd.d3.select("#singleValueTooltip");
+
+ singleValueGraphTooltipDiv.style("left", +
($wnd.d3.event.pageX) + 15 + "px")
+ .style("top",
($wnd.d3.event.pageY)+"px");
singleValueGraphTooltipDiv.select("#singleValueTooltipTimeLabel")
.text(chartContext.timeLabel);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/MetricD3Graph.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/MetricD3Graph.java
index 6081aef..f153022 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/MetricD3Graph.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/MetricD3Graph.java
@@ -168,112 +168,11 @@ public class MetricD3Graph<T extends AbstractD3GraphListView>
extends EnhancedVL
+ height + "px;\">");
divAndSvgDefs.append(getSvgDefs());
divAndSvgDefs.append("</svg>");
- divAndSvgDefs.append(createSingleValueTooltip());
- divAndSvgDefs.append(createNoDataTooltip());
- divAndSvgDefs.append(createMetricTooltip());
divAndSvgDefs.append("</div>");
return divAndSvgDefs.toString();
}
- private static String createMetricTooltip() {
- StringBuilder tooltipDivs = new StringBuilder();
-
- tooltipDivs.append("<div id=\"metricGraphTooltip\"
class=\"hidden\" >");
-
- tooltipDivs.append("<div>");
- tooltipDivs.append("<span id=\"metricGraphTooltipTimeLabel\"
></span>");
- tooltipDivs.append("<span>: </span>");
- tooltipDivs.append("<span id=\"metricGraphTooltipTimeValue\"
></span>");
- tooltipDivs.append("</div>");
-
- tooltipDivs.append("<div>");
- tooltipDivs.append("<span id=\"metricGraphTooltipDateLabel\"
></span>");
- tooltipDivs.append("<span>: </span>");
- tooltipDivs.append("<span id=\"metricGraphTooltipDateValue\"
></span>");
- tooltipDivs.append("</div>");
-
- tooltipDivs.append("<div>");
- tooltipDivs.append("<span
id=\"metricGraphTooltipDurationLabel\" ></span>");
- tooltipDivs.append("<span>: </span>");
- tooltipDivs.append("<span
id=\"metricGraphTooltipDurationValue\" ></span>");
- tooltipDivs.append("<div/>");
- tooltipDivs.append("<hr></hr>");
-
- tooltipDivs.append("<div >");
- tooltipDivs.append("<span id=\"metricGraphTooltipMaxLabel\"
></span>");
- tooltipDivs.append("<span> : </span>");
- tooltipDivs.append("<span id=\"metricGraphTooltipMaxValue\"
></span>");
- tooltipDivs.append("<div/>");
-
- tooltipDivs.append("<div>");
- tooltipDivs.append("<span id=\"metricGraphTooltipAvgLabel\"
></span>");
- tooltipDivs.append("<span> : </span>");
- tooltipDivs.append("<span id=\"metricGraphTooltipAvgValue\"
></span>");
- tooltipDivs.append("<div/>");
-
- tooltipDivs.append("<div>");
- tooltipDivs.append("<span id=\"metricGraphTooltipMinLabel\"
></span>");
- tooltipDivs.append("<span> : </span>");
- tooltipDivs.append("<span id=\"metricGraphTooltipMinValue\"
></span>");
- tooltipDivs.append("<div/>");
-
-
- tooltipDivs.append("</div>"); // end metricGraphTooltipDiv
- return tooltipDivs.toString();
- }
-
- private static String createNoDataTooltip() {
- StringBuilder tooltipDivs = new StringBuilder();
-
- tooltipDivs.append("<div id=\"noDataTooltip\"
class=\"hidden\" >");
-
- tooltipDivs.append("<div>");
- tooltipDivs.append("<span id=\"noDataTooltipTimeLabel\"
></span>");
- tooltipDivs.append("<span>: </span>");
- tooltipDivs.append("<span id=\"noDataTooltipTimeValue\"
></span>");
- tooltipDivs.append("</div>");
-
- tooltipDivs.append("<div>");
- tooltipDivs.append("<span id=\"noDataTooltipDateLabel\"
></span>");
- tooltipDivs.append("<span>: </span>");
- tooltipDivs.append("<span id=\"noDataTooltipDateValue\"
></span>");
- tooltipDivs.append("</div>");
- tooltipDivs.append("<hr></hr>");
-
- tooltipDivs.append("<div id=\"noDataLabel\"
></div>");
-
- tooltipDivs.append("</div>"); // end noDataTooltipDiv
- return tooltipDivs.toString();
- }
-
- private static String createSingleValueTooltip() {
- StringBuilder tooltipDivs = new StringBuilder();
-
- tooltipDivs.append("<div id=\"singleValueTooltip\"
class=\"hidden\" >");
-
- tooltipDivs.append("<div>");
- tooltipDivs.append("<span id=\"singleValueTooltipTimeLabel\"
></span>");
- tooltipDivs.append("<span>: </span>");
- tooltipDivs.append("<span id=\"singleValueTooltipTimeValue\"
></span>");
- tooltipDivs.append("</div>");
-
- tooltipDivs.append("<div>");
- tooltipDivs.append("<span id=\"singleValueTooltipDateLabel\"
></span>");
- tooltipDivs.append("<span>: </span>");
- tooltipDivs.append("<span id=\"singleValueTooltipDateValue\"
></span>");
- tooltipDivs.append("</div>");
- tooltipDivs.append("<hr></hr>");
-
- tooltipDivs.append("<div>");
- tooltipDivs.append("<span id=\"singleValueTooltipValueLabel\"
></span>");
- tooltipDivs.append("<span>: </span>");
- tooltipDivs.append("<span id=\"singleValueTooltipValue\"
></span>");
- tooltipDivs.append("</div>");
-
- tooltipDivs.append("</div>"); // end singleValueTooltipDiv
- return tooltipDivs.toString();
- }
/**
* Delegate the call to rendering the JSNI chart.
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
index 6499483..a8812a9 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
+++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
@@ -5,10 +5,10 @@
http://forums.smartclient.com/showthread.php?t=15973
2) solves initial app load issues that we experienced on some XP and
Vista/Windows7 flavors.
-->
- <meta http-equiv="X-UA-Compatible" content="IE=9" />
+ <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<!-- support internationalized characters -->
- <meta http-equiv="Content-Type"
content="text/html;charset=UTF-8" />
+ <meta http-equiv="Content-Type"
content="text/html;charset=UTF-8"/>
<link rel="stylesheet" href="CoreGUI-4.9.0.css">
<!-- for d3 charting -->
@@ -17,18 +17,19 @@
<script type="text/javascript">
var search = location.search;
// only do this if you have not specified locale as query param
- if(search.indexOf("locale") == -1){
+ if (search.indexOf("locale") == -1) {
// IE uses browserLanguage
- var lang = navigator.language!=null ? navigator.language :
navigator.browserLanguage;
+ var lang = navigator.language != null ? navigator.language :
navigator.browserLanguage;
lang = lang.replace("-", "_");
- document.write("<meta name='gwt:property'
content='locale="+lang +"'>");
+ document.write("<meta name='gwt:property'
content='locale=" + lang + "'>");
}
</script>
<script type="text/javascript">
- (function() {
+ (function () {
var method;
- var noop = function () {};
+ var noop = function () {
+ };
var methods = [
'assert', 'clear', 'count', 'debug',
'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed',
'groupEnd', 'info', 'log',
@@ -50,21 +51,22 @@
</script>
<title>RHQ</title>
- <link rel="icon" type="image/png"
href="/images/favicon.png" />
- <link rel="apple-touch-icon" href="/images/favicon.png" />
+ <link rel="icon" type="image/png"
href="/images/favicon.png"/>
+ <link rel="apple-touch-icon" href="/images/favicon.png"/>
<script type="text/javascript">
var isomorphicDir = "org.rhq.enterprise.gui.coregui.CoreGUI/sc/";
</script>
-
</head>
<body>
<script type="text/javascript" language="javascript"
src="org.rhq.enterprise.gui.coregui.CoreGUI/org.rhq.enterprise.gui.coregui.CoreGUI.nocache.js"></script>
+
+
<div id="Loading-Panel" style="width: 214px; height: 90px; margin-top:
300px; margin-left: 40%; margin-right: 40%;">
<div style="text-align: center; border: 3px solid lightgray;">
<img src="images/rhq_logo_animated_100px.gif"
alt="Loading..." style="border: none;">
@@ -74,5 +76,47 @@
<iframe src="javascript:''" id="__gwt_historyFrame"
style="width:0;height:0;border:0"></iframe>
+<div id="singleValueTooltip" class="hidden">
+ <div><span
id="singleValueTooltipTimeLabel"></span><span>:
</span><span id="singleValueTooltipTimeValue"></span>
+ </div>
+ <div><span
id="singleValueTooltipDateLabel"></span><span>:
</span><span id="singleValueTooltipDateValue"></span>
+ </div>
+ <hr>
+ <div><span
id="singleValueTooltipValueLabel"></span><span>:
</span><span id="singleValueTooltipValue"></span></div>
+</div>
+<div id="noDataTooltip" class="hidden">
+ <div><span
id="noDataTooltipTimeLabel"></span><span>: </span><span
id="noDataTooltipTimeValue"></span></div>
+ <div><span
id="noDataTooltipDateLabel"></span><span>: </span><span
id="noDataTooltipDateValue"></span></div>
+ <hr>
+ <div id="noDataLabel"></div>
+</div>
+<div id="metricGraphTooltip" class="hidden">
+ <div><span
id="metricGraphTooltipTimeLabel"></span><span>:
</span><span id="metricGraphTooltipTimeValue"></span>
+ </div>
+ <div><span
id="metricGraphTooltipDateLabel"></span><span>:
</span><span id="metricGraphTooltipDateValue"></span>
+ </div>
+ <div><span
id="metricGraphTooltipDurationLabel"></span><span>:
</span><span
+ id="metricGraphTooltipDurationValue"></span>
+ <div>
+ <hr>
+ <div><span
id="metricGraphTooltipMaxLabel"></span><span> :
</span><span
+ id="metricGraphTooltipMaxValue"></span>
+ <div>
+ <div><span
id="metricGraphTooltipAvgLabel"></span><span> :
</span><span
+ id="metricGraphTooltipAvgValue"></span>
+
+ <div>
+ <div><span
id="metricGraphTooltipMinLabel"></span><span> :
</span><span
+
id="metricGraphTooltipMinValue"></span>
+ <div></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+
</body>
</html>
commit a91848332427bcf365fccece1dcc6805009e68ad
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Tue Oct 1 00:58:38 2013 +0200
[BZ 1013489] - It is not possible to download an agent from RHQ server (HTTP Status
404) - Introducing three new simple wars for handling the
"/agentupdate/{download|version}", "/client/{download|version}" and
"/downloads/*". Besides fixing this bug, this commit should help to remove
portal war in the future.
diff --git a/modules/enterprise/gui/agentupdate-war/pom.xml
b/modules/enterprise/gui/agentupdate-war/pom.xml
new file mode 100644
index 0000000..a6a9182
--- /dev/null
+++ b/modules/enterprise/gui/agentupdate-war/pom.xml
@@ -0,0 +1,153 @@
+<?xml version="1.0"?>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-parent</artifactId>
+ <version>4.10.0-SNAPSHOT</version>
+ <relativePath>../../../../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-agentupdate-war</artifactId>
+ <packaging>war</packaging>
+ <name>RHQ Enterprise Agent Update War</name>
+ <description>the RHQ Enterprise Agent Update webapp</description>
+
+ <dependencies>
+ <!-- Internal Deps -->
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope> <!-- by rhq.ear (as ejb-jar) -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-server</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope> <!-- by rhq.ear (as ejb-jar) -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-util</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope> <!-- by rhq.ear -->
+ </dependency>
+
+ <!-- Import the Servlet API, we use provided scope as the API is included in
JBoss AS 7 -->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <!-- Set the name of the war, used as the context root when the app
+ is deployed -->
+ <finalName>rhq-agentupdate</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <failOnMissingWebXml>false</failOnMissingWebXml>
+ <archive>
+ <manifest>
+
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ </manifest>
+ <manifestEntries>
+ <Build-Number>${buildNumber}</Build-Number>
+ </manifestEntries>
+ </archive>
+ <webResources>
+ <resource>
+ <filtering>false</filtering>
+ <directory>${basedir}/src/main/webapp</directory>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>dev</id>
+
+ <properties>
+ <rhq.rootDir>../../../..</rhq.rootDir>
+
<rhq.containerDir>${rhq.rootDir}/${rhq.devContainerServerPath}</rhq.containerDir>
+
<rhq.deploymentName>${project.build.finalName}.war</rhq.deploymentName>
+
<rhq.deploymentDir>${rhq.containerDir}/${rhq.earDeployDir}/${rhq.deploymentName}</rhq.deploymentDir>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>deploy-classes</id>
+ <phase>compile</phase>
+ <configuration>
+ <target>
+ <property name="classes.dir"
location="${rhq.deploymentDir}/WEB-INF/classes" />
+ <echo>*** Copying updated files from target/classes to
${classes.dir}...</echo>
+ <copy todir="${classes.dir}"
verbose="${rhq.verbose}">
+ <fileset dir="target/classes" />
+ </copy>
+ <property name="deployment.dir"
location="${rhq.deploymentDir}" />
+ <echo>*** Copying updated files from
src${file.separator}main${file.separator}webapp${file.separator} to
${deployment.dir}${file.separator}...</echo>
+ <copy todir="${deployment.dir}"
verbose="${rhq.verbose}">
+ <fileset dir="${basedir}/src/main/webapp"
/>
+ </copy>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <execution>
+ <id>deploy</id>
+ <phase>package</phase>
+ <configuration>
+ <target>
+ <property name="deployment.dir"
location="${rhq.deploymentDir}" />
+ <echo>*** Copying updated files from
target${file.separator}${project.build.finalName}${file.separator} to
${deployment.dir}${file.separator}...</echo>
+ <copy todir="${deployment.dir}"
verbose="${rhq.verbose}">
+ <fileset
dir="${basedir}/target/${project.build.finalName}" />
+ </copy>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>undeploy</id>
+ <phase>clean</phase>
+ <configuration>
+ <target>
+ <property name="deployment.dir"
location="${rhq.deploymentDir}" />
+ <echo>*** Deleting
${deployment.dir}${file.separator}...</echo>
+ <delete dir="${deployment.dir}" />
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
diff --git
a/modules/enterprise/gui/agentupdate-war/src/main/java/org/rhq/enterprise/gui/agentupdate/AgentUpdateServlet.java
b/modules/enterprise/gui/agentupdate-war/src/main/java/org/rhq/enterprise/gui/agentupdate/AgentUpdateServlet.java
new file mode 100644
index 0000000..a35a9c6
--- /dev/null
+++
b/modules/enterprise/gui/agentupdate-war/src/main/java/org/rhq/enterprise/gui/agentupdate/AgentUpdateServlet.java
@@ -0,0 +1,273 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.agentupdate;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.rhq.core.domain.cloud.Server.OperationMode;
+import org.rhq.core.domain.common.composite.SystemSetting;
+import org.rhq.core.domain.common.composite.SystemSettings;
+import org.rhq.core.util.exception.ThrowableUtil;
+import org.rhq.core.util.stream.StreamUtil;
+import org.rhq.enterprise.server.core.AgentManagerLocal;
+import org.rhq.enterprise.server.util.LookupUtil;
+
+/**
+ * Serves the agent update binary that is stored in the RHQ Server's download area.
+ * This servlet also provides version information regarding the version of the agent
+ * this servlet serves up as well as versions of agents the RHQ Server supports.
+ */
+@WebServlet(urlPatterns = {"/download", "/version"}, loadOnStartup =
1)
+public class AgentUpdateServlet extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ // the system property that defines how many concurrent downloads we will allow
+ private static String SYSPROP_AGENT_DOWNLOADS_LIMIT =
"rhq.server.agent-downloads-limit";
+
+ // if the system property is not set or invalid, this is the default limit for number
of concurrent downloads
+ private static int DEFAULT_AGENT_DOWNLOADS_LIMIT = 45;
+
+ // the error code that will be returned if the server has been configured to disable
agent updates
+ private static final int ERROR_CODE_AGENT_UPDATE_DISABLED =
HttpServletResponse.SC_FORBIDDEN;
+
+ // the error code that will be returned if the server has too many agents downloading
the agent update binary
+ private static final int ERROR_CODE_TOO_MANY_DOWNLOADS =
HttpServletResponse.SC_SERVICE_UNAVAILABLE;
+
+ private AtomicInteger numActiveDownloads = null;
+
+ private Log log = LogFactory.getLog(this.getClass());
+
+ private AgentManagerLocal agentManager = null;
+
+ private boolean initialized = false;
+
+ @Override
+ public void init() throws ServletException {
+ log.info("Starting the RHQ agent update servlet");
+ numActiveDownloads = new AtomicInteger(0);
+ }
+
+ private synchronized void loadAgentUpdateBinaryInfo() throws ServletException {
+ if (!initialized) {
+ log.info("RHQ agent update servlet is looking up binary file
information...");
+
+ // make sure we have a agent update binary file; log its location
+ try {
+ log.info("Agent Update Binary File: " +
getAgentUpdateBinaryFile());
+ } catch (Throwable t) {
+ log.error("Missing agent update binary file - agents will not be
able to update", t);
+ }
+
+ // make sure we create a version file if we have to by getting the version
file now
+ try {
+ File versionFile = getAgentUpdateVersionFile();
+
+ // log the version info - this also makes sure we can read it back in
+ log.debug(versionFile + ": " + new String(StreamUtil.slurp(new
FileInputStream(versionFile))));
+
+ } catch (Throwable t) {
+ log.error("Cannot determine the agent version information - agents
will not be able to update.", t);
+ }
+
+ initialized = true;
+ }
+ }
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
+
+ // lazily initialize the servlet - we do this because when we started deploying
on AS7, our servlets
+ // init() method was being called before the agent SLSB is ready. So we don't
init() this at startup,
+ // rather, we now init this servlet the first time someone requests the agent
update binary file.
+ loadAgentUpdateBinaryInfo();
+
+ // seeing odd browser caching issues, even though we set Last-Modified. so force
no caching for now
+ disableBrowserCache(resp);
+
+ String servletPath = req.getServletPath();
+ if (servletPath != null) {
+ if (isServerAcceptingRequests()) {
+ if (servletPath.endsWith("version")) {
+ getVersion(req, resp);
+ } else if (servletPath.endsWith("download")) {
+ try {
+ numActiveDownloads.incrementAndGet();
+ getDownload(req, resp);
+ } finally {
+ numActiveDownloads.decrementAndGet();
+ }
+ } else {
+ resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Invalid
servlet path [" + servletPath
+ + "] - please contact administrator");
+ }
+ } else {
+ sendErrorServerNotAcceptingRequests(resp);
+ }
+ } else {
+ resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Invalid servlet path
- please contact administrator");
+ }
+
+ return;
+ }
+
+ private void getDownload(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
+ int limit = getDownloadLimit();
+ if (limit <= 0) {
+ sendErrorAgentUpdateDisabled(resp);
+ return;
+ } else if (limit < numActiveDownloads.get()) {
+ sendErrorTooManyDownloads(resp);
+ return;
+ }
+
+ try {
+ File agentJar = getAgentUpdateBinaryFile();
+ resp.setContentType("application/octet-stream");
+ resp.setHeader("Content-Disposition", "attachment;
filename=" + agentJar.getName());
+ resp.setContentLength((int) agentJar.length());
+ resp.setDateHeader("Last-Modified", agentJar.lastModified());
+
+ FileInputStream agentJarStream = new FileInputStream(agentJar);
+ try {
+ StreamUtil.copy(agentJarStream, resp.getOutputStream(), false);
+ } finally {
+ agentJarStream.close();
+ }
+ } catch (Throwable t) {
+ String clientAddr = getClientAddress(req);
+ log.error("Failed to stream agent jar to remote client [" +
clientAddr + "]: "
+ + ThrowableUtil.getAllMessages(t));
+ disableBrowserCache(resp);
+ resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Failed to
stream agent jar");
+ }
+
+ return;
+ }
+
+ private void getVersion(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
+ try {
+ File versionFile = getAgentUpdateVersionFile();
+ resp.setContentType("text/plain");
+ resp.setDateHeader("Last-Modified", versionFile.lastModified());
+
+ FileInputStream stream = new FileInputStream(versionFile);
+ byte[] versionData = StreamUtil.slurp(stream);
+ resp.getOutputStream().write(versionData);
+ } catch (Throwable t) {
+ String clientAddr = getClientAddress(req);
+ log.error("Failed to stream version info to remote client [" +
clientAddr + "]: "
+ + ThrowableUtil.getAllMessages(t));
+ disableBrowserCache(resp);
+ resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Failed to
stream version info");
+ }
+
+ return;
+ }
+
+ private int getDownloadLimit() {
+ // if the server cloud was configured to disallow updates, return 0
+ SystemSettings systemConfig = LookupUtil.getSystemManager().getSystemSettings(
+ LookupUtil.getSubjectManager().getOverlord());
+ if
(!Boolean.parseBoolean(systemConfig.get(SystemSetting.AGENT_AUTO_UPDATE_ENABLED))) {
+ return 0;
+ }
+
+ String limitStr = System.getProperty(SYSPROP_AGENT_DOWNLOADS_LIMIT);
+ int limit;
+ try {
+ limit = Integer.parseInt(limitStr);
+ } catch (Exception e) {
+ limit = DEFAULT_AGENT_DOWNLOADS_LIMIT;
+ log.warn("Agent downloads limit system property [" +
SYSPROP_AGENT_DOWNLOADS_LIMIT
+ + "] is either not set or invalid [" + limitStr + "] -
limit will be [" + limit + "].");
+ }
+
+ return limit;
+ }
+
+ private void disableBrowserCache(HttpServletResponse resp) {
+ resp.setHeader("Cache-Control", "no-cache, no-store");
+ resp.setHeader("Expires", "-1");
+ resp.setHeader("Pragma", "no-cache");
+ }
+
+ private void sendErrorServerNotAcceptingRequests(HttpServletResponse resp) throws
IOException {
+ disableBrowserCache(resp);
+ resp.sendError(ERROR_CODE_AGENT_UPDATE_DISABLED, "Server Is Down For
Maintenance");
+ }
+
+ private void sendErrorAgentUpdateDisabled(HttpServletResponse resp) throws
IOException {
+ disableBrowserCache(resp);
+ resp.sendError(ERROR_CODE_AGENT_UPDATE_DISABLED, "Agent Updates Has Been
Disabled");
+ }
+
+ private void sendErrorTooManyDownloads(HttpServletResponse resp) throws IOException
{
+ disableBrowserCache(resp);
+ resp.setHeader("Retry-After", "30");
+ resp.sendError(ERROR_CODE_TOO_MANY_DOWNLOADS, "Maximum limit exceeded -
download agent later");
+ }
+
+ private File getAgentUpdateVersionFile() throws Exception {
+ return getAgentManager().getAgentUpdateVersionFile();
+ }
+
+ private File getAgentUpdateBinaryFile() throws Exception {
+ return getAgentManager().getAgentUpdateBinaryFile();
+ }
+
+ private AgentManagerLocal getAgentManager() {
+ if (this.agentManager == null) {
+ this.agentManager = LookupUtil.getAgentManager();
+ }
+ return this.agentManager;
+ }
+
+ private boolean isServerAcceptingRequests() {
+ try {
+ OperationMode mode =
LookupUtil.getServerManager().getServer().getOperationMode();
+ return mode == OperationMode.NORMAL;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ private String getClientAddress(HttpServletRequest request) {
+ String ip = request.getHeader("X-Forwarded-For");
+ if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
{
+ ip = request.getHeader("HTTP_X_FORWARDED_FOR");
+ if (ip == null || ip.length() == 0 ||
"unknown".equalsIgnoreCase(ip)) {
+ ip = String.format("%s (%s)", request.getRemoteHost(),
request.getRemoteAddr());
+ }
+ }
+ return ip;
+ }
+}
diff --git a/modules/enterprise/gui/agentupdate-war/src/main/webapp/index.html
b/modules/enterprise/gui/agentupdate-war/src/main/webapp/index.html
new file mode 100644
index 0000000..5d7a115
--- /dev/null
+++ b/modules/enterprise/gui/agentupdate-war/src/main/webapp/index.html
@@ -0,0 +1,5 @@
+<html>
+ <head>
+ <meta http-equiv="Refresh" content="0; URL=version">
+ </head>
+</html>
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/DownloadsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/DownloadsView.java
index 5f3b9b6..ed966c2 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/DownloadsView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/DownloadsView.java
@@ -53,8 +53,6 @@ public class DownloadsView extends EnhancedVLayout {
public static final String VIEW_PATH = AdministrationView.VIEW_ID + "/"
+ AdministrationView.SECTION_CONFIGURATION_VIEW_ID + "/" + VIEW_ID;
- private static final String PORTAL_WAR_CONTEXT = "/portal";
-
private final SystemGWTServiceAsync systemManager =
GWTServiceLookup.getSystemService();
private SectionStack sectionStack;
@@ -145,7 +143,7 @@ public class DownloadsView extends EnhancedVLayout {
StaticTextItem linkItem = new StaticTextItem("agentLink");
linkItem.setTitle(MSG.common_label_link());
- linkItem.setValue("<a href=\"" + PORTAL_WAR_CONTEXT +
"/agentupdate/download\">"
+ linkItem.setValue("<a
href=\"/agentupdate/download\">"
+ MSG.view_admin_downloads_agent_link_value(version, build) +
"</a>");
SpacerItem spacerItem = new SpacerItem("agentSpacer");
@@ -196,7 +194,7 @@ public class DownloadsView extends EnhancedVLayout {
StaticTextItem linkItem = new StaticTextItem("cliLink");
linkItem.setTitle(MSG.common_label_link());
- linkItem.setValue("<a href=\"" + PORTAL_WAR_CONTEXT +
"/client/download\">"
+ linkItem.setValue("<a
href=\"/client/download\">"
+ MSG.view_admin_downloads_cli_link_value(version, build) +
"</a>");
SpacerItem spacerItem = new SpacerItem("clientSpacer");
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
index 9792b5f..6c458e3 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
@@ -48,8 +48,6 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl
implements Syst
private static final long serialVersionUID = 1L;
- private static final String PORTAL_WAR_CONTEXT = "/portal";
-
private SystemManagerLocal systemManager = LookupUtil.getSystemManager();
private AgentManagerLocal agentManager = LookupUtil.getAgentManager();
private RemoteClientManagerLocal remoteClientManager =
LookupUtil.getRemoteClientManager();
@@ -138,7 +136,7 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl
implements Syst
HashMap<String, String> map = new HashMap<String,
String>(files.size());
for (File file : files) {
// key is the filename, value is the relative URL to download the file
from the server
- map.put(file.getName(), PORTAL_WAR_CONTEXT +
"/downloads/connectors/" + file.getName());
+ map.put(file.getName(), "/downloads/connectors/" +
file.getName());
}
return map;
} catch (Throwable t) {
@@ -158,7 +156,7 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl
implements Syst
HashMap<String, String> ret = new HashMap<String,
String>(files.size());
for (File file : files) {
- ret.put(file.getName(), PORTAL_WAR_CONTEXT +
"/downloads/cli-alert-scripts/" + file.getName());
+ ret.put(file.getName(), "/downloads/cli-alert-scripts/" +
file.getName());
}
return ret;
}
@@ -178,7 +176,7 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl
implements Syst
HashMap<String, String> ret = new HashMap<String,
String>(files.size());
for (File file : files) {
- ret.put(file.getName(), PORTAL_WAR_CONTEXT +
"/downloads/script-modules/" + file.getName());
+ ret.put(file.getName(), "/downloads/script-modules/" +
file.getName());
}
return ret;
}
@@ -207,7 +205,7 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl
implements Syst
}
File file = files.get(0);
HashMap<String, String> ret = new HashMap<String, String>(1);
- ret.put(file.getName(), PORTAL_WAR_CONTEXT +
"/downloads/bundle-deployer/" + file.getName());
+ ret.put(file.getName(), "/downloads/bundle-deployer/" +
file.getName());
return ret;
} catch (Throwable t) {
throw getExceptionToThrowToClient(t);
diff --git a/modules/enterprise/gui/downloads-war/pom.xml
b/modules/enterprise/gui/downloads-war/pom.xml
new file mode 100644
index 0000000..9d694cb
--- /dev/null
+++ b/modules/enterprise/gui/downloads-war/pom.xml
@@ -0,0 +1,153 @@
+<?xml version="1.0"?>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-parent</artifactId>
+ <version>4.10.0-SNAPSHOT</version>
+ <relativePath>../../../../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-downloads-war</artifactId>
+ <packaging>war</packaging>
+ <name>RHQ Enterprise Downloads War</name>
+ <description>the RHQ Enterprise Downloads webapp</description>
+
+ <dependencies>
+ <!-- Internal Deps -->
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope> <!-- by rhq.ear (as ejb-jar) -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-server</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope> <!-- by rhq.ear (as ejb-jar) -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-util</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope> <!-- by rhq.ear -->
+ </dependency>
+
+ <!-- Import the Servlet API, we use provided scope as the API is included in
JBoss AS 7 -->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <!-- Set the name of the war, used as the context root when the app
+ is deployed -->
+ <finalName>rhq-downloads</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <failOnMissingWebXml>false</failOnMissingWebXml>
+ <archive>
+ <manifest>
+
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ </manifest>
+ <manifestEntries>
+ <Build-Number>${buildNumber}</Build-Number>
+ </manifestEntries>
+ </archive>
+ <webResources>
+ <resource>
+ <filtering>false</filtering>
+ <directory>${basedir}/src/main/webapp</directory>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>dev</id>
+
+ <properties>
+ <rhq.rootDir>../../../..</rhq.rootDir>
+
<rhq.containerDir>${rhq.rootDir}/${rhq.devContainerServerPath}</rhq.containerDir>
+
<rhq.deploymentName>${project.build.finalName}.war</rhq.deploymentName>
+
<rhq.deploymentDir>${rhq.containerDir}/${rhq.earDeployDir}/${rhq.deploymentName}</rhq.deploymentDir>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>deploy-classes</id>
+ <phase>compile</phase>
+ <configuration>
+ <target>
+ <property name="classes.dir"
location="${rhq.deploymentDir}/WEB-INF/classes" />
+ <echo>*** Copying updated files from target/classes to
${classes.dir}...</echo>
+ <copy todir="${classes.dir}"
verbose="${rhq.verbose}">
+ <fileset dir="target/classes" />
+ </copy>
+ <property name="deployment.dir"
location="${rhq.deploymentDir}" />
+ <echo>*** Copying updated files from
src${file.separator}main${file.separator}webapp${file.separator} to
${deployment.dir}${file.separator}...</echo>
+ <copy todir="${deployment.dir}"
verbose="${rhq.verbose}">
+ <fileset dir="${basedir}/src/main/webapp"
/>
+ </copy>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <execution>
+ <id>deploy</id>
+ <phase>package</phase>
+ <configuration>
+ <target>
+ <property name="deployment.dir"
location="${rhq.deploymentDir}" />
+ <echo>*** Copying updated files from
target${file.separator}${project.build.finalName}${file.separator} to
${deployment.dir}${file.separator}...</echo>
+ <copy todir="${deployment.dir}"
verbose="${rhq.verbose}">
+ <fileset
dir="${basedir}/target/${project.build.finalName}" />
+ </copy>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>undeploy</id>
+ <phase>clean</phase>
+ <configuration>
+ <target>
+ <property name="deployment.dir"
location="${rhq.deploymentDir}" />
+ <echo>*** Deleting
${deployment.dir}${file.separator}...</echo>
+ <delete dir="${deployment.dir}" />
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
diff --git
a/modules/enterprise/gui/downloads-war/src/main/java/org/rhq/enterprise/gui/download/DownloadServlet.java
b/modules/enterprise/gui/downloads-war/src/main/java/org/rhq/enterprise/gui/download/DownloadServlet.java
new file mode 100644
index 0000000..a6b6818
--- /dev/null
+++
b/modules/enterprise/gui/downloads-war/src/main/java/org/rhq/enterprise/gui/download/DownloadServlet.java
@@ -0,0 +1,295 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.download;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.rhq.core.domain.cloud.Server.OperationMode;
+import org.rhq.core.util.stream.StreamUtil;
+import org.rhq.enterprise.server.util.LookupUtil;
+
+/**
+ * Serves the static content found in rhq-downloads.
+ */
+@WebServlet(urlPatterns = {"/*"}, loadOnStartup = 1)
+public class DownloadServlet extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ // the system property that disables/enables file listing - default is to show the
listing
+ private static String SYSPROP_SHOW_DOWNLOADS_LISTING =
"rhq.server.show-downloads-listing";
+
+ private static int numActiveDownloads = 0;
+ private static boolean showDownloadsListing;
+
+ private Log log = LogFactory.getLog(this.getClass());
+
+ @Override
+ public void init() throws ServletException {
+ log.info("Starting the RHQ download servlet...");
+
+ String propValue = System.getProperty(SYSPROP_SHOW_DOWNLOADS_LISTING,
"true");
+ showDownloadsListing = Boolean.parseBoolean(propValue);
+ }
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
+
+ // seeing odd browser caching issues, even though we set Last-Modified. so force
no caching for now
+ disableBrowserCache(resp);
+
+ if (isServerAcceptingRequests()) {
+ String requestedDirectory = getRequestedDirectory(req);
+ if (requestedDirectory == null) {
+ numActiveDownloads++;
+ download(req, resp);
+ numActiveDownloads--;
+ } else {
+ if (showDownloadsListing) {
+ outputFileList(requestedDirectory, req, resp);
+ } else {
+ disableBrowserCache(resp);
+ resp.sendError(HttpServletResponse.SC_FORBIDDEN, "Listing
disabled");
+ }
+ }
+ } else {
+ sendErrorServerNotAcceptingRequests(resp);
+ }
+ return;
+ }
+
+ /**
+ * Returns the relative path of the requested directory but only if it exists in
+ * one of the root directories. If the requested path is a file or the directory
+ * doesn't exist under a root directory, null is returned.
+ *
+ * @param req
+ * @return relative path of the directory being requested
+ * @throws ServletException
+ */
+ private String getRequestedDirectory(HttpServletRequest req) throws ServletException
{
+
+ String pathInfo = req.getPathInfo();
+
+ File[] rootDownloadsDirs;
+ try {
+ rootDownloadsDirs = getRootDownloadsDirs();
+ } catch (Throwable t) {
+ throw new ServletException(t);
+ }
+
+ if (pathInfo == null || pathInfo.equals("") ||
pathInfo.equals("/")) {
+ return "";
+ }
+
+ for (File rootDownloadsDir : rootDownloadsDirs) {
+ File downloadDir = new File(rootDownloadsDir, pathInfo);
+ if (downloadDir.isDirectory()) {
+ return pathInfo;
+ }
+ }
+
+ // either the path does not exist or its a file, not a directory
+ return null;
+ }
+
+ private void download(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
+ try {
+ if (isForbiddenPath(req.getPathInfo(), resp)) {
+ return;
+ }
+
+ // look for the file in one of the root download directories
+ File fileToDownload = null;
+ File[] downloadDirs = getRootDownloadsDirs();
+ for (File downloadDir : downloadDirs) {
+ File file = new File(downloadDir, req.getPathInfo());
+ if (file.exists()) {
+ fileToDownload = file;
+ break;
+ }
+ }
+
+ if (fileToDownload == null) {
+ disableBrowserCache(resp);
+ resp.sendError(HttpServletResponse.SC_NOT_FOUND, "File does not
exist: " + req.getPathInfo());
+ return;
+ }
+
+ resp.setContentType(getMimeType(fileToDownload));
+ resp.setHeader("Content-Disposition", "attachment;
filename=" + fileToDownload.getName());
+ resp.setContentLength((int) fileToDownload.length());
+ resp.setDateHeader("Last-Modified",
fileToDownload.lastModified());
+
+ FileInputStream stream = new FileInputStream(fileToDownload);
+ try {
+ StreamUtil.copy(stream, resp.getOutputStream(), false);
+ } finally {
+ stream.close();
+ }
+ } catch (Throwable t) {
+ log.error("Failed to stream download content.", t);
+ disableBrowserCache(resp);
+ resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Failed to
download content");
+ }
+
+ return;
+ }
+
+ private String getMimeType(File file) {
+ String mimeType = null;
+
+ try {
+ mimeType = getServletContext().getMimeType(file.getName());
+ } catch (Throwable t) {
+ // i'm paranoid, no idea if this will ever happen, but its not fatal so
keep going
+ log.warn("Failed to get mime type for [" + file + "].",
t);
+ }
+
+ if (mimeType == null) {
+ mimeType = "application/octet-stream";
+ }
+ return mimeType;
+ }
+
+ private void outputFileList(String requestedDirectory, HttpServletRequest req,
HttpServletResponse resp)
+ throws ServletException {
+
+ try {
+ if (!isForbiddenPath(requestedDirectory, resp)) {
+ File requestedDirectoryRelativePath = new File(requestedDirectory);
+ String dirName = requestedDirectoryRelativePath.getName();
+ disableBrowserCache(resp);
+ resp.setContentType("text/html");
+ PrintWriter writer = resp.getWriter();
+
writer.println(String.format("<html><head><title>Available
Downloads: %s</title></head>", dirName));
+ writer.println("<body><h1>Available
Downloads</h1>");
+ writer.println(String.format("<font
size=\"+2\"><b><pre>%s</pre></b></font>",
dirName));
+ List<File> files = getDownloadFiles(requestedDirectory);
+ if (files.size() > 0) {
+ String pathInfo = req.getPathInfo();
+ if (!pathInfo.endsWith("/")) {
+ pathInfo += "/";
+ }
+ writer.println("<ul>");
+ for (File file : files) {
+ writer.println("<li><a href=\"" +
req.getContextPath() + req.getServletPath() + pathInfo + file.getName() +
"\">"
+ + file.getName() + "</a></li>");
+ }
+ writer.println("</ul>");
+ } else {
+ writer.println("<h4>NONE</h4>");
+ }
+ writer.println("</body></html>");
+ }
+ } catch (Exception e) {
+ throw new ServletException("Cannot get downloads listing", e);
+ }
+ }
+
+ private boolean isForbiddenPath(String requestedPath, HttpServletResponse resp)
throws IOException {
+ boolean forbidden = true; // assume it is forbidden
+ if (requestedPath.toString().contains("rhq-agent")) {
+ resp.sendError(HttpServletResponse.SC_FORBIDDEN, "Use
/agentupdate/download to obtain the agent");
+ } else if (requestedPath.toString().contains("rhq-client")) {
+ resp.sendError(HttpServletResponse.SC_FORBIDDEN, "Use /client/download
to obtain the client");
+ } else {
+ forbidden = false;
+ }
+ return forbidden;
+ }
+
+ private void sendErrorServerNotAcceptingRequests(HttpServletResponse resp) throws
IOException {
+ disableBrowserCache(resp);
+ resp.sendError(HttpServletResponse.SC_FORBIDDEN, "Server Is Down For
Maintenance");
+ }
+
+ private void disableBrowserCache(HttpServletResponse resp) {
+ resp.setHeader("Cache-Control", "no-cache, no-store");
+ resp.setHeader("Expires", "-1");
+ resp.setHeader("Pragma", "no-cache");
+ }
+
+ private List<File> getDownloadFiles(String requestedDirectory) throws Exception
{
+ // its possible if more than one root dir has the file, we'll get
duplicates.
+ // this should never happen, so ignore this edge case.
+ List<File> returnFiles = new ArrayList<File>();
+ File[] rootDownloadDirs = getRootDownloadsDirs();
+ for (File rootDownloadDir : rootDownloadDirs) {
+ File dir = new File(rootDownloadDir, requestedDirectory);
+ File[] filesArray = dir.listFiles();
+ // this is simple - we only serve up files located in the requested directory
- no content from subdirectories
+ if (filesArray != null) {
+ for (File file : filesArray) {
+ if (file.isFile()) {
+ returnFiles.add(file);
+ }
+ }
+ }
+ }
+
+ return returnFiles;
+ }
+
+ /**
+ * There are two locations for downloads - the static content under the EAR's
rhq-downloads
+ * and dynamic content in the data directory.
+ *
+ * @return the two root locations
+ *
+ * @throws Exception
+ */
+ private File[] getRootDownloadsDirs() throws Exception {
+ File earDir = LookupUtil.getCoreServer().getEarDeploymentDir();
+ File downloadDir = new File(earDir, "rhq-downloads");
+ if (!downloadDir.exists()) {
+ throw new FileNotFoundException("Missing downloads directory at ["
+ downloadDir + "]");
+ }
+
+ File dataDir = LookupUtil.getCoreServer().getJBossServerDataDir();
+ File dataDownloadDir = new File(dataDir, "rhq-downloads");
+
+ return new File[] { dataDownloadDir, downloadDir }; // put the data dir first, I
think that should take precedence
+ }
+
+ private boolean isServerAcceptingRequests() {
+ try {
+ OperationMode mode =
LookupUtil.getServerManager().getServer().getOperationMode();
+ return mode == OperationMode.NORMAL;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+}
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index 648d913..31f5d8c 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -28,6 +28,9 @@
</activation>
<modules>
<module>portal-war</module>
+ <module>remote-client-war</module>
+ <module>agentupdate-war</module>
+ <module>downloads-war</module>
<module>content_http-war</module>
<module>coregui</module>
<module>rest-war</module>
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/agentupdate/AgentUpdateServlet.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/agentupdate/AgentUpdateServlet.java
deleted file mode 100644
index d115187..0000000
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/agentupdate/AgentUpdateServlet.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.rhq.enterprise.gui.agentupdate;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.rhq.core.domain.cloud.Server.OperationMode;
-import org.rhq.core.domain.common.composite.SystemSetting;
-import org.rhq.core.domain.common.composite.SystemSettings;
-import org.rhq.core.util.exception.ThrowableUtil;
-import org.rhq.core.util.stream.StreamUtil;
-import org.rhq.enterprise.server.core.AgentManagerLocal;
-import org.rhq.enterprise.server.util.LookupUtil;
-
-/**
- * Serves the agent update binary that is stored in the RHQ Server's download area.
- * This servlet also provides version information regarding the version of the agent
- * this servlet serves up as well as versions of agents the RHQ Server supports.
- */
-public class AgentUpdateServlet extends HttpServlet {
-
- private static final long serialVersionUID = 1L;
-
- // the system property that defines how many concurrent downloads we will allow
- private static String SYSPROP_AGENT_DOWNLOADS_LIMIT =
"rhq.server.agent-downloads-limit";
-
- // if the system property is not set or invalid, this is the default limit for number
of concurrent downloads
- private static int DEFAULT_AGENT_DOWNLOADS_LIMIT = 45;
-
- // the error code that will be returned if the server has been configured to disable
agent updates
- private static final int ERROR_CODE_AGENT_UPDATE_DISABLED =
HttpServletResponse.SC_FORBIDDEN;
-
- // the error code that will be returned if the server has too many agents downloading
the agent update binary
- private static final int ERROR_CODE_TOO_MANY_DOWNLOADS =
HttpServletResponse.SC_SERVICE_UNAVAILABLE;
-
- private AtomicInteger numActiveDownloads = null;
-
- private Log log = LogFactory.getLog(this.getClass());
-
- private AgentManagerLocal agentManager = null;
-
- private boolean initialized = false;
-
- @Override
- public void init() throws ServletException {
- log.info("Starting the RHQ agent update servlet");
- numActiveDownloads = new AtomicInteger(0);
- }
-
- private synchronized void loadAgentUpdateBinaryInfo() throws ServletException {
- if (!initialized) {
- log.info("RHQ agent update servlet is looking up binary file
information...");
-
- // make sure we have a agent update binary file; log its location
- try {
- log.info("Agent Update Binary File: " +
getAgentUpdateBinaryFile());
- } catch (Throwable t) {
- log.error("Missing agent update binary file - agents will not be
able to update", t);
- }
-
- // make sure we create a version file if we have to by getting the version
file now
- try {
- File versionFile = getAgentUpdateVersionFile();
-
- // log the version info - this also makes sure we can read it back in
- log.debug(versionFile + ": " + new String(StreamUtil.slurp(new
FileInputStream(versionFile))));
-
- } catch (Throwable t) {
- log.error("Cannot determine the agent version information - agents
will not be able to update.", t);
- }
-
- initialized = true;
- }
- }
-
- @Override
- protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
-
- // lazily initialize the servlet - we do this because when we started deploying
on AS7, our servlets
- // init() method was being called before the agent SLSB is ready. So we don't
init() this at startup,
- // rather, we now init this servlet the first time someone requests the agent
update binary file.
- loadAgentUpdateBinaryInfo();
-
- // seeing odd browser caching issues, even though we set Last-Modified. so force
no caching for now
- disableBrowserCache(resp);
-
- String servletPath = req.getServletPath();
- if (servletPath != null) {
- if (isServerAcceptingRequests()) {
- if (servletPath.endsWith("version")) {
- getVersion(req, resp);
- } else if (servletPath.endsWith("download")) {
- try {
- numActiveDownloads.incrementAndGet();
- getDownload(req, resp);
- } finally {
- numActiveDownloads.decrementAndGet();
- }
- } else {
- resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Invalid
servlet path [" + servletPath
- + "] - please contact administrator");
- }
- } else {
- sendErrorServerNotAcceptingRequests(resp);
- }
- } else {
- resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Invalid servlet path
- please contact administrator");
- }
-
- return;
- }
-
- private void getDownload(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
- int limit = getDownloadLimit();
- if (limit <= 0) {
- sendErrorAgentUpdateDisabled(resp);
- return;
- } else if (limit < numActiveDownloads.get()) {
- sendErrorTooManyDownloads(resp);
- return;
- }
-
- try {
- File agentJar = getAgentUpdateBinaryFile();
- resp.setContentType("application/octet-stream");
- resp.setHeader("Content-Disposition", "attachment;
filename=" + agentJar.getName());
- resp.setContentLength((int) agentJar.length());
- resp.setDateHeader("Last-Modified", agentJar.lastModified());
-
- FileInputStream agentJarStream = new FileInputStream(agentJar);
- try {
- StreamUtil.copy(agentJarStream, resp.getOutputStream(), false);
- } finally {
- agentJarStream.close();
- }
- } catch (Throwable t) {
- String clientAddr = getClientAddress(req);
- log.error("Failed to stream agent jar to remote client [" +
clientAddr + "]: "
- + ThrowableUtil.getAllMessages(t));
- disableBrowserCache(resp);
- resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Failed to
stream agent jar");
- }
-
- return;
- }
-
- private void getVersion(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
- try {
- File versionFile = getAgentUpdateVersionFile();
- resp.setContentType("text/plain");
- resp.setDateHeader("Last-Modified", versionFile.lastModified());
-
- FileInputStream stream = new FileInputStream(versionFile);
- byte[] versionData = StreamUtil.slurp(stream);
- resp.getOutputStream().write(versionData);
- } catch (Throwable t) {
- String clientAddr = getClientAddress(req);
- log.error("Failed to stream version info to remote client [" +
clientAddr + "]: "
- + ThrowableUtil.getAllMessages(t));
- disableBrowserCache(resp);
- resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Failed to
stream version info");
- }
-
- return;
- }
-
- private int getDownloadLimit() {
- // if the server cloud was configured to disallow updates, return 0
- SystemSettings systemConfig = LookupUtil.getSystemManager().getSystemSettings(
- LookupUtil.getSubjectManager().getOverlord());
- if
(!Boolean.parseBoolean(systemConfig.get(SystemSetting.AGENT_AUTO_UPDATE_ENABLED))) {
- return 0;
- }
-
- String limitStr = System.getProperty(SYSPROP_AGENT_DOWNLOADS_LIMIT);
- int limit;
- try {
- limit = Integer.parseInt(limitStr);
- } catch (Exception e) {
- limit = DEFAULT_AGENT_DOWNLOADS_LIMIT;
- log.warn("Agent downloads limit system property [" +
SYSPROP_AGENT_DOWNLOADS_LIMIT
- + "] is either not set or invalid [" + limitStr + "] -
limit will be [" + limit + "].");
- }
-
- return limit;
- }
-
- private void disableBrowserCache(HttpServletResponse resp) {
- resp.setHeader("Cache-Control", "no-cache, no-store");
- resp.setHeader("Expires", "-1");
- resp.setHeader("Pragma", "no-cache");
- }
-
- private void sendErrorServerNotAcceptingRequests(HttpServletResponse resp) throws
IOException {
- disableBrowserCache(resp);
- resp.sendError(ERROR_CODE_AGENT_UPDATE_DISABLED, "Server Is Down For
Maintenance");
- }
-
- private void sendErrorAgentUpdateDisabled(HttpServletResponse resp) throws
IOException {
- disableBrowserCache(resp);
- resp.sendError(ERROR_CODE_AGENT_UPDATE_DISABLED, "Agent Updates Has Been
Disabled");
- }
-
- private void sendErrorTooManyDownloads(HttpServletResponse resp) throws IOException
{
- disableBrowserCache(resp);
- resp.setHeader("Retry-After", "30");
- resp.sendError(ERROR_CODE_TOO_MANY_DOWNLOADS, "Maximum limit exceeded -
download agent later");
- }
-
- private File getAgentUpdateVersionFile() throws Exception {
- return getAgentManager().getAgentUpdateVersionFile();
- }
-
- private File getAgentUpdateBinaryFile() throws Exception {
- return getAgentManager().getAgentUpdateBinaryFile();
- }
-
- private AgentManagerLocal getAgentManager() {
- if (this.agentManager == null) {
- this.agentManager = LookupUtil.getAgentManager();
- }
- return this.agentManager;
- }
-
- private boolean isServerAcceptingRequests() {
- try {
- OperationMode mode =
LookupUtil.getServerManager().getServer().getOperationMode();
- return mode == OperationMode.NORMAL;
- } catch (Exception e) {
- return false;
- }
- }
-
- private String getClientAddress(HttpServletRequest request) {
- String ip = request.getHeader("X-Forwarded-For");
- if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
{
- ip = request.getHeader("HTTP_X_FORWARDED_FOR");
- if (ip == null || ip.length() == 0 ||
"unknown".equalsIgnoreCase(ip)) {
- ip = String.format("%s (%s)", request.getRemoteHost(),
request.getRemoteAddr());
- }
- }
- return ip;
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/client/RemoteClientServlet.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/client/RemoteClientServlet.java
deleted file mode 100644
index 9127927..0000000
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/client/RemoteClientServlet.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.rhq.enterprise.gui.client;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.rhq.core.domain.cloud.Server.OperationMode;
-import org.rhq.core.util.stream.StreamUtil;
-import org.rhq.enterprise.server.util.LookupUtil;
-
-/**
- * Serves the remote client binary that is stored in the RHQ Server's download area.
- * This servlet also provides version information regarding the version of the remote
- * client this servlet serves up.
- */
-public class RemoteClientServlet extends HttpServlet {
-
- private static final long serialVersionUID = 1L;
-
- // the system property that defines how many concurrent downloads we will allow
- private static String SYSPROP_CLIENT_DOWNLOADS_LIMIT =
"rhq.server.client-downloads-limit";
-
- // if the system property is not set or invalid, this is the default limit for number
of concurrent downloads
- // There is no reason this be heavily downloaded.
- private static int DEFAULT_CLIENT_DOWNLOADS_LIMIT = 5;
-
- // the error code that will be returned if the server has been configured to disable
client updates
- private static final int ERROR_CODE_CLIENT_UPDATE_DISABLED =
HttpServletResponse.SC_FORBIDDEN;
-
- // the error code that will be returned if the server has too many clients
downloading the binary
- private static final int ERROR_CODE_TOO_MANY_DOWNLOADS =
HttpServletResponse.SC_SERVICE_UNAVAILABLE;
-
- private static int numActiveDownloads = 0;
-
- private Log log = LogFactory.getLog(this.getClass());
-
- @Override
- protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
- // seeing odd browser caching issues, even though we set Last-Modified. so force
no caching for now
- disableBrowserCache(resp);
-
- String servletPath = req.getServletPath();
- if (servletPath != null) {
- if (isServerAcceptingRequests()) {
- if (servletPath.endsWith("version")) {
- getVersion(req, resp);
- } else if (servletPath.endsWith("download")) {
- try {
- numActiveDownloads++;
- getDownload(req, resp);
- } finally {
- numActiveDownloads--;
- }
- } else {
- resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Invalid
servlet path [" + servletPath
- + "] - please contact administrator");
- }
- } else {
- sendErrorServerNotAcceptingRequests(resp);
- }
- } else {
- resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Invalid servlet path
- please contact administrator");
- }
-
- return;
- }
-
- private void getDownload(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
- int limit = getDownloadLimit();
- if (limit <= 0) {
- sendErrorDownloadDisabled(resp);
- return;
- } else if (limit < numActiveDownloads) {
- sendErrorTooManyDownloads(resp);
- return;
- }
-
- try {
- File zip = LookupUtil.getRemoteClientManager().getRemoteClientBinaryFile();
- if (!zip.exists()) {
- disableBrowserCache(resp);
- resp.sendError(HttpServletResponse.SC_NOT_FOUND, "Remote Client
binary does not exist: "
- + zip.getName());
- return;
- }
-
- resp.setContentType("application/octet-stream");
- resp.setHeader("Content-Disposition", "attachment;
filename=" + zip.getName());
- resp.setContentLength((int) zip.length());
- resp.setDateHeader("Last-Modified", zip.lastModified());
-
- FileInputStream zipStream = new FileInputStream(zip);
- try {
- StreamUtil.copy(zipStream, resp.getOutputStream(), false);
- } finally {
- zipStream.close();
- }
- } catch (Throwable t) {
- log.error("Failed to stream remote client zip.", t);
- disableBrowserCache(resp);
- resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Failed to
stream remote client zip");
- }
-
- return;
- }
-
- private void getVersion(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
- try {
- File versionFile =
LookupUtil.getRemoteClientManager().getRemoteClientVersionFile();
- resp.setContentType("text/plain");
- resp.setDateHeader("Last-Modified", versionFile.lastModified());
-
- FileInputStream stream = new FileInputStream(versionFile);
- byte[] versionData = StreamUtil.slurp(stream);
- resp.getOutputStream().write(versionData);
- } catch (Throwable t) {
- log.error("Failed to stream version info.", t);
- disableBrowserCache(resp);
- resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Failed to
stream version info");
- }
-
- return;
- }
-
- private int getDownloadLimit() {
- String limitStr = System.getProperty(SYSPROP_CLIENT_DOWNLOADS_LIMIT);
- int limit;
- try {
- limit = Integer.parseInt(limitStr);
- } catch (Exception e) {
- limit = DEFAULT_CLIENT_DOWNLOADS_LIMIT;
- log.warn("Remote Client downloads limit system property [" +
SYSPROP_CLIENT_DOWNLOADS_LIMIT
- + "] is either not set or invalid [" + limitStr + "] -
limit will be [" + limit + "].");
- }
-
- return limit;
- }
-
- private void disableBrowserCache(HttpServletResponse resp) {
- resp.setHeader("Cache-Control", "no-cache, no-store");
- resp.setHeader("Expires", "-1");
- resp.setHeader("Pragma", "no-cache");
- }
-
- private void sendErrorServerNotAcceptingRequests(HttpServletResponse resp) throws
IOException {
- disableBrowserCache(resp);
- resp.sendError(ERROR_CODE_CLIENT_UPDATE_DISABLED, "Server Is Down For
Maintenance");
- }
-
- private void sendErrorDownloadDisabled(HttpServletResponse resp) throws IOException
{
- disableBrowserCache(resp);
- resp.sendError(ERROR_CODE_CLIENT_UPDATE_DISABLED, "Client Download Has Been
Disabled");
- }
-
- private void sendErrorTooManyDownloads(HttpServletResponse resp) throws IOException
{
- disableBrowserCache(resp);
- resp.setHeader("Retry-After", "30");
- resp.sendError(ERROR_CODE_TOO_MANY_DOWNLOADS, "Maximum limit exceeded -
download client later");
- }
-
- private boolean isServerAcceptingRequests() {
- try {
- OperationMode mode =
LookupUtil.getServerManager().getServer().getOperationMode();
- return mode == OperationMode.NORMAL;
- } catch (Exception e) {
- return false;
- }
- }
-
-}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/download/DownloadServlet.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/download/DownloadServlet.java
deleted file mode 100644
index 59369a7..0000000
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/download/DownloadServlet.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.rhq.enterprise.gui.download;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.rhq.core.domain.cloud.Server.OperationMode;
-import org.rhq.core.util.stream.StreamUtil;
-import org.rhq.enterprise.server.util.LookupUtil;
-
-/**
- * Serves the static content found in rhq-downloads.
- */
-public class DownloadServlet extends HttpServlet {
-
- private static final long serialVersionUID = 1L;
-
- // the system property that disables/enables file listing - default is to show the
listing
- private static String SYSPROP_SHOW_DOWNLOADS_LISTING =
"rhq.server.show-downloads-listing";
-
- private static int numActiveDownloads = 0;
- private static boolean showDownloadsListing;
-
- private Log log = LogFactory.getLog(this.getClass());
-
- @Override
- public void init() throws ServletException {
- log.info("Starting the RHQ download servlet...");
-
- String propValue = System.getProperty(SYSPROP_SHOW_DOWNLOADS_LISTING,
"true");
- showDownloadsListing = Boolean.parseBoolean(propValue);
- }
-
- @Override
- protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
-
- // seeing odd browser caching issues, even though we set Last-Modified. so force
no caching for now
- disableBrowserCache(resp);
-
- if (isServerAcceptingRequests()) {
- String requestedDirectory = getRequestedDirectory(req);
- if (requestedDirectory == null) {
- numActiveDownloads++;
- download(req, resp);
- numActiveDownloads--;
- } else {
- if (showDownloadsListing) {
- outputFileList(requestedDirectory, req, resp);
- } else {
- disableBrowserCache(resp);
- resp.sendError(HttpServletResponse.SC_FORBIDDEN, "Listing
disabled");
- }
- }
- } else {
- sendErrorServerNotAcceptingRequests(resp);
- }
- return;
- }
-
- /**
- * Returns the relative path of the requested directory but only if it exists in
- * one of the root directories. If the requested path is a file or the directory
- * doesn't exist under a root directory, null is returned.
- *
- * @param req
- * @return relative path of the directory being requested
- * @throws ServletException
- */
- private String getRequestedDirectory(HttpServletRequest req) throws ServletException
{
-
- String pathInfo = req.getPathInfo();
-
- File[] rootDownloadsDirs;
- try {
- rootDownloadsDirs = getRootDownloadsDirs();
- } catch (Throwable t) {
- throw new ServletException(t);
- }
-
- if (pathInfo == null || pathInfo.equals("") ||
pathInfo.equals("/")) {
- return "";
- }
-
- for (File rootDownloadsDir : rootDownloadsDirs) {
- File downloadDir = new File(rootDownloadsDir, pathInfo);
- if (downloadDir.isDirectory()) {
- return pathInfo;
- }
- }
-
- // either the path does not exist or its a file, not a directory
- return null;
- }
-
- private void download(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
- try {
- if (isForbiddenPath(req.getPathInfo(), resp)) {
- return;
- }
-
- // look for the file in one of the root download directories
- File fileToDownload = null;
- File[] downloadDirs = getRootDownloadsDirs();
- for (File downloadDir : downloadDirs) {
- File file = new File(downloadDir, req.getPathInfo());
- if (file.exists()) {
- fileToDownload = file;
- break;
- }
- }
-
- if (fileToDownload == null) {
- disableBrowserCache(resp);
- resp.sendError(HttpServletResponse.SC_NOT_FOUND, "File does not
exist: " + req.getPathInfo());
- return;
- }
-
- resp.setContentType(getMimeType(fileToDownload));
- resp.setHeader("Content-Disposition", "attachment;
filename=" + fileToDownload.getName());
- resp.setContentLength((int) fileToDownload.length());
- resp.setDateHeader("Last-Modified",
fileToDownload.lastModified());
-
- FileInputStream stream = new FileInputStream(fileToDownload);
- try {
- StreamUtil.copy(stream, resp.getOutputStream(), false);
- } finally {
- stream.close();
- }
- } catch (Throwable t) {
- log.error("Failed to stream download content.", t);
- disableBrowserCache(resp);
- resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Failed to
download content");
- }
-
- return;
- }
-
- private String getMimeType(File file) {
- String mimeType = null;
-
- try {
- mimeType = getServletContext().getMimeType(file.getName());
- } catch (Throwable t) {
- // i'm paranoid, no idea if this will ever happen, but its not fatal so
keep going
- log.warn("Failed to get mime type for [" + file + "].",
t);
- }
-
- if (mimeType == null) {
- mimeType = "application/octet-stream";
- }
- return mimeType;
- }
-
- private void outputFileList(String requestedDirectory, HttpServletRequest req,
HttpServletResponse resp)
- throws ServletException {
-
- try {
- if (!isForbiddenPath(requestedDirectory, resp)) {
- File requestedDirectoryRelativePath = new File(requestedDirectory);
- String dirName = requestedDirectoryRelativePath.getName();
- disableBrowserCache(resp);
- resp.setContentType("text/html");
- PrintWriter writer = resp.getWriter();
-
writer.println(String.format("<html><head><title>Available
Downloads: %s</title></head>", dirName));
- writer.println("<body><h1>Available
Downloads</h1>");
- writer.println(String.format("<font
size=\"+2\"><b><pre>%s</pre></b></font>",
dirName));
- List<File> files = getDownloadFiles(requestedDirectory);
- if (files.size() > 0) {
- String pathInfo = req.getPathInfo();
- if (!pathInfo.endsWith("/")) {
- pathInfo += "/";
- }
- writer.println("<ul>");
- for (File file : files) {
- writer.println("<li><a href=\"" +
req.getServletPath() + pathInfo + file.getName() + "\">"
- + file.getName() + "</a></li>");
- }
- writer.println("</ul>");
- } else {
- writer.println("<h4>NONE</h4>");
- }
- writer.println("</body></html>");
- }
- } catch (Exception e) {
- throw new ServletException("Cannot get downloads listing", e);
- }
- }
-
- private boolean isForbiddenPath(String requestedPath, HttpServletResponse resp)
throws IOException {
- boolean forbidden = true; // assume it is forbidden
- if (requestedPath.toString().contains("rhq-agent")) {
- resp.sendError(HttpServletResponse.SC_FORBIDDEN, "Use
/agentupdate/download to obtain the agent");
- } else if (requestedPath.toString().contains("rhq-client")) {
- resp.sendError(HttpServletResponse.SC_FORBIDDEN, "Use /client/download
to obtain the client");
- } else {
- forbidden = false;
- }
- return forbidden;
- }
-
- private void sendErrorServerNotAcceptingRequests(HttpServletResponse resp) throws
IOException {
- disableBrowserCache(resp);
- resp.sendError(HttpServletResponse.SC_FORBIDDEN, "Server Is Down For
Maintenance");
- }
-
- private void disableBrowserCache(HttpServletResponse resp) {
- resp.setHeader("Cache-Control", "no-cache, no-store");
- resp.setHeader("Expires", "-1");
- resp.setHeader("Pragma", "no-cache");
- }
-
- private List<File> getDownloadFiles(String requestedDirectory) throws Exception
{
- // its possible if more than one root dir has the file, we'll get
duplicates.
- // this should never happen, so ignore this edge case.
- List<File> returnFiles = new ArrayList<File>();
- File[] rootDownloadDirs = getRootDownloadsDirs();
- for (File rootDownloadDir : rootDownloadDirs) {
- File dir = new File(rootDownloadDir, requestedDirectory);
- File[] filesArray = dir.listFiles();
- // this is simple - we only serve up files located in the requested directory
- no content from subdirectories
- if (filesArray != null) {
- for (File file : filesArray) {
- if (file.isFile()) {
- returnFiles.add(file);
- }
- }
- }
- }
-
- return returnFiles;
- }
-
- /**
- * There are two locations for downloads - the static content under the EAR's
rhq-downloads
- * and dynamic content in the data directory.
- *
- * @return the two root locations
- *
- * @throws Exception
- */
- private File[] getRootDownloadsDirs() throws Exception {
- File earDir = LookupUtil.getCoreServer().getEarDeploymentDir();
- File downloadDir = new File(earDir, "rhq-downloads");
- if (!downloadDir.exists()) {
- throw new FileNotFoundException("Missing downloads directory at ["
+ downloadDir + "]");
- }
-
- File dataDir = LookupUtil.getCoreServer().getJBossServerDataDir();
- File dataDownloadDir = new File(dataDir, "rhq-downloads");
-
- return new File[] { dataDownloadDir, downloadDir }; // put the data dir first, I
think that should take precedence
- }
-
- private boolean isServerAcceptingRequests() {
- try {
- OperationMode mode =
LookupUtil.getServerManager().getServer().getOperationMode();
- return mode == OperationMode.NORMAL;
- } catch (Exception e) {
- return false;
- }
- }
-
-}
\ No newline at end of file
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
index f623679..5aa727d 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
@@ -314,26 +314,6 @@
<load-on-startup>1</load-on-startup>
</servlet>
- <!-- Servlet that serves the agent update binaries and version information -->
- <servlet>
- <servlet-name>AgentUpdateServlet</servlet-name>
-
<servlet-class>org.rhq.enterprise.gui.agentupdate.AgentUpdateServlet</servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
-
- <!-- Servlet that serves the content from rhq-downloads -->
- <servlet>
- <servlet-name>DownloadServlet</servlet-name>
-
<servlet-class>org.rhq.enterprise.gui.download.DownloadServlet</servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
-
- <servlet>
- <servlet-name>RemoteClientServlet</servlet-name>
-
<servlet-class>org.rhq.enterprise.gui.client.RemoteClientServlet</servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
-
<!-- standalone servlets used by the JSPs -->
<!-- Struts ActionServlet configuration (with debugging) -->
@@ -363,40 +343,12 @@
<load-on-startup>2</load-on-startup>
</servlet>
- <!-- The endpoints to the agent update servlet -->
- <servlet-mapping>
- <servlet-name>AgentUpdateServlet</servlet-name>
- <url-pattern>/agentupdate/version</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>AgentUpdateServlet</servlet-name>
- <url-pattern>/agentupdate/download</url-pattern>
- </servlet-mapping>
-
- <!-- The endpoints to the remote client servlet -->
- <servlet-mapping>
- <servlet-name>RemoteClientServlet</servlet-name>
- <url-pattern>/client/version</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>RemoteClientServlet</servlet-name>
- <url-pattern>/client/download</url-pattern>
- </servlet-mapping>
-
<!-- TODO what is this for? -->
<servlet-mapping>
<servlet-name>sessionAccess</servlet-name>
<url-pattern>/sessionAccess</url-pattern>
</servlet-mapping>
- <!-- The download servlet; this URI /downloads will effectively look like its
pointing to rhq-downloads -->
- <servlet-mapping>
- <servlet-name>DownloadServlet</servlet-name>
- <url-pattern>/downloads/*</url-pattern>
- </servlet-mapping>
-
-
-
<!-- mappings for Struts ActionServlet -->
<servlet-mapping>
<servlet-name>action</servlet-name>
diff --git a/modules/enterprise/gui/remote-client-war/pom.xml
b/modules/enterprise/gui/remote-client-war/pom.xml
new file mode 100644
index 0000000..92ec018
--- /dev/null
+++ b/modules/enterprise/gui/remote-client-war/pom.xml
@@ -0,0 +1,153 @@
+<?xml version="1.0"?>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-parent</artifactId>
+ <version>4.10.0-SNAPSHOT</version>
+ <relativePath>../../../../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-remote-client-war</artifactId>
+ <packaging>war</packaging>
+ <name>RHQ Enterprise Remote Client War</name>
+ <description>the RHQ Enterprise Remote Client webapp</description>
+
+ <dependencies>
+ <!-- Internal Deps -->
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope> <!-- by rhq.ear (as ejb-jar) -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-server</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope> <!-- by rhq.ear (as ejb-jar) -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-util</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope> <!-- by rhq.ear -->
+ </dependency>
+
+ <!-- Import the Servlet API, we use provided scope as the API is included in
JBoss AS 7 -->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <!-- Set the name of the war, used as the context root when the app
+ is deployed -->
+ <finalName>rhq-client</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <failOnMissingWebXml>false</failOnMissingWebXml>
+ <archive>
+ <manifest>
+
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ </manifest>
+ <manifestEntries>
+ <Build-Number>${buildNumber}</Build-Number>
+ </manifestEntries>
+ </archive>
+ <webResources>
+ <resource>
+ <filtering>false</filtering>
+ <directory>${basedir}/src/main/webapp</directory>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>dev</id>
+
+ <properties>
+ <rhq.rootDir>../../../..</rhq.rootDir>
+
<rhq.containerDir>${rhq.rootDir}/${rhq.devContainerServerPath}</rhq.containerDir>
+
<rhq.deploymentName>${project.build.finalName}.war</rhq.deploymentName>
+
<rhq.deploymentDir>${rhq.containerDir}/${rhq.earDeployDir}/${rhq.deploymentName}</rhq.deploymentDir>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>deploy-classes</id>
+ <phase>compile</phase>
+ <configuration>
+ <target>
+ <property name="classes.dir"
location="${rhq.deploymentDir}/WEB-INF/classes" />
+ <echo>*** Copying updated files from target/classes to
${classes.dir}...</echo>
+ <copy todir="${classes.dir}"
verbose="${rhq.verbose}">
+ <fileset dir="target/classes" />
+ </copy>
+ <property name="deployment.dir"
location="${rhq.deploymentDir}" />
+ <echo>*** Copying updated files from
src${file.separator}main${file.separator}webapp${file.separator} to
${deployment.dir}${file.separator}...</echo>
+ <copy todir="${deployment.dir}"
verbose="${rhq.verbose}">
+ <fileset dir="${basedir}/src/main/webapp"
/>
+ </copy>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <execution>
+ <id>deploy</id>
+ <phase>package</phase>
+ <configuration>
+ <target>
+ <property name="deployment.dir"
location="${rhq.deploymentDir}" />
+ <echo>*** Copying updated files from
target${file.separator}${project.build.finalName}${file.separator} to
${deployment.dir}${file.separator}...</echo>
+ <copy todir="${deployment.dir}"
verbose="${rhq.verbose}">
+ <fileset
dir="${basedir}/target/${project.build.finalName}" />
+ </copy>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>undeploy</id>
+ <phase>clean</phase>
+ <configuration>
+ <target>
+ <property name="deployment.dir"
location="${rhq.deploymentDir}" />
+ <echo>*** Deleting
${deployment.dir}${file.separator}...</echo>
+ <delete dir="${deployment.dir}" />
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
diff --git
a/modules/enterprise/gui/remote-client-war/src/main/java/org/rhq/enterprise/gui/client/RemoteClientServlet.java
b/modules/enterprise/gui/remote-client-war/src/main/java/org/rhq/enterprise/gui/client/RemoteClientServlet.java
new file mode 100644
index 0000000..234fc58
--- /dev/null
+++
b/modules/enterprise/gui/remote-client-war/src/main/java/org/rhq/enterprise/gui/client/RemoteClientServlet.java
@@ -0,0 +1,196 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.client;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.rhq.core.domain.cloud.Server.OperationMode;
+import org.rhq.core.util.stream.StreamUtil;
+import org.rhq.enterprise.server.util.LookupUtil;
+
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+
+/**
+ * Serves the remote client binary that is stored in the RHQ Server's download area.
+ * This servlet also provides version information regarding the version of the remote
+ * client this servlet serves up.
+ */
+@WebServlet(urlPatterns = {"/download", "/version"}, loadOnStartup =
1)
+public class RemoteClientServlet extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ // the system property that defines how many concurrent downloads we will allow
+ private static String SYSPROP_CLIENT_DOWNLOADS_LIMIT =
"rhq.server.client-downloads-limit";
+
+ // if the system property is not set or invalid, this is the default limit for number
of concurrent downloads
+ // There is no reason this be heavily downloaded.
+ private static int DEFAULT_CLIENT_DOWNLOADS_LIMIT = 5;
+
+ // the error code that will be returned if the server has been configured to disable
client updates
+ private static final int ERROR_CODE_CLIENT_UPDATE_DISABLED =
HttpServletResponse.SC_FORBIDDEN;
+
+ // the error code that will be returned if the server has too many clients
downloading the binary
+ private static final int ERROR_CODE_TOO_MANY_DOWNLOADS =
HttpServletResponse.SC_SERVICE_UNAVAILABLE;
+
+ private static int numActiveDownloads = 0;
+
+ private Log log = LogFactory.getLog(this.getClass());
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
+ // seeing odd browser caching issues, even though we set Last-Modified. so force
no caching for now
+ disableBrowserCache(resp);
+
+ String servletPath = req.getServletPath();
+ if (servletPath != null) {
+ if (isServerAcceptingRequests()) {
+ if (servletPath.endsWith("version")) {
+ getVersion(req, resp);
+ } else if (servletPath.endsWith("download")) {
+ try {
+ numActiveDownloads++;
+ getDownload(req, resp);
+ } finally {
+ numActiveDownloads--;
+ }
+ } else {
+ resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Invalid
servlet path [" + servletPath
+ + "] - please contact administrator");
+ }
+ } else {
+ sendErrorServerNotAcceptingRequests(resp);
+ }
+ } else {
+ resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Invalid servlet path
- please contact administrator");
+ }
+
+ return;
+ }
+
+ private void getDownload(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
+ int limit = getDownloadLimit();
+ if (limit <= 0) {
+ sendErrorDownloadDisabled(resp);
+ return;
+ } else if (limit < numActiveDownloads) {
+ sendErrorTooManyDownloads(resp);
+ return;
+ }
+
+ try {
+ File zip = LookupUtil.getRemoteClientManager().getRemoteClientBinaryFile();
+ if (!zip.exists()) {
+ disableBrowserCache(resp);
+ resp.sendError(HttpServletResponse.SC_NOT_FOUND, "Remote Client
binary does not exist: "
+ + zip.getName());
+ return;
+ }
+
+ resp.setContentType("application/octet-stream");
+ resp.setHeader("Content-Disposition", "attachment;
filename=" + zip.getName());
+ resp.setContentLength((int) zip.length());
+ resp.setDateHeader("Last-Modified", zip.lastModified());
+
+ FileInputStream zipStream = new FileInputStream(zip);
+ try {
+ StreamUtil.copy(zipStream, resp.getOutputStream(), false);
+ } finally {
+ zipStream.close();
+ }
+ } catch (Throwable t) {
+ log.error("Failed to stream remote client zip.", t);
+ disableBrowserCache(resp);
+ resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Failed to
stream remote client zip");
+ }
+
+ return;
+ }
+
+ private void getVersion(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
+ try {
+ File versionFile =
LookupUtil.getRemoteClientManager().getRemoteClientVersionFile();
+ resp.setContentType("text/plain");
+ resp.setDateHeader("Last-Modified", versionFile.lastModified());
+
+ FileInputStream stream = new FileInputStream(versionFile);
+ byte[] versionData = StreamUtil.slurp(stream);
+ resp.getOutputStream().write(versionData);
+ } catch (Throwable t) {
+ log.error("Failed to stream version info.", t);
+ disableBrowserCache(resp);
+ resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Failed to
stream version info");
+ }
+
+ return;
+ }
+
+ private int getDownloadLimit() {
+ String limitStr = System.getProperty(SYSPROP_CLIENT_DOWNLOADS_LIMIT);
+ int limit;
+ try {
+ limit = Integer.parseInt(limitStr);
+ } catch (Exception e) {
+ limit = DEFAULT_CLIENT_DOWNLOADS_LIMIT;
+ log.warn("Remote Client downloads limit system property [" +
SYSPROP_CLIENT_DOWNLOADS_LIMIT
+ + "] is either not set or invalid [" + limitStr + "] -
limit will be [" + limit + "].");
+ }
+
+ return limit;
+ }
+
+ private void disableBrowserCache(HttpServletResponse resp) {
+ resp.setHeader("Cache-Control", "no-cache, no-store");
+ resp.setHeader("Expires", "-1");
+ resp.setHeader("Pragma", "no-cache");
+ }
+
+ private void sendErrorServerNotAcceptingRequests(HttpServletResponse resp) throws
IOException {
+ disableBrowserCache(resp);
+ resp.sendError(ERROR_CODE_CLIENT_UPDATE_DISABLED, "Server Is Down For
Maintenance");
+ }
+
+ private void sendErrorDownloadDisabled(HttpServletResponse resp) throws IOException
{
+ disableBrowserCache(resp);
+ resp.sendError(ERROR_CODE_CLIENT_UPDATE_DISABLED, "Client Download Has Been
Disabled");
+ }
+
+ private void sendErrorTooManyDownloads(HttpServletResponse resp) throws IOException
{
+ disableBrowserCache(resp);
+ resp.setHeader("Retry-After", "30");
+ resp.sendError(ERROR_CODE_TOO_MANY_DOWNLOADS, "Maximum limit exceeded -
download client later");
+ }
+
+ private boolean isServerAcceptingRequests() {
+ try {
+ OperationMode mode =
LookupUtil.getServerManager().getServer().getOperationMode();
+ return mode == OperationMode.NORMAL;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+}
diff --git a/modules/enterprise/gui/remote-client-war/src/main/webapp/index.html
b/modules/enterprise/gui/remote-client-war/src/main/webapp/index.html
new file mode 100644
index 0000000..5d7a115
--- /dev/null
+++ b/modules/enterprise/gui/remote-client-war/src/main/webapp/index.html
@@ -0,0 +1,5 @@
+<html>
+ <head>
+ <meta http-equiv="Refresh" content="0; URL=version">
+ </head>
+</html>
diff --git a/modules/enterprise/server/ear/pom.xml
b/modules/enterprise/server/ear/pom.xml
index a2e91a3..f312015 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -48,6 +48,28 @@
<dependency>
<groupId>${project.groupId}</groupId>
+ <artifactId>rhq-remote-client-war</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>rhq-downloads-war</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>rhq-agentupdate-war</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
<artifactId>rhq-coregui</artifactId>
<version>${project.version}</version>
<type>war</type>
@@ -263,6 +285,27 @@
<contextRoot>/portal</contextRoot>
</webModule>
+ <webModule>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>rhq-remote-client-war</artifactId>
+ <bundleFileName>rhq-client.war</bundleFileName>
+ <contextRoot>/client</contextRoot>
+ </webModule>
+
+ <webModule>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>rhq-downloads-war</artifactId>
+
<bundleFileName>rhq-downloads.war</bundleFileName>
+ <contextRoot>/downloads</contextRoot>
+ </webModule>
+
+ <webModule>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>rhq-agentupdate-war</artifactId>
+
<bundleFileName>rhq-agentupdate.war</bundleFileName>
+ <contextRoot>/agentupdate</contextRoot>
+ </webModule>
+
<!-- used to expose content through http -->
<webModule>
<groupId>${project.groupId}</groupId>
commit e0e11c053a3b4c0cfc2625a7fa9ae19b1caaa5fd
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Mon Sep 30 16:37:57 2013 -0500
[BZ 1010265] Add a little more verbiage around unknown host exception; the goal is to
point the user towards documentation and dns settings.
diff --git
a/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
b/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
index 58c04ac..30a51a4 100644
---
a/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
+++
b/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
@@ -34,6 +34,7 @@ import java.net.BindException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
+import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -941,7 +942,12 @@ public class StorageInstaller {
CommandLine cmdLine = parser.parse(installer.getOptions(), args);
int status = installer.run(cmdLine);
System.exit(status);
- } catch (ParseException e) {
+ } catch (UnknownHostException unknownHostException) {
+ installer.log
+ .error("Failed to resolve requested binding address. Please check
the installation instructions and host DNS settings. "
+ + unknownHostException.getMessage());
+ throw unknownHostException;
+ } catch (ParseException parseException) {
installer.printUsage();
System.exit(STATUS_SHOW_USAGE);
}
commit 45836de0bdb7f19c9b2797848ff1dcab785188de
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Sep 30 14:42:00 2013 -0400
remove extraneous logging and making reporting interval configurable
diff --git
a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
index f77d805..886155f 100644
---
a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
+++
b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
@@ -345,7 +345,6 @@ public class MetricsServer {
long timeSlice = dateTimeService.getTimeSlice(new
DateTime(rawData.getTimestamp()),
configuration.getRawTimeSliceDuration()).getMillis();
- log.debug("Updating metrics_index with time " + new
DateTime(timeSlice));
StorageResultSetFuture resultSetFuture =
dao.updateMetricsIndex(MetricsTable.ONE_HOUR, rawData.getScheduleId(),
timeSlice);
Futures.addCallback(resultSetFuture, new FutureCallback<ResultSet>() {
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Simulator.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Simulator.java
index 2d2564e..1ec9399 100644
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Simulator.java
+++
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Simulator.java
@@ -88,7 +88,7 @@ public class Simulator implements ShutdownManager {
MeasurementAggregator measurementAggregator = new
MeasurementAggregator(metricsServer, this, metrics,
aggregationQueue);
- ConsoleReporter consoleReporter = createConsoleReporter(metrics);
+ ConsoleReporter consoleReporter = createConsoleReporter(metrics,
plan.getMetricsReportInterval());
for (int i = 0; i < plan.getNumMeasurementCollectors(); ++i) {
collectors.scheduleAtFixedRate(new MeasurementCollector(plan.getBatchSize(),
@@ -107,14 +107,14 @@ public class Simulator implements ShutdownManager {
shutdown(0);
}
- private ConsoleReporter createConsoleReporter(Metrics metrics) {
+ private ConsoleReporter createConsoleReporter(Metrics metrics, int reportInterval) {
try {
File basedir = new
File(System.getProperty("rhq.metrics.simulator.basedir"));
File logDir = new File(basedir, "log");
ConsoleReporter consoleReporter =
ConsoleReporter.forRegistry(metrics.registry)
.convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS)
.outputTo(new PrintStream(new FileOutputStream(new File(logDir,
"metrics.txt")))).build();
- consoleReporter.start(1, TimeUnit.MINUTES);
+ consoleReporter.start(reportInterval, TimeUnit.SECONDS);
return consoleReporter;
} catch (FileNotFoundException e) {
throw new RuntimeException("Failed to create console reporter",
e);
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlan.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlan.java
index 1508edf..630c0ca 100644
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlan.java
+++
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlan.java
@@ -32,8 +32,6 @@ import org.rhq.server.metrics.MetricsConfiguration;
*/
public class SimulationPlan {
- private int threadPoolSize;
-
private long collectionInterval;
private long aggregationInterval;
@@ -50,6 +48,8 @@ public class SimulationPlan {
private int batchSize;
+ private int metricsReportInterval;
+
public long getCollectionInterval() {
return collectionInterval;
}
@@ -113,4 +113,12 @@ public class SimulationPlan {
public void setBatchSize(int batchSize) {
this.batchSize = batchSize;
}
+
+ public int getMetricsReportInterval() {
+ return metricsReportInterval;
+ }
+
+ public void setMetricsReportInterval(int metricsReportInterval) {
+ this.metricsReportInterval = metricsReportInterval;
+ }
}
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlanner.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlanner.java
index cb690e5..1674766 100644
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlanner.java
+++
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlanner.java
@@ -51,6 +51,7 @@ public class SimulationPlanner {
simulation.setNumMeasurementCollectors(getInt(root.get("numMeasurementCollectors"),
5));
simulation.setSimulationTime(getInt(root.get("simulationTime"), 10));
simulation.setBatchSize(getInt(root.get("batchSize"), 5000));
+
simulation.setMetricsReportInterval(getInt(root.get("metricsReportInterval"),
180));
String[] nodes;
if (root.get("nodes") == null || root.get("nodes").size() ==
0) {
commit f050eadea380b5f5a26e51f658e6d8f293efba81
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Sep 30 13:53:14 2013 -0400
remove obsolete config setting and add nowInMills() method
The nowInMills method avoids the overhead of creating a new DateTime object
which could non-trivial since it is called continuously in MeasurementCollector.
diff --git
a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/DateTimeService.java
b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/DateTimeService.java
index 9920ad6..92499fe 100644
---
a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/DateTimeService.java
+++
b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/DateTimeService.java
@@ -50,7 +50,11 @@ public class DateTimeService {
}
public DateTime now() {
- return DateTime.now();
+ return new DateTime(nowInMillis());
+ }
+
+ public long nowInMillis() {
+ return System.currentTimeMillis();
}
public DateTime getTimeSlice(long timestamp, Minutes interval) {
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementCollector.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementCollector.java
index 22bf81d..eeb508e 100644
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementCollector.java
+++
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementCollector.java
@@ -66,7 +66,7 @@ public class MeasurementCollector implements Runnable {
private Set<MeasurementDataNumeric> generateData() {
Set<MeasurementDataNumeric> data = new
HashSet<MeasurementDataNumeric>(batchSize);
- long timestamp = dateTimeService.now().getMillis();
+ long timestamp = dateTimeService.nowInMillis();
ThreadLocalRandom random = ThreadLocalRandom.current();
for (int i = 0; i < batchSize; ++i) {
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlan.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlan.java
index 70c326a..1508edf 100644
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlan.java
+++
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlan.java
@@ -50,14 +50,6 @@ public class SimulationPlan {
private int batchSize;
- public int getThreadPoolSize() {
- return threadPoolSize;
- }
-
- public void setThreadPoolSize(int threadPoolSize) {
- this.threadPoolSize = threadPoolSize;
- }
-
public long getCollectionInterval() {
return collectionInterval;
}
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlanner.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlanner.java
index dc9142c..cb690e5 100644
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlanner.java
+++
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlanner.java
@@ -50,7 +50,6 @@ public class SimulationPlanner {
simulation.setAggregationInterval(getLong(root.get("aggregationInterval"),
150000L)); // 2.5 minutes
simulation.setNumMeasurementCollectors(getInt(root.get("numMeasurementCollectors"),
5));
simulation.setSimulationTime(getInt(root.get("simulationTime"), 10));
- simulation.setThreadPoolSize(getInt(root.get("threadPoolSize"),
simulation.getNumMeasurementCollectors() + 2));
simulation.setBatchSize(getInt(root.get("batchSize"), 5000));
String[] nodes;
commit 97e6cc2ce4d452f64a2a7f46f08b16edcec4ce61
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Sep 30 13:11:54 2013 -0400
fixing bugs and adding support for compressed time slices
The simulator now uses hard-coded TTLs and time slices. The duration of the
time slice for each table is as follows,
raw data --> 2.5 minutes
1 hr data --> 15 minutes
6 hr data --> 1 hour
Aggregation runs every 2.5 minutes. The execution time for aggregation can and
will exceed 2.5 minutes. I do not want the aggregator thread to block and wind
up kicking aggregation with the wrong start times. It now submits a task for
each aggregation so that the aggregator thread itself does not get delayed.
diff --git
a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/DateTimeService.java
b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/DateTimeService.java
index 01b6f71..9920ad6 100644
---
a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/DateTimeService.java
+++
b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/DateTimeService.java
@@ -25,8 +25,6 @@
package org.rhq.server.metrics;
-import static org.joda.time.DateTime.now;
-
import org.joda.time.Chronology;
import org.joda.time.DateTime;
import org.joda.time.DateTimeComparator;
@@ -45,12 +43,16 @@ public class DateTimeService {
private DateTimeComparator dateTimeComparator = DateTimeComparator.getInstance();
- private MetricsConfiguration configuration;
+ protected MetricsConfiguration configuration;
public void setConfiguration(MetricsConfiguration configuration) {
this.configuration = configuration;
}
+ public DateTime now() {
+ return DateTime.now();
+ }
+
public DateTime getTimeSlice(long timestamp, Minutes interval) {
return getTimeSlice(new DateTime(timestamp), interval);
}
diff --git
a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
index f21f5c1..f77d805 100644
---
a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
+++
b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
@@ -98,7 +98,7 @@ public class MetricsServer {
* purged.
*/
private void determineMostRecentRawDataSinceLastShutdown() {
- DateTime previousHour =
currentInterval().minus(configuration.getRawTimeSliceDuration());
+ DateTime previousHour =
currentHour().minus(configuration.getRawTimeSliceDuration());
DateTime oldestRawTime = previousHour.minus(configuration.getRawRetention());
ResultSet resultSet = dao.setFindTimeSliceForIndex(MetricsTable.ONE_HOUR,
previousHour.getMillis());
@@ -126,17 +126,12 @@ public class MetricsServer {
}
}
- protected DateTime currentInterval() {
- return dateTimeService.getTimeSlice(DateTime.now(),
configuration.getRawTimeSliceDuration());
- }
-
protected DateTime currentHour() {
- DateTime dt = new DateTime(System.currentTimeMillis());
- return dateTimeService.getTimeSlice(dt, Duration.standardHours(1));
+ return dateTimeService.getTimeSlice(dateTimeService.now(),
configuration.getRawTimeSliceDuration());
}
protected DateTime roundDownToHour(long timestamp) {
- return dateTimeService.getTimeSlice(new DateTime(timestamp),
Duration.standardHours(1));
+ return dateTimeService.getTimeSlice(new DateTime(timestamp),
configuration.getRawTimeSliceDuration());
}
public void shutdown() {
@@ -313,7 +308,7 @@ public class MetricsServer {
log.debug("Inserting " + dataSet.size() + " raw
metrics");
}
- final long startTime = System.currentTimeMillis();
+ final long startTime = dateTimeService.now().getMillis();
final AtomicInteger remainingInserts = new AtomicInteger(dataSet.size());
for (final MeasurementDataNumeric data : dataSet) {
@@ -350,6 +345,7 @@ public class MetricsServer {
long timeSlice = dateTimeService.getTimeSlice(new
DateTime(rawData.getTimestamp()),
configuration.getRawTimeSliceDuration()).getMillis();
+ log.debug("Updating metrics_index with time " + new
DateTime(timeSlice));
StorageResultSetFuture resultSetFuture =
dao.updateMetricsIndex(MetricsTable.ONE_HOUR, rawData.getScheduleId(),
timeSlice);
Futures.addCallback(resultSetFuture, new FutureCallback<ResultSet>() {
@@ -385,7 +381,7 @@ public class MetricsServer {
* for subsequently computing baselines.
*/
public Iterable<AggregateNumericMetric> calculateAggregates() {
- DateTime theHour = currentInterval();
+ DateTime theHour = currentHour();
if (pastAggregationMissed) {
calculateAggregates(roundDownToHour(mostRecentRawDataPriorToStartup).plusHours(1).getMillis());
@@ -401,7 +397,9 @@ public class MetricsServer {
DateTime currentHour = dateTimeService.getTimeSlice(dt,
configuration.getRawTimeSliceDuration());
DateTime lastHour = currentHour.minus(configuration.getRawTimeSliceDuration());
- long hourTimeSlice = lastHour.getMillis();
+ if (log.isDebugEnabled()) {
+ log.debug("Starting aggregation for time slice " + lastHour);
+ }
long sixHourTimeSlice = dateTimeService.getTimeSlice(lastHour,
configuration.getOneHourTimeSliceDuration()).getMillis();
@@ -424,10 +422,10 @@ public class MetricsServer {
Iterable<AggregateNumericMetric> newOneHourAggregates = null;
- List<AggregateNumericMetric> updatedSchedules =
aggregateRawData(hourTimeSlice);
+ List<AggregateNumericMetric> updatedSchedules =
aggregateRawData(lastHour);
newOneHourAggregates = updatedSchedules;
if (!updatedSchedules.isEmpty()) {
- dao.deleteMetricsIndexEntries(MetricsTable.ONE_HOUR, hourTimeSlice);
+ dao.deleteMetricsIndexEntries(MetricsTable.ONE_HOUR, lastHour.getMillis());
updateMetricsIndex(MetricsTable.SIX_HOUR, updatedSchedules,
configuration.getOneHourTimeSliceDuration());
}
@@ -457,16 +455,20 @@ public class MetricsServer {
dao.updateMetricsIndex(bucket, updates);
}
- private List<AggregateNumericMetric> aggregateRawData(long theHour) {
+ private List<AggregateNumericMetric> aggregateRawData(DateTime theHour) {
long start = System.currentTimeMillis();
try {
- Iterable<MetricsIndexEntry> indexEntries =
dao.findMetricsIndexEntries(MetricsTable.ONE_HOUR, theHour);
+ if (log.isDebugEnabled()) {
+ log.debug("Preparing to aggregate raw data. Time slice start time is
[" + theHour +
+ "] and the end time is [" +
theHour.plus(configuration.getRawTimeSliceDuration()) + "]");
+ }
+ Iterable<MetricsIndexEntry> indexEntries =
dao.findMetricsIndexEntries(MetricsTable.ONE_HOUR,
+ theHour.getMillis());
List<AggregateNumericMetric> oneHourMetrics = new
ArrayList<AggregateNumericMetric>();
for (MetricsIndexEntry indexEntry : indexEntries) {
DateTime startTime = indexEntry.getTime();
DateTime endTime =
startTime.plus(configuration.getRawTimeSliceDuration());
-
Iterable<RawNumericMetric> rawMetrics =
dao.findRawMetrics(indexEntry.getScheduleId(),
startTime.getMillis(), endTime.getMillis());
AggregateNumericMetric aggregatedRaw = calculateAggregatedRaw(rawMetrics,
startTime.getMillis());
@@ -518,16 +520,14 @@ public class MetricsServer {
private List<AggregateNumericMetric> calculateAggregates(MetricsTable
fromTable,
MetricsTable toTable, long timeSlice, Duration nextDuration) {
- if (log.isDebugEnabled()) {
- log.debug("Preparing to compute aggregates for data in " +
fromTable + " table");
- }
long start = System.currentTimeMillis();
try {
DateTime startTime = new DateTime(timeSlice);
DateTime endTime = startTime.plus(nextDuration);
- DateTime currentHour = currentInterval();
+ DateTime currentHour = currentHour();
if (log.isDebugEnabled()) {
+ log.debug("Preparing to compute aggregates for data in " +
fromTable + " table");
log.debug("Time slice start time is [" + startTime + "]
and the end time is [" + endTime + "].");
}
diff --git
a/modules/enterprise/server/server-metrics/src/test/java/org/rhq/server/metrics/MetricsServerTest.java
b/modules/enterprise/server/server-metrics/src/test/java/org/rhq/server/metrics/MetricsServerTest.java
index a670fcf..95ada4c 100644
---
a/modules/enterprise/server/server-metrics/src/test/java/org/rhq/server/metrics/MetricsServerTest.java
+++
b/modules/enterprise/server/server-metrics/src/test/java/org/rhq/server/metrics/MetricsServerTest.java
@@ -102,10 +102,6 @@ public class MetricsServerTest extends CassandraIntegrationTest {
return currentHour;
}
- @Override
- protected DateTime currentInterval() {
- return currentHour;
- }
}
@BeforeMethod
diff --git a/modules/helpers/metrics-simulator/pom.xml
b/modules/helpers/metrics-simulator/pom.xml
index 7f9f6ae..885e86e 100644
--- a/modules/helpers/metrics-simulator/pom.xml
+++ b/modules/helpers/metrics-simulator/pom.xml
@@ -58,12 +58,6 @@
</dependency>
<dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-math3</artifactId>
- <version>3.1.1</version>
- </dependency>
-
- <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>${commons-logging.version}</version>
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementAggregator.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementAggregator.java
index ef223cb..03d4afe 100644
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementAggregator.java
+++
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementAggregator.java
@@ -25,6 +25,8 @@
package org.rhq.metrics.simulator;
+import java.util.concurrent.ExecutorService;
+
import com.codahale.metrics.Timer;
import org.apache.commons.logging.Log;
@@ -43,24 +45,34 @@ public class MeasurementAggregator implements Runnable {
private Metrics metrics;
+ private ExecutorService aggregationQueue;
+
private ShutdownManager shutdownManager;
- public MeasurementAggregator(MetricsServer metricsServer, ShutdownManager
shutdownManager, Metrics metrics) {
+ public MeasurementAggregator(MetricsServer metricsServer, ShutdownManager
shutdownManager, Metrics metrics,
+ ExecutorService aggregationQueue) {
this.metricsServer = metricsServer;
this.shutdownManager = shutdownManager;
this.metrics = metrics;
+ this.aggregationQueue = aggregationQueue;
}
public void run() {
- Timer.Context context = metrics.totalAggregationTime.time();
- try {
- metricsServer.calculateAggregates();
- } catch (Exception e) {
- log.error("An error occurred while trying to perform aggregation",
e);
- log.error("Requesting simulation shutdown...");
- shutdownManager.shutdown(1);
- } finally {
- context.stop();
- }
+ aggregationQueue.submit(new Runnable() {
+ @Override
+ public void run() {
+ Timer.Context context = metrics.totalAggregationTime.time();
+ try {
+ log.debug("Starting metrics aggregation");
+ metricsServer.calculateAggregates();
+ } catch (Exception e) {
+ log.error("An error occurred while trying to perform
aggregation", e);
+ log.error("Requesting simulation shutdown...");
+ shutdownManager.shutdown(1);
+ } finally {
+ context.stop();
+ }
+ }
+ });
}
}
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementCollector.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementCollector.java
index 45fe409..22bf81d 100644
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementCollector.java
+++
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementCollector.java
@@ -53,16 +53,20 @@ public class MeasurementCollector implements Runnable {
private Metrics metrics;
- public MeasurementCollector(int batchSize, int startingScheduleId, Metrics metrics,
MetricsServer metricsServer) {
+ private SimulatorDateTimeService dateTimeService;
+
+ public MeasurementCollector(int batchSize, int startingScheduleId, Metrics metrics,
MetricsServer metricsServer,
+ SimulatorDateTimeService dateTimeService) {
this.batchSize = batchSize;
this.startingScheduleId = startingScheduleId;
this.metrics = metrics;
this.metricsServer = metricsServer;
+ this.dateTimeService = dateTimeService;
}
private Set<MeasurementDataNumeric> generateData() {
Set<MeasurementDataNumeric> data = new
HashSet<MeasurementDataNumeric>(batchSize);
- long timestamp = System.currentTimeMillis();
+ long timestamp = dateTimeService.now().getMillis();
ThreadLocalRandom random = ThreadLocalRandom.current();
for (int i = 0; i < batchSize; ++i) {
@@ -93,17 +97,4 @@ public class MeasurementCollector implements Runnable {
});
}
- private static class NoOpCallback implements RawDataInsertedCallback {
- @Override
- public void onFinish() {
- }
-
- @Override
- public void onSuccess(MeasurementDataNumeric measurementDataNumeric) {
- }
-
- @Override
- public void onFailure(Throwable throwable) {
- }
- }
}
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Simulator.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Simulator.java
index be45017..2d2564e 100644
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Simulator.java
+++
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Simulator.java
@@ -23,6 +23,7 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
+import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
@@ -40,7 +41,6 @@ import org.joda.time.Minutes;
import org.rhq.cassandra.schema.SchemaManager;
import org.rhq.cassandra.util.ClusterBuilder;
import org.rhq.metrics.simulator.plan.SimulationPlan;
-import org.rhq.server.metrics.DateTimeService;
import org.rhq.server.metrics.MetricsDAO;
import org.rhq.server.metrics.MetricsServer;
import org.rhq.server.metrics.StorageSession;
@@ -55,13 +55,17 @@ public class Simulator implements ShutdownManager {
private boolean shutdown = false;
public void run(SimulationPlan plan) {
- final ScheduledExecutorService executorService =
Executors.newScheduledThreadPool(plan.getThreadPoolSize(),
- new SimulatorThreadFactory());
+ final ScheduledExecutorService aggregators = Executors.newScheduledThreadPool(1,
new SimulatorThreadFactory());
+ final ScheduledExecutorService collectors = Executors.newScheduledThreadPool(
+ plan.getNumMeasurementCollectors(), new SimulatorThreadFactory());
+ final ExecutorService aggregationQueue = Executors.newSingleThreadExecutor(new
SimulatorThreadFactory());
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
- shutdown(executorService);
+ shutdown(collectors, "collectors", 5);
+ shutdown(aggregators, "aggregators", 1);
+ shutdown(aggregationQueue, "aggregationQueue",
Integer.MAX_VALUE);
}
});
@@ -75,27 +79,25 @@ public class Simulator implements ShutdownManager {
metricsServer.setDAO(metricsDAO);
metricsServer.setConfiguration(plan.getMetricsServerConfiguration());
- DateTimeService dateTimeService = new DateTimeService();
+ SimulatorDateTimeService dateTimeService = new SimulatorDateTimeService();
dateTimeService.setConfiguration(plan.getMetricsServerConfiguration());
metricsServer.setDateTimeService(dateTimeService);
Metrics metrics = new Metrics();
- MeasurementAggregator measurementAggregator = new
MeasurementAggregator(metricsServer, this, metrics);
+ MeasurementAggregator measurementAggregator = new
MeasurementAggregator(metricsServer, this, metrics,
+ aggregationQueue);
ConsoleReporter consoleReporter = createConsoleReporter(metrics);
- int batchSize = 3;
for (int i = 0; i < plan.getNumMeasurementCollectors(); ++i) {
- MeasurementCollector measurementCollector = new
MeasurementCollector(batchSize, batchSize * i, metrics,
- metricsServer);
- executorService.scheduleAtFixedRate(measurementCollector, 0,
plan.getCollectionInterval(),
+ collectors.scheduleAtFixedRate(new MeasurementCollector(plan.getBatchSize(),
+ plan.getBatchSize() * i, metrics, metricsServer, dateTimeService), 0,
plan.getCollectionInterval(),
TimeUnit.MILLISECONDS);
}
- executorService.scheduleAtFixedRate(measurementAggregator, 0,
plan.getAggregationInterval(),
+ aggregators.scheduleAtFixedRate(measurementAggregator, 0,
plan.getAggregationInterval(),
TimeUnit.MILLISECONDS);
-
try {
Thread.sleep(Minutes.minutes(plan.getSimulationTime()).toStandardDuration().getMillis());
} catch (InterruptedException e) {
@@ -130,18 +132,18 @@ public class Simulator implements ShutdownManager {
System.exit(status);
}
- private void shutdown(ScheduledExecutorService executorService) {
- log.info("Shutting down executor service");
- executorService.shutdown();
+ private void shutdown(ExecutorService service, String serviceName, int wait) {
+ log.info("Shutting down " + serviceName);
+ service.shutdown();
try {
- executorService.awaitTermination(5, TimeUnit.SECONDS);
+ service.awaitTermination(wait, TimeUnit.SECONDS);
} catch (InterruptedException e) {
}
- if (!executorService.isTerminated()) {
- log.info("Forcing executor service shutdown.");
- executorService.shutdownNow();
+ if (!service.isTerminated()) {
+ log.info("Forcing " + serviceName + " shutdown.");
+ service.shutdownNow();
}
- log.info("Shut down complete");
+ log.info(serviceName + " shut down complete");
}
private void createSchema(String[] nodes, int cqlPort) {
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/SimulatorDateTimeService.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/SimulatorDateTimeService.java
new file mode 100644
index 0000000..c62340b
--- /dev/null
+++
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/SimulatorDateTimeService.java
@@ -0,0 +1,27 @@
+package org.rhq.metrics.simulator;
+
+import org.joda.time.DateTime;
+import org.joda.time.Duration;
+
+import org.rhq.server.metrics.DateTimeService;
+
+/**
+ * @author John Sanda
+ */
+public class SimulatorDateTimeService extends DateTimeService {
+
+ @Override
+ public DateTime getTimeSlice(DateTime dt, Duration duration) {
+ if (duration.equals(configuration.getRawTimeSliceDuration())) {
+ int seconds = ((dt.getMinuteOfHour() * 60) + dt.getSecondOfMinute()) / 150;
+ return dt.hourOfDay().roundFloorCopy().plusSeconds(seconds * 150);
+ } else if (duration.equals(configuration.getOneHourTimeSliceDuration())) {
+ int minutes = dt.minuteOfHour().get() / 15;
+ return dt.hourOfDay().roundFloorCopy().plusMinutes(minutes * 15);
+ } else if (duration.equals(configuration.getSixHourTimeSliceDuration())) {
+ return dt.hourOfDay().roundFloorCopy();
+ } else {
+ throw new IllegalArgumentException("The duration [" + duration +
"] is not supported");
+ }
+ }
+}
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/ClusterConfig.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/ClusterConfig.java
deleted file mode 100644
index af3ffeb..0000000
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/ClusterConfig.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- *
- * * RHQ Management Platform
- * * Copyright (C) 2005-2012 Red Hat, Inc.
- * * All rights reserved.
- * *
- * * This program is free software; you can redistribute it and/or modify
- * * it under the terms of the GNU General Public License, version 2, as
- * * published by the Free Software Foundation, and/or the GNU Lesser
- * * General Public License, version 2.1, also as published by the Free
- * * Software Foundation.
- * *
- * * This program is distributed in the hope that it will be useful,
- * * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * * GNU General Public License and the GNU Lesser General Public License
- * * for more details.
- * *
- * * You should have received a copy of the GNU General Public License
- * * and the GNU Lesser General Public License along with this program;
- * * if not, write to the Free Software Foundation, Inc.,
- * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-package org.rhq.metrics.simulator.plan;
-
-import java.io.File;
-
-/**
- * @author John Sanda
- */
-public class ClusterConfig {
-
- private boolean embedded = true;
-
- private String clusterDir = new
File(System.getProperty("rhq.metrics.simulator.basedir")).getAbsolutePath();
-
- private int numNodes = 2;
-
- private String heapSize = "256M";
-
- private String heapNewSize = "64M";
-
- private String stackSize;
-
- public boolean isEmbedded() {
- return embedded;
- }
-
- public void setEmbedded(boolean embedded) {
- this.embedded = embedded;
- }
-
- public String getClusterDir() {
- return clusterDir;
- }
-
- public void setClusterDir(String clusterDir) {
- this.clusterDir = clusterDir;
- }
-
- public int getNumNodes() {
- return numNodes;
- }
-
- public void setNumNodes(int numNodes) {
- this.numNodes = numNodes;
- }
-
- public String getHeapSize() {
- return heapSize;
- }
-
- public void setHeapSize(String heapSize) {
- this.heapSize = heapSize;
- }
-
- public String getHeapNewSize() {
- return heapNewSize;
- }
-
- public void setHeapNewSize(String heapNewSize) {
- this.heapNewSize = heapNewSize;
- }
-
- public String getStackSize() {
- return stackSize;
- }
-
- public void setStackSize(String stackSize) {
- this.stackSize = stackSize;
- }
-}
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlan.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlan.java
index a1079db..70c326a 100644
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlan.java
+++
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlan.java
@@ -48,6 +48,8 @@ public class SimulationPlan {
private int cqlPort;
+ private int batchSize;
+
public int getThreadPoolSize() {
return threadPoolSize;
}
@@ -111,4 +113,12 @@ public class SimulationPlan {
public void setCqlPort(int cqlPort) {
this.cqlPort = cqlPort;
}
+
+ public int getBatchSize() {
+ return batchSize;
+ }
+
+ public void setBatchSize(int batchSize) {
+ this.batchSize = batchSize;
+ }
}
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlanner.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlanner.java
index 06aaaa1..dc9142c 100644
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlanner.java
+++
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlanner.java
@@ -31,14 +31,10 @@ import java.net.InetAddress;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
-import org.joda.time.Days;
-import org.joda.time.Duration;
-import org.joda.time.Hours;
import org.joda.time.Minutes;
import org.joda.time.Seconds;
import org.rhq.server.metrics.MetricsConfiguration;
-import org.rhq.server.metrics.domain.MetricsTable;
/**
* @author John Sanda
@@ -50,11 +46,12 @@ public class SimulationPlanner {
JsonNode root = mapper.readTree(jsonFile);
SimulationPlan simulation = new SimulationPlan();
-
simulation.setCollectionInterval(getLong(root.get("collectionInterval"),
1000L));
-
simulation.setAggregationInterval(getLong(root.get("aggregationInterval"),
60000L));
+
simulation.setCollectionInterval(getLong(root.get("collectionInterval"),
1250L));
+
simulation.setAggregationInterval(getLong(root.get("aggregationInterval"),
150000L)); // 2.5 minutes
simulation.setNumMeasurementCollectors(getInt(root.get("numMeasurementCollectors"),
5));
simulation.setSimulationTime(getInt(root.get("simulationTime"), 10));
simulation.setThreadPoolSize(getInt(root.get("threadPoolSize"),
simulation.getNumMeasurementCollectors() + 2));
+ simulation.setBatchSize(getInt(root.get("batchSize"), 5000));
String[] nodes;
if (root.get("nodes") == null || root.get("nodes").size() ==
0) {
@@ -78,26 +75,18 @@ public class SimulationPlanner {
private MetricsConfiguration createDefaultMetricsConfiguration() {
- // 500 ms --> 30 sec
- // 1 sec --> 1 minute
- // 60 sec / 1 minute --> 1 hr
- // 1440 sec / 24 minutes --> 1 day
- // 168 minutes --> 1 week
- // 744 minutes / 12.4 hr --> 31 days / 1 month
- // 8928 minutes / 148.8 hr --> 1 yr
-
MetricsConfiguration configuration = new MetricsConfiguration();
configuration.setRawTTL(Minutes.minutes(168).toStandardSeconds().getSeconds());
configuration.setRawRetention(Minutes.minutes(168).toStandardDuration());
- configuration.setRawTimeSliceDuration(Minutes.ONE.toStandardDuration());
+
configuration.setRawTimeSliceDuration(Seconds.seconds(150).toStandardDuration());
configuration.setOneHourTTL(Minutes.minutes(336).toStandardSeconds().getSeconds());
configuration.setOneHourRetention(Minutes.minutes(336));
-
configuration.setOneHourTimeSliceDuration(Minutes.minutes(6).toStandardDuration());
+
configuration.setOneHourTimeSliceDuration(Minutes.minutes(15).toStandardDuration());
configuration.setSixHourTTL(Minutes.minutes(744).toStandardSeconds().getSeconds());
configuration.setSixHourRetention(Minutes.minutes(744).toStandardSeconds());
-
configuration.setSixHourTimeSliceDuration(Minutes.minutes(24).toStandardDuration());
+
configuration.setSixHourTimeSliceDuration(Minutes.minutes(60).toStandardDuration());
configuration.setTwentyFourHourTTL(Minutes.minutes(8928).toStandardSeconds().getSeconds());
configuration.setTwentyFourHourRetention(Minutes.minutes(8928).toStandardSeconds());
@@ -105,72 +94,6 @@ public class SimulationPlanner {
return configuration;
}
- private MetricsTable getTable(String name) {
- if (name.equals(MetricsTable.RAW.getTableName())) {
- return MetricsTable.RAW;
- } else if (name.equals(MetricsTable.ONE_HOUR.getTableName())) {
- return MetricsTable.ONE_HOUR;
- } else if (name.equals(MetricsTable.SIX_HOUR.getTableName())) {
- return MetricsTable.SIX_HOUR;
- } else if (name.equals(MetricsTable.TWENTY_FOUR_HOUR.getTableName())) {
- return MetricsTable.TWENTY_FOUR_HOUR;
- } else {
- throw new IllegalArgumentException(name + " is not a valid metrics table
name");
- }
- }
-
- private void setTTLAndRetention(MetricsTable table, int ttl, MetricsConfiguration
configuration) {
- switch (table) {
- case RAW:
- configuration.setRawTTL(ttl);
-
configuration.setRawRetention(Seconds.seconds(ttl).toStandardDuration());
- break;
- case ONE_HOUR:
- configuration.setOneHourTTL(ttl);
- configuration.setOneHourRetention(Seconds.seconds(ttl));
- break;
- case SIX_HOUR:
- configuration.setSixHourTTL(ttl);
- configuration.setSixHourRetention(Seconds.seconds(ttl));
- break;
- default:
- configuration.setTwentyFourHourTTL(ttl);
- configuration.setTwentyFourHourRetention(Seconds.seconds(ttl));
- break;
- }
- }
-
- private Duration getDuration(String units, int value) {
- if (units.equals("seconds")) {
- return Seconds.seconds(value).toStandardDuration();
- } else if (units.equals("minutes")) {
- return Minutes.minutes(value).toStandardDuration();
- } else if (units.equals("hours")) {
- return Hours.hours(value).toStandardDuration();
-
- } else if (units.equals("days")) {
- return Days.days(value).toStandardDuration();
- } else {
- throw new IllegalArgumentException(units + " is not a valid value for
the units property.");
- }
- }
-
- private void setTimeSliceDuration(MetricsTable table, Duration duration,
MetricsConfiguration configuration) {
- switch (table) {
- case RAW:
- configuration.setRawTimeSliceDuration(duration);
- break;
- case ONE_HOUR:
- configuration.setOneHourTimeSliceDuration(duration);
- break;
- case SIX_HOUR:
- configuration.setSixHourTimeSliceDuration(duration);
- break;
- default:
- // do nothing
- }
- }
-
private long getLong(JsonNode node, long defaultValue) {
if (node == null) {
return defaultValue;
commit cc2c6dbc98c8ae5e34fe11f577d0dfbac35a49a0
Author: John Sanda <jsanda(a)redhat.com>
Date: Fri Sep 27 10:41:55 2013 -0400
allow for configurable time slices
diff --git
a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
index 83f7653..f21f5c1 100644
---
a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
+++
b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
@@ -27,6 +27,7 @@ package org.rhq.server.metrics;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -97,13 +98,13 @@ public class MetricsServer {
* purged.
*/
private void determineMostRecentRawDataSinceLastShutdown() {
- DateTime previousHour = currentHour().minusHours(1);
+ DateTime previousHour =
currentInterval().minus(configuration.getRawTimeSliceDuration());
DateTime oldestRawTime = previousHour.minus(configuration.getRawRetention());
ResultSet resultSet = dao.setFindTimeSliceForIndex(MetricsTable.ONE_HOUR,
previousHour.getMillis());
Row row = resultSet.one();
while (row == null && previousHour.compareTo(oldestRawTime) > 0) {
- previousHour = previousHour.minusHours(1);
+ previousHour = previousHour.minus(configuration.getRawTimeSliceDuration());
resultSet = dao.setFindTimeSliceForIndex(MetricsTable.ONE_HOUR,
previousHour.getMillis());
row = resultSet.one();
}
@@ -125,6 +126,10 @@ public class MetricsServer {
}
}
+ protected DateTime currentInterval() {
+ return dateTimeService.getTimeSlice(DateTime.now(),
configuration.getRawTimeSliceDuration());
+ }
+
protected DateTime currentHour() {
DateTime dt = new DateTime(System.currentTimeMillis());
return dateTimeService.getTimeSlice(dt, Duration.standardHours(1));
@@ -380,7 +385,7 @@ public class MetricsServer {
* for subsequently computing baselines.
*/
public Iterable<AggregateNumericMetric> calculateAggregates() {
- DateTime theHour = currentHour();
+ DateTime theHour = currentInterval();
if (pastAggregationMissed) {
calculateAggregates(roundDownToHour(mostRecentRawDataPriorToStartup).plusHours(1).getMillis());
@@ -394,12 +399,15 @@ public class MetricsServer {
private Iterable<AggregateNumericMetric> calculateAggregates(long startTime) {
DateTime dt = new DateTime(startTime);
DateTime currentHour = dateTimeService.getTimeSlice(dt,
configuration.getRawTimeSliceDuration());
- DateTime lastHour = currentHour.minusHours(1);
+ DateTime lastHour = currentHour.minus(configuration.getRawTimeSliceDuration());
long hourTimeSlice = lastHour.getMillis();
long sixHourTimeSlice = dateTimeService.getTimeSlice(lastHour,
configuration.getOneHourTimeSliceDuration()).getMillis();
+ if (log.isDebugEnabled()) {
+ log.debug("six hour time slice = " + new Date(sixHourTimeSlice));
+ }
long twentyFourHourTimeSlice = dateTimeService.getTimeSlice(lastHour,
configuration.getSixHourTimeSliceDuration()).getMillis();
@@ -457,7 +465,7 @@ public class MetricsServer {
for (MetricsIndexEntry indexEntry : indexEntries) {
DateTime startTime = indexEntry.getTime();
- DateTime endTime = startTime.plusMinutes(60);
+ DateTime endTime =
startTime.plus(configuration.getRawTimeSliceDuration());
Iterable<RawNumericMetric> rawMetrics =
dao.findRawMetrics(indexEntry.getScheduleId(),
startTime.getMillis(), endTime.getMillis());
@@ -517,7 +525,7 @@ public class MetricsServer {
try {
DateTime startTime = new DateTime(timeSlice);
DateTime endTime = startTime.plus(nextDuration);
- DateTime currentHour = currentHour();
+ DateTime currentHour = currentInterval();
if (log.isDebugEnabled()) {
log.debug("Time slice start time is [" + startTime + "]
and the end time is [" + endTime + "].");
@@ -554,6 +562,9 @@ public class MetricsServer {
AggregateNumericMetric aggregatedMetric = calculateAggregate(metrics,
startTime.getMillis());
aggregatedMetric.setScheduleId(indexEntry.getScheduleId());
toMetrics.add(aggregatedMetric);
+ if (toTable == MetricsTable.TWENTY_FOUR_HOUR) {
+ log.debug("Calculated 24 hour metric = " +
aggregatedMetric);
+ }
}
switch (toTable) {
diff --git
a/modules/enterprise/server/server-metrics/src/test/java/org/rhq/server/metrics/DateTimeServiceTest.java
b/modules/enterprise/server/server-metrics/src/test/java/org/rhq/server/metrics/DateTimeServiceTest.java
index 2e3d899..01b3a76 100644
---
a/modules/enterprise/server/server-metrics/src/test/java/org/rhq/server/metrics/DateTimeServiceTest.java
+++
b/modules/enterprise/server/server-metrics/src/test/java/org/rhq/server/metrics/DateTimeServiceTest.java
@@ -96,6 +96,18 @@ public class DateTimeServiceTest {
}
@Test
+ public void getMinuteTimeSliceForSixHourData() {
+ configuration = new MetricsConfiguration();
+
configuration.setSixHourTimeSliceDuration(Minutes.minutes(24).toStandardDuration());
+
+ DateTime currentHour =
dateTimeService.hour0().plusHours(9).plusMinutes(12).plusSeconds(47);
+ DateTime timeSlice = dateTimeService.getTimeSlice(currentHour,
configuration.getSixHourTimeSliceDuration());
+ DateTime expected = dateTimeService.hour0().plusHours(9);
+
+ assertEquals(timeSlice, expected, "The hour time slice for six hour data is
wrong");
+ }
+
+ @Test
public void timestampBefore7DaysShouldBeInRawDataRange() {
assertTrue(dateTimeService.isInRawDataRange(now().minusHours(1)), "1 hour
ago should be in raw data range.");
assertTrue(dateTimeService.isInRawDataRange(now().minusDays(1)), "1 day ago
should be in raw data range.");
diff --git
a/modules/enterprise/server/server-metrics/src/test/java/org/rhq/server/metrics/MetricsServerTest.java
b/modules/enterprise/server/server-metrics/src/test/java/org/rhq/server/metrics/MetricsServerTest.java
index 2c140f6..a670fcf 100644
---
a/modules/enterprise/server/server-metrics/src/test/java/org/rhq/server/metrics/MetricsServerTest.java
+++
b/modules/enterprise/server/server-metrics/src/test/java/org/rhq/server/metrics/MetricsServerTest.java
@@ -101,6 +101,11 @@ public class MetricsServerTest extends CassandraIntegrationTest {
}
return currentHour;
}
+
+ @Override
+ protected DateTime currentInterval() {
+ return currentHour;
+ }
}
@BeforeMethod
commit 3a28eb4c10139416a6ea65597b9d006ec881b313
Author: John Sanda <jsanda(a)redhat.com>
Date: Fri Sep 27 10:29:21 2013 -0400
numerous changes in metrics-simulator to simplify things
Metrics are now captured using the Metrics Core library which renders both
Stats.java and StatsCollector.java obsolete.
MetricsCollector has been simplified substantially. It is now seeded with a
starting schedule id and a batch size and generates batch size inserts each
time it runs.
A good bit of the simulator configuration that is specified in the json file
has been removed as well in an effort to make sure things are correct. As of
now intervals and time slices are fixed.
* raw data --> 1 minute
* 1 hour data --> 6 minutes
* 6 hour data --> 1 hour
This means that a day's worth of data is generated in one hour. Minor changes
have been made in MetricsServer to allow for configurable time slices.
diff --git a/modules/helpers/metrics-simulator/pom.xml
b/modules/helpers/metrics-simulator/pom.xml
index 3281f90..7f9f6ae 100644
--- a/modules/helpers/metrics-simulator/pom.xml
+++ b/modules/helpers/metrics-simulator/pom.xml
@@ -10,6 +10,10 @@
<artifactId>rhq-metrics-simulator</artifactId>
<name>RHQ Metrics Simulator</name>
+ <properties>
+ <animal.sniffer.skip>true</animal.sniffer.skip>
+ </properties>
+
<dependencies>
<dependency>
<groupId>org.rhq</groupId>
@@ -76,6 +80,12 @@
<artifactId>commons-cli</artifactId>
<version>1.2</version>
</dependency>
+
+ <dependency>
+ <groupId>com.codahale.metrics</groupId>
+ <artifactId>metrics-core</artifactId>
+ <version>3.0.1</version>
+ </dependency>
</dependencies>
<build>
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementAggregator.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementAggregator.java
index 31bca0b..ef223cb 100644
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementAggregator.java
+++
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementAggregator.java
@@ -25,6 +25,8 @@
package org.rhq.metrics.simulator;
+import com.codahale.metrics.Timer;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -39,20 +41,18 @@ public class MeasurementAggregator implements Runnable {
private MetricsServer metricsServer;
+ private Metrics metrics;
+
private ShutdownManager shutdownManager;
- public void setMetricsServer(MetricsServer metricsServer) {
+ public MeasurementAggregator(MetricsServer metricsServer, ShutdownManager
shutdownManager, Metrics metrics) {
this.metricsServer = metricsServer;
- }
-
- public void setShutdownManager(ShutdownManager shutdownManager) {
this.shutdownManager = shutdownManager;
+ this.metrics = metrics;
}
- @Override
public void run() {
- log.info("Starting metrics aggregation...");
- long startTime = System.currentTimeMillis();
+ Timer.Context context = metrics.totalAggregationTime.time();
try {
metricsServer.calculateAggregates();
} catch (Exception e) {
@@ -60,8 +60,7 @@ public class MeasurementAggregator implements Runnable {
log.error("Requesting simulation shutdown...");
shutdownManager.shutdown(1);
} finally {
- long endTime = System.currentTimeMillis();
- log.info("Finished metrics aggregation in " + (endTime - startTime)
+ " ms");
+ context.stop();
}
}
}
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementCollector.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementCollector.java
index b0a67c8..45fe409 100644
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementCollector.java
+++
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/MeasurementCollector.java
@@ -26,15 +26,15 @@
package org.rhq.metrics.simulator;
import java.util.HashSet;
-import java.util.PriorityQueue;
import java.util.Set;
-import java.util.concurrent.locks.ReentrantLock;
+import java.util.concurrent.ThreadLocalRandom;
+
+import com.codahale.metrics.Timer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.rhq.core.domain.measurement.MeasurementDataNumeric;
-import org.rhq.metrics.simulator.stats.Stats;
import org.rhq.server.metrics.MetricsServer;
import org.rhq.server.metrics.RawDataInsertedCallback;
@@ -45,98 +45,52 @@ public class MeasurementCollector implements Runnable {
private final Log log = LogFactory.getLog(MeasurementCollector.class);
- private PriorityQueue<Schedule> queue;
-
private MetricsServer metricsServer;
- private ReentrantLock queueLock;
-
- private Stats stats;
+ private int batchSize;
- private ShutdownManager shutdownManager;
+ private int startingScheduleId;
- private int batchSize = 500;
-
- private NoOpCallback rawInsertsCallback = new NoOpCallback();
-
- public void setQueue(PriorityQueue<Schedule> queue) {
- this.queue = queue;
- }
+ private Metrics metrics;
- public void setMetricsServer(MetricsServer metricsServer) {
+ public MeasurementCollector(int batchSize, int startingScheduleId, Metrics metrics,
MetricsServer metricsServer) {
+ this.batchSize = batchSize;
+ this.startingScheduleId = startingScheduleId;
+ this.metrics = metrics;
this.metricsServer = metricsServer;
}
- public void setQueueLock(ReentrantLock queueLock) {
- this.queueLock = queueLock;
- }
+ private Set<MeasurementDataNumeric> generateData() {
+ Set<MeasurementDataNumeric> data = new
HashSet<MeasurementDataNumeric>(batchSize);
+ long timestamp = System.currentTimeMillis();
+ ThreadLocalRandom random = ThreadLocalRandom.current();
- public void setStats(Stats stats) {
- this.stats = stats;
- }
+ for (int i = 0; i < batchSize; ++i) {
+ data.add(new MeasurementDataNumeric(timestamp, startingScheduleId + i,
random.nextDouble()));
+ }
- public void setShutdownManager(ShutdownManager shutdownManager) {
- this.shutdownManager = shutdownManager;
+ return data;
}
@Override
public void run() {
- long startTime = System.currentTimeMillis();
- int metricsCollected = 0;
- // TODO parameterize threshold
- try {
- log.info("Starting metrics collections...");
- Set<Schedule> schedules = new HashSet<Schedule>();
- try {
- queueLock.lock();
- Schedule first = queue.peek();
- if (first != null && first.getNextCollection() <=
System.currentTimeMillis()) {
- Schedule next = first;
- while (next != null && next.getNextCollection() ==
first.getNextCollection() &&
- schedules.size() < batchSize) {
- schedules.add(queue.poll());
- next = queue.peek();
- }
- }
- } finally {
- queueLock.unlock();
+ final Timer.Context context = metrics.batchInsertTime.time();
+ metricsServer.addNumericData(generateData(), new RawDataInsertedCallback() {
+ @Override
+ public void onFinish() {
+ context.stop();
}
- if (schedules.isEmpty()) {
- log.debug("No schedules are ready for collections.");
- return;
+ @Override
+ public void onSuccess(MeasurementDataNumeric result) {
+ metrics.rawInserts.mark();
}
- log.debug("There are " + schedules.size() + " schedules ready
for collection.");
- Set<MeasurementDataNumeric> data = new
HashSet<MeasurementDataNumeric>(schedules.size());
- for (Schedule schedule : schedules) {
- data.add(new MeasurementDataNumeric(schedule.getNextCollection(),
schedule.getId(),
- schedule.getNextValue()));
- schedule.updateCollection();
+ @Override
+ public void onFailure(Throwable t) {
+ log.warn("Failed to insert raw data", t);
}
- metricsCollected = data.size();
- try {
- metricsServer.addNumericData(data, rawInsertsCallback);
- } catch (Exception e) {
- log.error("An error occurred while trying to store raw
metrics", e);
- log.error("Requesting simulation shutdown...");
- shutdownManager.shutdown(1);
- }
- stats.addRawInserts(metricsCollected);
- try {
- queueLock.lock();
- for (Schedule schedule : schedules) {
- queue.offer(schedule);
- }
- } finally {
- queueLock.unlock();
- }
- } finally {
- long endTime = System.currentTimeMillis();
- long totalTime = endTime - startTime;
- stats.addRawInsertTime(totalTime);
- log.info("Finished collecting and storing " + metricsCollected +
" raw metric in " +totalTime + " ms.");
- }
+ });
}
private static class NoOpCallback implements RawDataInsertedCallback {
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Metrics.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Metrics.java
new file mode 100644
index 0000000..f7ea87a
--- /dev/null
+++
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Metrics.java
@@ -0,0 +1,30 @@
+package org.rhq.metrics.simulator;
+
+import static com.codahale.metrics.MetricRegistry.name;
+
+import com.codahale.metrics.Meter;
+import com.codahale.metrics.MetricRegistry;
+import com.codahale.metrics.Timer;
+
+/**
+ * @author John Sanda
+ */
+public class Metrics {
+
+ public final MetricRegistry registry;
+
+ public final Meter rawInserts;
+
+ public final Timer batchInsertTime;
+
+ public final Timer totalAggregationTime;
+
+ public Metrics() {
+ registry = new MetricRegistry();
+
+ rawInserts = registry.meter(name(MeasurementCollector.class,
"rawInserts"));
+ batchInsertTime = registry.timer(name(MeasurementCollector.class,
"batchInsertTime"));
+ totalAggregationTime = registry.timer(name(MeasurementAggregator.class,
"totalAggregationTime"));
+ }
+
+}
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Schedule.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Schedule.java
deleted file mode 100644
index 0bcb4b8..0000000
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Schedule.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- *
- * * RHQ Management Platform
- * * Copyright (C) 2005-2012 Red Hat, Inc.
- * * All rights reserved.
- * *
- * * This program is free software; you can redistribute it and/or modify
- * * it under the terms of the GNU General Public License, version 2, as
- * * published by the Free Software Foundation, and/or the GNU Lesser
- * * General Public License, version 2.1, also as published by the Free
- * * Software Foundation.
- * *
- * * This program is distributed in the hope that it will be useful,
- * * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * * GNU General Public License and the GNU Lesser General Public License
- * * for more details.
- * *
- * * You should have received a copy of the GNU General Public License
- * * and the GNU Lesser General Public License along with this program;
- * * if not, write to the Free Software Foundation, Inc.,
- * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-package org.rhq.metrics.simulator;
-
-/**
- * @author John Sanda
- */
-public class Schedule implements Comparable<Schedule> {
-
- private int id;
-
- private long lastCollection;
-
- private long nextCollection;
-
- private long interval;
-
- public Schedule(int id) {
- this.id = id;
- }
-
- public int getId() {
- return id;
- }
-
- public long getLastCollection() {
- return lastCollection;
- }
-
- public void setLastCollection(long lastCollection) {
- this.lastCollection = lastCollection;
- }
-
- public long getNextCollection() {
- return nextCollection;
- }
-
- public void setNextCollection(long nextCollection) {
- this.nextCollection = nextCollection;
- }
-
- public void updateCollection() {
- nextCollection += interval;
- }
-
- public long getInterval() {
- return interval;
- }
-
- public void setInterval(long interval) {
- this.interval = interval;
- }
-
- public double getNextValue() {
- return 1.23;
- }
-
- @Override
- public int compareTo(Schedule that) {
- if (this.nextCollection < that.nextCollection) {
- return -1;
- }
-
- if (this.nextCollection > that.nextCollection) {
- return 1;
- }
-
- return 0;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- Schedule schedule = (Schedule) o;
-
- if (id != schedule.id) return false;
- if (interval != schedule.interval) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = id;
- result = 31 * result + (int) (interval ^ (interval >>> 32));
- return result;
- }
-
- @Override
- public String toString() {
- return "Schedule[id= " + id + ", lastCollection= " +
lastCollection + ", nextCollection= " + nextCollection +
- ", interval= " + interval + "]";
- }
-}
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Simulator.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Simulator.java
index 59bafcf..be45017 100644
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Simulator.java
+++
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/Simulator.java
@@ -20,18 +20,16 @@
package org.rhq.metrics.simulator;
import java.io.File;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.PriorityQueue;
-import java.util.Set;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.PrintStream;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.ReentrantLock;
+import com.codahale.metrics.ConsoleReporter;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.Host;
-import com.datastax.driver.core.ProtocolOptions;
import com.datastax.driver.core.Session;
import com.datastax.driver.core.exceptions.NoHostAvailableException;
@@ -39,16 +37,9 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.joda.time.Minutes;
-import org.rhq.cassandra.CassandraClusterManager;
-import org.rhq.cassandra.ClusterInitService;
-import org.rhq.cassandra.DeploymentOptions;
-import org.rhq.cassandra.DeploymentOptionsFactory;
import org.rhq.cassandra.schema.SchemaManager;
import org.rhq.cassandra.util.ClusterBuilder;
-import org.rhq.metrics.simulator.plan.ClusterConfig;
-import org.rhq.metrics.simulator.plan.ScheduleGroup;
import org.rhq.metrics.simulator.plan.SimulationPlan;
-import org.rhq.metrics.simulator.stats.Stats;
import org.rhq.server.metrics.DateTimeService;
import org.rhq.server.metrics.MetricsDAO;
import org.rhq.server.metrics.MetricsServer;
@@ -63,8 +54,6 @@ public class Simulator implements ShutdownManager {
private boolean shutdown = false;
- private CassandraClusterManager ccm;
-
public void run(SimulationPlan plan) {
final ScheduledExecutorService executorService =
Executors.newScheduledThreadPool(plan.getThreadPoolSize(),
new SimulatorThreadFactory());
@@ -76,18 +65,9 @@ public class Simulator implements ShutdownManager {
}
});
- initCluster(plan);
- createSchema();
-
- Session session = createSession();
-// if (plan.getClientCompression() == null) {
-// session = createSession();
-// } else {
-// ProtocolOptions.Compression compression =
Enum.valueOf(ProtocolOptions.Compression.class,
-// plan.getClientCompression().toUpperCase());
-// session = createSession(compression);
-// }
+ createSchema(plan.getNodes(), plan.getCqlPort());
+ Session session = createSession(plan.getNodes(), plan.getCqlPort());
StorageSession storageSession = new StorageSession(session);
MetricsDAO metricsDAO = new MetricsDAO(storageSession,
plan.getMetricsServerConfiguration());
@@ -99,29 +79,16 @@ public class Simulator implements ShutdownManager {
dateTimeService.setConfiguration(plan.getMetricsServerConfiguration());
metricsServer.setDateTimeService(dateTimeService);
- Set<Schedule> schedules = initSchedules(plan.getScheduleSets().get(0));
- PriorityQueue<Schedule> queue = new
PriorityQueue<Schedule>(schedules);
- ReentrantLock queueLock = new ReentrantLock();
-
- MeasurementAggregator measurementAggregator = new MeasurementAggregator();
- measurementAggregator.setMetricsServer(metricsServer);
- measurementAggregator.setShutdownManager(this);
+ Metrics metrics = new Metrics();
- Stats stats = new Stats();
- StatsCollector statsCollector = new StatsCollector(stats);
-
- log.info("Starting executor service");
- executorService.scheduleAtFixedRate(statsCollector, 0, 1, TimeUnit.MINUTES);
+ MeasurementAggregator measurementAggregator = new
MeasurementAggregator(metricsServer, this, metrics);
+ ConsoleReporter consoleReporter = createConsoleReporter(metrics);
+ int batchSize = 3;
for (int i = 0; i < plan.getNumMeasurementCollectors(); ++i) {
- MeasurementCollector measurementCollector = new MeasurementCollector();
- measurementCollector.setMetricsServer(metricsServer);
- measurementCollector.setQueue(queue);
- measurementCollector.setQueueLock(queueLock);
- measurementCollector.setStats(stats);
- measurementCollector.setShutdownManager(this);
-
+ MeasurementCollector measurementCollector = new
MeasurementCollector(batchSize, batchSize * i, metrics,
+ metricsServer);
executorService.scheduleAtFixedRate(measurementCollector, 0,
plan.getCollectionInterval(),
TimeUnit.MILLISECONDS);
}
@@ -133,16 +100,31 @@ public class Simulator implements ShutdownManager {
Thread.sleep(Minutes.minutes(plan.getSimulationTime()).toStandardDuration().getMillis());
} catch (InterruptedException e) {
}
- statsCollector.reportSummaryStats();
log.info("Simulation has completed. Initiating shutdown...");
+ consoleReporter.stop();
shutdown(0);
}
+ private ConsoleReporter createConsoleReporter(Metrics metrics) {
+ try {
+ File basedir = new
File(System.getProperty("rhq.metrics.simulator.basedir"));
+ File logDir = new File(basedir, "log");
+ ConsoleReporter consoleReporter =
ConsoleReporter.forRegistry(metrics.registry)
+
.convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS)
+ .outputTo(new PrintStream(new FileOutputStream(new File(logDir,
"metrics.txt")))).build();
+ consoleReporter.start(1, TimeUnit.MINUTES);
+ return consoleReporter;
+ } catch (FileNotFoundException e) {
+ throw new RuntimeException("Failed to create console reporter",
e);
+ }
+ }
+
@Override
public synchronized void shutdown(int status) {
if (shutdown) {
return;
}
+
shutdown = true;
log.info("Preparing to shutdown simulator...");
System.exit(status);
@@ -159,65 +141,23 @@ public class Simulator implements ShutdownManager {
log.info("Forcing executor service shutdown.");
executorService.shutdownNow();
}
- shutdownCluster();
log.info("Shut down complete");
}
- private void initCluster(SimulationPlan plan) {
- try {
- deployCluster(plan.getClusterConfig());
- waitForClusterToInitialize();
- } catch (Exception e) {
- throw new RuntimeException("Failed to start simulator. Cluster
initialization failed.", e);
- }
- }
-
- private void deployCluster(ClusterConfig clusterConfig) throws IOException {
- File clusterDir = new File(clusterConfig.getClusterDir(),
"cassandra");
- log.info("Deploying cluster to " + clusterDir);
- clusterDir.mkdirs();
-
- DeploymentOptionsFactory factory = new DeploymentOptionsFactory();
- DeploymentOptions deploymentOptions = factory.newDeploymentOptions();
- deploymentOptions.setClusterDir(clusterDir.getAbsolutePath());
- deploymentOptions.setNumNodes(clusterConfig.getNumNodes());
- deploymentOptions.setHeapSize(clusterConfig.getHeapSize());
- deploymentOptions.setHeapNewSize(clusterConfig.getHeapNewSize());
- if (clusterConfig.getStackSize() != null) {
- deploymentOptions.setStackSize(clusterConfig.getStackSize());
- }
- deploymentOptions.setLoggingLevel("INFO");
- deploymentOptions.load();
-
- ccm = new CassandraClusterManager(deploymentOptions);
- ccm.createCluster();
- ccm.startCluster(false);
- }
-
- private void shutdownCluster() {
- log.info("Shutting down cluster");
- ccm.shutdownCluster();
- }
-
- private void waitForClusterToInitialize() {
- log.info("Waiting for cluster to initialize");
- ClusterInitService clusterInitService = new ClusterInitService();
- clusterInitService.waitForClusterToStart(ccm.getNodes(), ccm.getJmxPorts(),
ccm.getNodes().length, 2000, 20, 10);
- }
-
- private void createSchema() {
+ private void createSchema(String[] nodes, int cqlPort) {
try {
log.info("Creating schema");
- SchemaManager schemaManager = new SchemaManager("rhqadmin",
"1eeb2f255e832171df8592078de921bc", ccm.getNodes(), ccm.getCqlPort());
+ SchemaManager schemaManager = new SchemaManager("rhqadmin",
"1eeb2f255e832171df8592078de921bc",
+ new String[] {"127.0.0.1"}, 9142);
schemaManager.install();
} catch (Exception e) {
throw new RuntimeException("Failed to start simulator. An error occurred
during schema creation.", e);
}
}
- private Session createSession() throws NoHostAvailableException {
+ private Session createSession(String[] nodes, int cqlPort) throws
NoHostAvailableException {
try {
- Cluster cluster = new
ClusterBuilder().addContactPoints(ccm.getNodes()).withPort(ccm.getCqlPort())
+ Cluster cluster = new
ClusterBuilder().addContactPoints(nodes).withPort(cqlPort)
.withCredentials("rhqadmin", "rhqadmin")
.build();
@@ -231,25 +171,6 @@ public class Simulator implements ShutdownManager {
}
}
- private Session createSession(ProtocolOptions.Compression compression)
- throws NoHostAvailableException {
- try {
- log.debug("Creating session using " + compression.name() + "
compression");
-
- Cluster cluster = new
ClusterBuilder().addContactPoints(ccm.getNodes()).withPort(ccm.getCqlPort())
- .withCredentials("cassandra", "cassandra")
- .withCompression(compression)
- .build();
-
- log.debug("Created cluster object with " +
cluster.getConfiguration().getProtocolOptions().getCompression()
- + " compression.");
-
- return initSession(cluster);
- } catch (Exception e) {
- throw new RuntimeException("Failed to start simulator. Unable to create
" + Session.class, e);
- }
- }
-
@SuppressWarnings("deprecation")
private Session initSession(Cluster cluster) {
NodeFailureListener listener = new NodeFailureListener();
@@ -260,18 +181,6 @@ public class Simulator implements ShutdownManager {
return cluster.connect("rhq");
}
- private Set<Schedule> initSchedules(ScheduleGroup scheduleSet) {
- long nextCollection = System.currentTimeMillis();
- Set<Schedule> schedules = new HashSet<Schedule>();
- for (int i = 0; i < scheduleSet.getCount(); ++i) {
- Schedule schedule = new Schedule(i);
- schedule.setInterval(scheduleSet.getInterval());
- schedule.setNextCollection(nextCollection);
- schedules.add(schedule);
- }
- return schedules;
- }
-
private static class NodeFailureListener implements Host.StateListener {
private Log log = LogFactory.getLog(NodeFailureListener.class);
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/StatsCollector.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/StatsCollector.java
deleted file mode 100644
index b59ca9c..0000000
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/StatsCollector.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- *
- * * RHQ Management Platform
- * * Copyright (C) 2005-2012 Red Hat, Inc.
- * * All rights reserved.
- * *
- * * This program is free software; you can redistribute it and/or modify
- * * it under the terms of the GNU General Public License, version 2, as
- * * published by the Free Software Foundation, and/or the GNU Lesser
- * * General Public License, version 2.1, also as published by the Free
- * * Software Foundation.
- * *
- * * This program is distributed in the hope that it will be useful,
- * * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * * GNU General Public License and the GNU Lesser General Public License
- * * for more details.
- * *
- * * You should have received a copy of the GNU General Public License
- * * and the GNU Lesser General Public License along with this program;
- * * if not, write to the Free Software Foundation, Inc.,
- * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-package org.rhq.metrics.simulator;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.joda.time.Duration;
-
-import org.rhq.metrics.simulator.stats.Stats;
-
-/**
- * @author John Sanda
- */
-public class StatsCollector implements Runnable {
-
- private final Log log = LogFactory.getLog(StatsCollector.class);
-
- private Stats stats;
-
- private long previousRawInsertTotal;
-
- private long lastRunTimestamp;
-
- private SimpleDateFormat dateFormat;
-
- public StatsCollector(Stats stats) {
- this.stats = stats;
- dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
- }
-
- @Override
- public void run() {
- long now = System.currentTimeMillis();
- long totalRawInserts = stats.getTotalRawInserts();
-
- // inserts will be null on the first run
- if (lastRunTimestamp == 0) {
- lastRunTimestamp = now;
- previousRawInsertTotal = totalRawInserts;
- return;
- }
-
- long lastRawInsertsCount = totalRawInserts - previousRawInsertTotal;
- Duration duration = new Duration(lastRunTimestamp, now);
- stats.addRawInsertsPerMinute(lastRawInsertsCount);
-
- StringBuilder data = new StringBuilder("Statistics Report\n")
-
.append("------------------------------------------------------------------------------------\n")
- .append("Sampling period start time: " + dateFormat.format(new
Date(lastRunTimestamp))).append("\n")
- .append("Sampling period length: " +
duration.toStandardSeconds().getSeconds()).append(" seconds\n")
- .append("Total raw metrics inserted:
").append(totalRawInserts).append("\n")
- .append("Raw inserts this sampling period:
").append(lastRawInsertsCount).append("\n")
- .append(stats.getRawInsertsPerMinute()).append("\n")
- .append(stats.getRawInsertTimes()).append("\n")
-
.append("------------------------------------------------------------------------------------");
-
- log.info(data);
-
- lastRunTimestamp = now;
- previousRawInsertTotal = totalRawInserts;
- }
-
- public void reportSummaryStats() {
- log.info("Reporting statistics for entire simulation run.");
- log.info(stats.getRawInsertsPerMinute());
- }
-
-}
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/ScheduleGroup.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/ScheduleGroup.java
deleted file mode 100644
index 4dbcf29..0000000
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/ScheduleGroup.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *
- * * RHQ Management Platform
- * * Copyright (C) 2005-2012 Red Hat, Inc.
- * * All rights reserved.
- * *
- * * This program is free software; you can redistribute it and/or modify
- * * it under the terms of the GNU General Public License, version 2, as
- * * published by the Free Software Foundation, and/or the GNU Lesser
- * * General Public License, version 2.1, also as published by the Free
- * * Software Foundation.
- * *
- * * This program is distributed in the hope that it will be useful,
- * * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * * GNU General Public License and the GNU Lesser General Public License
- * * for more details.
- * *
- * * You should have received a copy of the GNU General Public License
- * * and the GNU Lesser General Public License along with this program;
- * * if not, write to the Free Software Foundation, Inc.,
- * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-package org.rhq.metrics.simulator.plan;
-
-/**
- * @author John Sanda
- */
-public class ScheduleGroup {
-
- private int count;
-
- private long interval;
-
- public ScheduleGroup() {
- }
-
- public ScheduleGroup(int count, long interval) {
- this.count = count;
- this.interval = interval;
- }
-
- public int getCount() {
- return count;
- }
-
- public void setCount(int count) {
- this.count = count;
- }
-
- public long getInterval() {
- return interval;
- }
-
- public void setInterval(long interval) {
- this.interval = interval;
- }
-}
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlan.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlan.java
index d2c62c0..a1079db 100644
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlan.java
+++
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlan.java
@@ -25,9 +25,6 @@
package org.rhq.metrics.simulator.plan;
-import java.util.ArrayList;
-import java.util.List;
-
import org.rhq.server.metrics.MetricsConfiguration;
/**
@@ -35,8 +32,6 @@ import org.rhq.server.metrics.MetricsConfiguration;
*/
public class SimulationPlan {
- private List<ScheduleGroup> scheduleSets = new
ArrayList<ScheduleGroup>();
-
private int threadPoolSize;
private long collectionInterval;
@@ -49,21 +44,9 @@ public class SimulationPlan {
private int simulationTime;
- private ClusterConfig clusterConfig;
-
- private String clientCompression = null;
-
- public List<ScheduleGroup> getScheduleSets() {
- return scheduleSets;
- }
-
- public void addScheduleSet(ScheduleGroup scheduleSet) {
- scheduleSets.add(scheduleSet);
- }
+ private String[] nodes;
- public void setScheduleSets(List<ScheduleGroup> scheduleSets) {
- this.scheduleSets = scheduleSets;
- }
+ private int cqlPort;
public int getThreadPoolSize() {
return threadPoolSize;
@@ -113,19 +96,19 @@ public class SimulationPlan {
this.simulationTime = simulationTime;
}
- public ClusterConfig getClusterConfig() {
- return clusterConfig;
+ public String[] getNodes() {
+ return nodes;
}
- public void setClusterConfig(ClusterConfig clusterConfig) {
- this.clusterConfig = clusterConfig;
+ public void setNodes(String[] nodes) {
+ this.nodes = nodes;
}
- public String getClientCompression() {
- return clientCompression;
+ public int getCqlPort() {
+ return cqlPort;
}
- public void setClientCompression(String clientCompression) {
- this.clientCompression = clientCompression;
+ public void setCqlPort(int cqlPort) {
+ this.cqlPort = cqlPort;
}
}
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlanner.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlanner.java
index f0e41ed..06aaaa1 100644
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlanner.java
+++
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/plan/SimulationPlanner.java
@@ -26,6 +26,7 @@
package org.rhq.metrics.simulator.plan;
import java.io.File;
+import java.net.InetAddress;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -49,117 +50,57 @@ public class SimulationPlanner {
JsonNode root = mapper.readTree(jsonFile);
SimulationPlan simulation = new SimulationPlan();
-
simulation.setCollectionInterval(getLong(root.get("collectionInterval"),
500L));
-
simulation.setAggregationInterval(getLong(root.get("aggregationInterval"),
1000L));
- simulation.setThreadPoolSize(getInt(root.get("threadPoolSize"), 7));
+
simulation.setCollectionInterval(getLong(root.get("collectionInterval"),
1000L));
+
simulation.setAggregationInterval(getLong(root.get("aggregationInterval"),
60000L));
simulation.setNumMeasurementCollectors(getInt(root.get("numMeasurementCollectors"),
5));
simulation.setSimulationTime(getInt(root.get("simulationTime"), 10));
+ simulation.setThreadPoolSize(getInt(root.get("threadPoolSize"),
simulation.getNumMeasurementCollectors() + 2));
- JsonNode clientCompressionNode = root.get("clientCompression");
- if (clientCompressionNode != null) {
- simulation.setClientCompression(clientCompressionNode.asText());
- }
-
- JsonNode schedules = root.get("schedules");
- if (schedules == null) {
- simulation.addScheduleSet(new ScheduleGroup(2500, 500L));
+ String[] nodes;
+ if (root.get("nodes") == null || root.get("nodes").size() ==
0) {
+ nodes = new String[] {InetAddress.getLocalHost().getHostAddress()};
} else {
- if (schedules.isArray()) {
- for (JsonNode node : schedules) {
- simulation.addScheduleSet(new
ScheduleGroup(getInt(node.get("count"), 2500),
- getLong(node.get("interval"), 500L)));
- }
- } else {
- simulation.addScheduleSet(new
ScheduleGroup(getInt(schedules.get("count"), 2500),
- getLong(schedules.get("interval"), 500L)));
+ nodes = new String[root.get("nodes").size()];
+ int i = 0;
+ for (JsonNode node : root.get("nodes")) {
+ nodes[i++] = node.asText();
}
}
+ simulation.setNodes(nodes);
+
+ simulation.setCqlPort(getInt(root.get("cqlPort"), 9142));
MetricsConfiguration serverConfiguration = createDefaultMetricsConfiguration();
simulation.setMetricsServerConfiguration(serverConfiguration);
- JsonNode ttlNodes = root.get("ttl");
- if (ttlNodes != null) {
- for (JsonNode node : ttlNodes) {
- String tableName = node.get("table").asText();
- if (!tableName.isEmpty()) {
- MetricsTable table = getTable(tableName);
- JsonNode ttlNode = node.get("value");
- if (ttlNode != null) {
- setTTLAndRetention(table, ttlNode.asInt(), serverConfiguration);
- }
- }
- }
- }
-
- JsonNode timeSliceNode = root.get("timeSliceDuration");
- if (timeSliceNode != null) {
- String units = timeSliceNode.get("units").asText();
- if (units.isEmpty()) {
- units = "minutes";
- }
- for (JsonNode node : timeSliceNode.get("values")) {
- JsonNode valueNode = node.get("value");
- JsonNode tableNode = node.get("table");
- if (!(tableNode == null || valueNode == null)) {
- Duration duration = getDuration(units, valueNode.asInt());
- MetricsTable table = getTable(tableNode.asText());
- setTimeSliceDuration(table, duration, serverConfiguration);
- }
- }
- }
-
- ClusterConfig clusterConfig = new ClusterConfig();
- JsonNode clusterConfigNode = root.get("cluster");
- if (clusterConfigNode != null) {
- JsonNode embeddedNode = clusterConfigNode.get("embedded");
- if (embeddedNode != null) {
- clusterConfig.setEmbedded(embeddedNode.asBoolean(true));
- }
-
- JsonNode clusterDirNode = clusterConfigNode.get("clusterDir");
- if (clusterDirNode != null) {
- clusterConfig.setClusterDir(clusterDirNode.asText());
- }
-
- JsonNode heapSizeNode = clusterConfigNode.get("heapSize");
- if (heapSizeNode != null) {
- clusterConfig.setHeapSize(heapSizeNode.asText());
- }
-
- JsonNode heapNewSizeNode = clusterConfigNode.get("heapNewSize");
- if (heapNewSizeNode != null) {
- clusterConfig.setHeapNewSize(heapNewSizeNode.asText());
- }
-
- JsonNode stackSizeNode = clusterConfigNode.get("stackSize");
- if (stackSizeNode != null) {
- clusterConfig.setStackSize(stackSizeNode.asText());
- }
-
- clusterConfig.setNumNodes(getInt(clusterConfigNode.get("numNodes"),
2));
- }
- simulation.setClusterConfig(clusterConfig);
-
return simulation;
}
private MetricsConfiguration createDefaultMetricsConfiguration() {
+
+ // 500 ms --> 30 sec
+ // 1 sec --> 1 minute
+ // 60 sec / 1 minute --> 1 hr
+ // 1440 sec / 24 minutes --> 1 day
+ // 168 minutes --> 1 week
+ // 744 minutes / 12.4 hr --> 31 days / 1 month
+ // 8928 minutes / 148.8 hr --> 1 yr
+
MetricsConfiguration configuration = new MetricsConfiguration();
- configuration.setRawTTL(180);
- configuration.setRawRetention(Seconds.seconds(180).toStandardDuration());
+ configuration.setRawTTL(Minutes.minutes(168).toStandardSeconds().getSeconds());
+ configuration.setRawRetention(Minutes.minutes(168).toStandardDuration());
configuration.setRawTimeSliceDuration(Minutes.ONE.toStandardDuration());
- configuration.setOneHourTTL(360);
- configuration.setOneHourRetention(Seconds.seconds(360));
+
configuration.setOneHourTTL(Minutes.minutes(336).toStandardSeconds().getSeconds());
+ configuration.setOneHourRetention(Minutes.minutes(336));
configuration.setOneHourTimeSliceDuration(Minutes.minutes(6).toStandardDuration());
- configuration.setSixHourTTL(540);
- configuration.setSixHourRetention(Seconds.seconds(540));
+
configuration.setSixHourTTL(Minutes.minutes(744).toStandardSeconds().getSeconds());
+ configuration.setSixHourRetention(Minutes.minutes(744).toStandardSeconds());
configuration.setSixHourTimeSliceDuration(Minutes.minutes(24).toStandardDuration());
- configuration.setTwentyFourHourTTL(720);
- configuration.setTwentyFourHourRetention(Seconds.seconds(720));
+
configuration.setTwentyFourHourTTL(Minutes.minutes(8928).toStandardSeconds().getSeconds());
+
configuration.setTwentyFourHourRetention(Minutes.minutes(8928).toStandardSeconds());
return configuration;
}
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/stats/Aggregate.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/stats/Aggregate.java
deleted file mode 100644
index 61a6b51..0000000
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/stats/Aggregate.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- *
- * * RHQ Management Platform
- * * Copyright (C) 2005-2012 Red Hat, Inc.
- * * All rights reserved.
- * *
- * * This program is free software; you can redistribute it and/or modify
- * * it under the terms of the GNU General Public License, version 2, as
- * * published by the Free Software Foundation, and/or the GNU Lesser
- * * General Public License, version 2.1, also as published by the Free
- * * Software Foundation.
- * *
- * * This program is distributed in the hope that it will be useful,
- * * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * * GNU General Public License and the GNU Lesser General Public License
- * * for more details.
- * *
- * * You should have received a copy of the GNU General Public License
- * * and the GNU Lesser General Public License along with this program;
- * * if not, write to the Free Software Foundation, Inc.,
- * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-package org.rhq.metrics.simulator.stats;
-
-/**
- * @author John Sanda
- */
-public class Aggregate {
-
- private String name;
- private double max;
- private double min;
- private double mean;
- private double standardDeviation;
-
-
- public Aggregate(String name, double max, double min, double mean, double
standardDeviation) {
- this.name = name;
- this.max = max;
- this.min = min;
- this.mean = mean;
- this.standardDeviation = standardDeviation;
- }
-
- public double getMax() {
- return max;
- }
-
- public double getMin() {
- return min;
- }
-
- public double getMean() {
- return mean;
- }
-
- public double getStandardDeviation() {
- return standardDeviation;
- }
-
- @Override
- public String toString() {
- return name + ": {min: " + getMin() + ", mean: " + getMean()
+ ", max: " + getMax() + ", standardDeviation: " +
- getStandardDeviation() + "}";
- }
-}
diff --git
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/stats/Stats.java
b/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/stats/Stats.java
deleted file mode 100644
index 604f1ba..0000000
---
a/modules/helpers/metrics-simulator/src/main/java/org/rhq/metrics/simulator/stats/Stats.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- *
- * * RHQ Management Platform
- * * Copyright (C) 2005-2012 Red Hat, Inc.
- * * All rights reserved.
- * *
- * * This program is free software; you can redistribute it and/or modify
- * * it under the terms of the GNU General Public License, version 2, as
- * * published by the Free Software Foundation, and/or the GNU Lesser
- * * General Public License, version 2.1, also as published by the Free
- * * Software Foundation.
- * *
- * * This program is distributed in the hope that it will be useful,
- * * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * * GNU General Public License and the GNU Lesser General Public License
- * * for more details.
- * *
- * * You should have received a copy of the GNU General Public License
- * * and the GNU Lesser General Public License along with this program;
- * * if not, write to the Free Software Foundation, Inc.,
- * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-package org.rhq.metrics.simulator.stats;
-
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
-
-/**
- * @author John Sanda
- */
-public class Stats {
-
- /**
- * The total number of raw inserts
- */
- private AtomicLong totalRawInserts = new AtomicLong(0);
-
- private AtomicInteger rawInsertsThisMinute = new AtomicInteger(0);
-
- private DescriptiveStatistics rawInsertsPerMinute = new DescriptiveStatistics(200);
-
- private DescriptiveStatistics rawInsertTimesPerMinute = new
DescriptiveStatistics(200);
-
- private ReentrantLock insertTimesLock = new ReentrantLock();
-
- public void addRawInserts(int count) {
- totalRawInserts.addAndGet(count);
- rawInsertsThisMinute.addAndGet(count);
- }
-
- public long getTotalRawInserts() {
- return totalRawInserts.get();
- }
-
- /**
- * Called by measurement collectors to report insertion times. This method uses an
- * internal lock to allow for concurrent access.
- *
- * @param time The time to insert a set of raw metrics
- */
- public void addRawInsertTime(long time) {
- try {
- insertTimesLock.lock();
- rawInsertTimesPerMinute.addValue(time);
- } finally {
- insertTimesLock.unlock();
- }
- }
-
- public Aggregate getRawInsertTimes() {
- try {
- insertTimesLock.lock();
- return new Aggregate("raw insertion times (milliseconds)",
rawInsertTimesPerMinute.getMax(),
- rawInsertTimesPerMinute.getMin(), rawInsertTimesPerMinute.getMean(),
- rawInsertTimesPerMinute.getStandardDeviation());
- } finally {
- insertTimesLock.unlock();
- }
- }
-
- /**
- * Called by {@link org.rhq.metrics.simulator.StatsCollector} to report the number of
raw inserts for a given
- * minute. Since there is only a single {@link
org.rhq.metrics.simulator.StatsCollector} this method does not
- * support concurrent access.
- *
- * @param value The number of raw metrics inserted in a given minute.
- */
- public void addRawInsertsPerMinute(long value) {
- rawInsertsPerMinute.addValue(value);
- }
-
- public Aggregate getRawInsertsPerMinute() {
- return new Aggregate("Raw inserts per minute",
rawInsertsPerMinute.getMax(), rawInsertsPerMinute.getMin(),
- rawInsertsPerMinute.getMean(), rawInsertsPerMinute.getStandardDeviation());
- }
-
-}
diff --git a/modules/helpers/metrics-simulator/src/main/resources/conf/log4j.properties
b/modules/helpers/metrics-simulator/src/main/resources/conf/log4j.properties
index ee270e8..58fa73c 100644
--- a/modules/helpers/metrics-simulator/src/main/resources/conf/log4j.properties
+++ b/modules/helpers/metrics-simulator/src/main/resources/conf/log4j.properties
@@ -35,5 +35,5 @@ log4j.appender.FILE.Append=false
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%5p %d{HH:mm:ss,SSS} %m%n
+log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} %-5p [%t] (%c{5}) - %m%n
log4j.logger.org.rhq=DEBUG
\ No newline at end of file
commit 56c6467abcfe9af7e61568209a55267a48a4a5be
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Mon Sep 30 17:19:40 2013 +0200
api checks: adding the change as a intentional change not to break JON compatibility.
diff --git a/modules/enterprise/server/jar/intentional-api-changes-since-4.9.0.xml
b/modules/enterprise/server/jar/intentional-api-changes-since-4.9.0.xml
index 488adc3..6ab00ba 100644
--- a/modules/enterprise/server/jar/intentional-api-changes-since-4.9.0.xml
+++ b/modules/enterprise/server/jar/intentional-api-changes-since-4.9.0.xml
@@ -56,4 +56,12 @@
<justification>Adding a method to a remote API interface is safe. This is
method is added in order to deprecate the getAggregate. For more details see the previous
intentional change.</justification>
</difference>
+ <difference>
+
<className>org/rhq/enterprise/server/operation/OperationManagerRemote</className>
+ <differenceType>7006</differenceType> <!-- method return type changed
-->
+ <method>org.rhq.core.domain.util.PageList
findOperationDefinitionsByCriteria(org.rhq.core.domain.auth.Subject,
org.rhq.core.domain.criteria.OperationDefinitionCriteria)</method>
+ <to>java.util.List</to>
+ <justification> While this is technically a welcome change (because impl of
that method returned the PageList anyway), it breaks the strongly typed clients, because
the methods are linked by their full signature and hence a library compiled against
JON312GA version of that remote will fail to find the method with the new signature and
will fail with NoSuchMethodError at runtime.</justification>
+ </difference>
+
</differences>
commit 9b38a7ecf4853047cfc3635bff6ec270954e3541
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 17:43:01 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
Commit 0ba8c5f (among other things) removed several public constants in
MeasurementScheduleCriteria because they were improperly named and didn't
do what they seemed to.
Users might be using those constants even if they don't do what they're
supposed to. The constants have therefore been re-introduced with a
deprecation notice.
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java
index 33d2623..1980d01 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java
@@ -42,10 +42,37 @@ public class MeasurementScheduleCriteria extends Criteria {
private static final long serialVersionUID = 3L;
// sort fields from the MeasurementSchedule's MeasurementDefinition
+
+ /**
+ * Note that sorting by definition id alone might not produce repeatable results.
This depends on the filters
+ * and other sort field applied.
+ */
+ public static final String SORT_FIELD_DEFINITION_ID = "definitionId";
public static final String SORT_FIELD_NAME = "name";
public static final String SORT_FIELD_DISPLAY_NAME = "displayName";
public static final String SORT_FIELD_DATA_TYPE = "dataType";
+ /**
+ * @deprecated Sorting by this field has never been supported. This constant has been
introduced in error and will
+ * be removed in the next major release.
+ */
+ @Deprecated
+ public static final String SORT_FIELD_ENABLED = "enabled";
+
+ /**
+ * @deprecated Sorting by this field has never been supported. This constant has been
introduced in error and will
+ * be removed in the next major release.
+ */
+ @Deprecated
+ public static final String SORT_FIELD_INTERVAL = "interval";
+
+ /**
+ * @deprecated Sorting by this field has never been supported. This constant has been
introduced in error and will
+ * be removed in the next major release.
+ */
+ @Deprecated
+ public static final String SORT_FIELD_DESCRIPTION = "description";
+
// filter fields
public static final String FILTER_FIELD_DEFINITION_IDS = "definitionIds";
public static final String FILTER_FIELD_RESOURCE_ID = "resourceId";
@@ -93,6 +120,7 @@ public class MeasurementScheduleCriteria extends Criteria {
+ " WHERE parent.id = ? )");
filterOverrides.put(FILTER_FIELD_RESOURCE_TYPE_ID, "resource.type.id =
?");
+ sortOverrides.put(SORT_FIELD_DEFINITION_ID, "definition.id");
sortOverrides.put(SORT_FIELD_NAME, "definition.name");
sortOverrides.put(SORT_FIELD_DISPLAY_NAME, "definition.displayName");
sortOverrides.put(SORT_FIELD_DATA_TYPE, "definition.dataType");
@@ -167,4 +195,4 @@ public class MeasurementScheduleCriteria extends Criteria {
this.sortDataType = sortDataType;
}
-}
\ No newline at end of file
+}
commit 8de9364b5f83e26bdda3eb16543c0ba13768393d
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 16:20:45 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
Commit 26959a31d8c37bcb86dc6a845b5707a277bff3cb made the constructor of
the DatabaseQueryUtility private, which it should be, and removed an
unused class.
While the chances of anyone either instantiating the utility class or using
the absolutely useless DatabaseQueryUtility.StatementParameter are very
slim, we need to keep API back-compat.
The public constructor and the class have been reintroduced with
a deprecation notice.
diff --git
a/modules/plugins/database/src/main/java/org/rhq/plugins/database/DatabaseQueryUtility.java
b/modules/plugins/database/src/main/java/org/rhq/plugins/database/DatabaseQueryUtility.java
index 95e981d..d6d83f2 100644
---
a/modules/plugins/database/src/main/java/org/rhq/plugins/database/DatabaseQueryUtility.java
+++
b/modules/plugins/database/src/main/java/org/rhq/plugins/database/DatabaseQueryUtility.java
@@ -44,7 +44,11 @@ public class DatabaseQueryUtility {
private static final Log LOG = LogFactory.getLog(DatabaseQueryUtility.class);
- private DatabaseQueryUtility() {}
+ /**
+ * @deprecated instantiating a static utility class doesn't make sense. Don't
do it.
+ */
+ @Deprecated
+ public DatabaseQueryUtility() {}
/**
* Executes a database update.
@@ -274,4 +278,14 @@ public class DatabaseQueryUtility {
}
}
}
+
+ /**
+ * @deprecated This class is not used for anything in the codebase of the database
plugin. If you are using it
+ * in some way or another, move it to your own code, because this class will be
removed in future.
+ */
+ @Deprecated
+ public static class StatementParameter {
+ private String name;
+ private String value;
+ }
}
commit f78beeb0deff4fc4801f2236881e45d659bd578f
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 15:06:43 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
The fix for bug 840512 changed the way we handle the value of an obfuscated
property, which rendered the obfuscate() method unused. It has been removed
which unfortunately is an API breaking change due to its protected
visibility.
While the chances of anyone using that method are miniscule we cannot break
the API. The method was re-introduced but made a NOOP so that it doesn't
break the obfuscation. The deprecation notice on the method suggests to
stop using it.
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ObfuscatedPropertySimple.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ObfuscatedPropertySimple.java
index bb00ef5..ac0598f 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ObfuscatedPropertySimple.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ObfuscatedPropertySimple.java
@@ -216,7 +216,18 @@ public class ObfuscatedPropertySimple extends PropertySimple {
throw new IllegalArgumentException("Failed to obfuscate property value:
[" + value + "]", e);
}
}
-
+
+ /**
+ * @deprecated do not use this method. It has been superseded by the {@link
#deobfuscate(String)} and
+ * {@link #obfuscate(String)} pair. The way the obfuscated value is handled has
changed and is fully contained
+ * within this class. You should not worry about it, nor have a need to call any of
the obfuscate() methods.
+ * This method is currently no-op and will be removed in future.
+ */
+ @Deprecated
+ protected void obfuscate() {
+
+ }
+
/**
* Overriden to not leak the unobfuscated value in the toString() method, output of
which
* might end up in logs, etc.
commit aeae80458d5175f2e5c3cc164943c561da2cc0f3
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 15:02:58 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
The fix for bug 1000006 declared the constructor of
o.r.c.d.configuration.ConfigurationUtility private. It previously had the
default pulic constructor and hence this was a API breaking change.
While the utility class should have had the private constructor in first
place, we cannot break the API, so the public constructor has been
re-introduced with a deprecation notice.
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ConfigurationUtility.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ConfigurationUtility.java
index f4d575a..fa49454 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ConfigurationUtility.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ConfigurationUtility.java
@@ -36,8 +36,12 @@ import
org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
*/
public class ConfigurationUtility {
- private ConfigurationUtility() {
- // Utility class
+ /**
+ * @deprecated do not create instances of this class. It is meant as a static utility
class.
+ */
+ @Deprecated
+ public ConfigurationUtility() {
+
}
/**
commit 53f3329850efcb7fd0e18fca2964c8c4dbb6a3b1
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 14:46:57 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
Commit 85f75e0 removed 2 enum fields from the server details, because they
are no longer used due to our move from DB to Cassandra for metric storage.
Nevertheless the clients might be using those fields to get back that
information. To retain the backwards compatibility, we need to keep those
enum fields, making the server details work without recompilation.
The server details will no longer contain any information for the for those
fields. The fact that some information might be missing is part of the
contract of the ServerDetails class though, so the users should be able to
handle that situation.
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/common/ServerDetails.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/common/ServerDetails.java
index 5cfcc96..b9637bf 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/common/ServerDetails.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/common/ServerDetails.java
@@ -47,6 +47,21 @@ public class ServerDetails implements Serializable {
SERVER_LOCAL_TIME, //
SERVER_INSTALL_DIR, // where RHQ is installed, the top directory where everything
else is
SERVER_HOME_DIR, // where the RHQ server's JBossAS deployment is; this is
under the install dir
+
+ /**
+ * @deprecated this is no longer used or exposed by the server. The measurements
are not stored in the database
+ * anymore.
+ */
+ @Deprecated
+ CURRENT_MEASUREMENT_TABLE, //
+
+ /**
+ * @deprecated this is no longer used or exposed by the server. The measurements
are not stored in the database
+ * anymore.
+ */
+ @Deprecated
+ NEXT_MEASUREMENT_TABLE_ROTATION, //
+
SERVER_IDENTITY;
};
commit be6f70ce0ae66b544965636f503bbe6e4732958b
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 14:40:42 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
Commit a4b78eb6e1adeffaa519115a9ef07b3f00025168 fixed the handling of the
server status, but changed the signature of
o.r.c.d.cloud.Server#clearStatus() method in an incompatible way. Adding
the old method back with a deprecation notice.
The chances of anyone using this method are miniscule but we need to retain
back-compat.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/Server.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/Server.java
index 671db6b..6e04ab6 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/Server.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/Server.java
@@ -306,6 +306,15 @@ public class Server implements Serializable {
}
/**
+ * @deprecated do not use this method as it may corrupt the tracking of the server
status. Use the new
+ * {@link #clearStatus(org.rhq.core.domain.cloud.Server.Status)} instead.
+ */
+ @Deprecated
+ public void clearStatus() {
+ this.status = 0;
+ }
+
+ /**
* If some subsystem makes a change to some data that this server cares about (as
summarized
* by the various {@link Status} elements), then that change should be added via this
method.
* Periodically, a background job will come along, check the status, and possibly
perform
commit 9a5a5a7a1b9153968474a459f097e73d5421e038
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 14:37:22 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
Bug 888927 changed the signature of the
AlertConditionAvailabilityCategoryComposite class to add a missing
parameter.
While the chances of anyone using this method miniscule, we need to retain
the back-compat. Therefore I added the wrong constructor back with
a deprecation notice.
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/composite/AlertConditionAvailabilityCategoryComposite.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/composite/AlertConditionAvailabilityCategoryComposite.java
index 870dbd2..cd1a948 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/composite/AlertConditionAvailabilityCategoryComposite.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/composite/AlertConditionAvailabilityCategoryComposite.java
@@ -49,6 +49,17 @@ public class AlertConditionAvailabilityCategoryComposite extends
AbstractAlertCo
this.availabilityType = (null != availabilityType) ? availabilityType :
AvailabilityType.UNKNOWN;
}
+ /**
+ * @deprecated This constructor will NOT produce a valid instance of this class,
because it cannot specify
+ * the required alert definition id. Use {@link
#AlertConditionAvailabilityCategoryComposite(
+ * org.rhq.core.domain.alert.AlertCondition, Integer, Integer,
org.rhq.core.domain.measurement.AvailabilityType)}
+ * instead.
+ */
+ @Deprecated
+ public AlertConditionAvailabilityCategoryComposite(AlertCondition condition, Integer
resourceId, AvailabilityType availabilityType) {
+ this(condition, null, resourceId, availabilityType);
+ }
+
public Integer getAlertDefinitionId() {
return alertDefinitionId;
}
commit 92aaf569774b9328812f447cc940719287540883
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Mon Sep 23 15:37:06 2013 +0200
Adding intentional api changes for the new methods ported over from RHQ 4.4.0.
diff --git a/modules/enterprise/binding/intentional-api-changes-since-4.9.0.xml
b/modules/enterprise/binding/intentional-api-changes-since-4.9.0.xml
new file mode 100644
index 0000000..e9a97bc
--- /dev/null
+++ b/modules/enterprise/binding/intentional-api-changes-since-4.9.0.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+<!--
+ ~ RHQ Management Platform
+ ~ Copyright (C) 2005-2013 Red Hat, Inc.
+ ~ All rights reserved.
+ ~
+ ~ This program is free software; you can redistribute it and/or modify
+ ~ it under the terms of the GNU General Public License as published by
+ ~ the Free Software Foundation version 2 of the License.
+ ~
+ ~ This program is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ ~ GNU General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU General Public License
+ ~ along with this program; if not, write to the Free Software Foundation, Inc.,
+ ~ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ -->
+
+<differences>
+
+ <difference>
+ <className>org/rhq/bindings/client/RhqFacade</className>
+ <differenceType>7012</differenceType> <!-- method added to an
interface -->
+ <method>*ManagerRemote get*Manager()</method>
+ <justification>
+ Adding back methods removed in RHQ 4.5.0 to regain compatibility with RHQ 4.4.0
interface.
+ This is safe, because this interface is not to be implemented by 3rd parties.
+ </justification>
+ </difference>
+
+ <difference>
+ <className>org/rhq/bindings/client/RhqFacade</className>
+ <differenceType>7012</differenceType> <!-- method added to an
interface -->
+ <method>org.rhq.enterprise.server.discovery.DiscoveryBossRemote
getDiscoveryBoss()</method>
+ <justification>
+ Adding back methods removed in RHQ 4.5.0 to regain compatibility with RHQ 4.4.0
interface.
+ This is safe, because this interface is not to be implemented by 3rd parties.
+ </justification>
+ </difference>
+
+ <difference>
+ <className>org/rhq/bindings/client/RhqFacade</className>
+ <differenceType>7012</differenceType> <!-- method added to an
interface -->
+ <method>java.util.Map getManagers()</method>
+ <justification>
+ Adding back methods removed in RHQ 4.5.0 to regain compatibility with RHQ 4.4.0
interface.
+ This is safe, because this interface is not to be implemented by 3rd parties.
+ </justification>
+ </difference>
+</differences>
+
commit 2a152b1f670099c7f3341abe8ca35bac11ff29bd
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 20 21:09:02 2013 +0200
(Almost) regain back-compat with RHQ 4.4.0 in script bindings.
diff --git
a/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/AbstractRhqFacade.java
b/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/AbstractRhqFacade.java
new file mode 100644
index 0000000..8ee82e2
--- /dev/null
+++
b/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/AbstractRhqFacade.java
@@ -0,0 +1,200 @@
+package org.rhq.bindings.client;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.rhq.enterprise.server.alert.AlertDefinitionManagerRemote;
+import org.rhq.enterprise.server.alert.AlertManagerRemote;
+import org.rhq.enterprise.server.auth.SubjectManagerRemote;
+import org.rhq.enterprise.server.authz.RoleManagerRemote;
+import org.rhq.enterprise.server.bundle.BundleManagerRemote;
+import org.rhq.enterprise.server.configuration.ConfigurationManagerRemote;
+import org.rhq.enterprise.server.content.ContentManagerRemote;
+import org.rhq.enterprise.server.content.RepoManagerRemote;
+import org.rhq.enterprise.server.discovery.DiscoveryBossRemote;
+import org.rhq.enterprise.server.drift.DriftManagerRemote;
+import org.rhq.enterprise.server.event.EventManagerRemote;
+import org.rhq.enterprise.server.install.remote.RemoteInstallManagerRemote;
+import org.rhq.enterprise.server.measurement.AvailabilityManagerRemote;
+import org.rhq.enterprise.server.measurement.CallTimeDataManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementBaselineManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementDataManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerRemote;
+import org.rhq.enterprise.server.operation.OperationManagerRemote;
+import org.rhq.enterprise.server.report.DataAccessManagerRemote;
+import org.rhq.enterprise.server.resource.ResourceFactoryManagerRemote;
+import org.rhq.enterprise.server.resource.ResourceManagerRemote;
+import org.rhq.enterprise.server.resource.ResourceTypeManagerRemote;
+import org.rhq.enterprise.server.resource.group.ResourceGroupManagerRemote;
+import org.rhq.enterprise.server.search.SavedSearchManagerRemote;
+import org.rhq.enterprise.server.support.SupportManagerRemote;
+import org.rhq.enterprise.server.sync.SynchronizationManagerRemote;
+import org.rhq.enterprise.server.system.SystemManagerRemote;
+import org.rhq.enterprise.server.tagging.TagManagerRemote;
+
+/**
+ * This is a support base class for the implementations of the RhqFacade interface that
+ * implements the deprecated methods by the means of the new version of the {@link
RhqFacade} methods.
+ *
+ * @author Lukas Krejci
+ * @since 4.10
+ */
+public abstract class AbstractRhqFacade implements RhqFacade {
+
+ @Override
+ public AlertDefinitionManagerRemote getAlertDefinitionManager() {
+ return getProxy(AlertDefinitionManagerRemote.class);
+ }
+
+ @Override
+ public AlertManagerRemote getAlertManager() {
+ return getProxy(AlertManagerRemote.class);
+ }
+
+ @Override
+ public AvailabilityManagerRemote getAvailabilityManager() {
+ return getProxy(AvailabilityManagerRemote.class);
+ }
+
+ @Override
+ public BundleManagerRemote getBundleManager() {
+ return getProxy(BundleManagerRemote.class);
+ }
+
+ @Override
+ public CallTimeDataManagerRemote getCallTimeDataManager() {
+ return getProxy(CallTimeDataManagerRemote.class);
+ }
+
+ @Override
+ public ConfigurationManagerRemote getConfigurationManager() {
+ return getProxy(ConfigurationManagerRemote.class);
+ }
+
+ @Override
+ public ContentManagerRemote getContentManager() {
+ return getProxy(ContentManagerRemote.class);
+ }
+
+ @Override
+ public DataAccessManagerRemote getDataAccessManager() {
+ return getProxy(DataAccessManagerRemote.class);
+ }
+
+ @Override
+ public DiscoveryBossRemote getDiscoveryBoss() {
+ return getProxy(DiscoveryBossRemote.class);
+ }
+
+ @Override
+ public DriftManagerRemote getDriftManager() {
+ return getProxy(DriftManagerRemote.class);
+ }
+
+ @Override
+ public EventManagerRemote getEventManager() {
+ return getProxy(EventManagerRemote.class);
+ }
+
+ @Override
+ public Map<RhqManagers, Object> getManagers() {
+ HashMap<RhqManagers, Object> ret = new HashMap<RhqManagers,
Object>();
+
+ for(RhqManagers m : RhqManagers.values()) {
+ ret.put(m, getProxy(m.remote()));
+ }
+
+ return ret;
+ }
+
+ @Override
+ public MeasurementBaselineManagerRemote getMeasurementBaselineManager() {
+ return getProxy(MeasurementBaselineManagerRemote.class);
+ }
+
+ @Override
+ public MeasurementDataManagerRemote getMeasurementDataManager() {
+ return getProxy(MeasurementDataManagerRemote.class);
+ }
+
+ @Override
+ public MeasurementDefinitionManagerRemote getMeasurementDefinitionManager() {
+ return getProxy(MeasurementDefinitionManagerRemote.class);
+ }
+
+ @Override
+ public MeasurementScheduleManagerRemote getMeasurementScheduleManager() {
+ return getProxy(MeasurementScheduleManagerRemote.class);
+ }
+
+ @Override
+ public OperationManagerRemote getOperationManager() {
+ return getProxy(OperationManagerRemote.class);
+ }
+
+ @Override
+ public RemoteInstallManagerRemote getRemoteInstallManager() {
+ return getProxy(RemoteInstallManagerRemote.class);
+ }
+
+ @Override
+ public RepoManagerRemote getRepoManager() {
+ return getProxy(RepoManagerRemote.class);
+ }
+
+ @Override
+ public ResourceFactoryManagerRemote getResourceFactoryManager() {
+ return getProxy(ResourceFactoryManagerRemote.class);
+ }
+
+ @Override
+ public ResourceGroupManagerRemote getResourceGroupManager() {
+ return getProxy(ResourceGroupManagerRemote.class);
+ }
+
+ @Override
+ public ResourceManagerRemote getResourceManager() {
+ return getProxy(ResourceManagerRemote.class);
+ }
+
+ @Override
+ public ResourceTypeManagerRemote getResourceTypeManager() {
+ return getProxy(ResourceTypeManagerRemote.class);
+ }
+
+ @Override
+ public RoleManagerRemote getRoleManager() {
+ return getProxy(RoleManagerRemote.class);
+ }
+
+ @Override
+ public SavedSearchManagerRemote getSavedSearchManager() {
+ return getProxy(SavedSearchManagerRemote.class);
+ }
+
+ @Override
+ public SubjectManagerRemote getSubjectManager() {
+ return getProxy(SubjectManagerRemote.class);
+ }
+
+ @Override
+ public SupportManagerRemote getSupportManager() {
+ return getProxy(SupportManagerRemote.class);
+ }
+
+ @Override
+ public SynchronizationManagerRemote getSynchronizationManager() {
+ return getProxy(SynchronizationManagerRemote.class);
+ }
+
+ @Override
+ public SystemManagerRemote getSystemManager() {
+ return getProxy(SystemManagerRemote.class);
+ }
+
+ @Override
+ public TagManagerRemote getTagManager() {
+ return getProxy(TagManagerRemote.class);
+ }
+}
diff --git
a/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/RhqFacade.java
b/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/RhqFacade.java
index 2f80f0c..e6ec7a9 100644
--- a/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/RhqFacade.java
+++ b/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/RhqFacade.java
@@ -22,6 +22,35 @@ package org.rhq.bindings.client;
import java.util.Map;
import org.rhq.core.domain.auth.Subject;
+import org.rhq.enterprise.server.alert.AlertDefinitionManagerRemote;
+import org.rhq.enterprise.server.alert.AlertManagerRemote;
+import org.rhq.enterprise.server.auth.SubjectManagerRemote;
+import org.rhq.enterprise.server.authz.RoleManagerRemote;
+import org.rhq.enterprise.server.bundle.BundleManagerRemote;
+import org.rhq.enterprise.server.configuration.ConfigurationManagerRemote;
+import org.rhq.enterprise.server.content.ContentManagerRemote;
+import org.rhq.enterprise.server.content.RepoManagerRemote;
+import org.rhq.enterprise.server.discovery.DiscoveryBossRemote;
+import org.rhq.enterprise.server.drift.DriftManagerRemote;
+import org.rhq.enterprise.server.event.EventManagerRemote;
+import org.rhq.enterprise.server.install.remote.RemoteInstallManagerRemote;
+import org.rhq.enterprise.server.measurement.AvailabilityManagerRemote;
+import org.rhq.enterprise.server.measurement.CallTimeDataManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementBaselineManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementDataManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerRemote;
+import org.rhq.enterprise.server.operation.OperationManagerRemote;
+import org.rhq.enterprise.server.report.DataAccessManagerRemote;
+import org.rhq.enterprise.server.resource.ResourceFactoryManagerRemote;
+import org.rhq.enterprise.server.resource.ResourceManagerRemote;
+import org.rhq.enterprise.server.resource.ResourceTypeManagerRemote;
+import org.rhq.enterprise.server.resource.group.ResourceGroupManagerRemote;
+import org.rhq.enterprise.server.search.SavedSearchManagerRemote;
+import org.rhq.enterprise.server.support.SupportManagerRemote;
+import org.rhq.enterprise.server.sync.SynchronizationManagerRemote;
+import org.rhq.enterprise.server.system.SystemManagerRemote;
+import org.rhq.enterprise.server.tagging.TagManagerRemote;
/**
* This is an interface through which the script can communicate with RHQ server.
@@ -59,4 +88,192 @@ public interface RhqFacade {
* @return the proxy of the remote API interface backed by this facade
*/
<T> T getProxy(Class<T> remoteApiIface);
+
+ ///////////////////// deprecated methods added to re-introduce compatibility with RHQ
4.4.0
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ AlertDefinitionManagerRemote getAlertDefinitionManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ AlertManagerRemote getAlertManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ AvailabilityManagerRemote getAvailabilityManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ BundleManagerRemote getBundleManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ CallTimeDataManagerRemote getCallTimeDataManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ ConfigurationManagerRemote getConfigurationManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ ContentManagerRemote getContentManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ DataAccessManagerRemote getDataAccessManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ DiscoveryBossRemote getDiscoveryBoss();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ DriftManagerRemote getDriftManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ EventManagerRemote getEventManager();
+
+ /**
+ * Kept for backwards compatibility but otherwise unused.
+ * In RHQ prior to 4.5.0, the values in the map, i.e. the manager objects themselves
both implemented the various
+ * {@code *Remote} interfaces and contained methods with the modified signatures with
the {@link Subject} parameter
+ * removed.
+ * <p />
+ * Since RHQ 4.5.0 the returned objects no longer contain the modified method. If you
want to obtain objects with
+ * such methods (intended for use in scripted environments), use {@link
#getScriptingAPI()} method instead.
+ */
+ @Deprecated
+ Map<RhqManagers, Object> getManagers();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ MeasurementBaselineManagerRemote getMeasurementBaselineManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ MeasurementDataManagerRemote getMeasurementDataManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ MeasurementDefinitionManagerRemote getMeasurementDefinitionManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ MeasurementScheduleManagerRemote getMeasurementScheduleManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ OperationManagerRemote getOperationManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ RemoteInstallManagerRemote getRemoteInstallManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ RepoManagerRemote getRepoManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ ResourceFactoryManagerRemote getResourceFactoryManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ ResourceGroupManagerRemote getResourceGroupManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ ResourceManagerRemote getResourceManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ ResourceTypeManagerRemote getResourceTypeManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ RoleManagerRemote getRoleManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ SavedSearchManagerRemote getSavedSearchManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ SubjectManagerRemote getSubjectManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ SupportManagerRemote getSupportManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ SynchronizationManagerRemote getSynchronizationManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ SystemManagerRemote getSystemManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ TagManagerRemote getTagManager();
}
diff --git
a/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/RhqManagers.java
b/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/RhqManagers.java
new file mode 100644
index 0000000..77612d1
--- /dev/null
+++ b/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/RhqManagers.java
@@ -0,0 +1,139 @@
+package org.rhq.bindings.client;
+
+import org.rhq.enterprise.server.alert.AlertDefinitionManagerRemote;
+import org.rhq.enterprise.server.alert.AlertManagerRemote;
+import org.rhq.enterprise.server.auth.SubjectManagerRemote;
+import org.rhq.enterprise.server.authz.RoleManagerRemote;
+import org.rhq.enterprise.server.bundle.BundleManagerRemote;
+import org.rhq.enterprise.server.cloud.StorageNodeManagerRemote;
+import org.rhq.enterprise.server.configuration.ConfigurationManagerRemote;
+import org.rhq.enterprise.server.content.ContentManagerRemote;
+import org.rhq.enterprise.server.content.RepoManagerRemote;
+import org.rhq.enterprise.server.discovery.DiscoveryBossRemote;
+import org.rhq.enterprise.server.drift.DriftManagerRemote;
+import org.rhq.enterprise.server.drift.DriftTemplateManagerRemote;
+import org.rhq.enterprise.server.event.EventManagerRemote;
+import org.rhq.enterprise.server.install.remote.RemoteInstallManagerRemote;
+import org.rhq.enterprise.server.measurement.AvailabilityManagerRemote;
+import org.rhq.enterprise.server.measurement.CallTimeDataManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementBaselineManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementDataManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerRemote;
+import org.rhq.enterprise.server.operation.OperationManagerRemote;
+import org.rhq.enterprise.server.report.DataAccessManagerRemote;
+import org.rhq.enterprise.server.resource.ResourceFactoryManagerRemote;
+import org.rhq.enterprise.server.resource.ResourceManagerRemote;
+import org.rhq.enterprise.server.resource.ResourceTypeManagerRemote;
+import org.rhq.enterprise.server.resource.group.ResourceGroupManagerRemote;
+import org.rhq.enterprise.server.resource.group.definition.GroupDefinitionManagerRemote;
+import org.rhq.enterprise.server.search.SavedSearchManagerRemote;
+import org.rhq.enterprise.server.support.SupportManagerRemote;
+import org.rhq.enterprise.server.sync.SynchronizationManagerRemote;
+import org.rhq.enterprise.server.system.SystemManagerRemote;
+import org.rhq.enterprise.server.tagging.TagManagerRemote;
+
+/**
+ * @author Lukas Krejci
+ *
+ * @deprecated since 4.10 do not use this. Use {@link RhqManager} instead.
+ */
+@Deprecated
+public enum RhqManagers {
+ AlertManager(AlertManagerRemote.class, "${AlertManager}"), //
+ AlertDefinitionManager(AlertDefinitionManagerRemote.class,
"${AlertDefinitionManager}"), //
+ AvailabilityManager(AvailabilityManagerRemote.class,
"${AvailabilityManager}"), //
+ BundleManager(BundleManagerRemote.class, "${BundleManager}"), //
+ CallTimeDataManager(CallTimeDataManagerRemote.class,
"${CallTimeDataManager}"), //
+ RepoManager(RepoManagerRemote.class, "${RepoManager}"), //
+ ConfigurationManager(ConfigurationManagerRemote.class,
"${ConfigurationManager}"), //
+ ContentManager(ContentManagerRemote.class, "${ContentManager}"), //
+ DataAccessManager(DataAccessManagerRemote.class, "${DataAccessManager}"),
//
+ DriftManager(DriftManagerRemote.class, "${DriftManager}"), //
+ DriftTemplateManager(DriftTemplateManagerRemote.class,
"${DriftTemplateManager}"), //
+ DiscoveryBoss(DiscoveryBossRemote.class, "${DiscoveryBoss}"), //
+ EventManager(EventManagerRemote.class, "${EventManager}"), //
+ GroupDefinitionManager(GroupDefinitionManagerRemote.class,
"${GroupDefinitionManager}"), //
+ MeasurementBaselineManager(MeasurementBaselineManagerRemote.class,
"${MeasurementBaselineManager}"), //
+ MeasurementDataManager(MeasurementDataManagerRemote.class,
"${MeasurementDataManager}"), //
+ MeasurementDefinitionManager(MeasurementDefinitionManagerRemote.class,
"${MeasurementDefinitionManager}"), //
+ MeasurementScheduleManager(MeasurementScheduleManagerRemote.class,
"${MeasurementScheduleManager}"), //
+ OperationManager(OperationManagerRemote.class, "${OperationManager}"), //
+ ResourceManager(ResourceManagerRemote.class, "${ResourceManager}"), //
+ ResourceFactoryManager(ResourceFactoryManagerRemote.class,
"${ResourceFactoryManager}"), //
+ ResourceGroupManager(ResourceGroupManagerRemote.class,
"${ResourceGroupManager}"), //
+ ResourceTypeManager(ResourceTypeManagerRemote.class,
"${ResourceTypeManager}"), //
+ RoleManager(RoleManagerRemote.class, "${RoleManager}"), //
+ SavedSearchManager(SavedSearchManagerRemote.class,
"${SavedSearchManager}"), //
+ StorageNodeManager(StorageNodeManagerRemote.class,
"${StorageNodeManager}"), //
+ SubjectManager(SubjectManagerRemote.class, "${SubjectManager}"), //
+ SupportManager(SupportManagerRemote.class, "${SupportManager}"), //
+ SystemManager(SystemManagerRemote.class, "${SystemManager}"), //
+ RemoteInstallManager(RemoteInstallManagerRemote.class,
"${RemoteInstallManager}"), //
+ TagManager(TagManagerRemote.class, "${TagManager}"), //
+ SynchronizationManager(SynchronizationManagerRemote.class,
"${SynchronizationManager}");
+
+ private Class<?> remote;
+ private String localInterfaceClassName;
+ private String beanName;
+ private boolean enabled;
+
+
+ private RhqManagers(Class<?> remote, String enable) {
+ this.remote = remote;
+ this.beanName = this.name() + "Bean";
+ localInterfaceClassName = getLocalInterfaceClassName(remote);
+
+ //defaults and evaluates to TRUE unless the string contains "false".
Done to defend against
+ //possible errors in string replacement during rhq build.
+ this.enabled = true;
+ if ((enable != null) && (enable.trim().length() > 0)) {
+ this.enabled = (enable.trim().equalsIgnoreCase("false")) ?
Boolean.FALSE : Boolean.TRUE;
+ }
+ }
+
+ public static RhqManagers forInterface(Class<?> iface) {
+ for (RhqManagers m : values()) {
+ if (m.remote().equals(iface)) {
+ return m;
+ }
+ }
+
+ return null;
+ }
+
+ public Class<?> remote() {
+ return this.remote;
+ }
+
+ /**
+ * @deprecated since 4.6.0, use the {@link #remote()} method instead
+ * @return the class name of the remote interface
+ */
+ @Deprecated
+ public String remoteName() {
+ return this.remote.getName();
+ }
+
+ public String localInterfaceClassName() {
+ return localInterfaceClassName;
+ }
+
+ public String beanName() {
+ return this.beanName;
+ }
+
+ public boolean enabled() {
+ return this.enabled;
+ }
+
+ private static String getLocalInterfaceClassName(Class<?> remoteIface) {
+ String ifaceName = remoteIface.getName();
+ if (!ifaceName.endsWith("Remote")) {
+ throw new AssertionError("Inconsistent SLSB naming in RHQ! Remote
interface '" + remoteIface.getName()
+ + "' does not follow the established naming convention. This is
a bug, please report it.");
+ }
+
+ return (ifaceName.substring(0, ifaceName.lastIndexOf("Remote")) +
"Local");
+ }
+}
diff --git a/modules/enterprise/binding/src/test/java/org/rhq/bindings/FakeRhqFacade.java
b/modules/enterprise/binding/src/test/java/org/rhq/bindings/FakeRhqFacade.java
index 39cb145..c420c1b 100644
--- a/modules/enterprise/binding/src/test/java/org/rhq/bindings/FakeRhqFacade.java
+++ b/modules/enterprise/binding/src/test/java/org/rhq/bindings/FakeRhqFacade.java
@@ -22,11 +22,12 @@ package org.rhq.bindings;
import java.util.Collections;
import java.util.Map;
+import org.rhq.bindings.client.AbstractRhqFacade;
import org.rhq.bindings.client.RhqFacade;
import org.rhq.bindings.client.RhqManager;
import org.rhq.core.domain.auth.Subject;
-public class FakeRhqFacade implements RhqFacade {
+public class FakeRhqFacade extends AbstractRhqFacade {
public Subject getSubject() {
return null;
diff --git
a/modules/enterprise/binding/src/test/java/org/rhq/bindings/client/AbstractRhqFacadeProxyTest.java
b/modules/enterprise/binding/src/test/java/org/rhq/bindings/client/AbstractRhqFacadeProxyTest.java
index d1042df..65f6178 100644
---
a/modules/enterprise/binding/src/test/java/org/rhq/bindings/client/AbstractRhqFacadeProxyTest.java
+++
b/modules/enterprise/binding/src/test/java/org/rhq/bindings/client/AbstractRhqFacadeProxyTest.java
@@ -44,7 +44,7 @@ public class AbstractRhqFacadeProxyTest {
void method();
}
- public static class TestFacade implements RhqFacade {
+ public static class TestFacade extends AbstractRhqFacade {
private Subject subject;
diff --git
a/modules/enterprise/remoting/client-api/src/main/java/org/rhq/enterprise/clientapi/RemoteClient.java
b/modules/enterprise/remoting/client-api/src/main/java/org/rhq/enterprise/clientapi/RemoteClient.java
index 95c00ae..b0f25b7 100644
---
a/modules/enterprise/remoting/client-api/src/main/java/org/rhq/enterprise/clientapi/RemoteClient.java
+++
b/modules/enterprise/remoting/client-api/src/main/java/org/rhq/enterprise/clientapi/RemoteClient.java
@@ -35,6 +35,7 @@ import org.jboss.remoting.invocation.NameBasedInvocation;
import org.jboss.remoting.security.SSLSocketBuilder;
import org.jboss.remoting.transport.http.ssl.HTTPSClientInvoker;
+import org.rhq.bindings.client.AbstractRhqFacade;
import org.rhq.bindings.client.RhqFacade;
import org.rhq.bindings.client.RhqManager;
import org.rhq.bindings.util.InterfaceSimplifier;
@@ -52,7 +53,7 @@ import org.rhq.enterprise.server.system.SystemManagerRemote;
* @author Jay Shaughnessy
* @author John Mazzitelli
*/
-public class RemoteClient implements RhqFacade {
+public class RemoteClient extends AbstractRhqFacade {
private static final Log LOG = LogFactory.getLog(RemoteClient.class);
@@ -512,4 +513,4 @@ public class RemoteClient implements RhqFacade {
}
}
}
-}
\ No newline at end of file
+}
diff --git
a/modules/enterprise/server/client-api/src/main/java/org/rhq/enterprise/client/LocalClient.java
b/modules/enterprise/server/client-api/src/main/java/org/rhq/enterprise/client/LocalClient.java
index df0eab4..51b3b2e 100644
---
a/modules/enterprise/server/client-api/src/main/java/org/rhq/enterprise/client/LocalClient.java
+++
b/modules/enterprise/server/client-api/src/main/java/org/rhq/enterprise/client/LocalClient.java
@@ -28,6 +28,7 @@ import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.rhq.bindings.client.AbstractRhqFacade;
import org.rhq.bindings.client.RhqFacade;
import org.rhq.bindings.client.RhqManager;
import org.rhq.bindings.util.InterfaceSimplifier;
@@ -39,7 +40,7 @@ import org.rhq.enterprise.server.util.LookupUtil;
*
* @author Lukas Krejci
*/
-public class LocalClient implements RhqFacade {
+public class LocalClient extends AbstractRhqFacade {
private static final Log LOG = LogFactory.getLog(LocalClient.class);
commit 3885d705e8b31485fae92e8df5ae2209a4c6a5d0
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Mon Sep 30 16:55:49 2013 +0200
api checks: reverting a change that broke JON 3.2 backward compatibility
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerRemote.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerRemote.java
index 3c6e81d..c10bc88 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerRemote.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerRemote.java
@@ -267,7 +267,14 @@ public interface OperationManagerRemote {
List<GroupOperationSchedule> findScheduledGroupOperations(Subject subject, int
groupId) throws Exception;
- PageList<OperationDefinition> findOperationDefinitionsByCriteria(Subject
subject, OperationDefinitionCriteria criteria);
+ /**
+ * TODO: major release: this should return PageList as all our criteria finder do
+ *
+ * @param subject The logged in user's subject.
+ * @param criteria The criteria object for the finding.
+ * @return instance of PageList<OperationDefinition> (can be safely casted)
+ */
+ List<OperationDefinition> findOperationDefinitionsByCriteria(Subject subject,
OperationDefinitionCriteria criteria);
PageList<ResourceOperationHistory>
findResourceOperationHistoriesByCriteria(Subject subject,
ResourceOperationHistoryCriteria criteria);
commit 12317968d83d7ca408b01e7b9715364215fd5907
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Mon Sep 30 16:23:01 2013 +0200
Bug 1013489 - It is not possible to download an agent from RHQ server (HTTP Status
404)
Fixed 'Downloads' page broken links
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/DownloadsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/DownloadsView.java
index 950b57d..5f3b9b6 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/DownloadsView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/DownloadsView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2009 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.gui.coregui.client.admin;
@@ -53,6 +53,8 @@ public class DownloadsView extends EnhancedVLayout {
public static final String VIEW_PATH = AdministrationView.VIEW_ID + "/"
+ AdministrationView.SECTION_CONFIGURATION_VIEW_ID + "/" + VIEW_ID;
+ private static final String PORTAL_WAR_CONTEXT = "/portal";
+
private final SystemGWTServiceAsync systemManager =
GWTServiceLookup.getSystemService();
private SectionStack sectionStack;
@@ -143,7 +145,7 @@ public class DownloadsView extends EnhancedVLayout {
StaticTextItem linkItem = new StaticTextItem("agentLink");
linkItem.setTitle(MSG.common_label_link());
- linkItem.setValue("<a
href=\"/agentupdate/download\">"
+ linkItem.setValue("<a href=\"" + PORTAL_WAR_CONTEXT +
"/agentupdate/download\">"
+ MSG.view_admin_downloads_agent_link_value(version, build) +
"</a>");
SpacerItem spacerItem = new SpacerItem("agentSpacer");
@@ -194,7 +196,7 @@ public class DownloadsView extends EnhancedVLayout {
StaticTextItem linkItem = new StaticTextItem("cliLink");
linkItem.setTitle(MSG.common_label_link());
- linkItem.setValue("<a
href=\"/client/download\">"
+ linkItem.setValue("<a href=\"" + PORTAL_WAR_CONTEXT +
"/client/download\">"
+ MSG.view_admin_downloads_cli_link_value(version, build) +
"</a>");
SpacerItem spacerItem = new SpacerItem("clientSpacer");
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
index 168522d..9792b5f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2010 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.gui.coregui.server.gwt;
@@ -48,6 +48,8 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl
implements Syst
private static final long serialVersionUID = 1L;
+ private static final String PORTAL_WAR_CONTEXT = "/portal";
+
private SystemManagerLocal systemManager = LookupUtil.getSystemManager();
private AgentManagerLocal agentManager = LookupUtil.getAgentManager();
private RemoteClientManagerLocal remoteClientManager =
LookupUtil.getRemoteClientManager();
@@ -136,7 +138,7 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl
implements Syst
HashMap<String, String> map = new HashMap<String,
String>(files.size());
for (File file : files) {
// key is the filename, value is the relative URL to download the file
from the server
- map.put(file.getName(), "/downloads/connectors/" +
file.getName());
+ map.put(file.getName(), PORTAL_WAR_CONTEXT +
"/downloads/connectors/" + file.getName());
}
return map;
} catch (Throwable t) {
@@ -156,7 +158,7 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl
implements Syst
HashMap<String, String> ret = new HashMap<String,
String>(files.size());
for (File file : files) {
- ret.put(file.getName(), "/downloads/cli-alert-scripts/" +
file.getName());
+ ret.put(file.getName(), PORTAL_WAR_CONTEXT +
"/downloads/cli-alert-scripts/" + file.getName());
}
return ret;
}
@@ -176,7 +178,7 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl
implements Syst
HashMap<String, String> ret = new HashMap<String,
String>(files.size());
for (File file : files) {
- ret.put(file.getName(), "/downloads/script-modules/" +
file.getName());
+ ret.put(file.getName(), PORTAL_WAR_CONTEXT +
"/downloads/script-modules/" + file.getName());
}
return ret;
}
@@ -205,7 +207,7 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl
implements Syst
}
File file = files.get(0);
HashMap<String, String> ret = new HashMap<String, String>(1);
- ret.put(file.getName(), "/downloads/bundle-deployer/" +
file.getName());
+ ret.put(file.getName(), PORTAL_WAR_CONTEXT +
"/downloads/bundle-deployer/" + file.getName());
return ret;
} catch (Throwable t) {
throw getExceptionToThrowToClient(t);
@@ -297,4 +299,4 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl
implements Syst
}
return map;
}
-}
\ No newline at end of file
+}
commit 1bb3cdf0ba93f10621090a729794b2bed7f3714c
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Mon Sep 30 10:11:55 2013 -0400
fix compilation failure.
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
index 8acbcd8..9cd7cc3 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
@@ -135,7 +135,7 @@ public class StorageClientManagerBean {
log.warn("Storage client subsystem wasn't initialized because it
wasn't possible to connect to the"
+ " storage cluster. The RHQ server is set to MAINTENANCE mode.
Please start the storage cluster"
+ " as soon as possible.");
- return;
+ return initialized;
}
Session wrappedSession = createSession(username, password, storageNodes);
session = new StorageSession(wrappedSession);
commit 6c2bcfab6985002d9d9fb8e652cbd88c31129060
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Fri Sep 27 13:02:45 2013 -0400
BZ 1010841 - a few more storage client changes.
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
index 9cd7cc3..8acbcd8 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
@@ -135,7 +135,7 @@ public class StorageClientManagerBean {
log.warn("Storage client subsystem wasn't initialized because it
wasn't possible to connect to the"
+ " storage cluster. The RHQ server is set to MAINTENANCE mode.
Please start the storage cluster"
+ " as soon as possible.");
- return initialized;
+ return;
}
Session wrappedSession = createSession(username, password, storageNodes);
session = new StorageSession(wrappedSession);
commit b0ff8622f259f971ef309fe086829fffd62e2605
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Sep 27 11:20:32 2013 -0400
Fix an issue where the storage client init was using system properties
to get the storage user and password. This had two issues:
1) at install the system properties were seeded in AS via
-p rhq-server.properties, but this was prior to the generation of the
storage cluster creds.
2) for HA installs the props file was actually not even correct, the
generated values were superseded by the existing db creds.
This commit syncs the props file and the db, during install, so problem
2 really should no longer be a problem. But this was mainly done to
reduce confusion for a person who may have wondered why the db and props
file had different values. It didn't solve problem 1. To solve problem
1 the storage client should always get its creds from the DB, which it
now does.
diff --git
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
index e10c993..445f41e 100644
---
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
+++
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
@@ -468,7 +468,8 @@ public class InstallerServiceImpl implements InstallerService {
throw new Exception("Cannot connect to the database: " +
testConnectionErrorMessage);
}
- // write the new properties to the rhq-server.properties file (this ensures the
encoded password is written out)
+ // write the new properties to the rhq-server.properties file (this ensures the
encoded password is written
+ // out). Being paranoid, leaving this here despite the fact that we now write it
out again, at the bottom.
saveServerProperties(serverProperties);
// Prepare the db schema.
@@ -548,6 +549,9 @@ public class InstallerServiceImpl implements InstallerService {
ServerInstallUtil.persistStorageNodesIfNecessary(serverProperties,
clearTextDbPassword,
parseNodeInformation(serverProperties));
ServerInstallUtil.persistStorageClusterSettingsIfNecessary(serverProperties,
clearTextDbPassword);
+
+ // For sanity, make sure the server props file is in sync with the db settings.
+ saveServerProperties(serverProperties);
}
@Override
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
index c484e0a..f0912fc 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
@@ -450,7 +450,7 @@ public class StartupBean implements StartupLocal {
}
/**
- * Initalizes the storage client subsystem which is needed for reading/writing metric
data.
+ * Initializes the storage client subsystem which is needed for reading/writing
metric data.
*
* @return true if the storage subsystem is running
*/
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
index 943c53c..9cd7cc3 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
@@ -49,8 +49,11 @@ import org.apache.commons.logging.LogFactory;
import org.rhq.cassandra.schema.SchemaManager;
import org.rhq.cassandra.util.ClusterBuilder;
import org.rhq.core.domain.cloud.StorageNode;
-import org.rhq.core.util.StringUtil;
+import org.rhq.core.domain.common.composite.SystemSetting;
+import org.rhq.core.domain.common.composite.SystemSettings;
+import org.rhq.enterprise.server.auth.SubjectManagerLocal;
import org.rhq.enterprise.server.cloud.StorageNodeManagerLocal;
+import org.rhq.enterprise.server.system.SystemManagerLocal;
import org.rhq.server.metrics.DateTimeService;
import org.rhq.server.metrics.MetricsConfiguration;
import org.rhq.server.metrics.MetricsDAO;
@@ -66,13 +69,17 @@ public class StorageClientManagerBean {
private final Log log = LogFactory.getLog(StorageClientManagerBean.class);
- private static final String USERNAME_PROP = "rhq.storage.username";
- private static final String PASSWORD_PROP = "rhq.storage.password";
private static final String RHQ_KEYSPACE = "rhq";
@EJB
+ private SubjectManagerLocal subjectManager;
+
+ @EJB
private StorageNodeManagerLocal storageNodeManager;
+ @EJB
+ private SystemManagerLocal systemManager;
+
private Cluster cluster;
private StorageSession session;
private MetricsConfiguration metricsConfiguration;
@@ -94,8 +101,10 @@ public class StorageClientManagerBean {
log.info("Initializing storage client subsystem");
- final String username = getRequiredStorageProperty(USERNAME_PROP);
- final String password = getRequiredStorageProperty(PASSWORD_PROP);
+ // Always get the creds from the DB, system props may not be up to date at
install time
+ SystemSettings settings =
systemManager.getSystemSettings(subjectManager.getOverlord());
+ final String username = settings.get(SystemSetting.STORAGE_USERNAME);
+ final String password = settings.get(SystemSetting.STORAGE_PASSWORD);
List<StorageNode> storageNodes = new ArrayList<StorageNode>();
for (StorageNode storageNode : storageNodeManager.getStorageNodes()) {
@@ -105,9 +114,9 @@ public class StorageClientManagerBean {
// and REMOVE_MAINTENANCE, but this errors on the side of being safe.
Lastly,
// if a storage node does not have a resource, then that means it was was
// deployed prior to installing the server.
- if (storageNode.getOperationMode() == StorageNode.OperationMode.NORMAL ||
- storageNode.getOperationMode() == StorageNode.OperationMode.MAINTENANCE
||
- storageNode.getResource() == null) {
+ if (storageNode.getOperationMode() == StorageNode.OperationMode.NORMAL
+ || storageNode.getOperationMode() ==
StorageNode.OperationMode.MAINTENANCE
+ || storageNode.getResource() == null) {
storageNodes.add(storageNode);
}
}
@@ -123,9 +132,9 @@ public class StorageClientManagerBean {
checkSchemaCompability(username, password, storageNodes);
} catch (NoHostAvailableException e) {
initialized = false;
- log.warn("Storage client subsystem wasn't initialized because it
wasn't possible to connect to the" +
- " storage cluster. The RHQ server is set to MAINTENANCE mode.
Please start the storage cluster" +
- " as soon as possible.");
+ log.warn("Storage client subsystem wasn't initialized because it
wasn't possible to connect to the"
+ + " storage cluster. The RHQ server is set to MAINTENANCE mode.
Please start the storage cluster"
+ + " as soon as possible.");
return initialized;
}
Session wrappedSession = createSession(username, password, storageNodes);
@@ -231,21 +240,17 @@ public class StorageClientManagerBean {
ProtocolOptions.Compression compression;
if (compressionEnabled) {
compression = ProtocolOptions.Compression.SNAPPY;
- log.info("Compression has been enabled for the storage client. Be aware
that if your storage nodes do " +
- "not support compression then the client will not be able to connect
to the storage cluster.");
+ log.info("Compression has been enabled for the storage client. Be aware
that if your storage nodes do "
+ + "not support compression then the client will not be able to
connect to the storage cluster.");
} else {
compression = ProtocolOptions.Compression.NONE;
log.debug("Storage client compression is disabled");
}
- cluster = new ClusterBuilder()
- .addContactPoints(hostNames.toArray(new String[hostNames.size()]))
- .withCredentialsObfuscated(username, password)
- .withPort(port)
+ cluster = new ClusterBuilder().addContactPoints(hostNames.toArray(new
String[hostNames.size()]))
+ .withCredentialsObfuscated(username, password).withPort(port)
.withLoadBalancingPolicy(new RoundRobinPolicy())
- .withRetryPolicy(new LoggingRetryPolicy(DefaultRetryPolicy.INSTANCE))
- .withCompression(compression)
- .build();
+ .withRetryPolicy(new
LoggingRetryPolicy(DefaultRetryPolicy.INSTANCE)).withCompression(compression).build();
return cluster.connect(RHQ_KEYSPACE);
}
@@ -263,14 +268,4 @@ public class StorageClientManagerBean {
metricsServer.setDateTimeService(dateTimeService);
metricsServer.init();
}
-
- private String getRequiredStorageProperty(String property) {
- String value = System.getProperty(property);
- if (StringUtil.isEmpty(property)) {
- throw new IllegalStateException("The system property [" + property
+ "] is not set. The RHQ "
- + "server will not be able connect to the RHQ storage node(s). This
property should be defined "
- + "in rhq-server.properties.");
- }
- return value;
- }
}
commit 226b0a806bbbd18dcffa69335f201238331ffbe8
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Thu Sep 26 09:59:17 2013 -0700
[BZ 1012589] Multi-line Graph Auto-refresh not working.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupD3GraphListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupD3GraphListView.java
index 7408f62..c3cfb75 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupD3GraphListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupD3GraphListView.java
@@ -42,8 +42,10 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.JsonMetricProducer;
import org.rhq.enterprise.gui.coregui.client.Messages;
import org.rhq.enterprise.gui.coregui.client.UserSessionManager;
+import org.rhq.enterprise.gui.coregui.client.dashboard.AutoRefreshUtil;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.inventory.AutoRefresh;
import
org.rhq.enterprise.gui.coregui.client.inventory.common.graph.ButtonBarDateTimeRangeEditor;
import org.rhq.enterprise.gui.coregui.client.inventory.common.graph.Refreshable;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
@@ -62,7 +64,7 @@ import
org.rhq.enterprise.gui.coregui.client.util.preferences.MeasurementUserPre
*
* @author Mike Thompson
*/
-public abstract class CompositeGroupD3GraphListView extends EnhancedVLayout implements
JsonMetricProducer, Refreshable {
+public abstract class CompositeGroupD3GraphListView extends EnhancedVLayout implements
JsonMetricProducer, AutoRefresh, Refreshable {
static protected final Messages MSG = CoreGUI.getMessages();
// string labels
@@ -89,6 +91,9 @@ public abstract class CompositeGroupD3GraphListView extends
EnhancedVLayout impl
private String chartTitle;
private Integer chartHeight;
+ protected static Timer refreshTimer;
+ protected boolean isRefreshing;
+
public CompositeGroupD3GraphListView(int groupId, int defId, boolean isAutoGroup) {
super();
this.groupId = groupId;
@@ -100,6 +105,7 @@ public abstract class CompositeGroupD3GraphListView extends
EnhancedVLayout impl
setHeight100();
setWidth100();
setPadding(10);
+ startRefreshCycle();
}
public void populateData() {
@@ -113,89 +119,89 @@ public abstract class CompositeGroupD3GraphListView extends
EnhancedVLayout impl
measurementForEachResource.clear();
groupService.findResourceGroupCompositesByCriteria(criteria,
- new AsyncCallback<PageList<ResourceGroupComposite>>() {
- @Override
- public void onFailure(Throwable caught) {
-
CoreGUI.getErrorHandler().handleError(MSG.view_resource_monitor_graphs_lookupFailed(),
caught);
- }
-
- @Override
- public void onSuccess(PageList<ResourceGroupComposite> result) {
- if (result.isEmpty()) {
- return;
+ new AsyncCallback<PageList<ResourceGroupComposite>>() {
+ @Override
+ public void onFailure(Throwable caught) {
+
CoreGUI.getErrorHandler().handleError(MSG.view_resource_monitor_graphs_lookupFailed(),
caught);
}
- final ResourceGroup parentGroup = result.get(0).getResourceGroup();
- chartTitle = parentGroup.getName();
- Log.debug("group name: " + parentGroup.getName());
- // setting up a deferred Command to execute after all resource
queries have completed (successfully or unsuccessfully)
- final CountDownLatch countDownLatch =
CountDownLatch.create(parentGroup.getExplicitResources()
- .size(), new Command() {
- @Override
- /**
- * Do this only after ALL of the metric queries for each
resource
- */
- public void execute() {
- if (parentGroup.getExplicitResources().size() !=
measurementForEachResource.size()) {
- Log.warn("Number of graphs doesn't match number
of resources");
- Log.warn("# of child resources: " +
parentGroup.getExplicitResources().size());
- Log.warn("# of charted graphs: " +
measurementForEachResource.size());
- }
- drawGraph();
+ @Override
+ public void onSuccess(PageList<ResourceGroupComposite> result)
{
+ if (result.isEmpty()) {
+ return;
}
- });
- final Set<Resource> childResources =
parentGroup.getExplicitResources();
- if (!childResources.isEmpty()) {
+ final ResourceGroup parentGroup =
result.get(0).getResourceGroup();
+ chartTitle = parentGroup.getName();
+ Log.debug("group name: " + parentGroup.getName());
+ // setting up a deferred Command to execute after all resource
queries have completed (successfully or unsuccessfully)
+ final CountDownLatch countDownLatch =
CountDownLatch.create(parentGroup.getExplicitResources()
+ .size(), new Command() {
+ @Override
+ /**
+ * Do this only after ALL of the metric queries for each
resource
+ */
+ public void execute() {
+ if (parentGroup.getExplicitResources().size() !=
measurementForEachResource.size()) {
+ Log.warn("Number of graphs doesn't match
number of resources");
+ Log.warn("# of child resources: " +
parentGroup.getExplicitResources().size());
+ Log.warn("# of charted graphs: " +
measurementForEachResource.size());
+ }
+ drawGraph();
+ }
+ });
- // resourceType will be the same for all autogroup children so
get first
- Resource childResource = childResources.iterator().next();
+ final Set<Resource> childResources =
parentGroup.getExplicitResources();
+ if (!childResources.isEmpty()) {
- ResourceTypeRepository.Cache.getInstance().getResourceTypes(
- childResource.getResourceType().getId(),
-
EnumSet.of(ResourceTypeRepository.MetadataType.measurements),
- new ResourceTypeRepository.TypeLoadedCallback() {
- @Override
- public void onTypesLoaded(final ResourceType type) {
+ // resourceType will be the same for all autogroup children
so get first
+ Resource childResource = childResources.iterator().next();
- for (MeasurementDefinition def :
type.getMetricDefinitions()) {
- // only need the one selected measurement
- if (def.getId() == getDefinitionId()) {
- setDefinition(def);
- }
- }
-
- for (final Resource childResource : childResources)
{
- Log.debug("Adding child composite: " +
childResource.getName()
- + childResource.getId());
-
-
GWTServiceLookup.getMeasurementDataService().findDataForResource(
- childResource.getId(), new int[] {
getDefinitionId() },
- buttonBarDateTimeRangeEditor.getStartTime(),
- buttonBarDateTimeRangeEditor.getEndTime(),
60,
- new
AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>>() {
- @Override
- public void onFailure(Throwable caught)
{
-
CoreGUI.getErrorHandler().handleError(
-
MSG.view_resource_monitor_graphs_loadFailed(), caught);
- countDownLatch.countDown();
- }
+ ResourceTypeRepository.Cache.getInstance().getResourceTypes(
+ childResource.getResourceType().getId(),
+
EnumSet.of(ResourceTypeRepository.MetadataType.measurements),
+ new ResourceTypeRepository.TypeLoadedCallback() {
+ @Override
+ public void onTypesLoaded(final ResourceType
type) {
- @Override
- public void onSuccess(
-
List<List<MeasurementDataNumericHighLowComposite>> measurements) {
-
addMeasurementForEachResource(childResource.getName(),
- childResource.getId(),
measurements.get(0));
- countDownLatch.countDown();
+ for (MeasurementDefinition def :
type.getMetricDefinitions()) {
+ // only need the one selected
measurement
+ if (def.getId() == getDefinitionId()) {
+ setDefinition(def);
}
- });
- }
- }
- });
+ }
+
+ for (final Resource childResource :
childResources) {
+ Log.debug("Adding child composite:
" + childResource.getName()
+ + childResource.getId());
+
+
GWTServiceLookup.getMeasurementDataService().findDataForResource(
+ childResource.getId(), new
int[]{getDefinitionId()},
+
buttonBarDateTimeRangeEditor.getStartTime(),
+
buttonBarDateTimeRangeEditor.getEndTime(), 60,
+ new
AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>>() {
+ @Override
+ public void
onFailure(Throwable caught) {
+
CoreGUI.getErrorHandler().handleError(
+
MSG.view_resource_monitor_graphs_loadFailed(), caught);
+
countDownLatch.countDown();
+ }
+
+ @Override
+ public void onSuccess(
+
List<List<MeasurementDataNumericHighLowComposite>> measurements) {
+
addMeasurementForEachResource(childResource.getName(),
+
childResource.getId(), measurements.get(0));
+
countDownLatch.countDown();
+ }
+ });
+ }
+ }
+ });
+ }
}
- }
- });
+ });
}
@@ -418,6 +424,36 @@ public abstract class CompositeGroupD3GraphListView extends
EnhancedVLayout impl
return MSG.chart_xaxis_time_format_hours();
}
+ @Override
+ public void startRefreshCycle() {
+ refreshTimer = AutoRefreshUtil.startRefreshCycleWithPageRefreshInterval(this,
this, refreshTimer);
+ }
+
+ @Override
+ protected void onDestroy() {
+ AutoRefreshUtil.onDestroy(refreshTimer);
+
+ super.onDestroy();
+ }
+
+ @Override
+ public boolean isRefreshing() {
+ return isRefreshing;
+ }
+
+ //Custom refresh operation as we are not directly extending Table
+ @Override
+ public void refresh() {
+ if (isVisible() && !isRefreshing()) {
+ isRefreshing = true;
+ try {
+ buttonBarDateTimeRangeEditor.updateTimeRangeToNow();
+ refreshData();
+ } finally {
+ isRefreshing = false;
+ }
+ }
+ }
/**
* Client can choose which graph types to render.
*/
commit 77312423e631cc63462868baedfb0e8fe129e1fc
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Thu Sep 26 07:52:06 2013 -0700
Update Summary metric portlet graphs for Date/Time range feedback of period being
selected for charting.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/ButtonBarDateTimeRangeEditor.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/ButtonBarDateTimeRangeEditor.java
index 778bbb2..561f961 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/ButtonBarDateTimeRangeEditor.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/ButtonBarDateTimeRangeEditor.java
@@ -64,9 +64,12 @@ public class ButtonBarDateTimeRangeEditor extends EnhancedVLayout {
private Label dateRangeLabel;
private DateTimeButtonBarClickHandler dateTimeButtonBarClickHandler;
private AbstractMeasurementRangeEditor.MetricRangePreferences prefs;
+ // just a reference to pass to CustomDateRangeWindow as it must be final
+ // so 'this' won't work
final private ButtonBarDateTimeRangeEditor self;
private RefreshIntervalMenu refreshIntervalMenu;
private boolean allowPreferenceUpdateRefresh;
+ private boolean isCustomDateRangeActive;
public ButtonBarDateTimeRangeEditor(MeasurementUserPreferences measurementUserPrefs,
Refreshable d3GraphListView) {
this.self = this;
@@ -110,6 +113,7 @@ public class ButtonBarDateTimeRangeEditor extends EnhancedVLayout {
CustomDateRangeWindow customDateRangeWindow = new
CustomDateRangeWindow(MSG
.common_buttonbar_custom_window_title(),
MSG.common_buttonbar_custom_window_subtitle(), self,
new Date(prefs.begin), new Date(prefs.end));
+ isCustomDateRangeActive = true;
customDateRangeWindow.show();
}
});
@@ -130,6 +134,10 @@ public class ButtonBarDateTimeRangeEditor extends EnhancedVLayout {
addMember(toolStrip);
}
+ public boolean isCustomTimeRangeActive(){
+ return isCustomDateRangeActive;
+ }
+
public void redrawGraphs() {
d3GraphListView.refreshData();
}
@@ -213,6 +221,7 @@ public class ButtonBarDateTimeRangeEditor extends EnhancedVLayout {
public void onClick(ClickEvent clickEvent) {
IButton button = (IButton) clickEvent.getSource();
String selectedDateTimeRange = button.getTitle();
+ isCustomDateRangeActive = false;
Date now = new Date();
Date calculatedStartDateTime = calculateStartDate(now,
selectedDateTimeRange);
saveDateRange(calculatedStartDateTime.getTime(), now.getTime());
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/D3GroupGraphListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/D3GroupGraphListView.java
index dcfb744..561a7a5 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/D3GroupGraphListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/D3GroupGraphListView.java
@@ -141,7 +141,9 @@ public final class D3GroupGraphListView extends
AbstractD3GraphListView implemen
@Override
public void run() {
availabilityGraph.drawJsniChart();
- buttonBarDateTimeRangeEditor.updateTimeRangeToNow();
+
if(!buttonBarDateTimeRangeEditor.isCustomTimeRangeActive()){
+
buttonBarDateTimeRangeEditor.updateTimeRangeToNow();
+ }
}
}.schedule(150);
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupD3GraphListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupD3GraphListView.java
index 013696f..7408f62 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupD3GraphListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupD3GraphListView.java
@@ -103,7 +103,6 @@ public abstract class CompositeGroupD3GraphListView extends
EnhancedVLayout impl
}
public void populateData() {
- buttonBarDateTimeRangeEditor.updateTimeRangeToNow();
ResourceGroupGWTServiceAsync groupService =
GWTServiceLookup.getResourceGroupService();
ResourceGroupCriteria criteria = new ResourceGroupCriteria();
@@ -143,7 +142,6 @@ public abstract class CompositeGroupD3GraphListView extends
EnhancedVLayout impl
Log.warn("# of charted graphs: " +
measurementForEachResource.size());
}
drawGraph();
- buttonBarDateTimeRangeEditor.updateTimeRangeToNow();
}
});
@@ -284,6 +282,9 @@ public abstract class CompositeGroupD3GraphListView extends
EnhancedVLayout impl
@Override
public void run() {
+ if(!buttonBarDateTimeRangeEditor.isCustomTimeRangeActive()){
+ buttonBarDateTimeRangeEditor.updateTimeRangeToNow();
+ }
drawJsniChart();
}
}.schedule(200);
@@ -357,7 +358,6 @@ public abstract class CompositeGroupD3GraphListView extends
EnhancedVLayout impl
sb.append("{ \"x\":" + measurement.getTimestamp() +
",");
MeasurementNumericValueAndUnits dataValue =
normalizeUnitsAndValues(measurement.getValue(),
definition.getUnits());
- //sb.append(" \"y\":" +
MeasurementUnits.scaleUp(measurement.getValue(), definition.getUnits()) +
"},");
sb.append(" \"y\":" + dataValue.getValue() +
"},");
adjustedMeasurementUnits = dataValue.getUnits().toString();
}
@@ -381,8 +381,9 @@ public abstract class CompositeGroupD3GraphListView extends
EnhancedVLayout impl
}
sb.setLength(sb.length() - 1); // delete the last ','
sb.append("]");
+ Log.debug("Multi-resource Graph size: " +
measurementForEachResource.size());
}
- Log.debug("Multi-resource Graph json: " + sb.toString());
+ //Log.debug("Multi-resource Graph json: " + sb.toString());
return sb.toString();
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/D3GraphListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/D3GraphListView.java
index 6eab1e9..0086871 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/D3GraphListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/D3GraphListView.java
@@ -233,6 +233,9 @@ public class D3GraphListView extends AbstractD3GraphListView {
new Timer() {
@Override
public void run() {
+
if(!buttonBarDateTimeRangeEditor.isCustomTimeRangeActive()){
+ buttonBarDateTimeRangeEditor.updateTimeRangeToNow();
+ }
availabilityGraph.drawJsniChart();
}
}.schedule(150);
commit 1b567f2f9eb2e81f86dbedf60cf85b42283aea05
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Thu Sep 26 22:36:43 2013 +0200
api checks: Adding back the org.rhq.enterprise.server.measurement.MeasurementAggregate
see the commit c2a609f48 for more details.
diff --git a/modules/enterprise/server/jar/intentional-api-changes-since-4.9.0.xml
b/modules/enterprise/server/jar/intentional-api-changes-since-4.9.0.xml
index 40508c6..488adc3 100644
--- a/modules/enterprise/server/jar/intentional-api-changes-since-4.9.0.xml
+++ b/modules/enterprise/server/jar/intentional-api-changes-since-4.9.0.xml
@@ -41,4 +41,19 @@
<justification>Adding a method to a remote API interface is safe. This is newly
implemented functionality.</justification>
</difference>
+ <difference>
+
<className>org/rhq/enterprise/server/measurement/MeasurementDataManagerRemote</className>
+ <differenceType>7006</differenceType> <!-- method return type changed
-->
+ <method>org.rhq.core.domain.measurement.MeasurementAggregate
getAggregate(org.rhq.core.domain.auth.Subject, int, long, long)</method>
+ <to>org.rhq.enterprise.server.measurement.MeasurementAggregate</to>
+ <justification>In RHQ 4.8 the MeasurementAggregate class was moved from server
jar module to core domain module. This change is not backward compatible with Java clients
using the remote EJB API. The breaking change was introduced by commit 2f6e74080e2299 the
backward compatible change was introduced by c2a609f48d5f36.</justification>
+ </difference>
+
+ <difference>
+
<className>org/rhq/enterprise/server/measurement/MeasurementDataManagerRemote</className>
+ <differenceType>7012</differenceType> <!-- method added to an
interface -->
+ <method>org.rhq.core.domain.measurement.MeasurementAggregate
getMeasurementAggregate(org.rhq.core.domain.auth.Subject, int, long, long)</method>
+ <justification>Adding a method to a remote API interface is safe. This is
method is added in order to deprecate the getAggregate. For more details see the previous
intentional change.</justification>
+ </difference>
+
</differences>
commit c2a609f48d5f364310060d031069495679b69c6f
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Thu Sep 26 22:32:46 2013 +0200
Adding back the org.rhq.enterprise.server.measurement.MeasurementAggregate because of
the JON 3.2 backward compatibility breakage (for EJB remote clients). This contains also
adding a new method, deprecating the old method and the added class so that it can be
removed in the next major release.
diff --git
a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBeanTest.java
b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBeanTest.java
index dbd03ae..e07fb65 100644
---
a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBeanTest.java
+++
b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBeanTest.java
@@ -258,7 +258,7 @@ public class MeasurementDataManagerBeanTest extends AbstractEJB3Test
{
dataManager.mergeMeasurementReport(report);
waitForRawInserts();
- MeasurementAggregate actual = dataManager.getAggregate(getOverlord(),
dynamicSchedule.getId(),
+ MeasurementAggregate actual = dataManager.getMeasurementAggregate(getOverlord(),
dynamicSchedule.getId(),
beginTime.getMillis(), endTime.getMillis());
MeasurementAggregate expected = new MeasurementAggregate(1.1, divide((1.1 + 2.2 +
3.3 + 4.4 + 5.5 + 6.6), 6),
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerBean.java
index 97dd33f..70a0e60 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerBean.java
@@ -347,7 +347,7 @@ public class StorageNodeManagerBean implements
StorageNodeManagerLocal, StorageN
// find the aggregates and enrich the result instance
if (!scheduleIdsMap.isEmpty()) {
if ((scheduleId = scheduleIdsMap.get(METRIC_TOKENS)) != null) {
- MeasurementAggregate tokensAggregate =
measurementManager.getAggregate(subject, scheduleId, beginTime,
+ MeasurementAggregate tokensAggregate =
measurementManager.getMeasurementAggregate(subject, scheduleId, beginTime,
endTime);
result.setTokens(tokensAggregate);
}
@@ -369,7 +369,7 @@ public class StorageNodeManagerBean implements
StorageNodeManagerLocal, StorageN
result.setTotalDiskUsedPercentage(totalDiskUsedPercentageAggregateWithUnits);
}
if ((scheduleId = scheduleIdsMap.get(METRIC_FREE_DISK_TO_DATA_RATIO)) !=
null) {
- MeasurementAggregate freeDiskToDataRatioAggregate =
measurementManager.getAggregate(subject,
+ MeasurementAggregate freeDiskToDataRatioAggregate =
measurementManager.getMeasurementAggregate(subject,
scheduleId, beginTime, endTime);
result.setFreeDiskToDataSizeRatio(freeDiskToDataRatioAggregate);
}
@@ -383,17 +383,17 @@ public class StorageNodeManagerBean implements
StorageNodeManagerLocal, StorageN
}
if ((scheduleId = scheduleIdsMap.get(METRIC_KEY_CACHE_SIZE)) != null) {
updateAggregateTotal(totalDiskUsedAggregate,
- measurementManager.getAggregate(subject, scheduleId, beginTime,
endTime));
+ measurementManager.getMeasurementAggregate(subject, scheduleId,
beginTime, endTime));
}
if ((scheduleId = scheduleIdsMap.get(METRIC_ROW_CACHE_SIZE)) != null) {
updateAggregateTotal(totalDiskUsedAggregate,
- measurementManager.getAggregate(subject, scheduleId, beginTime,
endTime));
+ measurementManager.getMeasurementAggregate(subject, scheduleId,
beginTime, endTime));
}
if ((scheduleId = scheduleIdsMap.get(METRIC_TOTAL_COMMIT_LOG_SIZE)) != null)
{
updateAggregateTotal(totalDiskUsedAggregate,
- measurementManager.getAggregate(subject, scheduleId, beginTime,
endTime));
+ measurementManager.getMeasurementAggregate(subject, scheduleId,
beginTime, endTime));
}
if (totalDiskUsedAggregate.getMax() > 0) {
StorageNodeLoadComposite.MeasurementAggregateWithUnits
totalDiskUsedAggregateWithUnits = new
StorageNodeLoadComposite.MeasurementAggregateWithUnits(
@@ -539,7 +539,7 @@ public class StorageNodeManagerBean implements
StorageNodeManagerLocal, StorageN
private StorageNodeLoadComposite.MeasurementAggregateWithUnits
getMeasurementAggregateWithUnits(Subject subject,
int schedId, MeasurementUnits units, long beginTime, long endTime) {
- MeasurementAggregate measurementAggregate =
measurementManager.getAggregate(subject, schedId, beginTime,
+ MeasurementAggregate measurementAggregate =
measurementManager.getMeasurementAggregate(subject, schedId, beginTime,
endTime);
StorageNodeLoadComposite.MeasurementAggregateWithUnits
measurementAggregateWithUnits = new
StorageNodeLoadComposite.MeasurementAggregateWithUnits(
measurementAggregate, units);
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementAggregate.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementAggregate.java
new file mode 100644
index 0000000..7acc5f6
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementAggregate.java
@@ -0,0 +1,83 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.server.measurement;;
+
+import java.io.Serializable;
+
+/**
+ * Simple Java Bean to hold aggregate values
+ *
+ * @author <a href="mailto:heiko.rupp@redhat.com">Heiko W.
Rupp</a>
+ * @deprecated As of release RHQ 4.8, replaced by {@link
org.rhq.core.domain.measurement.MeasurementAggregate}. Use this class from core domain
instead.
+ */
+public class MeasurementAggregate implements Serializable {
+
+ static final long serialVersionUID = 5673395371271765240L;
+
+ Double min;
+ Double avg;
+ Double max;
+
+ public MeasurementAggregate() {
+ }
+
+ public MeasurementAggregate(Double min, Double avg, Double max) {
+ this.min = (min != null) ? min : Double.NaN;
+ this.avg = (avg != null) ? avg : Double.NaN;
+ this.max = (max != null) ? max : Double.NaN;
+ }
+
+ public Double getMin() {
+ return min;
+ }
+
+ public void setMin(Double min) {
+ this.min = min;
+ }
+
+ public Double getAvg() {
+ return avg;
+ }
+
+ public void setAvg(Double avg) {
+ this.avg = avg;
+ }
+
+ public Double getMax() {
+ return max;
+ }
+
+ public void setMax(Double max) {
+ this.max = max;
+ }
+
+ @Override
+ public String toString() {
+ return "Min: " + min + ", Max: " + max + ", Avg: "
+ avg;
+ }
+
+ /**
+ * Return true if the aggregate has "no real data" I.e. when all values are
Not A Number.
+ *
+ * @return
+ */
+ public boolean isEmpty() {
+ return min.isNaN() && avg.isNaN() && max.isNaN();
+ }
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementBaselineManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementBaselineManagerBean.java
index 3504cdc..1470337 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementBaselineManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementBaselineManagerBean.java
@@ -480,7 +480,7 @@ public class MeasurementBaselineManagerBean implements
MeasurementBaselineManage
throw new BaselineCreationException("Baseline calculation is only valid
for a dynamic measurement");
}
- MeasurementAggregate agg = dataManager.getAggregate(subjectManager.getOverlord(),
schedule.getId(), startDate,
+ MeasurementAggregate agg =
dataManager.getMeasurementAggregate(subjectManager.getOverlord(), schedule.getId(),
startDate,
endDate);
// attach the entity, so we can find the baseline
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementChartsManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementChartsManagerBean.java
index c481c6e..618bcc7 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementChartsManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementChartsManagerBean.java
@@ -373,7 +373,7 @@ public class MeasurementChartsManagerBean implements
MeasurementChartsManagerLoc
summary.setCollectionType(collectionType);
if (!narrowed) {
- MeasurementAggregate compositeHighLow = dataManager.getAggregate(subject,
schedule.getId(), begin, end);
+ MeasurementAggregate compositeHighLow =
dataManager.getMeasurementAggregate(subject, schedule.getId(), begin, end);
if (compositeHighLow.isEmpty()) {
summary.setValuesPresent(false);
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java
index 19c5ecf..ee679f1 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java
@@ -605,9 +605,41 @@ public class MeasurementDataManagerBean implements
MeasurementDataManagerLocal,
log.debug(callingMethod + ": " + stats.toString());
}
+ @Deprecated
@Override
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
- public MeasurementAggregate getAggregate(Subject subject, int scheduleId, long
startTime, long endTime) {
+ public org.rhq.enterprise.server.measurement.MeasurementAggregate
getAggregate(Subject subject, int scheduleId, long startTime, long endTime) {
+ MeasurementScheduleCriteria criteria = new MeasurementScheduleCriteria();
+ criteria.addFilterId(scheduleId);
+ criteria.fetchResource(true);
+
+ PageList<MeasurementSchedule> schedules =
measurementScheduleManager.findSchedulesByCriteria(
+ subjectManager.getOverlord(), criteria);
+ if (schedules.isEmpty()) {
+ throw new MeasurementException("Could not fine MeasurementSchedule with
the id[" + scheduleId + "]");
+ }
+ MeasurementSchedule schedule = schedules.get(0);
+
+ if (authorizationManager.canViewResource(subject, schedule.getResource().getId())
== false) {
+ throw new PermissionException("User[" + subject.getName()
+ + "] does not have permission to view schedule[id=" +
scheduleId + "]");
+ }
+
+ if (schedule.getDefinition().getDataType() != DataType.MEASUREMENT) {
+ throw new IllegalArgumentException(schedule + " is not about numerical
values. Can't compute aggregates");
+ }
+
+ if (startTime > endTime) {
+ throw new IllegalArgumentException("Start date " + startTime +
" is not before " + endTime);
+ }
+
+ MetricsServer metricsServer = storageClientManager.getMetricsServer();
+ AggregateNumericMetric summary = metricsServer.getSummaryAggregate(scheduleId,
startTime, endTime);
+
+ return new
org.rhq.enterprise.server.measurement.MeasurementAggregate(summary.getMin(),
summary.getAvg(), summary.getMax());
+ }
+
+ public MeasurementAggregate getMeasurementAggregate(Subject subject, int scheduleId,
long startTime, long endTime) {
MeasurementScheduleCriteria criteria = new MeasurementScheduleCriteria();
criteria.addFilterId(scheduleId);
criteria.fetchResource(true);
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerRemote.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerRemote.java
index 116c82a..1a049c3 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerRemote.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerRemote.java
@@ -51,8 +51,27 @@ public interface MeasurementDataManagerRemote {
*
* @throws FetchException if the schedule does not reference numerical data or if the
user is not allowed to view
* the {@link Resource} corresponding to this scheduleId
+ * @deprecated class {@link
org.rhq.enterprise.server.measurement.MeasurementAggregate} has been deprecated
+ * since RHQ 4.8, therefore this method was deprecated as well and
+ * replaced by {@link
#getMeasurementAggregate(org.rhq.core.domain.auth.Subject,int,long,long)}
*/
- MeasurementAggregate getAggregate(Subject subject, int scheduleId, long startTime,
long endTime);
+ org.rhq.enterprise.server.measurement.MeasurementAggregate getAggregate(Subject
subject, int scheduleId, long startTime, long endTime);
+
+ /**
+ * Get the aggregate values of the numerical values for a given schedule. This can
only provide aggregates for data
+ * in the "live" table
+ *
+ * @param subject the user requesting the aggregate
+ * @param scheduleId the id of the {@link MeasurementSchedule} for which this
aggregate is being requested
+ * @param start the start time
+ * @param end the end time
+ *
+ * @return MeasurementAggregate bean with the data
+ *
+ * @throws FetchException if the schedule does not reference numerical data or if the
user is not allowed to view
+ * the {@link Resource} corresponding to this scheduleId
+ */
+ MeasurementAggregate getMeasurementAggregate(Subject subject, int scheduleId, long
startTime, long endTime);
/**
* Return all known trait data for the passed schedule, defined by resourceId and
definitionId
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/MetricHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/MetricHandlerBean.java
index d5ca8dc..fb927ec 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/MetricHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/MetricHandlerBean.java
@@ -162,7 +162,7 @@ public class MetricHandlerBean extends AbstractRestBean {
MeasurementSchedule schedule = obtainSchedule(scheduleId, false,
DataType.MEASUREMENT);
- MeasurementAggregate aggr = dataManager.getAggregate(caller, scheduleId,
startTime, endTime);
+ MeasurementAggregate aggr = dataManager.getMeasurementAggregate(caller,
scheduleId, startTime, endTime);
MetricAggregate res = new MetricAggregate(scheduleId,
aggr.getMin(),aggr.getAvg(),aggr.getMax());
int definitionId = schedule.getDefinition().getId();
@@ -387,7 +387,7 @@ public class MetricHandlerBean extends AbstractRestBean {
List<List<MeasurementDataNumericHighLowComposite>> listList =
dataManager.findDataForContext(caller,
EntityContext.forResource(sched.getResource().getId()),definitionId,startTime,endTime,dataPoints);
if (!listList.isEmpty()) {
- MeasurementAggregate measurementAggregate =
dataManager.getAggregate(caller,scheduleId,startTime,endTime);
+ MeasurementAggregate measurementAggregate =
dataManager.getMeasurementAggregate(caller,scheduleId,startTime,endTime);
List<MeasurementDataNumericHighLowComposite> list =
listList.get(0);
MetricAggregate res = new
MetricAggregate(scheduleId,measurementAggregate.getMin(),measurementAggregate.getAvg(),measurementAggregate.getMax());
boolean isHtml = mediaType.equals(MediaType.TEXT_HTML_TYPE);
@@ -552,7 +552,7 @@ public class MetricHandlerBean extends AbstractRestBean {
List<MetricAggregate> ret = new
ArrayList<MetricAggregate>(schedules.size());
for (MeasurementSchedule schedule: schedules) {
- MeasurementAggregate aggr =
dataManager.getAggregate(caller,schedule.getId(),startTime,endTime);
+ MeasurementAggregate aggr =
dataManager.getMeasurementAggregate(caller,schedule.getId(),startTime,endTime);
MetricAggregate res = new MetricAggregate(schedule.getId(),
aggr.getMin(),aggr.getAvg(),aggr.getMax());
if (includeDataPoints) {
commit 0d40ad930ba3248614e366f28f0a98ad8c98f136
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Thu Sep 26 22:32:11 2013 +0200
[BZ 967542] - UI shows confusing units when editing Availability Duration alert
condition type - The table with listed conditions should now display the same number-unit
tuple as the popup dialog.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java
index ce95963..6d75a27 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java
@@ -28,6 +28,7 @@ import org.rhq.core.domain.alert.AlertConditionCategory;
import org.rhq.core.domain.alert.AlertConditionOperator;
import org.rhq.core.domain.alert.AlertDefinition;
import org.rhq.core.domain.measurement.MeasurementUnits;
+import org.rhq.core.domain.measurement.composite.MeasurementNumericValueAndUnits;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.Messages;
import org.rhq.enterprise.gui.coregui.client.util.MeasurementConverterClient;
@@ -93,9 +94,17 @@ public class AlertFormatUtility {
}
str.append(" For ");
- // value is stored in seconds but should be presented in minutes
- String value = String.valueOf(Integer.valueOf(condition.getOption()) / 60);
- String formatted = MeasurementConverterClient.format(value,
MeasurementUnits.MINUTES);
+ long longValue = Long.valueOf(condition.getOption());
+ MeasurementNumericValueAndUnits valueWithUnits;
+ if (longValue % 3600 == 0) {
+ valueWithUnits = MeasurementConverterClient.fit((double) longValue,
MeasurementUnits.SECONDS,
+ MeasurementUnits.HOURS, MeasurementUnits.HOURS);
+ } else {
+ valueWithUnits = MeasurementConverterClient.fit((double) longValue,
MeasurementUnits.SECONDS,
+ MeasurementUnits.MINUTES, MeasurementUnits.MINUTES);
+ }
+ String formatted =
MeasurementConverterClient.format(String.valueOf(valueWithUnits.getValue()),
+ valueWithUnits.getUnits());
str.append(formatted);
str.append("]");
commit 2ec569c22ac62a0624ed1044db2c6a0e33107cc2
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Thu Sep 26 18:51:11 2013 +0200
Fix ResourceContainerTest intermittent failure
diff --git
a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/inventory/ResourceContainerTest.java
b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/inventory/ResourceContainerTest.java
index d02447e..c7c2b77 100644
---
a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/inventory/ResourceContainerTest.java
+++
b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/inventory/ResourceContainerTest.java
@@ -19,7 +19,7 @@
package org.rhq.core.pc.inventory;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static java.util.concurrent.TimeUnit.SECONDS;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
@@ -147,7 +147,7 @@ public class ResourceContainerTest {
public void testUninterruptedComponentInvocationContext() throws Exception {
ResourceContainer resourceContainer = getResourceContainer();
OperationFacet proxy =
resourceContainer.createResourceComponentProxy(OperationFacet.class,
- FacetLockType.WRITE, 150, true, false, true);
+ FacetLockType.WRITE, SECONDS.toMillis(2), true, false, true);
try {
OperationResult op = proxy.invokeOperation("op", new
Configuration());
assertTrue(op.getSimpleResult().equals(MockResourceComponent.OPERATION_RESULT));
@@ -218,8 +218,8 @@ public class ResourceContainerTest {
public OperationResult invokeOperation(String name, Configuration parameters)
throws Exception {
long start = System.nanoTime();
while (!resourceContext.getComponentInvocationContext().isInterrupted()) {
- if ((System.nanoTime() - start) > MILLISECONDS.toNanos(100)) {
- // Return after 100ms
+ // Return after 1s
+ if ((System.nanoTime() - start) > SECONDS.toNanos(1)) {
caughtInterruptedComponentInvocation = false;
return new OperationResult(OPERATION_RESULT);
}
commit 8cfdad217914a513f98f2a474e367b1374eb23ea
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Thu Sep 26 18:37:49 2013 +0200
Bug 1010330 - JBossAS7 server resource is not available after upgrade to jon3.2.er1
The bug was introduced with the implementation of BZ974876 "[RFE]
ResourceUpgradeFacet should support upgrade of plugin config properties"
In DiscoveryBossBean, upgrade responses were filled with current resource plugin
configuration if the upgrade request had nothing to update in it. But plugin config was
loaded lazily and when going through the server services marshalling layer, it was turned
into null. As a consequence, the server still had the right configuration, but the agent
data was wrong.
diff --git
a/modules/core/arquillian-integration/container/src/main/java/org/rhq/test/arquillian/FakeServerInventory.java
b/modules/core/arquillian-integration/container/src/main/java/org/rhq/test/arquillian/FakeServerInventory.java
index a16ceb8..1f56095 100644
---
a/modules/core/arquillian-integration/container/src/main/java/org/rhq/test/arquillian/FakeServerInventory.java
+++
b/modules/core/arquillian-integration/container/src/main/java/org/rhq/test/arquillian/FakeServerInventory.java
@@ -1,24 +1,20 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
+ * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.test.arquillian;
@@ -330,19 +326,28 @@ public class FakeServerInventory {
}
}, ID_COMPARATOR);
if (resource != null) {
+
+ ResourceUpgradeResponse resp = new
ResourceUpgradeResponse();
+ resp.setResourceId(resource.getId());
+
if (request.getNewDescription() != null) {
resource.setDescription(request.getNewDescription());
+
resp.setUpgradedResourceDescription(resource.getDescription());
}
+
if (request.getNewName() != null) {
resource.setName(request.getNewName());
+ resp.setUpgradedResourceName(resource.getName());
}
if (request.getNewResourceKey() != null) {
resource.setResourceKey(request.getNewResourceKey());
+ resp.setUpgradedResourceKey(resource.getResourceKey());
}
if (request.getNewPluginConfiguration() != null) {
resource.setPluginConfiguration(request.getNewPluginConfiguration());
+
resp.setUpgradedResourcePluginConfiguration(resource.getPluginConfiguration());
}
if (request.getUpgradeErrorMessage() != null) {
@@ -352,12 +357,6 @@ public class FakeServerInventory {
resource.getResourceErrors().add(error);
}
- ResourceUpgradeResponse resp = new
ResourceUpgradeResponse();
- resp.setResourceId(resource.getId());
- resp.setUpgradedResourceName(resource.getName());
- resp.setUpgradedResourceKey(resource.getResourceKey());
-
resp.setUpgradedResourceDescription(resource.getDescription());
-
resp.setUpgradedResourcePluginConfiguration(resource.getPluginConfiguration());
responses.add(resp);
}
}
diff --git
a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
index 28f2d83..3f2bbb9 100644
---
a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
+++
b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/upgrade/FakeServerInventory.java
@@ -1,24 +1,20 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
+ * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.core.pc.upgrade;
@@ -186,19 +182,28 @@ public class FakeServerInventory {
}
}, ID_COMPARATOR);
if (resource != null) {
+
+ ResourceUpgradeResponse resp = new
ResourceUpgradeResponse();
+ resp.setResourceId(resource.getId());
+
if (request.getNewDescription() != null) {
resource.setDescription(request.getNewDescription());
+
resp.setUpgradedResourceDescription(resource.getDescription());
}
+
if (request.getNewName() != null) {
resource.setName(request.getNewName());
+ resp.setUpgradedResourceName(resource.getName());
}
if (request.getNewResourceKey() != null) {
resource.setResourceKey(request.getNewResourceKey());
+ resp.setUpgradedResourceKey(resource.getResourceKey());
}
if (request.getNewPluginConfiguration() != null) {
resource.setPluginConfiguration(request.getNewPluginConfiguration());
+
resp.setUpgradedResourcePluginConfiguration(resource.getPluginConfiguration());
}
if (request.getUpgradeErrorMessage() != null) {
@@ -208,12 +213,6 @@ public class FakeServerInventory {
resource.getResourceErrors().add(error);
}
- ResourceUpgradeResponse resp = new
ResourceUpgradeResponse();
- resp.setResourceId(resource.getId());
- resp.setUpgradedResourceName(resource.getName());
- resp.setUpgradedResourceKey(resource.getResourceKey());
-
resp.setUpgradedResourceDescription(resource.getDescription());
-
resp.setUpgradedResourcePluginConfiguration(resource.getPluginConfiguration());
responses.add(resp);
}
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
index 899dbe9..09b6271 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java
@@ -114,6 +114,7 @@ import org.rhq.enterprise.server.util.LookupUtil;
*/
@Stateless
public class DiscoveryBossBean implements DiscoveryBossLocal, DiscoveryBossRemote {
+ private static final Log LOG = LogFactory.getLog(DiscoveryBossBean.class.getName());
static private final int MERGE_BATCH_SIZE;
@@ -128,8 +129,6 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
MERGE_BATCH_SIZE = mergeBatchSize;
}
- private final Log log = LogFactory.getLog(DiscoveryBossBean.class.getName());
-
@PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME)
private EntityManager entityManager;
@@ -173,11 +172,11 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
Set<ResourceType> deletedTypes = filter.apply(report);
if (!deletedTypes.isEmpty()) {
- if (log.isDebugEnabled()) {
- log.debug("The inventory report from " + report.getAgent() +
" with added roots "
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("The inventory report from " + report.getAgent() +
" with added roots "
+ report.getAddedRoots() + " contains these deleted resource
types " + deletedTypes);
} else {
- log.info("The inventory report from " + report.getAgent() +
" contains these deleted resource types "
+ LOG.info("The inventory report from " + report.getAgent() +
" contains these deleted resource types "
+ deletedTypes);
}
throw new StaleTypeException("The report contains one or more resource
types that have been marked for "
@@ -195,13 +194,13 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
+ agent.getName() + "] was recently removed from the inventory. In
any other case this is a bug.");
}
- if (log.isDebugEnabled()) {
- log.debug("Received inventory report from RHQ Agent [" + knownAgent
+ "]. Number of added roots: "
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Received inventory report from RHQ Agent [" + knownAgent
+ "]. Number of added roots: "
+ report.getAddedRoots().size());
}
Set<Resource> roots = report.getAddedRoots();
- log.debug(report);
+ LOG.debug(report);
final Map<String, ResourceType> allTypes = new HashMap<String,
ResourceType>();
@@ -220,8 +219,8 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
mergeResource(root, knownAgent);
- if (log.isDebugEnabled()) {
- log.debug("Root merged: resource/millis=" + root.getName() +
'/'
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Root merged: resource/millis=" + root.getName() +
'/'
+ (System.currentTimeMillis() - rootStart));
}
}
@@ -251,8 +250,8 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
results = null;
}
- if (log.isDebugEnabled()) {
- log.debug("Inventory merge completed in (" +
(System.currentTimeMillis() - start) + ")ms");
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Inventory merge completed in (" +
(System.currentTimeMillis() - start) + ")ms");
}
return results;
@@ -351,8 +350,8 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
scheduleAgentInventoryOperationJob(platforms, servers);
- if (log.isDebugEnabled()) {
- log.debug("Inventory status set to [" + status + "] for
[" + platforms.size() + "] platforms and ["
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Inventory status set to [" + status + "] for
[" + platforms.size() + "] platforms and ["
+ servers.size() + "] servers in [" +
(System.currentTimeMillis() - start) + "]ms");
}
}
@@ -365,7 +364,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
isScheduled = true;
}
} catch (SchedulerException se) {
- log.error("Error getting job detail", se);
+ LOG.error("Error getting job detail", se);
}
return isScheduled;
}
@@ -402,7 +401,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
scheduler.scheduleJob(jobDetail, trigger);
}
} catch (SchedulerException e) {
- log.error("Failed to schedule agent inventory update operation.",
e);
+ LOG.error("Failed to schedule agent inventory update operation.",
e);
updateAgentInventoryStatus(platforms, servers);
}
}
@@ -426,7 +425,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
syncInfo = entityManager.find(ResourceSyncInfo.class, platform.getId());
agentClient.getDiscoveryAgentService().synchronizeInventory(syncInfo);
} catch (Exception e) {
- log.warn("Could not perform commit synchronization with agent for
platform [" + platform.getName()
+ LOG.warn("Could not perform commit synchronization with agent for
platform [" + platform.getName()
+ "]", e);
}
}
@@ -438,7 +437,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
syncInfo = entityManager.find(ResourceSyncInfo.class,
server.getId());
agentClient.getDiscoveryAgentService().synchronizeInventory(syncInfo);
} catch (Exception e) {
- log.warn("Could not perform commit synchronization with agent
for server [" + server.getName()
+ LOG.warn("Could not perform commit synchronization with agent
for server [" + server.getName()
+ "]", e);
}
}
@@ -605,7 +604,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
result.add(upgradedData);
}
} catch (Exception e) {
- log.error("Failed to process upgrade request for resource "
+ existingResource + ".", e);
+ LOG.error("Failed to process upgrade request for resource "
+ existingResource + ".", e);
}
}
}
@@ -643,7 +642,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
versionChanged = !oldVersion.equals(newVersion);
if (versionChanged) {
- log.info("Resource [" + resource + "] changed its version
from [" + oldVersion + "] to [" + newVersion
+ LOG.info("Resource [" + resource + "] changed its version
from [" + oldVersion + "] to [" + newVersion
+ "]");
resource.setVersion(newVersion);
@@ -688,20 +687,20 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
if (needsUpgrade(resource.getResourceKey(), resourceKey)) {
resource.setResourceKey(resourceKey);
logMessage.append("resourceKey, ");
+ ret.setUpgradedResourceKey(resource.getResourceKey());
}
- ret.setUpgradedResourceKey(resource.getResourceKey());
if (allowGenericPropertiesUpgrade && needsUpgrade(resource.getName(),
name)) {
resource.setName(name);
logMessage.append("name, ");
+ ret.setUpgradedResourceName(resource.getName());
}
- ret.setUpgradedResourceName(resource.getName());
if (allowGenericPropertiesUpgrade &&
needsUpgrade(resource.getDescription(), description)) {
resource.setDescription(description);
logMessage.append("description, ");
+ ret.setUpgradedResourceDescription(resource.getDescription());
}
- ret.setUpgradedResourceDescription(resource.getDescription());
// If provided, assume the new plugin config should replace the old plugin
config in its entirety.
// Use a deep copy without ids as the updgardeRequest config may contain
entity config props.
@@ -714,9 +713,6 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
PluginConfigurationUpdate update =
configurationManager.upgradePluginConfiguration(
subjectManager.getOverlord(), resource.getId(), pluginConfig);
ret.setUpgradedResourcePluginConfiguration(update.getResource().getPluginConfiguration());
-
- } else {
-
ret.setUpgradedResourcePluginConfiguration(resource.getPluginConfiguration());
}
// finally let's remove the potential previous upgrade error. we've
now successfully
@@ -730,7 +726,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
logMessage.replace(logMessage.length() - 1, logMessage.length(), "to
become [").append(resource.toString())
.append("]");
- log.info(logMessage.toString());
+ LOG.info(logMessage.toString());
}
return ret;
@@ -787,8 +783,8 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
long start = System.currentTimeMillis();
- if (log.isDebugEnabled()) {
- log.debug("Merging [" + resource + "]...");
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Merging [" + resource + "]...");
}
// We don't merge the entire resource tree. Instead we batch them in order to
reduce transaction overhead
@@ -797,8 +793,8 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
// NOTE: this will also strip out all resources that are to be ignored; thus,
ignored resources won't get merged
List<Resource> resourceList = treeToBreadthFirstList(resource);
- if (log.isDebugEnabled()) {
- log.debug("Preparing to merge [" + resourceList.size() + "]
Resources with a batch size of ["
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Preparing to merge [" + resourceList.size() + "]
Resources with a batch size of ["
+ MERGE_BATCH_SIZE + "]");
}
@@ -813,8 +809,8 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
resourceBatch.clear();
}
- if (log.isDebugEnabled()) {
- log.debug("Resource and children merged: resource/millis=" +
resource.getName() + '/'
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Resource and children merged: resource/millis=" +
resource.getName() + '/'
+ (System.currentTimeMillis() - start));
}
@@ -854,7 +850,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
throws InvalidInventoryReportException {
long batchStart = System.currentTimeMillis();
- boolean isDebugEnabled = log.isDebugEnabled();
+ boolean isDebugEnabled = LOG.isDebugEnabled();
// Cache parent resources we've already fetched from the DB, many resources
will have the same parent
Map<Integer, Resource> parentMap = new HashMap<Integer, Resource>();
@@ -874,7 +870,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
}
if (isDebugEnabled) {
- log.debug("Single Resource merged: resource/millis=" +
resource.getName() + '/'
+ LOG.debug("Single Resource merged: resource/millis=" +
resource.getName() + '/'
+ (System.currentTimeMillis() - start));
}
}
@@ -884,7 +880,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
if (isDebugEnabled) {
long delta = (System.currentTimeMillis() - batchStart);
- log.debug("Resource Batch merged: size/average/millis=" +
resourceBatch.size() + "/" + delta
+ LOG.debug("Resource Batch merged: size/average/millis=" +
resourceBatch.size() + "/" + delta
/ resourceBatch.size() + "/" + delta);
}
}
@@ -917,31 +913,31 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
*/
private Resource findExistingResource(Resource resource, Map<Integer, Resource>
parentMap) {
- boolean isDebugEnabled = log.isDebugEnabled();
+ boolean isDebugEnabled = LOG.isDebugEnabled();
if (isDebugEnabled) {
- log.debug("getExistingResource processing for [" + resource +
"]");
+ LOG.debug("getExistingResource processing for [" + resource +
"]");
}
Resource existingResource = null;
if (resource.getId() != 0) {
if (isDebugEnabled) {
- log.debug("Agent claims resource is already in inventory. Id="
+ resource.getId());
+ LOG.debug("Agent claims resource is already in inventory. Id="
+ resource.getId());
}
// This maybe could be more efficient using a named query that pulls some
lazy data, but this should be fine
existingResource = entityManager.find(Resource.class, resource.getId());
if (isDebugEnabled) {
if (null != existingResource) {
- log.debug("Found resource already in inventory. Id=" +
resource.getId());
+ LOG.debug("Found resource already in inventory. Id=" +
resource.getId());
} else {
// agent lied - agent's copy of JON server inventory must be
stale.
- log.debug("However, no resource exists with the specified id.
Id=" + resource.getId());
+ LOG.debug("However, no resource exists with the specified id.
Id=" + resource.getId());
}
}
} else {
- log.debug("Agent reported resource with id of 0");
+ LOG.debug("Agent reported resource with id of 0");
}
// If necessary double-check for an existing resource using the business key.
@@ -949,7 +945,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
// or if the agent didn't know about it to begin with (id was 0).
if (existingResource == null) {
if (isDebugEnabled) {
- log.debug("Checking if a resource exists with the specified business
key. Id=" + resource.getId()
+ LOG.debug("Checking if a resource exists with the specified business
key. Id=" + resource.getId()
+ ", key=" + resource.getResourceKey());
}
@@ -969,7 +965,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
int parentId = parent.getId();
if (parentId <= 0) {
- log.warn("Expected potential parent resource to have a valid
ID. Parent=" + parent + ", Child="
+ LOG.warn("Expected potential parent resource to have a valid
ID. Parent=" + parent + ", Child="
+ resource);
}
@@ -1010,20 +1006,20 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
// We found it - reset the id to what it should be.
resource.setId(existingResource.getId());
if (isDebugEnabled) {
- log.debug("Found resource already in inventory with specified
business key, Id=" + resource.getId());
+ LOG.debug("Found resource already in inventory with specified
business key, Id=" + resource.getId());
}
} else {
- log.debug("Unable to find the agent-reported resource by id or
business key.");
+ LOG.debug("Unable to find the agent-reported resource by id or
business key.");
if (resource.getId() != 0) {
// existingResource is still null at this point, the resource does
not exist in inventory.
- log.error("Resetting the resource's id to zero. Previous
Id=" + resource.getId());
+ LOG.error("Resetting the resource's id to zero. Previous
Id=" + resource.getId());
resource.setId(0);
// TODO: Is there anything else we should do here to inform the agent
it has an out-of-sync resource?
} else {
- log.debug("Resource's id was already zero, nothing to do for
the merge.");
+ LOG.debug("Resource's id was already zero, nothing to do for
the merge.");
}
}
}
@@ -1083,8 +1079,8 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
}
} else {
- if (log.isDebugEnabled()) {
- log.debug("Existing Resource " + existingResource + "
has invalid parent type ("
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Existing Resource " + existingResource + "
has invalid parent type ("
+ existingResourceParentType + ") and so does
plugin-reported Resource " + updatedResource
+ " (" + updatedResourceParentType + ") - valid
parent types are [" + validParentTypes + "].");
}
@@ -1093,8 +1089,8 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
// The below block is for Resources that were created via the RHQ GUI, whose
descriptions will be null.
if (existingResource.getDescription() == null &&
updatedResource.getDescription() != null) {
- if (log.isDebugEnabled()) {
- log.debug("Setting description of existing resource with id " +
existingResource.getId() + " to '"
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Setting description of existing resource with id " +
existingResource.getId() + " to '"
+ updatedResource.getDescription() + "' (as reported by
agent)...");
}
existingResource.setDescription(updatedResource.getDescription());
@@ -1104,7 +1100,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
if ((existingResource.getResourceKey() != null)
&&
!existingResource.getResourceKey().equals(updatedResource.getResourceKey())) {
- log.warn("Agent reported that key for " + existingResource + "
has changed from '"
+ LOG.warn("Agent reported that key for " + existingResource + "
has changed from '"
+ existingResource.getResourceKey() + "' to '" +
updatedResource.getResourceKey() + "'.");
}
@@ -1152,7 +1148,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
}
if (null == resourceType) {
- log.error("Reported resource [" + resource + "] has an
unknown type [" + resource.getResourceType()
+ LOG.error("Reported resource [" + resource + "] has an
unknown type [" + resource.getResourceType()
+ "]. The Agent most likely has a plugin named '" +
plugin
+ "' installed that is not installed on the Server. Resource
will be ignored...");
return false;
@@ -1292,7 +1288,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
try {
this.availabilityManager.setResourceAvailabilities(resourceIds,
AvailabilityType.UNKNOWN);
} catch (Exception e) {
- log.error("Failed to reset availabilities for resources being ignored:
" + ThrowableUtil.getAllMessages(e));
+ LOG.error("Failed to reset availabilities for resources being ignored:
" + ThrowableUtil.getAllMessages(e));
}
return;
@@ -1367,7 +1363,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal,
DiscoveryBossRemot
ResourceCategory category = resource.getResourceType().getCategory();
if (category == ResourceCategory.PLATFORM) {
if (target == InventoryStatus.IGNORED &&
(resource.getInventoryStatus() == InventoryStatus.COMMITTED)) {
- log.warn("Cannot ignore a committed platform - skipping request
to ignore:" + resource);
+ LOG.warn("Cannot ignore a committed platform - skipping request
to ignore:" + resource);
} else {
platforms.add(resource);
}
commit cbd5dfa575bd337a9fb6007707a49f1b63a6da35
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Sep 26 12:35:58 2013 -0400
improve comments in generated rhq-server.properties
diff --git a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
index 41e8931..57d2012 100644
--- a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
+++ b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
@@ -793,20 +793,23 @@ rhq.sync.endpoint-address=false
# not be edited.
rhq.server.management.password=
-#############################################
-# Cassandra cluster configuration settings
-#############################################
-# The username RHQ will use to authenticate against Cassandra.
+# The username RHQ will use to authenticate against the Storage Cluster.
+# The value is generated and should not be edited.
rhq.storage.username=${rhq.storage.username}
-# The password RHQ will use to authenticate against Cassandra.
+# The password RHQ will use to authenticate against the Storage Cluster.
+# The value is generated and obfuscated and should not be edited.
rhq.storage.password=${rhq.storage.password}
-# A comma-delimited list of storage nodes. Each Cassandra node uses this list as
+#############################################
+# Storage cluster configuration settings
+#############################################
+
+# A comma-delimited list of storage nodes. Each Storage node uses this list as
# contact points to find other nodes in the cluster and learn the ring
# topology. The RHQ server(s) use this list to connect to the cluster;
-# therefore, this property MUST BE SET in order for RHQ to talk to Cassandra.
-# The of an entry is as follows,
+# therefore, this property MUST BE SET in order for RHQ to talk to the Storage.
+# Cluster. The of an entry is as follows:
#
# hostname1,hostname2
#
commit 09c7e488dcc099d890482de94e6a6098018a7e4b
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Sep 26 12:35:08 2013 -0400
Bug 1010841 - Installation of RHQ server fails - de-obfuscating db password failed
Fix in a way that won't suffer from ambiguity or db vendor incompatibilities.
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml
b/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml
index ebf7189..7213fc3 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml
@@ -148,9 +148,9 @@
<data ID="62" PROPERTY_KEY="STORAGE_GOSSIP_PORT"
FREAD_ONLY="TRUE"/>
- <data ID="63" PROPERTY_KEY="STORAGE_USERNAME"
PROPERTY_VALUE="" DEFAULT_PROPERTY_VALUE=""
FREAD_ONLY="TRUE"/>
+ <data ID="63" PROPERTY_KEY="STORAGE_USERNAME"
PROPERTY_VALUE="UNSET" DEFAULT_PROPERTY_VALUE="UNSET"
FREAD_ONLY="TRUE"/>
- <data ID="64" PROPERTY_KEY="STORAGE_PASSWORD"
PROPERTY_VALUE="" DEFAULT_PROPERTY_VALUE=""
FREAD_ONLY="TRUE"/>
+ <data ID="64" PROPERTY_KEY="STORAGE_PASSWORD"
PROPERTY_VALUE="UNSET" DEFAULT_PROPERTY_VALUE="UNSET"
FREAD_ONLY="TRUE"/>
</table>
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 94688f6..713aefe 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -2263,22 +2263,22 @@
<schema-directSQL>
<statement targetDBVendor="postgresql" desc="Adding
storage username">
INSERT INTO rhq_system_config (id, property_key, property_value,
default_property_value, fread_only)
- VALUES (63, 'STORAGE_USERNAME', null, null, true)
+ VALUES (63, 'STORAGE_USERNAME', 'UNSET',
'UNSET', true)
</statement>
<statement targetDBVendor="oracle" desc="Adding storage
username">
INSERT INTO rhq_system_config (id, property_key, property_value,
default_property_value, fread_only)
- VALUES (63, 'STORAGE_USERNAME', null, null, 1)
+ VALUES (63, 'STORAGE_USERNAME', 'UNSET',
'UNSET', 1)
</statement>
</schema-directSQL>
<schema-directSQL>
<statement targetDBVendor="postgresql" desc="Adding
storage password">
INSERT INTO rhq_system_config (id, property_key, property_value,
default_property_value, fread_only)
- VALUES (64, 'STORAGE_PASSWORD', null, null, true)
+ VALUES (64, 'STORAGE_PASSWORD', 'UNSET',
'UNSET', true)
</statement>
<statement targetDBVendor="oracle" desc="Adding default
storage password">
INSERT INTO rhq_system_config (id, property_key, property_value,
default_property_value, fread_only)
- VALUES (64, 'STORAGE_PASSWORD', null, null, 1)
+ VALUES (64, 'STORAGE_PASSWORD', 'UNSET',
'UNSET', 1)
</statement>
</schema-directSQL>
</schemaSpec>
diff --git
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
index 408442a..e10c993 100644
---
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
+++
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
@@ -50,7 +50,6 @@ import org.rhq.core.util.obfuscation.PicketBoxObfuscator;
import org.rhq.enterprise.server.installer.ServerInstallUtil.ExistingSchemaOption;
import org.rhq.enterprise.server.installer.ServerInstallUtil.SupportedDatabaseType;
-
/**
* @author John Mazzitelli
*/
@@ -61,6 +60,8 @@ public class InstallerServiceImpl implements InstallerService {
private static final String EAR_NAME = "rhq.ear";
private static final String SYSPROP_PROPFILE =
"rhq.server.properties-file";
+ private static final String UNSET = "UNSET";
+
private final Log log = LogFactory.getLog(InstallerServiceImpl.class);
private final InstallerConfiguration installerConfiguration;
@@ -508,16 +509,16 @@ public class InstallerServiceImpl implements InstallerService {
throw new Exception("Could not complete the database schema
installation", e);
}
- // if the storage cluster credentials are already set (typically an HA install),
override
+ // if the storage cluster credentials are already set in the DB (typically an HA
install), override
// what's currently in the server properties file, and then continue with
storage schema setup
Map<String, String> storageProperties =
ServerInstallUtil.fetchStorageClusterSettings(serverProperties,
clearTextDbPassword);
String storageUsernameSetting =
storageProperties.get(ServerProperties.PROP_STORAGE_USERNAME);
String storagePasswordSetting =
storageProperties.get(ServerProperties.PROP_STORAGE_PASSWORD);
- if (StringUtil.isNotBlank(storageUsernameSetting)) {
+ if (!(StringUtil.isBlank(storageUsernameSetting) ||
storageUsernameSetting.equals(UNSET))) {
serverProperties.put(ServerProperties.PROP_STORAGE_USERNAME,
storageUsernameSetting);
}
- if (StringUtil.isNotBlank(storagePasswordSetting)) {
+ if (!(StringUtil.isBlank(storagePasswordSetting) ||
storagePasswordSetting.equals(UNSET))) {
serverProperties.put(ServerProperties.PROP_STORAGE_PASSWORD,
storagePasswordSetting);
}
diff --git
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java
index c01ef5c..c5b66d7 100644
---
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java
+++
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java
@@ -1054,9 +1054,11 @@ public class ServerInstallUtil {
connection = getDatabaseConnection(dbUrl, userName, password);
connection.setAutoCommit(false);
- updateClusterSetting = connection.prepareStatement("UPDATE
rhq_system_config "
- + "SET property_value = ?, default_property_value = ? "
- + "WHERE property_key = ? AND property_value IS NULL AND
default_property_value IS NULL");
+ updateClusterSetting = connection.prepareStatement("" //
+ + "UPDATE rhq_system_config " //
+ + " SET property_value = ?, default_property_value = ? " //
+ + " WHERE property_key = ? " //
+ + " AND ( property_value IS NULL OR property_value = '' OR
property_value = 'UNSET' ) ");
updateClusterSetting.setString(1,
serverProperties.get(ServerProperties.PROP_STORAGE_USERNAME));
updateClusterSetting.setString(2,
serverProperties.get(ServerProperties.PROP_STORAGE_USERNAME));
commit b19ccea4c8917e9481326a376555c413a151fe95
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Sep 26 11:26:34 2013 -0400
Don't consider a blank string a valid storage username or password
diff --git
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
index 59c9360..408442a 100644
---
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
+++
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
@@ -43,12 +43,14 @@ import org.rhq.common.jbossas.client.controller.WebJBossASClient;
import org.rhq.core.db.DatabaseTypeFactory;
import org.rhq.core.domain.cloud.StorageNode;
import org.rhq.core.util.PropertiesFileUpdate;
+import org.rhq.core.util.StringUtil;
import org.rhq.core.util.exception.ThrowableUtil;
import org.rhq.core.util.obfuscation.Obfuscator;
import org.rhq.core.util.obfuscation.PicketBoxObfuscator;
import org.rhq.enterprise.server.installer.ServerInstallUtil.ExistingSchemaOption;
import org.rhq.enterprise.server.installer.ServerInstallUtil.SupportedDatabaseType;
+
/**
* @author John Mazzitelli
*/
@@ -512,10 +514,10 @@ public class InstallerServiceImpl implements InstallerService {
clearTextDbPassword);
String storageUsernameSetting =
storageProperties.get(ServerProperties.PROP_STORAGE_USERNAME);
String storagePasswordSetting =
storageProperties.get(ServerProperties.PROP_STORAGE_PASSWORD);
- if (null != storageUsernameSetting) {
+ if (StringUtil.isNotBlank(storageUsernameSetting)) {
serverProperties.put(ServerProperties.PROP_STORAGE_USERNAME,
storageUsernameSetting);
}
- if (null != storagePasswordSetting) {
+ if (StringUtil.isNotBlank(storagePasswordSetting)) {
serverProperties.put(ServerProperties.PROP_STORAGE_PASSWORD,
storagePasswordSetting);
}
commit bfb7aabc5a20c50ad3ecaee9e9c2f15f16a737e1
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Sep 26 10:48:36 2013 -0400
Update newly committed code with the storage prop name changes.
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
index 3d56c60..aca83c6 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
@@ -482,9 +482,9 @@ public abstract class AbstractInstall extends ControlCommand {
File basedirForData = new File(getBaseDir().getParentFile(),
"rhq-data");
// check that the data directories are set and convert to absolute dirs
- File dataDirProp = new File(storageProperties.getProperty("data",
"data"));
- File commitlogDirProp = new
File(storageProperties.getProperty("commitlog", "commit_log"));
- File savedcachesDirProp = new
File(storageProperties.getProperty("saved-caches", "saved_caches"));
+ File dataDirProp = new
File(storageProperties.getProperty("rhq.storage.data", "data"));
+ File commitlogDirProp = new
File(storageProperties.getProperty("rhq.storage.commitlog",
"commit_log"));
+ File savedcachesDirProp = new
File(storageProperties.getProperty("rhq.storage.saved-caches",
"saved_caches"));
if (!dataDirProp.isAbsolute()) {
dataDirProp = new File(basedirForData, dataDirProp.getPath());
@@ -518,9 +518,9 @@ public abstract class AbstractInstall extends ControlCommand {
if (rhqctlCommandLine.hasOption(STORAGE_DATA_ROOT_DIR)) {
StorageDataDirectories dataDirs;
dataDirs = getCustomStorageDataDirectories(rhqctlCommandLine);
- storageProperties.setProperty("data",
dataDirs.dataDir.getAbsolutePath());
- storageProperties.setProperty("commitlog",
dataDirs.commitlogDir.getAbsolutePath());
- storageProperties.setProperty("saved-caches",
dataDirs.savedcachesDir.getAbsolutePath());
+ storageProperties.setProperty("rhq.storage.data",
dataDirs.dataDir.getAbsolutePath());
+ storageProperties.setProperty("rhq.storage.commitlog",
dataDirs.commitlogDir.getAbsolutePath());
+ storageProperties.setProperty("rhq.storage.saved-caches",
dataDirs.savedcachesDir.getAbsolutePath());
}
// add the properties set in rhq-storage.properties to the command line
commit 8a5c8c38a145d0521d019360e3f2526f7604b1fa
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Sep 26 10:11:23 2013 -0400
Normalize storage props to be prefixed with "rhq.storage." and use the
props consistently, removing different names for the same logical value.
Also:
- remove the sslStoragePort setting, it was not actually supported
- improve some comments in the generated rhq-storage.properties file.
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/conf/rhq.cassandra.yaml
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/conf/rhq.cassandra.yaml
index 94ff227..97f6926 100644
---
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/conf/rhq.cassandra.yaml
+++
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/conf/rhq.cassandra.yaml
@@ -21,7 +21,7 @@ cluster_name: ${cluster.name}
#
# If you already have a cluster with 1 token per node, and wish to migrate to
# multiple tokens per node, see
http://wiki.apache.org/cassandra/Operations
-num_tokens: ${rhq.cassandra.num_tokens}
+num_tokens: ${rhq.storage.num_tokens}
# If you haven't specified num_tokens, or have set it to the default of 1 then
# you should always specify InitialToken when setting up a production
@@ -66,7 +66,7 @@ max_hints_delivery_threads: 2
# - PasswordAuthenticator relies on username/password pairs to authenticate
# users. It keeps usernames and hashed passwords in system_auth.credentials table.
# Please increase system_auth keyspace replication factor if you use this authenticator.
-authenticator: ${rhq.cassandra.authenticator}
+authenticator: ${rhq.storage.authenticator}
# Authorization backend, implementing IAuthorizer; used to limit access/provide
permissions
# Out of the box, Cassandra provides org.apache.cassandra.auth.{AllowAllAuthorizer,
@@ -75,7 +75,7 @@ authenticator: ${rhq.cassandra.authenticator}
# - AllowAllAuthorizer allows any action to any user - set it to disable authorization.
# - CassandraAuthorizer stores permissions in system_auth.permissions table. Please
# increase system_auth keyspace replication factor if you use this authorizer.
-authorizer: ${rhq.cassandra.authorizer}
+authorizer: ${rhq.storage.authorizer}
# Validity period for permissions cache (fetching permissions can be an
# expensive operation depending on the authorizer, CassandraAuthorizer is
@@ -110,10 +110,10 @@ partitioner: org.apache.cassandra.dht.Murmur3Partitioner
# will spread data evenly across them, subject to the granularity of
# the configured compaction strategy.
data_file_directories:
- - ${rhq.cassandra.data.dir}
+ - ${rhq.storage.data}
# commit log
-commitlog_directory: ${rhq.cassandra.commitlog.dir}
+commitlog_directory: ${rhq.storage.commitlog}
# policy for data disk failures:
# stop: shut down gossip and Thrift, leaving the node effectively dead, but
@@ -193,7 +193,7 @@ row_cache_save_period: 0
row_cache_provider: SerializingCacheProvider
# saved caches
-saved_caches_directory: ${rhq.cassandra.saved.caches.dir}
+saved_caches_directory: ${rhq.storage.saved-caches}
# commitlog_sync may be either "periodic" or "batch."
# When in batch mode, Cassandra won't ack writes until the commit log
@@ -232,7 +232,7 @@ seed_provider:
parameters:
# seeds is actually a comma-delimited list of addresses.
# Ex: "<ip1>,<ip2>,<ip3>"
- - seeds: "${rhq.cassandra.seeds}"
+ - seeds: "${rhq.storage.seeds}"
# emergency pressure valve: each time heap usage after a full (CMS)
# garbage collection is above this fraction of the max, Cassandra will
@@ -307,11 +307,11 @@ trickle_fsync: false
trickle_fsync_interval_in_kb: 10240
# TCP port, for commands and data
-storage_port: ${rhq.cassandra.storage.port}
+storage_port: ${rhq.storage.gossip-port}
# SSL port, for encrypted communication. Unused unless enabled in
# encryption_options
-ssl_storage_port: ${rhq.cassandra.ssl.storage.port}
+ssl_storage_port: 7101
# Address to bind to and tell other Cassandra nodes to connect to. You
# _must_ change this if you want multiple nodes to be able to
@@ -323,7 +323,7 @@ ssl_storage_port: ${rhq.cassandra.ssl.storage.port}
# address associated with the hostname (it might not be).
#
# Setting this to 0.0.0.0 is always wrong.
-listen_address: ${rhq.cassandra.listen.address}
+listen_address: ${rhq.storage.listen.address}
# Address to broadcast to other Cassandra nodes
# Leaving this blank will set it to the same value as listen_address
@@ -340,7 +340,7 @@ internode_authenticator:
org.rhq.cassandra.auth.RhqInternodeAuthenticator
# same as the rpc_address. The port however is different and specified below.
start_native_transport: true
# port for the CQL native transport to listen for clients on
-native_transport_port: ${rhq.cassandra.native_transport_port}
+native_transport_port: ${rhq.storage.cql-port}
# NOTE: native_transport_min_threads is now deprecated and ignored (but kept
# in the 1.2.x series for compatibility sake).
# The minimum and maximum threads for handling requests when the native
@@ -350,7 +350,7 @@ native_transport_port: ${rhq.cassandra.native_transport_port}
# native_transport_max_threads: 128
# Whether to start the thrift rpc server.
-start_rpc: ${rhq.cassandra.start_rpc}
+start_rpc: ${rhq.storage.start_rpc}
# The address to bind the Thrift RPC service and native transport
# server -- clients connect here.
@@ -364,7 +364,7 @@ start_rpc: ${rhq.cassandra.start_rpc}
# client drivers.
rpc_address: ${rpc.address}
# port for Thrift to listen for clients on
-rpc_port: ${rhq.cassandra.rpc_port}
+rpc_port: ${rhq.storage.rpc_port}
# enable or disable keepalive on rpc connections
rpc_keepalive: true
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/conf/rhq.log4j-server.properties
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/conf/rhq.log4j-server.properties
index e1b3cd4..fcea1b3 100644
---
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/conf/rhq.log4j-server.properties
+++
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/conf/rhq.log4j-server.properties
@@ -13,33 +13,26 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-
-# for production, you should probably set pattern to %c instead of %l.
-# (%l is slower.)
-
-# output messages into a rolling log file as well as stdout
-log4j.rootLogger=${rhq.cassandra.logging.level},stdout,R
-
-# stdout
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%5p %d{HH:mm:ss,SSS} %m%n
-
# rolling log file
-log4j.appender.R=org.apache.log4j.RollingFileAppender
-log4j.appender.R.maxFileSize=20MB
-log4j.appender.R.maxBackupIndex=50
-log4j.appender.R.layout=org.apache.log4j.PatternLayout
-log4j.appender.R.layout.ConversionPattern=%5p [%t] %d{ISO8601} %F (line %L) %m%n
+log4j.appender.R = org.apache.log4j.RollingFileAppender
# Edit the next line to point to your logs directory
-log4j.appender.R.File=${rhq.cassandra.log.file}
-log4j.appender.R.Threshold=${rhq.cassandra.logging.level}
-
+log4j.appender.R.File = ${rhq.storage.log.file}
+log4j.appender.R.Threshold = ${rhq.storage.logging.level}
+log4j.appender.R.layout = org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern = %5p [%t] %d{ISO8601} %F (line %L) %m%n
+log4j.appender.R.maxBackupIndex = 50
+log4j.appender.R.maxFileSize = 20MB
+# stdout
+log4j.appender.stdout = org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern = %5p %d{HH:mm:ss,SSS} %m%n
# Application logging options
#log4j.logger.org.apache.cassandra=DEBUG
#log4j.logger.org.apache.cassandra.db=DEBUG
#log4j.logger.org.apache.cassandra.service.StorageProxy=DEBUG
-
# Adding this to avoid thrift logging disconnect errors.
-log4j.logger.org.apache.thrift.server.TNonblockingServer=ERROR
-
+log4j.logger.org.apache.thrift.server.TNonblockingServer = ERROR
+# for production, you should probably set pattern to %c instead of %l.
+# (%l is slower.)
+# output messages into a rolling log file as well as stdout
+log4j.rootLogger = ${rhq.storage.logging.level},stdout,R
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/CassandraClusterManager.java
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/CassandraClusterManager.java
index 4a02e1d..a49d77d 100644
---
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/CassandraClusterManager.java
+++
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/CassandraClusterManager.java
@@ -144,7 +144,7 @@ public class CassandraClusterManager {
this.nodes = new String[deploymentOptions.getNumNodes()];
this.jmxPorts = new int[deploymentOptions.getNumNodes()];
- this.cqlPort = deploymentOptions.getNativeTransportPort();
+ this.cqlPort = deploymentOptions.getCqlPort();
for (int i = 0; i < deploymentOptions.getNumNodes(); ++i) {
File basedir = new File(deploymentOptions.getClusterDir(), "node" +
i);
@@ -240,7 +240,7 @@ public class CassandraClusterManager {
this.jmxPorts[i] = deploymentOptions.getJmxPort() + i;
}
- this.cqlPort = deploymentOptions.getNativeTransportPort();
+ this.cqlPort = deploymentOptions.getCqlPort();
}
public void startCluster() {
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/DeploymentOptions.java
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/DeploymentOptions.java
index 36620c2..cbe408d 100644
---
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/DeploymentOptions.java
+++
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/DeploymentOptions.java
@@ -73,7 +73,7 @@ public class DeploymentOptions {
private Boolean embedded;
private String loggingLevel;
private Integer numTokens;
- private Integer nativeTransportPort;
+ private Integer cqlPort;
private Boolean startRpc;
private Integer rpcPort;
private Integer nativeTransportMaxThreads;
@@ -87,8 +87,7 @@ public class DeploymentOptions {
private String listenAddress;
private String rpcAddress;
private Integer jmxPort;
- private Integer storagePort;
- private Integer sslStoragePort;
+ private Integer gossipPort;
private String seeds;
private String heapSize;
private String heapNewSize;
@@ -138,34 +137,38 @@ public class DeploymentOptions {
setUsername(loadProperty("rhq.storage.username", properties));
setPassword(loadProperty("rhq.storage.password", properties));
- setClusterDir(loadProperty("rhq.cassandra.cluster.dir", properties));
-
setNumNodes(Integer.parseInt(loadProperty("rhq.cassandra.cluster.num-nodes",
properties)));
-
setEmbedded(Boolean.valueOf(loadProperty("rhq.cassandra.cluster.is-embedded",
properties)));
- setLoggingLevel(loadProperty("rhq.cassandra.logging.level",
properties));
+ setBasedir(loadProperty("rhq.storage.basedir", properties));
+ setClusterDir(loadProperty("rhq.storage.cluster.dir", properties));
+
setNumNodes(Integer.parseInt(loadProperty("rhq.storage.cluster.num-nodes",
properties)));
+
setEmbedded(Boolean.valueOf(loadProperty("rhq.storage.cluster.is-embedded",
properties)));
- setNumTokens(Integer.valueOf(loadProperty("rhq.cassandra.num-tokens",
properties)));
-
setNativeTransportPort(Integer.valueOf(loadProperty("rhq.cassandra.native-transport-port",
properties)));
- setRpcPort(Integer.valueOf(loadProperty("rhq.cassandra.rpc-port",
properties)));
-
setNativeTransportMaxThreads(Integer.valueOf(loadProperty("rhq.cassandra.native-transport-max-threads",
+ setLoggingLevel(loadProperty("rhq.storage.logging.level",
properties));
+ setLogFileName(loadProperty("rhq.storage.log.file", properties));
+
+ setRpcPort(Integer.valueOf(loadProperty("rhq.storage.rpc-port",
properties)));
+ setCqlPort(Integer.valueOf(loadProperty("rhq.storage.cql-port",
properties)));
+ setJmxPort(Integer.valueOf(loadProperty("rhq.storage.jmx-port",
properties)));
+ setGossipPort(Integer.valueOf(loadProperty("rhq.storage.gossip-port",
properties)));
+
+ setNumTokens(Integer.valueOf(loadProperty("rhq.storage.num-tokens",
properties)));
+
setNativeTransportMaxThreads(Integer.valueOf(loadProperty("rhq.storage.native-transport-max-threads",
properties)));
- setAuthenticator(loadProperty("rhq.cassandra.authenticator",
properties));
- setAuthorizer(loadProperty("rhq.cassandra.authorizer", properties));
- setDataDir(loadProperty("rhq.cassandra.data.dir", properties));
- setCommitLogDir(loadProperty("rhq.cassandra.commitlog.dir",
properties));
- setSavedCachesDir(loadProperty("rhq.cassandra.saved.caches.dir",
properties));
- setLogFileName(loadProperty("rhq.cassandra.log.file", properties));
- setListenAddress(loadProperty("rhq.cassandra.listen.address",
properties));
- setStartRpc(Boolean.valueOf(loadProperty("rhq.cassandra.start_rpc",
properties)));
- setRpcAddress(loadProperty("rhq.cassandra.rpc.address", properties));
- setJmxPort(Integer.valueOf(loadProperty("rhq.cassandra.jmx.port",
properties)));
-
setStoragePort(Integer.valueOf(loadProperty("rhq.cassandra.storage.port",
properties)));
-
setSslStoragePort(Integer.valueOf(loadProperty("rhq.cassandra.ssl.storage.port",
properties)));
-
- setSeeds(loadProperty("rhq.cassandra.seeds", properties));
- setBasedir(loadProperty("rhq.cassandra.basedir", properties));
- setHeapSize(loadProperty("rhq.cassandra.max.heap.size", properties));
- setHeapNewSize(loadProperty("rhq.cassandra.heap.new.size",
properties));
- setStackSize(loadProperty("rhq.cassandra.stack.size", properties));
+
+ setAuthenticator(loadProperty("rhq.storage.authenticator",
properties));
+ setAuthorizer(loadProperty("rhq.storage.authorizer", properties));
+
+ setDataDir(loadProperty("rhq.storage.data", properties));
+ setCommitLogDir(loadProperty("rhq.storage.commitlog", properties));
+ setSavedCachesDir(loadProperty("rhq.storage.saved-caches",
properties));
+
+ setSeeds(loadProperty("rhq.storage.seeds", properties));
+ setListenAddress(loadProperty("rhq.storage.listen.address",
properties));
+ setStartRpc(Boolean.valueOf(loadProperty("rhq.storage.start_rpc",
properties)));
+ setRpcAddress(loadProperty("rhq.storage.rpc.address", properties));
+
+ setHeapSize(loadProperty("rhq.storage.heap-size", properties));
+ setHeapNewSize(loadProperty("rhq.storage.heap-new-size", properties));
+ setStackSize(loadProperty("rhq.storage.stack-size", properties));
}
private String loadProperty(String key, Properties properties) {
@@ -182,7 +185,7 @@ public class DeploymentOptions {
setEmbedded(other.embedded);
setLoggingLevel(other.loggingLevel);
setNumTokens(other.numTokens);
- setNativeTransportPort(other.nativeTransportPort);
+ setCqlPort(cqlPort);
setNativeTransportMaxThreads(other.nativeTransportMaxThreads);
setUsername(other.username);
setPassword(other.password);
@@ -197,8 +200,7 @@ public class DeploymentOptions {
setStartRpc(other.startRpc);
setRpcPort(other.rpcPort);
setJmxPort(other.jmxPort);
- setStoragePort(other.storagePort);
- setSslStoragePort(other.sslStoragePort);
+ setGossipPort(other.gossipPort);
setSeeds(other.seeds);
setBasedir(other.basedir);
setHeapSize(other.heapSize);
@@ -252,7 +254,7 @@ public class DeploymentOptions {
/**
* @return The directory in which the node will be installed.
*/
- @DeploymentProperty(name = "rhq.cassandra.basedir")
+ @DeploymentProperty(name = "rhq.storage.basedir")
public String getBasedir() {
return basedir;
}
@@ -269,7 +271,7 @@ public class DeploymentOptions {
/**
* @return The number of nodes in the cluster. This only applies to embedded
clusters.
*/
- @DeploymentProperty(name = "rhq.cassandra.cluster.num-nodes")
+ @DeploymentProperty(name = "rhq.storage.cluster.num-nodes")
public int getNumNodes() {
return numNodes;
}
@@ -289,7 +291,7 @@ public class DeploymentOptions {
* embedded cluster is one in which all nodes run on a single host and can only
accept
* requests from that same host.
*/
- @DeploymentProperty(name = "rhq.cassandra.cluster.is-embedded")
+ @DeploymentProperty(name = "rhq.storage.cluster.is-embedded")
public boolean isEmbedded() {
return embedded;
}
@@ -308,7 +310,7 @@ public class DeploymentOptions {
/**
* @return The log4j logging level that Cassandra uses
*/
- @DeploymentProperty(name = "rhq.cassandra.logging.level")
+ @DeploymentProperty(name = "rhq.storage.logging.level")
public String getLoggingLevel() {
return loggingLevel;
}
@@ -325,7 +327,7 @@ public class DeploymentOptions {
/**
* @return The number of tokens assigned to this the node on the ring. Defaults to
256.
*/
- @DeploymentProperty(name = "rhq.cassandra.num_tokens")
+ @DeploymentProperty(name = "rhq.storage.num_tokens")
public Integer getNumTokens() {
return numTokens;
}
@@ -343,24 +345,24 @@ public class DeploymentOptions {
/**
* @return The port on which Cassandra listens for client requests.
*/
- @DeploymentProperty(name = "rhq.cassandra.native_transport_port")
- public Integer getNativeTransportPort() {
- return nativeTransportPort;
+ @DeploymentProperty(name = "rhq.storage.cql-port")
+ public Integer getCqlPort() {
+ return cqlPort;
}
/**
* @param port The port on which Cassandra listens for client requests.
*/
- public void setNativeTransportPort(Integer port) {
- if (nativeTransportPort == null) {
- nativeTransportPort = port;
+ public void setCqlPort(Integer port) {
+ if (cqlPort == null) {
+ cqlPort = port;
}
}
/**
* @return true whether the Thrift-based RPC should be started
*/
- @DeploymentProperty(name = "rhq.cassandra.start_rpc")
+ @DeploymentProperty(name = "rhq.storage.start_rpc")
public Boolean getStartRpc() {
return startRpc;
}
@@ -374,7 +376,7 @@ public class DeploymentOptions {
}
}
- @DeploymentProperty(name = "rhq.cassandra.rpc_port")
+ @DeploymentProperty(name = "rhq.storage.rpc_port")
public Integer getRpcPort() {
return rpcPort;
}
@@ -388,7 +390,7 @@ public class DeploymentOptions {
/**
* @return The max number of threads to handle CQL requests
*/
- @DeploymentProperty(name = "rhq.cassandra.native_transport_max_threads")
+ @DeploymentProperty(name = "rhq.storage.native_transport_max_threads")
public Integer getNativeTransportMaxThreads() {
return nativeTransportMaxThreads;
}
@@ -449,7 +451,7 @@ public class DeploymentOptions {
/**
* @return The FQCN of the class that handles Cassandra authentication
*/
- @DeploymentProperty(name = "rhq.cassandra.authenticator")
+ @DeploymentProperty(name = "rhq.storage.authenticator")
public String getAuthenticator() {
return authenticator;
}
@@ -466,7 +468,7 @@ public class DeploymentOptions {
/**
* @return The FQCN of the class that handles Cassandra authorization
*/
- @DeploymentProperty(name = "rhq.cassandra.authorizer")
+ @DeploymentProperty(name = "rhq.storage.authorizer")
public String getAuthorizer() {
return authorizer;
}
@@ -483,7 +485,7 @@ public class DeploymentOptions {
/**
* @return The directory where Cassandra stores data on disk
*/
- @DeploymentProperty(name = "rhq.cassandra.data.dir")
+ @DeploymentProperty(name = "rhq.storage.data")
public String getDataDir() {
return dataDir;
}
@@ -500,7 +502,7 @@ public class DeploymentOptions {
/**
* @return The directory where Cassandra stores commit log files
*/
- @DeploymentProperty(name = "rhq.cassandra.commitlog.dir")
+ @DeploymentProperty(name = "rhq.storage.commitlog")
public String getCommitLogDir() {
return commitLogDir;
}
@@ -517,7 +519,7 @@ public class DeploymentOptions {
/**
* @return The directory where Cassandra stores saved caches on disk
*/
- @DeploymentProperty(name = "rhq.cassandra.saved.caches.dir")
+ @DeploymentProperty(name = "rhq.storage.saved-caches")
public String getSavedCachesDir() {
return savedCachesDir;
}
@@ -534,7 +536,7 @@ public class DeploymentOptions {
/**
* @return The full path of the Log4J log file to which Cassandra writes.
*/
- @DeploymentProperty(name = "rhq.cassandra.log.file")
+ @DeploymentProperty(name = "rhq.storage.log.file")
public String getLogFileName() {
return logFileName;
}
@@ -551,7 +553,7 @@ public class DeploymentOptions {
/**
* @return The address to which Cassandra binds and tells other node to connect to
*/
- @DeploymentProperty(name = "rhq.cassandra.listen.address")
+ @DeploymentProperty(name = "rhq.storage.listen.address")
public String getListenAddress() {
return listenAddress;
}
@@ -579,7 +581,7 @@ public class DeploymentOptions {
/**
* @return The port on which Cassandra listens for JMX connections
*/
- @DeploymentProperty(name = "rhq.cassandra.jmx.port")
+ @DeploymentProperty(name = "rhq.storage.jmx-port")
public Integer getJmxPort() {
return jmxPort;
}
@@ -596,36 +598,17 @@ public class DeploymentOptions {
/**
* @return The port on which Cassandra listens for gossip requests
*/
- @DeploymentProperty(name = "rhq.cassandra.storage.port")
- public Integer getStoragePort() {
- return storagePort;
+ @DeploymentProperty(name = "rhq.storage.gossip-port")
+ public Integer getGossipPort() {
+ return gossipPort;
}
/**
* @param port The port on which Cassandra listens for gossip requests
*/
- public void setStoragePort(Integer port) {
- if (storagePort == null) {
- storagePort = port;
- }
- }
-
- /**
- * @return The port on which Cassandra listens for encrypted gossip requests. Note
that
- * this is only used if encryption is enabled.
- */
- @DeploymentProperty(name = "rhq.cassandra.ssl.storage.port")
- public Integer getSslStoragePort() {
- return sslStoragePort;
- }
-
- /**
- * @param port The port on which Cassandra listens for encrypted gossip requests.
Note
- * that this is only used if encryption is enabled.
- */
- public void setSslStoragePort(Integer port) {
- if (sslStoragePort == null) {
- sslStoragePort = port;
+ public void setGossipPort(Integer port) {
+ if (gossipPort == null) {
+ gossipPort = port;
}
}
@@ -633,7 +616,7 @@ public class DeploymentOptions {
* @return A comma-delimited list of IP addresses/host names that are deemed contact
* points during node start up to learn about the ring topology.
*/
- @DeploymentProperty(name = "rhq.cassandra.seeds")
+ @DeploymentProperty(name = "rhq.storage.seeds")
public String getSeeds() {
return seeds;
}
@@ -652,7 +635,7 @@ public class DeploymentOptions {
* @return The value to use for both the max and min heap sizes. Defaults to
* ${MAX_HEAP_SIZE} which allows the cassandra-env.sh script to determine the value.
*/
- @DeploymentProperty(name = "rhq.cassandra.max.heap.size")
+ @DeploymentProperty(name = "rhq.storage.heap-size")
public String getHeapSize() {
return heapSize;
}
@@ -671,7 +654,7 @@ public class DeploymentOptions {
* @return The value to use for the size of the new generation. Defaults to
* ${HEAP_NEWSIZE} which allows the cassandra-env.sh script to determine the value.
*/
- @DeploymentProperty(name = "rhq.cassandra.heap.new.size")
+ @DeploymentProperty(name = "rhq.storage.heap-new-size")
public String getHeapNewSize() {
return heapNewSize;
}
@@ -691,7 +674,7 @@ public class DeploymentOptions {
* @return The value to use for the JVM stack size. This is passed directly to the
-Xss
* JVM start up option.
*/
- @DeploymentProperty(name = "rhq.cassandra.stack.size")
+ @DeploymentProperty(name = "rhq.storage.stack-size")
public String getStackSize() {
return stackSize;
}
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/DeploymentOptionsFactory.java
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/DeploymentOptionsFactory.java
index 7a3f207..5aa138c 100644
---
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/DeploymentOptionsFactory.java
+++
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/DeploymentOptionsFactory.java
@@ -39,7 +39,7 @@ public class DeploymentOptionsFactory {
*/
public DeploymentOptions newDeploymentOptions() {
// Make sure we have a high enough stack size. See
https://bugzilla.redhat.com/show_bug.cgi?id=1008090
- System.setProperty("rhq.cassandra.stack.size", "256k");
+ System.setProperty("rhq.storage.stack-size", "256k");
return new DeploymentOptions();
}
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/cassandra.properties
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/cassandra.properties
index e44b3ac..3f565c1 100644
---
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/cassandra.properties
+++
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/cassandra.properties
@@ -4,7 +4,7 @@
# The directory in which Cassandra is installed. This property must be
# specified.
-rhq.cassandra.basedir=${rhq.rootDir}
+rhq.storage.basedir=${rhq.rootDir}
# The username with which to authenticate requests to Cassandra.
# rhq.storage.username=
@@ -18,77 +18,73 @@ rhq.cassandra.basedir=${rhq.rootDir}
# hardware capability. Tokens are randomly generated with the expectation of an even
# distribution. With that said, there can be some variation. Either increasing this
value
# or increasing the number of nodes in the cluster will help even out the distribution.
-rhq.cassandra.num-tokens=256
+rhq.storage.num-tokens=256
# A comma-delimited list of IP addresses/host names that are deemed contact points.
# Cassandra nodes use this list of hosts to find each other and learn the
# topology of the ring. If you are running a local development cluster, be sure
# to have aliases set up for localhost.
-rhq.cassandra.seeds=localhost
+rhq.storage.seeds=localhost
# A class that performs authentication. The value should be a fully qualified class name
# and implement IAuthenticator.
-rhq.cassandra.authenticator=org.apache.cassandra.auth.PasswordAuthenticator
+rhq.storage.authenticator=org.apache.cassandra.auth.PasswordAuthenticator
# A class that performs authorization. Used to limit/provide permissions. The value
should
# be a fully qualified class name and implement IAuthorizer.
-rhq.cassandra.authorizer=org.apache.cassandra.auth.CassandraAuthorizer
+rhq.storage.authorizer=org.apache.cassandra.auth.CassandraAuthorizer
# The IP address or hostname that other Cassandra nodes will use to connect to
# this node.
-rhq.cassandra.listen.address=localhost
+rhq.storage.listen.address=localhost
# Set this property to true for starting the Thrift-based RPC
-rhq.cassandra.start_rpc=false
+rhq.storage.start_rpc=false
# The listen address for Thrift clients.
-rhq.cassandra.rpc.address=localhost
+rhq.storage.rpc.address=localhost
# The port to listen for Thrift clients on.
-rhq.cassandra.rpc-port=9160
+rhq.storage.rpc-port=9160
# The maximum number of threads handling native CQL requests.
-rhq.cassandra.native-transport-max-threads=64
+rhq.storage.native-transport-max-threads=64
# The port for the CQL native transport to listen for clients on.
-rhq.cassandra.native-transport-port=9042
+rhq.storage.cql-port=9042
# The port over which Cassandra listens for JMX connections.
-rhq.cassandra.jmx.port=7200
+rhq.storage.jmx-port=7200
# TCP port, for commands and data (i.e., inter-node communication)
-rhq.cassandra.storage.port=7000
-
-# SSL port, for encrypted communication. Unused unless enabled in
-# encryption_options (i.e., encrypted inter-node communication)
-rhq.cassandra.ssl.storage.port=7001
+rhq.storage.gossip-port=7000
# The directory where Cassandra stores data files.
-rhq.cassandra.data.dir=${rhq.cassandra.basedir}/data
+rhq.storage.data=${rhq.storage.basedir}/data
# Th directory where Cassandra stores commit log files.
-rhq.cassandra.commitlog.dir=${rhq.cassandra.basedir}/commit_log
+rhq.storage.commitlog=${rhq.storage.basedir}/commit_log
# The directory where Cassandra stores saved caches.
-rhq.cassandra.saved.caches.dir=${rhq.cassandra.basedir}/saved_caches
+rhq.storage.saved-caches=${rhq.storage.basedir}/saved_caches
# The directory where Cassandra stored log4j log files.
-rhq.cassandra.log.dir=${rhq.cassandra.basedir}/logs
+rhq.storage.log.dir=${rhq.storage.basedir}/logs
# The log file to which Cassandra writes.
-rhq.cassandra.log.file=${rhq.cassandra.basedir}/logs/rhq-storage-node.log
+rhq.storage.log.file=${rhq.storage.basedir}/logs/rhq-storage-node.log
# Used for both the min and max heap sizes for the Cassandra JVM.
-rhq.cassandra.max.heap.size=\${MAX_HEAP_SIZE}
+rhq.storage.heap-size=\${MAX_HEAP_SIZE}
# Heap new size refers to the size of the young generation.
-rhq.cassandra.heap.new.size=\${HEAP_NEWSIZE}
+rhq.storage.heap-new-size=\${HEAP_NEWSIZE}
# The JVM stack size for Cassandra. This value is passed directly to the -Xss option.
-rhq.cassandra.stack.size=256k
+rhq.storage.stack-size=256k
# The log4j logging level to use.
-rhq.cassandra.logging.level=DEBUG
+rhq.storage.logging.level=DEBUG
# The remaining properties pertain to cluster configuration and are only used in
# development and testing environments when an embedded cluster is used. These
properties
@@ -102,16 +98,16 @@ rhq.cassandra.logging.level=DEBUG
# Accepts a value of true or false and specifies whether or not the cluster is embedded.
# Note that if this property is set to false, the other, remaining cluster configuration
# properties that are set will be ignored as they are only used with embedded clusters.
-rhq.cassandra.cluster.is-embedded=true
+rhq.storage.cluster.is-embedded=true
###################################################################
# Properties below this point apply ONLY to embedded clusters. #
###################################################################
# The directory in which cluster nodes will be installed.
-rhq.cassandra.cluster.dir=${rhq.rootDir}/cassandra
+rhq.storage.cluster.dir=${rhq.rootDir}/cassandra
# The number of nodes in the cluster. This specifies how many nodes to install and
# configure. The top level or base directory for each node will be nodeN where N is the
# node number.
-rhq.cassandra.cluster.num-nodes=2
+rhq.storage.cluster.num-nodes=2
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/java/org/rhq/cassandra/DeployerITest.java
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/java/org/rhq/cassandra/DeployerITest.java
index 76ff090..86c382d 100644
---
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/java/org/rhq/cassandra/DeployerITest.java
+++
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/java/org/rhq/cassandra/DeployerITest.java
@@ -33,15 +33,15 @@ import java.io.File;
import java.io.FileReader;
import java.util.List;
+import difflib.DiffUtils;
+import difflib.Patch;
+
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.rhq.core.util.StringUtil;
import org.rhq.core.util.stream.StreamUtil;
-import difflib.DiffUtils;
-import difflib.Patch;
-
/**
* @author John Sanda
*/
@@ -81,7 +81,7 @@ public class DeployerITest {
assertTrue(binDir.exists(), binDir + " does not exist");
File confDir = new File(deployDir, "conf");
- assertTrue(confDir.exists(), confDir + " does not exist");
+ assertTrue(confDir.exists(), confDir + " does not exist");
File libDir = new File(deployDir, "lib");
assertTrue(libDir.exists(), libDir + " does not exist");
@@ -89,7 +89,14 @@ public class DeployerITest {
@Test(dependsOnMethods = "deploy")
public void applyConfigChanges() throws Exception {
- deployer.applyConfigChanges();
+ try {
+ deployer.applyConfigChanges();
+ } catch (DeploymentException e) {
+ // on windows the update will fail when looking for the wrapper file
+ if (!(File.separatorChar == '\\' &&
e.getMessage().contains("rhq-storage-wrapper.env"))) {
+ throw e;
+ }
+ }
}
@Test(dependsOnMethods = "applyConfigChanges")
@@ -110,15 +117,15 @@ public class DeployerITest {
private void assertFileDeployedAndUpdated(String fileName) throws Exception {
File rhqFile = new File(confDir, "rhq." + fileName);
File file = new File(confDir, fileName);
- assertTrue(file.exists(), file + " does not exist");
+ assertTrue(file.exists(), file + " does not exist");
assertFalse(rhqFile.exists(), "Failed to delete " + rhqFile);
assertFileUpdated(file);
}
private void assertFileUpdated(File actualFile) throws Exception {
File expectedFile = new File(getClass().getResource("/expected." +
actualFile.getName()).toURI());
- assertTrue(expectedFile.exists(), "Cannot verify that " +
actualFile.getName() + " has been updated. There " +
- "should be a file named expected." + actualFile.getName() + "
in the root of the test classpath.");
+ assertTrue(expectedFile.exists(), "Cannot verify that " +
actualFile.getName() + " has been updated. There "
+ + "should be a file named expected." + actualFile.getName() +
" in the root of the test classpath.");
String actualContents = StreamUtil.slurp(new FileReader(actualFile));
List<String> actualList = asList(actualContents.split("\\n"));
@@ -127,10 +134,10 @@ public class DeployerITest {
List<String> expectedList =
asList(expectedContents.split("\\n"));
Patch patch = DiffUtils.diff(actualList, expectedList);
- List<String> diffs = DiffUtils.generateUnifiedDiff(actualFile.getName(),
"expected.cassandra.yaml",
- actualList, patch, 5);
- assertTrue(patch.getDeltas().isEmpty(), actualFile.getName() + " was not
configured correctly. The " +
- "following differences were found:\n" +
StringUtil.listToString(diffs, "\n"));
+ List<String> diffs = DiffUtils.generateUnifiedDiff(actualFile.getName(),
"expected.cassandra.yaml", actualList,
+ patch, 5);
+ assertTrue(patch.getDeltas().isEmpty(), actualFile.getName() + " was not
configured correctly. The "
+ + "following differences were found:\n" +
StringUtil.listToString(diffs, "\n"));
}
}
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/resources/expected.cassandra.yaml
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/resources/expected.cassandra.yaml
index 1aa6f87..90f298e 100644
---
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/resources/expected.cassandra.yaml
+++
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/test/resources/expected.cassandra.yaml
@@ -311,7 +311,7 @@ storage_port: 7000
# SSL port, for encrypted communication. Unused unless enabled in
# encryption_options
-ssl_storage_port: 7001
+ssl_storage_port: 7101
# Address to bind to and tell other Cassandra nodes to connect to. You
# _must_ change this if you want multiple nodes to be able to
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-testng/src/main/java/org/rhq/cassandra/CCMTestNGListener.java
b/modules/common/cassandra-ccm/cassandra-ccm-testng/src/main/java/org/rhq/cassandra/CCMTestNGListener.java
index ab58c95..286a5ff 100644
---
a/modules/common/cassandra-ccm/cassandra-ccm-testng/src/main/java/org/rhq/cassandra/CCMTestNGListener.java
+++
b/modules/common/cassandra-ccm/cassandra-ccm-testng/src/main/java/org/rhq/cassandra/CCMTestNGListener.java
@@ -56,8 +56,8 @@ public class CCMTestNGListener implements IInvokedMethodListener {
Method method =
invokedMethod.getTestMethod().getConstructorOrMethod().getMethod();
if (method.isAnnotationPresent(ShutdownCluster.class)) {
try {
- Boolean skipShutdown = Boolean.valueOf(
- System.getProperty("rhq.cassandra.cluster.skip-shutdown",
"false"));
+ Boolean skipShutdown = Boolean
+
.valueOf(System.getProperty("rhq.storage.cluster.skip-shutdown",
"false"));
if (!skipShutdown) {
shutdownCluster();
}
@@ -68,12 +68,12 @@ public class CCMTestNGListener implements IInvokedMethodListener {
}
private void deployCluster(DeployCluster annotation) throws Exception {
- boolean deploy =
Boolean.valueOf(System.getProperty("rhq.cassandra.cluster.deploy",
"true"));
+ boolean deploy =
Boolean.valueOf(System.getProperty("rhq.storage.cluster.deploy",
"true"));
if (!deploy) {
return;
}
- String clusterDir = System.getProperty("rhq.cassandra.cluster.dir");
+ String clusterDir = System.getProperty("rhq.storage.cluster.dir");
if (clusterDir == null || clusterDir.isEmpty()) {
File basedir = new File("target");
clusterDir = new File(basedir, "cassandra").getAbsolutePath();
@@ -102,7 +102,7 @@ public class CCMTestNGListener implements IInvokedMethodListener {
String[] nodes = ccm.getNodes();
int[] jmxPorts = ccm.getJmxPorts();
- if (System.getProperty("rhq.cassandra.cluster.skip-shutdown") == null)
{
+ if (System.getProperty("rhq.storage.cluster.skip-shutdown") == null) {
for (int index = 0; index < nodes.length; index++) {
try {
if (clusterInitService.isNativeTransportRunning(nodes[index],
jmxPorts[index])) {
@@ -115,7 +115,6 @@ public class CCMTestNGListener implements IInvokedMethodListener {
}
ccm.startCluster(false);
-
clusterInitService.waitForClusterToStart(nodes, jmxPorts, nodes.length, 2000, 20,
10);
SchemaManager schemaManager = new SchemaManager(annotation.username(),
annotation.password(), nodes,
diff --git
a/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
b/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
index 295c7ed..58c04ac 100644
---
a/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
+++
b/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
@@ -105,9 +105,20 @@ public class StorageInstaller {
private final String STORAGE_BASEDIR = "rhq-storage";
- private final Log log = LogFactory.getLog(StorageInstaller.class);
+ private static final String OPTION_HOSTNAME = "rhq.storage.hostname";
+ private static final String OPTION_SEEDS = "rhq.storage.seeds";
+ private static final String OPTION_CQL_PORT = "rhq.storage.cql-port";
+ private static final String OPTION_JMX_PORT = "rhq.storage.jmx-port";
+ private static final String OPTION_GOSSIP_PORT =
"rhq.storage.gossip-port";
+ private static final String OPTION_COMMITLOG = "rhq.storage.commitlog";
+ private static final String OPTION_DATA = "rhq.storage.data";
+ private static final String OPTION_SAVED_CACHES =
"rhq.storage.saved-caches";
+ private static final String OPTION_HEAP_SIZE = "rhq.storage.heap-size";
+ private static final String OPTION_HEAP_NEW_SIZE =
"rhq.storage.heap-new-size";
+ private static final String OPTION_STACK_SIZE = "rhq.storage.stack-size";
+ private static final String OPTION_VERIFY_DATA_DIRS_EMPTY =
"rhq.storage.verify-data-dirs-empty";
- private final String VERIFY_DATA_DIRS_EMPTY = "verify-data-dirs-empty";
+ private final Log log = LogFactory.getLog(StorageInstaller.class);
private Options options;
@@ -119,11 +130,9 @@ public class StorageInstaller {
private int rpcPort = 9160;
- private int defaultNativeTransportPort = 9142;
-
- private int defaultStoragePort = 7100;
+ private int defaultCqlPort = 9142;
- private int sslStoragePort = 7101;
+ private int defaultGossipPort = 7100;
private File logDir;
@@ -137,28 +146,28 @@ public class StorageInstaller {
storageBasedir = new File(basedir, STORAGE_BASEDIR);
logDir = new File(serverBasedir, "logs");
- Option hostname = new Option("n", "hostname", true,
+ Option hostname = new Option("n", OPTION_HOSTNAME, true,
"The hostname or IP address on which the node will listen for "
- + "requests. Note that if a hostname is specified, the IP address is
used. Defaults to the IP " +
- "address of the local host (which depending on hostname configuration
may not be localhost).");
+ + "requests. Note that if a hostname is specified, the IP address is
used. Defaults to the IP "
+ + "address of the local host (which depending on hostname
configuration may not be localhost).");
hostname.setArgName("HOSTNAME");
- Option seeds = new Option("s", "seeds", true, "A
comma-delimited list of hostnames or IP addresses that "
+ Option seeds = new Option("s", OPTION_SEEDS, true, "A
comma-delimited list of hostnames or IP addresses that "
+ "serve as contact points. Nodes use this list to find each other and
to learn the cluster topology. "
+ "It does not need to specify all nodes in the cluster. Defaults to
this node's hostname.");
seeds.setArgName("SEEDS");
- Option jmxPortOption = new Option("j", "jmx-port", true,
"The port on which to listen for JMX connections. "
- + "Defaults to " + defaultJmxPort + ".");
+ Option jmxPortOption = new Option("j", OPTION_JMX_PORT, true,
+ "The port on which to listen for JMX connections. " +
"Defaults to " + defaultJmxPort + ".");
jmxPortOption.setArgName("PORT");
- Option nativeTransportPortOption = new Option("c",
"client-port", true, "The port on which to "
- + "listen for client requests. Defaults to " +
defaultNativeTransportPort);
- nativeTransportPortOption.setArgName("PORT");
+ Option cqlPortOption = new Option("c", OPTION_CQL_PORT, true, "The
port on which to "
+ + "listen for client requests. Defaults to " + defaultCqlPort);
+ cqlPortOption.setArgName("PORT");
- Option storagePortOption = new Option(null, "storage-port", true,
"The port on which to listen for requests "
- + " from other nodes. Defaults to " + defaultStoragePort);
- storagePortOption.setArgName("PORT");
+ Option gossipPortOption = new Option(null, OPTION_GOSSIP_PORT, true,
+ "The port on which to listen for requests " + " from other
nodes. Defaults to " + defaultGossipPort);
+ gossipPortOption.setArgName("PORT");
Option startOption = new Option(null, "start", true, "Start the
storage node after installing it on disk. "
+ "Defaults to true.");
@@ -168,45 +177,49 @@ public class StorageInstaller {
+ "after starting it. This option is ignored if the start option is not
set. Defaults to true.");
checkStatus.setArgName("true|false");
- Option commitLogOption = new Option(null, "commitlog", true, "The
directory where the storage node keeps "
+ Option commitLogOption = new Option(null, OPTION_COMMITLOG, true, "The
directory where the storage node keeps "
+ "commit log files. Defaults to " + getDefaultCommitLogDir() +
".");
commitLogOption.setArgName("DIR");
- Option dataDirOption = new Option(null, "data", true, "The
directory where the storage node keeps data files. "
- + "Defaults to " + getDefaultDataDir() + ".");
+ Option dataDirOption = new Option(null, OPTION_DATA, true,
+ "The directory where the storage node keeps data files. " +
"Defaults to " + getDefaultDataDir() + ".");
dataDirOption.setArgName("DIR");
- Option savedCachesDirOption = new Option(null, "saved-caches", true,
"The directory where the storage node "
- + "keeps saved cache files. Defaults to " +
getDefaultSavedCachesDir() + ".");
+ Option savedCachesDirOption = new Option(null, OPTION_SAVED_CACHES, true,
+ "The directory where the storage node " + "keeps saved cache
files. Defaults to "
+ + getDefaultSavedCachesDir() + ".");
savedCachesDirOption.setArgName("DIR");
Option basedirOption = new Option(null, "dir", true, "The
directory where the storage node will be installed "
+ "The default directory will be " + storageBasedir);
- Option heapSizeOption = new Option(null, "heap-size", true, "The
value to use for both the min and max heap. "
- + "This value is passed directly to the -Xms and -Xmx options of the
Java executable. Defaults to "
- + defaultHeapSize);
+ Option heapSizeOption = new Option(null, OPTION_HEAP_SIZE, true,
+ "The value to use for both the min and max heap. "
+ + "This value is passed directly to the -Xms and -Xmx options of the
Java executable. Defaults to "
+ + defaultHeapSize);
- Option heapNewSizeOption = new Option(null, "heap-new-size", true,
"The value to use for the new generation "
- + "of the heap. This value is passed directly to the -Xmn option of the
Java executable. Defaults to "
- + defaultHeapNewSize);
+ Option heapNewSizeOption = new Option(null, OPTION_HEAP_NEW_SIZE, true,
+ "The value to use for the new generation "
+ + "of the heap. This value is passed directly to the -Xmn option of
the Java executable. Defaults to "
+ + defaultHeapNewSize);
- Option stackSizeOption = new Option(null, "stack-size", true, "The
value to use for the thread stack size. "
- + "This value is passed directly to the -Xss option of the Java
executable.");
+ Option stackSizeOption = new Option(null, OPTION_STACK_SIZE, true,
+ "The value to use for the thread stack size. "
+ + "This value is passed directly to the -Xss option of the Java
executable.");
Option upgradeOption = new Option(null, "upgrade", true, "Upgrades
an existing storage node. The directory "
+ "where the existing RHQ server is installed.");
upgradeOption.setArgName("RHQ_SERVER_DIR");
- Option verifyDataDirsEmptyOption = new Option(null, VERIFY_DATA_DIRS_EMPTY, true,
"Will cause the installer " +
- "to abort if any of the data directories is not empty. Defaults to
true.");
+ Option verifyDataDirsEmptyOption = new Option(null,
OPTION_VERIFY_DATA_DIRS_EMPTY, true,
+ "Will cause the installer " + "to abort if any of the data
directories is not empty. Defaults to true.");
options = new Options().addOption(new Option("h", "help",
false, "Show this message.")).addOption(hostname)
.addOption(seeds).addOption(jmxPortOption).addOption(startOption).addOption(checkStatus)
.addOption(commitLogOption).addOption(dataDirOption).addOption(savedCachesDirOption)
-
.addOption(nativeTransportPortOption).addOption(storagePortOption).addOption(basedirOption)
-
.addOption(heapSizeOption).addOption(heapNewSizeOption).addOption(stackSizeOption)
- .addOption(upgradeOption).addOption(verifyDataDirsEmptyOption);
+
.addOption(cqlPortOption).addOption(gossipPortOption).addOption(basedirOption).addOption(heapSizeOption)
+
.addOption(heapNewSizeOption).addOption(stackSizeOption).addOption(upgradeOption)
+ .addOption(verifyDataDirsEmptyOption);
}
public int run(CommandLine cmdLine) throws Exception {
@@ -230,14 +243,14 @@ public class StorageInstaller {
log.warn(e.getMessage());
log.warn("The storage installer will exit due to previous
errors");
return e.getErrorCode();
- }
+ }
PropertiesFileUpdate serverPropertiesUpdater = getServerProperties();
log.info("Updating rhq-server.properties...");
Properties properties = new Properties();
properties.setProperty("rhq.storage.nodes",
installerInfo.hostname);
- properties.setProperty("rhq.storage.cql-port",
Integer.toString(installerInfo.cqlPort));
- properties.setProperty("rhq.storage.gossip-port",
Integer.toString(installerInfo.gossipPort));
+ properties.setProperty(OPTION_CQL_PORT,
Integer.toString(installerInfo.cqlPort));
+ properties.setProperty(OPTION_GOSSIP_PORT,
Integer.toString(installerInfo.gossipPort));
serverPropertiesUpdater.update(properties);
@@ -257,12 +270,12 @@ public class StorageInstaller {
log.warn("The storage node reported the following errors while
trying to start:\n\n"
+ startupErrors + "\n");
if (startupErrors.contains("Port already in use: " +
installerInfo.jmxPort)) {
- log.warn("There is a conflict with the JMX port that
prevented the storage node JVM " +
- "from starting.");
+ log.warn("There is a conflict with the JMX port that
prevented the storage node JVM "
+ + "from starting.");
File confDir = new File(storageBasedir, "conf");
File confFile = new File(confDir,
"cassandra-jvm.properties");
- log.info("Change the jmx_port property in " + confFile
+ " to have the storage node listen " +
- "on a different port for JMX connections.");
+ log.info("Change the jmx_port property in " + confFile
+ " to have the storage node listen "
+ + "on a different port for JMX connections.");
return STATUS_JMX_PORT_CONFLICT;
}
@@ -283,13 +296,12 @@ public class StorageInstaller {
}
} else {
if (isRunning()) {
- log.info("Installation of the storage node is complete. The
node should be up and "
- + "running");
+ log.info("Installation of the storage node is complete. The
node should be up and " + "running");
return STATUS_NO_ERRORS;
} else {
log.warn("Installation of the storage node is complete, but
the node does not appear to "
- + "be running. No start up errors were reported. Check
the log file at " +
- installerInfo.logFile + " for any other possible
errors.");
+ + "be running. No start up errors were reported. Check
the log file at "
+ + installerInfo.logFile + " for any other possible
errors.");
return STATUS_STORAGE_NOT_RUNNING;
}
}
@@ -322,96 +334,91 @@ public class StorageInstaller {
deploymentOptions.setListenAddress(installerInfo.hostname);
deploymentOptions.setRpcAddress(installerInfo.hostname);
- String seeds = cmdLine.getOptionValue("seeds",
installerInfo.hostname);
+ String seeds = cmdLine.getOptionValue(OPTION_SEEDS, installerInfo.hostname);
deploymentOptions.setSeeds(seeds);
- String commitlogDir = cmdLine.getOptionValue("commitlog",
getDefaultCommitLogDir().getAbsolutePath());
- String dataDir = cmdLine.getOptionValue("data",
getDefaultDataDir().getAbsolutePath());
- String savedCachesDir = cmdLine.getOptionValue("saved-caches",
getDefaultSavedCachesDir().getAbsolutePath());
+ String commitlogDir = cmdLine.getOptionValue(OPTION_COMMITLOG,
getDefaultCommitLogDir().getAbsolutePath());
+ String dataDir = cmdLine.getOptionValue(OPTION_DATA,
getDefaultDataDir().getAbsolutePath());
+ String savedCachesDir = cmdLine.getOptionValue(OPTION_SAVED_CACHES,
getDefaultSavedCachesDir()
+ .getAbsolutePath());
File commitLogDirFile = new File(commitlogDir);
File dataDirFile = new File(dataDir);
File savedCachesDirFile = new File(savedCachesDir);
installerInfo.logFile = new File(logDir, "rhq-storage.log");
- boolean verifyDataDirsEmpty =
Boolean.valueOf(cmdLine.getOptionValue(VERIFY_DATA_DIRS_EMPTY, "true"));
+ boolean verifyDataDirsEmpty = Boolean
+ .valueOf(cmdLine.getOptionValue(OPTION_VERIFY_DATA_DIRS_EMPTY,
"true"));
if (verifyDataDirsEmpty) {
// validate the three data directories are empty - if they are not, we
are probably stepping on
// another storage node
if (!isDirectoryEmpty(commitLogDirFile)) {
log.error("Commitlog directory is not empty. It should not exist
for a new Storage Node ["
+ commitLogDirFile.getAbsolutePath() + "]");
- throw new StorageInstallerException("Installation cannot
proceed. The commit log directory " +
- commitLogDirFile + " is not empty",
STATUS_DATA_DIR_NOT_EMPTY);
+ throw new StorageInstallerException("Installation cannot
proceed. The commit log directory "
+ + commitLogDirFile + " is not empty",
STATUS_DATA_DIR_NOT_EMPTY);
}
if (!isDirectoryEmpty(dataDirFile)) {
log.error("Data directory is not empty. It should not exist for
a new Storage Node ["
+ dataDirFile.getAbsolutePath() + "]");
- throw new StorageInstallerException("Installation cannot
proceed. The data directory " + dataDirFile +
- " is not empty", STATUS_DATA_DIR_NOT_EMPTY);
+ throw new StorageInstallerException("Installation cannot
proceed. The data directory "
+ + dataDirFile + " is not empty",
STATUS_DATA_DIR_NOT_EMPTY);
}
if (!isDirectoryEmpty(savedCachesDirFile)) {
log.error("Saved caches directory is not empty. It should not
exist for a new Storage Node ["
+ savedCachesDirFile.getAbsolutePath() + "]");
- throw new StorageInstallerException("Installation cannot
proceed. The saved caches directory " +
- savedCachesDirFile + " is not empty",
STATUS_DATA_DIR_NOT_EMPTY);
+ throw new StorageInstallerException("Installation cannot
proceed. The saved caches directory "
+ + savedCachesDirFile + " is not empty",
STATUS_DATA_DIR_NOT_EMPTY);
}
}
- installerInfo.jmxPort = getPort(cmdLine, "jmx-port",
defaultJmxPort);
+ installerInfo.jmxPort = getPort(cmdLine, OPTION_JMX_PORT, defaultJmxPort);
if (isPortBound(installerInfo.hostname, installerInfo.jmxPort,
"jmx-port")) {
- throw new StorageInstallerException("The jmx-port (" +
installerInfo.jmxPort + ") is already in use. " +
- "Installation cannot proceed.", STATUS_JMX_PORT_CONFLICT);
+ throw new StorageInstallerException("The jmx-port (" +
installerInfo.jmxPort + ") is already in use. "
+ + "Installation cannot proceed.",
STATUS_JMX_PORT_CONFLICT);
}
- installerInfo.cqlPort = getPort(cmdLine, "client-port",
defaultNativeTransportPort);
- if (isPortBound(installerInfo.hostname, installerInfo.cqlPort,
"client-port")) {
- throw new StorageInstallerException("The client-port (" +
installerInfo.cqlPort + ") is already in use. " +
- "Installation cannot proceed.", STATUS_CQL_PORT_CONFLICT);
+ installerInfo.cqlPort = getPort(cmdLine, OPTION_CQL_PORT, defaultCqlPort);
+ if (isPortBound(installerInfo.hostname, installerInfo.cqlPort,
OPTION_CQL_PORT)) {
+ throw new StorageInstallerException("The cql-port (" +
installerInfo.cqlPort + ") is already in use. "
+ + "Installation cannot proceed.",
STATUS_CQL_PORT_CONFLICT);
}
- installerInfo.gossipPort = getPort(cmdLine, "storage-port",
defaultStoragePort);
- if (isPortBound(installerInfo.hostname, installerInfo.gossipPort,
"storage-port")) {
- throw new StorageInstallerException("The storage-port (" +
installerInfo.gossipPort + ") is already in use. " +
- "Installation cannot proceed.",
STATUS_GOSSIP_PORT_CONFLICT);
+ installerInfo.gossipPort = getPort(cmdLine, OPTION_GOSSIP_PORT,
defaultGossipPort);
+ if (isPortBound(installerInfo.hostname, installerInfo.gossipPort,
OPTION_GOSSIP_PORT)) {
+ throw new StorageInstallerException("The gossip-port (" +
installerInfo.gossipPort
+ + ") is already in use. " + "Installation cannot
proceed.", STATUS_GOSSIP_PORT_CONFLICT);
}
deploymentOptions.setCommitLogDir(commitlogDir);
// TODO add support for specifying multiple dirs
deploymentOptions.setDataDir(dataDirFile.getAbsolutePath());
deploymentOptions.setSavedCachesDir(savedCachesDir);
+
deploymentOptions.setLogFileName(installerInfo.logFile.getPath());
deploymentOptions.setLoggingLevel("INFO");
- deploymentOptions.setRpcPort(rpcPort);
- deploymentOptions.setNativeTransportPort(installerInfo.cqlPort);
- deploymentOptions.setStoragePort(installerInfo.gossipPort);
- deploymentOptions.setSslStoragePort(getPort(cmdLine,
"ssl-storage-port", sslStoragePort));
+ deploymentOptions.setRpcPort(rpcPort);
+ deploymentOptions.setCqlPort(installerInfo.cqlPort);
+ deploymentOptions.setGossipPort(installerInfo.gossipPort);
deploymentOptions.setJmxPort(installerInfo.jmxPort);
- deploymentOptions.setHeapSize(cmdLine.getOptionValue("heap-size",
defaultHeapSize));
-
deploymentOptions.setHeapNewSize(cmdLine.getOptionValue("heap-new-size",
defaultHeapNewSize));
- if (cmdLine.hasOption("stack-size")) {
-
deploymentOptions.setStackSize(cmdLine.getOptionValue("stack-size"));
- }
+ deploymentOptions.setHeapSize(cmdLine.getOptionValue(OPTION_HEAP_SIZE,
defaultHeapSize));
+ deploymentOptions.setHeapNewSize(cmdLine.getOptionValue(OPTION_HEAP_NEW_SIZE,
defaultHeapNewSize));
+ if (cmdLine.hasOption(OPTION_STACK_SIZE)) {
+
deploymentOptions.setStackSize(cmdLine.getOptionValue(OPTION_STACK_SIZE));
+ }
// The out of box default for native_transport_max_threads is 128. We
default
// to 64 for dev/test environments so we need to update it here.
deploymentOptions.setNativeTransportMaxThreads(128);
- deploymentOptions.setHeapSize(cmdLine.getOptionValue("heap-size",
defaultHeapSize));
-
deploymentOptions.setHeapNewSize(cmdLine.getOptionValue("heap-new-size",
defaultHeapNewSize));
-
- if (cmdLine.hasOption("stack-size")) {
-
deploymentOptions.setStackSize(cmdLine.getOptionValue("stack-size"));
- }
-
deploymentOptions.load();
List<String> errors = new ArrayList<String>();
- checkPerms(options.getOption("saved-caches"), savedCachesDir,
errors);
- checkPerms(options.getOption("commitlog"), commitlogDir, errors);
- checkPerms(options.getOption("data"), dataDir, errors);
+ checkPerms(options.getOption(OPTION_SAVED_CACHES), savedCachesDir, errors);
+ checkPerms(options.getOption(OPTION_COMMITLOG), commitlogDir, errors);
+ checkPerms(options.getOption(OPTION_DATA), dataDir, errors);
if (!errors.isEmpty()) {
log.error("Problems have been detected with one or more of the
directories in which the storage "
@@ -419,11 +426,12 @@ public class StorageInstaller {
for (String error : errors) {
log.error(error);
}
- throw new StorageInstallerException("Installation cannot proceed.
There are problems with one or more of " +
- "the storage data directories.",
STATUS_INVALID_FILE_PERMISSIONS);
+ throw new StorageInstallerException(
+ "Installation cannot proceed. There are problems with one or
more of "
+ + "the storage data directories.",
STATUS_INVALID_FILE_PERMISSIONS);
}
- Deployer deployer = new Deployer();
+ Deployer deployer = getDeployer();
deployer.setDeploymentOptions(deploymentOptions);
storageBasedir.mkdirs();
deployer.unzipDistro();
@@ -439,11 +447,19 @@ public class StorageInstaller {
throw new StorageInstallerException("The upgrade cannot proceed. An
unexpected I/O error occurred", e,
STATUS_IO_ERROR);
} catch (DeploymentException e) {
- throw new StorageInstallerException("The installation cannot proceed. An
error occurred during storage " +
- "node deployment.", e, STATUS_DEPLOYMENT_ERROR);
+ throw new StorageInstallerException("The installation cannot proceed. An
error occurred during storage "
+ + "node deployment.", e, STATUS_DEPLOYMENT_ERROR);
}
}
+ /**
+ * This can be overridden to allow for custom deploy behavior.
+ * @return a Deployer
+ */
+ protected Deployer getDeployer() {
+ return new Deployer();
+ }
+
private InstallerInfo upgrade(File upgradeFromDir) throws StorageInstallerException
{
DeploymentOptionsFactory factory = new DeploymentOptionsFactory();
DeploymentOptions deploymentOptions = factory.newDeploymentOptions();
@@ -454,16 +470,16 @@ public class StorageInstaller {
if (!upgradeFromDir.isDirectory()) {
log.error("The value passed to the upgrade option is not a directory.
The value must be a valid "
+ "path that points to the base directory of an existing RHQ server
installation.");
- throw new StorageInstallerException("The upgrade cannot proceed. The
value passed to the upgrade option " +
- "is invalid.", STATUS_INVALID_UPGRADE);
+ throw new StorageInstallerException("The upgrade cannot proceed. The
value passed to the upgrade option "
+ + "is invalid.", STATUS_INVALID_UPGRADE);
}
existingStorageDir = new File(upgradeFromDir, "rhq-storage");
if (!(existingStorageDir.exists() && existingStorageDir.isDirectory()))
{
log.error(existingStorageDir + " does not appear to be an existing RHQ
storage node installation. "
+ "Check the value that was passed to the upgrade option and make
sure it specifies the base "
+ "directory of an existing RHQ server installation.");
- throw new StorageInstallerException("The upgrade cannot proceed. "
+ existingStorageDir + " is not an " +
- "existing RHQ storage node installation",
STATUS_INVALID_UPGRADE);
+ throw new StorageInstallerException("The upgrade cannot proceed. "
+ existingStorageDir + " is not an "
+ + "existing RHQ storage node installation",
STATUS_INVALID_UPGRADE);
}
try {
@@ -540,8 +556,8 @@ public class StorageInstaller {
return installerInfo;
} catch (DeploymentException e) {
- throw new StorageInstallerException("THe upgrade cannot proceed. An
error occurred during the storage " +
- "node deployment", e, STATUS_DEPLOYMENT_ERROR);
+ throw new StorageInstallerException("THe upgrade cannot proceed. An
error occurred during the storage "
+ + "node deployment", e, STATUS_DEPLOYMENT_ERROR);
} catch (IOException e) {
throw new StorageInstallerException("The upgrade cannot proceed. An
unexpected I/O error occurred", e,
STATUS_IO_ERROR);
@@ -852,7 +868,7 @@ public class StorageInstaller {
throw new RuntimeException("Cannot determine JMX port");
}
- jmxPort = jmxPort.replaceAll("\"","");
+ jmxPort = jmxPort.replaceAll("\"", "");
return Integer.parseInt(jmxPort);
} catch (IOException e) {
@@ -895,8 +911,8 @@ public class StorageInstaller {
public Options getHelpOptions() {
Options helpOptions = new Options();
- for (Option option : (Collection<Option>)options.getOptions()) {
- if (option.getLongOpt().equals(VERIFY_DATA_DIRS_EMPTY)) {
+ for (Option option : (Collection<Option>) options.getOptions()) {
+ if (option.getLongOpt().equals(OPTION_VERIFY_DATA_DIRS_EMPTY)) {
continue;
}
helpOptions.addOption(option);
diff --git
a/modules/common/cassandra-installer/src/test/java/org/rhq/storage/installer/StorageInstallerTest.java
b/modules/common/cassandra-installer/src/test/java/org/rhq/storage/installer/StorageInstallerTest.java
index dff74bf..fab1a9f 100644
---
a/modules/common/cassandra-installer/src/test/java/org/rhq/storage/installer/StorageInstallerTest.java
+++
b/modules/common/cassandra-installer/src/test/java/org/rhq/storage/installer/StorageInstallerTest.java
@@ -1,6 +1,5 @@
package org.rhq.storage.installer;
-
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
@@ -28,6 +27,8 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import org.rhq.cassandra.CassandraClusterManager;
+import org.rhq.cassandra.Deployer;
+import org.rhq.cassandra.DeploymentException;
import org.rhq.cassandra.util.ConfigEditor;
import org.rhq.core.util.MessageDigestGenerator;
import org.rhq.core.util.file.FileUtil;
@@ -68,7 +69,7 @@ public class StorageInstallerTest {
storageDir = new File(serverDir, "rhq-storage");
- installer = new StorageInstaller();
+ installer = new SafeStorageInstaller();
}
@AfterMethod(alwaysRun = true)
@@ -134,7 +135,7 @@ public class StorageInstallerTest {
assertEquals(yamlEditor.getAuthenticator(),
"org.apache.cassandra.auth.PasswordAuthenticator",
"The authenticator property is wrong");
assertEquals(yamlEditor.getListenAddress(), address, "The listen_address
property is wrong");
- assertEquals(yamlEditor.getNativeTransportPort(), (Integer) 9142, "The
native_transport_port property is wrong");
+ assertEquals(yamlEditor.getNativeTransportPort(), (Integer) 9142, "The
native_transport_port property is wrong");
assertEquals(yamlEditor.getRpcAddress(), address, "The rpc_address property
is wrong");
assertEquals(yamlEditor.getStoragePort(), (Integer) 7100, "The storage_port
property is wrong");
@@ -154,7 +155,7 @@ public class StorageInstallerTest {
CommandLineParser parser = new PosixParser();
File defaultInstallDir = new File(basedir.getParentFile(),
"performDefaultInstall");
File upgradeFromServerDir = new File(defaultInstallDir, "rhq-server");
- String[] args = {"--upgrade", upgradeFromServerDir.getAbsolutePath()};
+ String[] args = { "--upgrade", upgradeFromServerDir.getAbsolutePath()
};
CommandLine cmdLine = parser.parse(installer.getOptions(), args);
int status = installer.run(cmdLine);
@@ -204,7 +205,7 @@ public class StorageInstallerTest {
assertEquals(yamlEditor.getAuthenticator(),
"org.apache.cassandra.auth.PasswordAuthenticator",
"The authenticator property is wrong");
assertEquals(yamlEditor.getListenAddress(), address, "The listen_address
property is wrong");
- assertEquals(yamlEditor.getNativeTransportPort(), (Integer) 9142, "The
native_transport_port property is wrong");
+ assertEquals(yamlEditor.getNativeTransportPort(), (Integer) 9142, "The
native_transport_port property is wrong");
assertEquals(yamlEditor.getRpcAddress(), address, "The rpc_address property
is wrong");
assertEquals(yamlEditor.getStoragePort(), (Integer) 7100, "The storage_port
property is wrong");
@@ -221,7 +222,7 @@ public class StorageInstallerTest {
@Test
public void performValidInstallWithOutputToStderr() throws Exception {
- installer = new StorageInstaller() {
+ installer = new SafeStorageInstaller() {
@Override
protected void exec(Executor executor, org.apache.commons.exec.CommandLine
cmdLine) throws IOException {
executor.execute(cmdLine, ImmutableMap.of("JAVA_TOOL_OPTIONS",
"-Dfile.encoding=UTF8"));
@@ -247,7 +248,8 @@ public class StorageInstallerTest {
serverSocket.bind(new InetSocketAddress(address, 7799));
CommandLineParser parser = new PosixParser();
- CommandLine cmdLine = parser.parse(installer.getOptions(), new String[]
{"--jmx-port", "7799"});
+ CommandLine cmdLine = parser.parse(installer.getOptions(),
+ new String[] { "--rhq.storage.jmx-port", "7799" });
int status = installer.run(cmdLine);
@@ -268,7 +270,8 @@ public class StorageInstallerTest {
serverSocket.bind(new InetSocketAddress(address, 9342));
CommandLineParser parser = new PosixParser();
- CommandLine cmdLine = parser.parse(installer.getOptions(), new String[]
{"--client-port", "9342"});
+ CommandLine cmdLine = parser.parse(installer.getOptions(),
+ new String[] { "--rhq.storage.cql-port", "9342" });
int status = installer.run(cmdLine);
@@ -284,15 +287,11 @@ public class StorageInstallerTest {
public void performValidInstall() throws Exception {
CommandLineParser parser = new PosixParser();
- String[] args = {
- "--dir", storageDir.getAbsolutePath(),
- "--commitlog", new File(storageDir,
"commit_log").getAbsolutePath(),
- "--data", new File(storageDir,
"data").getAbsolutePath(),
- "--saved-caches", new File(storageDir,
"saved_caches").getAbsolutePath(),
- "--heap-size", "256M",
- "--heap-new-size", "64M",
- "--hostname", "127.0.0.1"
- };
+ String[] args = { "--dir", storageDir.getAbsolutePath(),
"--rhq.storage.commitlog",
+ new File(storageDir, "commit_log").getAbsolutePath(),
"--rhq.storage.data",
+ new File(storageDir, "data").getAbsolutePath(),
"--rhq.storage.saved-caches",
+ new File(storageDir, "saved_caches").getAbsolutePath(),
"--rhq.storage.heap-size", "256M",
+ "--rhq.storage.heap-new-size", "64M",
"--rhq.storage.hostname", "127.0.0.1" };
CommandLine cmdLine = parser.parse(installer.getOptions(), args);
int status = installer.run(cmdLine);
@@ -331,19 +330,16 @@ public class StorageInstallerTest {
File oldLog4JFile = new File(rhq48StorageConfDir,
"log4j-server.properties");
rhq48StorageConfDir.mkdirs();
-
StreamUtil.copy(getClass().getResourceAsStream("/rhq48/storage/conf/cassandra.yaml"),
- new FileOutputStream(oldCassandraYamlFile), true);
-
StreamUtil.copy(getClass().getResourceAsStream("/rhq48/storage/conf/cassandra-env.sh"),
- new FileOutputStream(oldCassandraEnvFile));
+
StreamUtil.copy(getClass().getResourceAsStream("/rhq48/storage/conf/cassandra.yaml"),
new FileOutputStream(
+ oldCassandraYamlFile), true);
+
StreamUtil.copy(getClass().getResourceAsStream("/rhq48/storage/conf/cassandra-env.sh"),
new FileOutputStream(
+ oldCassandraEnvFile));
StreamUtil.copy(getClass().getResourceAsStream("/rhq48/storage/conf/log4j-server.properties"),
new FileOutputStream(oldLog4JFile));
CommandLineParser parser = new PosixParser();
- String[] args = {
- "--upgrade", rhq48ServerDir.getAbsolutePath(),
- "--dir", storageDir.getAbsolutePath()
- };
+ String[] args = { "--upgrade", rhq48ServerDir.getAbsolutePath(),
"--dir", storageDir.getAbsolutePath() };
CommandLine cmdLine = parser.parse(installer.getOptions(), args);
int status = installer.run(cmdLine);
@@ -383,8 +379,8 @@ public class StorageInstallerTest {
// If this check fails, make sure that the expected value matches the value in
// src/test/resources/rhq48/storage/conf/cassandra-env.sh
- assertEquals(properties.getProperty("jmx_port"), "7399",
"Failed to update the JMX port in " +
- cassandraJvmPropsFile);
+ assertEquals(properties.getProperty("jmx_port"), "7399",
"Failed to update the JMX port in "
+ + cassandraJvmPropsFile);
File yamlFile = new File(confDir, "cassandra.yaml");
ConfigEditor newYamlEditor = new ConfigEditor(yamlFile);
@@ -395,8 +391,8 @@ public class StorageInstallerTest {
assertEquals(newYamlEditor.getInternodeAuthenticator(),
"org.rhq.cassandra.auth.RhqInternodeAuthenticator",
"Failed to set the internode_authenticator property in " +
yamlFile);
- assertEquals(newYamlEditor.getAuthenticator(), oldYamlEditor.getAuthenticator(),
"The authenticator property " +
- "is wrong");
+ assertEquals(newYamlEditor.getAuthenticator(), oldYamlEditor.getAuthenticator(),
"The authenticator property "
+ + "is wrong");
assertEquals(newYamlEditor.getCommitLogDirectory(),
oldYamlEditor.getCommitLogDirectory(),
"The commit_log property is wrong");
assertEquals(newYamlEditor.getDataFileDirectories(),
oldYamlEditor.getDataFileDirectories(),
@@ -405,8 +401,7 @@ public class StorageInstallerTest {
"The listen_address property is wrong");
assertEquals(newYamlEditor.getNativeTransportPort(),
oldYamlEditor.getNativeTransportPort(),
"The native_transport_port property is wrong");
- assertEquals(newYamlEditor.getRpcAddress(), oldYamlEditor.getRpcAddress(),
- "The rpc_address property is wrong");
+ assertEquals(newYamlEditor.getRpcAddress(), oldYamlEditor.getRpcAddress(),
"The rpc_address property is wrong");
assertEquals(newYamlEditor.getSavedCachesDirectory(),
oldYamlEditor.getSavedCachesDirectory(),
"The saved_caches_directory property is wrong");
assertEquals(newYamlEditor.getStoragePort(), oldYamlEditor.getStoragePort(),
@@ -439,4 +434,24 @@ public class StorageInstallerTest {
assertEquals(properties.getProperty("rhq.storage.cql-port"),
"9142");
}
+ private static class SafeStorageInstaller extends StorageInstaller {
+
+ @Override
+ protected Deployer getDeployer() {
+ return new SafeDeployer();
+ }
+ }
+
+ private static class SafeDeployer extends Deployer {
+
+ @Override
+ public void applyChangesToWindowsServiceWrapper(File deployDir) throws
DeploymentException {
+ // Not every test env will have this file set up. If it doesn't exist
just skip this.
+ File wrapperDir = new File(deployDir, "../bin/wrapper");
+ File wrapperEnvFile = new File(wrapperDir,
"rhq-storage-wrapper.env");
+ if (wrapperEnvFile.isFile()) {
+ super.applyChangesToWindowsServiceWrapper(deployDir);
+ }
+ }
+ }
}
diff --git a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
index 1f28f14..41e8931 100644
--- a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
+++ b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
@@ -818,8 +818,8 @@ rhq.storage.nodes=
# and used by the RHQ server(s) to communicate with the cluster.
# Both properties are required.
#
-rhq.storage.cql-port=${rhq.cassandra.native-transport-port}
-rhq.storage.gossip-port=${rhq.cassandra.storage.port}
+rhq.storage.cql-port=${rhq.storage.cql-port}
+rhq.storage.gossip-port=${rhq.storage.gossip-port}
# If enabled data sent to and from storage nodes will be compressed using
# snappy (
https://code.google.com/p/snappy) compression. Note that this is an
@@ -832,7 +832,7 @@ rhq.storage.gossip-port=${rhq.cassandra.storage.port}
#
# Please make sure you do not find the above log statement in your storage logs
# before you enable client compression.
-# rhq.cassandra.client.compression-enabled=false
+# rhq.storage.client.compression-enabled=false
</echo>
<echo
file="${rhq.bin.dir}/rhq-storage.properties">#################### RHQ Storage
Configuration Properties ####################
@@ -847,7 +847,7 @@ rhq.storage.gossip-port=${rhq.cassandra.storage.port}
#############################################################################
# Data Directory Settings
# -----------------
-# Note, the RHQ_HOME directory as used below is the parent directory
+# The RHQ_HOME directory as used below is the parent directory
# of the RHQ server installation. It is recommended that RHQ be installed
# under an umbrella "rhq" directory. For example, if using a home directory
# of /opt/rhq then the default installation structure would be:
@@ -860,81 +860,99 @@ rhq.storage.gossip-port=${rhq.cassandra.storage.port}
# /opt/rhq/rhq-data/storage/data
# /opt/rhq/rhq-data/storage/saved_caches
#
-# commitlog The directory where the storage node keeps commit log files.
+# IMPORTANT: Always use forward slashes in the directory path names, even
+# on Windows!
+#
+# IMPORTANT: If using non-default settings for the data, commitlog, and/or
+# saved-caches directories, each directory should be unique,
+# typically under a common parent.
+#
+# rhq.storage.commitlog
+# The directory where the storage node keeps commit log files.
# Defaults to: RHQ_HOME/rhq-data/storage/commitlog
-# data The directory where the storage node keeps data files.
+# rhq.storage.data
+# The directory where the storage node keeps data files.
# Defaults to: RHQ_HOME/rhq-data/storage/data
-# saved-caches The directory where the storage node keeps saved cache files.
+# rhq.storage.saved-caches
+# The directory where the storage node keeps saved cache files.
# Defaults to: RHQ_HOME/rhq-data/storage/saved_caches
#############################################################################
-${comment}commitlog=${rhq.storage.commitlog}
-${comment}data=${rhq.storage.data}
-${comment}saved-caches=${rhq.storage.saved-caches}
+${comment}rhq.storage.commitlog=${rhq.storage.commitlog}
+${comment}rhq.storage.data=${rhq.storage.data}
+${comment}rhq.storage.saved-caches=${rhq.storage.saved-caches}
#############################################################################
# Heap/Memory Settings
# -----------------
#
-# heap-size The value to use for both the min and max heap. This value is
+# rhq.storage.heap-size
+# The value to use for both the min and max heap. This value is
# passed directly to the -Xms and -Xmx options of the Java
# executable.
# Defaults to 512M.
-# heap-new-size The value to use for the new generation of the heap. This
+# rhq.storage.heap-new-size
+# The value to use for the new generation of the heap. This
# value is passed directly to the -Xmn option of the Java
# executable.
-# Defaults to 256M.
-# stack-size The value to use for the thread stack size. This value is
+# Defaults to 128M.
+# rhq.storage.stack-size
+# The value to use for the thread stack size. This value is
# passed directly to the -Xss option of the Java executable.
# Defaults to 256k.
#############################################################################
-${comment}heap-size=${rhq.storage.heap-size}
-${comment}heap-new-size=${rhq.storage.heap-new-size}
-#stack-size=
+${comment}rhq.storage.heap-size=${rhq.storage.heap-size}
+${comment}rhq.storage.heap-new-size=${rhq.storage.heap-new-size}
+#rhq.storage.stack-size=
#############################################################################
# Port Settings
# -----------------
#
-# client-port The port on which to listen for client requests.
-# Defaults to 9142
-# jmx-port The port on which to listen for JMX connections.
+# rhq.storage.cql-port
+# The port on which to listen for client requests.
+# Defaults to 9142.
+# rhq.storage.jmx-port
+# The port on which to listen for JMX connections.
# Defaults to 7299.
-# storage-port The port on which to listen for requests from other nodes.
-# Defaults to 7100
-# ssl-storage-port The port on which to listen for encrypted requests from
-# other nodes. Only used when encryption is enabled.
-# Defaults to 7101
+# rhq.storage.gossip-port
+# The port on which to listen for requests from other nodes.
+# Defaults to 7100.
#############################################################################
-#client-port=
-${comment}jmx-port=${rhq.storage.jmx-port}
-#storage-port=
-#ssl-storage-port=
+#rhq.storage.cql-port=
+${comment}rhq.storage.jmx-port=${rhq.storage.jmx-port}
+#rhq.storage.gossip-port=
#############################################################################
# Address/Host Settings
# -----------------
#
-# hostname The hostname or IP address on which the node will listen
+# rhq.storage.hostname
+# The hostname or IP address on which the node will listen
# for requests.
-# Defaults to the hostname for localhost.
-# seeds A comma-delimited list of hostnames or IP addresses that
+# Defaults to this node's hostname.
+# rhq.storage.seeds
+# A comma-delimited list of hostnames or IP addresses that
# serve as contact points. Nodes use this list to find each
# other and to learn the cluster topology. It does not need
# to specify all nodes in the cluster.
# Defaults to this node's hostname.
#############################################################################
-${comment}hostname=${rhq.storage.hostname}
-${comment}seeds=${rhq.storage.seeds}
+${comment}rhq.storage.hostname=${rhq.storage.hostname}
+${comment}rhq.storage.seeds=${rhq.storage.seeds}
#############################################################################
# Advanced Settings
# -----------------
#
-# verify-data-dirs-empty If true then allow installation only when the data
-# directories are empty. Only upgrade is allowed.
+# rhq.storage.verify-data-dirs-empty
+# If true then allow installation only when the data
+# directories are empty. Typically set true only in
+# development environments when it may be useful to
+# perform a clean installation while maintaining
+# existing data. Defaults to true.
# Defaults to true.
#############################################################################
-${comment}verify-data-dirs-empty=${rhq.storage.verify-data-dirs-empty}
+${comment}rhq.storage.verify-data-dirs-empty=${rhq.storage.verify-data-dirs-empty}
</echo>
</target>
diff --git a/modules/enterprise/server/appserver/src/main/scripts/storage_setup.groovy
b/modules/enterprise/server/appserver/src/main/scripts/storage_setup.groovy
index c20e0ed..7cdbf9e 100644
--- a/modules/enterprise/server/appserver/src/main/scripts/storage_setup.groovy
+++ b/modules/enterprise/server/appserver/src/main/scripts/storage_setup.groovy
@@ -89,15 +89,15 @@ def createStoragePropertiesFile(basedir, nodeId) {
propsFile.withWriter { writer ->
writer.write("""# storage installer options for dev deployment
-commitlog=${dataRootDir}/storage-$nodeId/commit_log
-data=${dataRootDir}/storage-$nodeId/data
-saved-caches=${dataRootDir}/storage-$nodeId/saved_caches
-heap-size=${heapSize}
-heap-new-size=${heapNewSize}
-hostname=127.0.0.$nodeId
-jmx-port=${defaultJmxPort + (nodeId - 1)}
-seeds=${seeds}
-verify-data-dirs-empty=false
+rhq.storage.commitlog=${dataRootDir}/storage-$nodeId/commit_log
+rhq.storage.data=${dataRootDir}/storage-$nodeId/data
+rhq.storage.saved-caches=${dataRootDir}/storage-$nodeId/saved_caches
+rhq.storage.heap-size=${heapSize}
+rhq.storage.heap-new-size=${heapNewSize}
+rhq.storage.hostname=127.0.0.$nodeId
+rhq.storage.jmx-port=${defaultJmxPort + (nodeId - 1)}
+rhq.storage.seeds=${seeds}
+rhq.storage.verify-data-dirs-empty=false
"""
)
}
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
index 1d2f817..1dc2758 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
@@ -485,6 +485,12 @@ public class Upgrade extends AbstractInstall {
oldServerProps.setProperty("rhq.storage.cql-port", cqlPort);
}
+ String storageCompression =
oldServerProps.getProperty("rhq.cassandra.client.compression-enabled");
+ if (storageCompression != null) {
+ oldServerProps.remove("rhq.cassandra.client.compression-enabled");
+
oldServerProps.setProperty("rhq.storage.client.compression-enabled",
storageCompression);
+ }
+
// copy the old key/truststore files from the old location to the new server
configuration directory
copyReferredFile(commandLine, oldServerProps,
"rhq.server.tomcat.security.keystore.file");
copyReferredFile(commandLine, oldServerProps,
"rhq.server.tomcat.security.truststore.file");
diff --git
a/modules/plugins/rhq-storage/src/test/java/org/rhq/plugins/storage/StorageNodeComponentITest.java
b/modules/plugins/rhq-storage/src/test/java/org/rhq/plugins/storage/StorageNodeComponentITest.java
index f716ddb..bae3c1d 100644
---
a/modules/plugins/rhq-storage/src/test/java/org/rhq/plugins/storage/StorageNodeComponentITest.java
+++
b/modules/plugins/rhq-storage/src/test/java/org/rhq/plugins/storage/StorageNodeComponentITest.java
@@ -113,8 +113,8 @@ public class StorageNodeComponentITest {
deploymentOptions.setSavedCachesDir(new File(basedir,
"saved_caches").getAbsolutePath());
deploymentOptions.setCommitLogDir(new File(basedir,
"logs").getAbsolutePath());
deploymentOptions.setLoggingLevel("DEBUG");
- deploymentOptions.setStoragePort(7200);
- deploymentOptions.setNativeTransportPort(9142);
+ deploymentOptions.setGossipPort(7200);
+ deploymentOptions.setCqlPort(9142);
deploymentOptions.setJmxPort(7399);
deploymentOptions.setHeapSize("256M");
deploymentOptions.setHeapNewSize("64M");
@@ -309,8 +309,8 @@ public class StorageNodeComponentITest {
deploymentOptions.setSavedCachesDir(new File(node2Basedir,
"saved_caches").getAbsolutePath());
deploymentOptions.setCommitLogDir(new File(node2Basedir,
"logs").getAbsolutePath());
deploymentOptions.setLoggingLevel("DEBUG");
- deploymentOptions.setStoragePort(7200);
- deploymentOptions.setNativeTransportPort(9142);
+ deploymentOptions.setGossipPort(7200);
+ deploymentOptions.setCqlPort(9142);
deploymentOptions.setJmxPort(7400);
deploymentOptions.setHeapSize("256M");
deploymentOptions.setHeapNewSize("64M");
commit 3e2cc976d9d53517e718573cdb6969c6ac3fee31
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Sep 26 09:53:31 2013 -0400
add another source path
diff --git a/.classpath b/.classpath
index 6985799..dfe7c43 100644
--- a/.classpath
+++ b/.classpath
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src"
path="modules/common/ant-bundle/src/main/java"/>
+ <classpathentry kind="src"
path="modules/common/cassandra-installer/src/test/java"/>
<classpathentry kind="src"
path="modules/enterprise/server/plugins/alertdef-rhq/src/main/java"/>
<classpathentry kind="src"
path="modules/common/cassandra-util/src/main/java"/>
<classpathentry kind="src"
path="modules/common/cassandra-ccm/cassandra-ccm-maven-plugin/src/main/java"/>
commit 0c079cf60e2b2667550ddec07c0299fa52526e92
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Sep 26 09:51:24 2013 -0400
A change to solve an ora test failure for
SynchronizationManagerBeanTest#testExport, due to oracle treating "" as
null for config settings initialized to "".
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
index 86bb1b8..4c2e4d4 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
@@ -208,8 +208,8 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
public void setStorageClusterSettings(Subject subject, SystemSettings settings) {
for (SystemSetting setting : settings.keySet()) {
if (!isStorageSetting(setting)) {
- throw new IllegalArgumentException(setting + " cannot be updated
through this method. This method " +
- "only allows updating of storage cluster settings.");
+ throw new IllegalArgumentException(setting + " cannot be updated
through this method. This method "
+ + "only allows updating of storage cluster settings.");
}
}
setSystemSettings(settings, false, true);
@@ -255,12 +255,13 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
String existingValue = transformSystemConfigurationProperty(prop,
existingConfig.getPropertyValue(),
true);
- if ((existingValue == null && value != null) ||
!existingValue.equals(value)) {
+ //also for oracle, treat null and empty string as the same.
+ if ((isEmpty(existingValue) && !isEmpty(value))
+ || (null != existingValue && !existingValue.equals(value)))
{
//SystemSetting#isReadOnly should be a superset of the
"fReadOnly" field in the database
//but let's just be super paranoid here...
- if ((prop.isReadOnly()
- || (existingConfig.getFreadOnly() != null &&
existingConfig.getFreadOnly().booleanValue())) &&
- !(isStorageSetting(prop) || updateStorageSettings)) {
+ if ((prop.isReadOnly() || (existingConfig.getFreadOnly() != null
&& existingConfig.getFreadOnly()
+ .booleanValue())) && !(isStorageSetting(prop) ||
updateStorageSettings)) {
throw new IllegalArgumentException("The setting [" +
prop.getInternalName()
+ "] is read-only - you cannot change its current value!
Current value is ["
+ existingConfig.getPropertyValue() + "] while the new
value was [" + value + "].");
@@ -282,12 +283,20 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
cachedSystemSettings = null;
}
+ private static boolean isEmpty(String string) {
+ return null == string || string.trim().isEmpty();
+ }
+
private boolean isStorageSetting(SystemSetting setting) {
switch (setting) {
- case STORAGE_CQL_PORT: return true;
- case STORAGE_GOSSIP_PORT: return true;
- case STORAGE_AUTOMATIC_DEPLOYMENT: return true;
- default: return false;
+ case STORAGE_CQL_PORT:
+ return true;
+ case STORAGE_GOSSIP_PORT:
+ return true;
+ case STORAGE_AUTOMATIC_DEPLOYMENT:
+ return true;
+ default:
+ return false;
}
}
commit 2c0103fa83ddec0bbf224e892cf82680169d5eff
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Thu Sep 26 09:50:11 2013 -0400
Revert " updating itest fix for oracle failures."
This reverts commit 7abad911acaf15b7b0dd58af64df2be2c75c905a.
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml
b/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml
index 223042a..ebf7189 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml
@@ -148,9 +148,9 @@
<data ID="62" PROPERTY_KEY="STORAGE_GOSSIP_PORT"
FREAD_ONLY="TRUE"/>
- <data ID="63" PROPERTY_KEY="STORAGE_USERNAME"
PROPERTY_VALUE=" " DEFAULT_PROPERTY_VALUE=" "
FREAD_ONLY="TRUE"/>
+ <data ID="63" PROPERTY_KEY="STORAGE_USERNAME"
PROPERTY_VALUE="" DEFAULT_PROPERTY_VALUE=""
FREAD_ONLY="TRUE"/>
- <data ID="64" PROPERTY_KEY="STORAGE_PASSWORD"
PROPERTY_VALUE=" " DEFAULT_PROPERTY_VALUE=" "
FREAD_ONLY="TRUE"/>
+ <data ID="64" PROPERTY_KEY="STORAGE_PASSWORD"
PROPERTY_VALUE="" DEFAULT_PROPERTY_VALUE=""
FREAD_ONLY="TRUE"/>
</table>
commit 7abad911acaf15b7b0dd58af64df2be2c75c905a
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Wed Sep 25 19:13:00 2013 -0400
updating itest fix for oracle failures.
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml
b/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml
index ebf7189..223042a 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml
@@ -148,9 +148,9 @@
<data ID="62" PROPERTY_KEY="STORAGE_GOSSIP_PORT"
FREAD_ONLY="TRUE"/>
- <data ID="63" PROPERTY_KEY="STORAGE_USERNAME"
PROPERTY_VALUE="" DEFAULT_PROPERTY_VALUE=""
FREAD_ONLY="TRUE"/>
+ <data ID="63" PROPERTY_KEY="STORAGE_USERNAME"
PROPERTY_VALUE=" " DEFAULT_PROPERTY_VALUE=" "
FREAD_ONLY="TRUE"/>
- <data ID="64" PROPERTY_KEY="STORAGE_PASSWORD"
PROPERTY_VALUE="" DEFAULT_PROPERTY_VALUE=""
FREAD_ONLY="TRUE"/>
+ <data ID="64" PROPERTY_KEY="STORAGE_PASSWORD"
PROPERTY_VALUE=" " DEFAULT_PROPERTY_VALUE=" "
FREAD_ONLY="TRUE"/>
</table>
commit 9578cd367d1fdb028f2f38cff56135d410c8bc3e
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Wed Sep 25 15:43:20 2013 -0700
Add Date/Time range feedback of period being selected for charting. In addition to
showing the time range (i.e., X - Y) also show the length of the interval (i.e, '4
hours'). This applies to all chart types: resource, group, and multi-line.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractD3GraphListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractD3GraphListView.java
index 451659b..077a504 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractD3GraphListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractD3GraphListView.java
@@ -18,7 +18,6 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.common;
-import java.util.Date;
import java.util.List;
import com.google.gwt.user.client.Timer;
@@ -28,7 +27,6 @@ import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.measurement.Availability;
import org.rhq.core.domain.resource.group.composite.ResourceGroupAvailability;
import org.rhq.enterprise.gui.coregui.client.UserSessionManager;
-import
org.rhq.enterprise.gui.coregui.client.components.measurement.AbstractMeasurementRangeEditor;
import org.rhq.enterprise.gui.coregui.client.dashboard.AutoRefreshUtil;
import org.rhq.enterprise.gui.coregui.client.inventory.AutoRefresh;
import
org.rhq.enterprise.gui.coregui.client.inventory.common.graph.ButtonBarDateTimeRangeEditor;
@@ -48,11 +46,11 @@ public abstract class AbstractD3GraphListView extends EnhancedVLayout
implements
protected static final Label loadingLabel = new Label(MSG.common_msg_loading());
protected List<Availability> availabilityList;
protected List<ResourceGroupAvailability> groupAvailabilityList;
- protected AvailabilityD3GraphView availabilityGraph;
+ protected static AvailabilityD3GraphView availabilityGraph;
protected final MeasurementUserPreferences measurementUserPrefs;
protected boolean showAvailabilityGraph = false;
protected final ButtonBarDateTimeRangeEditor buttonBarDateTimeRangeEditor;
- protected Timer refreshTimer;
+ protected static Timer refreshTimer;
protected boolean isRefreshing;
public AbstractD3GraphListView() {
@@ -90,7 +88,7 @@ public abstract class AbstractD3GraphListView extends EnhancedVLayout
implements
if (isVisible() && !isRefreshing()) {
isRefreshing = true;
try {
- updateTimeRangeToNow();
+ buttonBarDateTimeRangeEditor.updateTimeRangeToNow();
refreshData();
} finally {
isRefreshing = false;
@@ -98,13 +96,4 @@ public abstract class AbstractD3GraphListView extends EnhancedVLayout
implements
}
}
- protected void updateTimeRangeToNow() {
- Date now = new Date();
- AbstractMeasurementRangeEditor.MetricRangePreferences metricRangePreferences =
measurementUserPrefs
- .getMetricRangePreferences();
- long timeRange = metricRangePreferences.end - metricRangePreferences.begin;
- Date newStartDate = new Date(now.getTime() - timeRange);
- buttonBarDateTimeRangeEditor.updateDateTimeRangeDisplay(newStartDate, now);
- buttonBarDateTimeRangeEditor.saveDateRange(newStartDate.getTime(),
now.getTime());
- }
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/ButtonBarDateTimeRangeEditor.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/ButtonBarDateTimeRangeEditor.java
index 5a81ab3..778bbb2 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/ButtonBarDateTimeRangeEditor.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/ButtonBarDateTimeRangeEditor.java
@@ -20,7 +20,6 @@ package org.rhq.enterprise.gui.coregui.client.inventory.common.graph;
import java.util.Date;
-import com.google.gwt.i18n.client.DateTimeFormat;
import com.smartgwt.client.types.FormErrorOrientation;
import com.smartgwt.client.types.SelectionType;
import com.smartgwt.client.types.VerticalAlignment;
@@ -58,11 +57,11 @@ public class ButtonBarDateTimeRangeEditor extends EnhancedVLayout {
private static final String TIMERANGE = "graphtimerange";
private static final int BUTTON_WIDTH = 28;
+ public final String DATE_TIME_FORMAT =
MSG.common_buttonbar_datetime_format_moment_js();
private MeasurementUserPreferences measurementUserPreferences;
private Refreshable d3GraphListView;
private Label dateRangeLabel;
- private static final DateTimeFormat fmt =
DateTimeFormat.getFormat(MSG.common_buttonbar_datetime_format());
private DateTimeButtonBarClickHandler dateTimeButtonBarClickHandler;
private AbstractMeasurementRangeEditor.MetricRangePreferences prefs;
final private ButtonBarDateTimeRangeEditor self;
@@ -80,8 +79,6 @@ public class ButtonBarDateTimeRangeEditor extends EnhancedVLayout {
dateTimeButtonBarClickHandler = new DateTimeButtonBarClickHandler();
prefs = measurementUserPreferences.getMetricRangePreferences();
- Log.debug("ButtonBarDateTimeRangeEditor initialized with start Date: "
+ new Date(prefs.begin) + " end Date: "
- + new Date(prefs.end));
}
@@ -123,7 +120,7 @@ public class ButtonBarDateTimeRangeEditor extends EnhancedVLayout {
dateRangeLabel = new Label();
dateRangeLabel.setWidth(400);
dateRangeLabel.addStyleName("graphDateTimeRangeLabel");
- updateDateTimeRangeDisplay(new Date(prefs.begin), new Date(prefs.end));
+ showUserFriendlyTimeRange(new Date(prefs.begin).getTime(), new
Date(prefs.end).getTime());
toolStrip.addMember(dateRangeLabel);
toolStrip.addSpacer(20);
@@ -151,10 +148,6 @@ public class ButtonBarDateTimeRangeEditor extends EnhancedVLayout {
createButtons();
}
- public Label getDateRangeLabel() {
- return dateRangeLabel;
- }
-
public Long getStartTime() {
return measurementUserPreferences.getMetricRangePreferences().begin;
}
@@ -175,11 +168,24 @@ public class ButtonBarDateTimeRangeEditor extends EnhancedVLayout {
return new Date(endDate.getTime() - dateTimeOffset);
}
- public void updateDateTimeRangeDisplay(Date startDate, Date endDate) {
- String rangeString = fmt.format(startDate) + " - " +
fmt.format(endDate);
- if (null != dateRangeLabel) {
- dateRangeLabel.setContents(rangeString);
- }
+ public native void showUserFriendlyTimeRange(double startTime, double endTime) /*-{
+ "use strict";
+ var startDateMoment = $wnd.moment(startTime),
+ endDateMoment = $wnd.moment(endTime),
+ dateTimeFormat =
this.@org.rhq.enterprise.gui.coregui.client.inventory.common.graph.ButtonBarDateTimeRangeEditor::DATE_TIME_FORMAT,
+ formattedDateRange = startDateMoment.format(dateTimeFormat) + ' - '
+ endDateMoment.format(dateTimeFormat),
+ timeRange = endDateMoment.from(startDateMoment,true);
+ $wnd.jQuery('.graphDateTimeRangeLabel').text(formattedDateRange+'
('+timeRange+')');
+ }-*/;
+
+ public void updateTimeRangeToNow() {
+ Log.debug("Updating timerange to now");
+ Date now = new Date();
+ AbstractMeasurementRangeEditor.MetricRangePreferences metricRangePreferences =
measurementUserPreferences.getMetricRangePreferences();
+ long timeRange = metricRangePreferences.end - metricRangePreferences.begin;
+ Date newStartDate = new Date(now.getTime() - timeRange);
+ showUserFriendlyTimeRange(newStartDate.getTime(), now.getTime());
+ saveDateRange(newStartDate.getTime(), now.getTime());
}
/**
@@ -190,8 +196,7 @@ public class ButtonBarDateTimeRangeEditor extends EnhancedVLayout {
* @param endTime double because JSNI doesn't support long
*/
public void saveDateRange(double startTime, double endTime) {
- final boolean advanced = true;
- prefs.explicitBeginEnd = advanced;
+ prefs.explicitBeginEnd = true; // default to advanced
prefs.begin = (long) startTime;
prefs.end = (long) endTime;
if (null != prefs.begin && null != prefs.end && prefs.begin >
prefs.end) {
@@ -208,10 +213,11 @@ public class ButtonBarDateTimeRangeEditor extends EnhancedVLayout {
public void onClick(ClickEvent clickEvent) {
IButton button = (IButton) clickEvent.getSource();
String selectedDateTimeRange = button.getTitle();
- Date calculatedStartDateTime = calculateStartDate(new Date(),
selectedDateTimeRange);
- saveDateRange(calculatedStartDateTime.getTime(), new Date().getTime());
+ Date now = new Date();
+ Date calculatedStartDateTime = calculateStartDate(now,
selectedDateTimeRange);
+ saveDateRange(calculatedStartDateTime.getTime(), now.getTime());
redrawGraphs();
- updateDateTimeRangeDisplay(calculatedStartDateTime, new Date());
+ showUserFriendlyTimeRange(calculatedStartDateTime.getTime(), now.getTime());
}
}
@@ -226,19 +232,10 @@ public class ButtonBarDateTimeRangeEditor extends EnhancedVLayout {
private final String label;
private final long timeSpanInSeconds;
- private final ClickHandler clickHandler;
DateTimeButton(String label, long timeSpanInSeconds) {
this.label = label;
this.timeSpanInSeconds = timeSpanInSeconds;
- this.clickHandler = new ClickHandler() {
- @Override
- public void onClick(ClickEvent clickEvent) {
- IButton button = (IButton) clickEvent.getSource();
-
- }
- };
-
}
}
@@ -307,7 +304,7 @@ public class ButtonBarDateTimeRangeEditor extends EnhancedVLayout {
.getMinutes());
buttonBarDateTimeRangeEditor.saveDateRange(newStartDate.getTime(),
newEndDate.getTime());
redrawGraphs();
- updateDateTimeRangeDisplay(startDateItem.getValueAsDate(),
endDateItem.getValueAsDate());
+ showUserFriendlyTimeRange(startDateItem.getValueAsDate().getTime(),
endDateItem.getValueAsDate().getTime());
CustomDateRangeWindow.this.destroy();
}
});
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/D3GroupGraphListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/D3GroupGraphListView.java
index bcb223a..dcfb744 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/D3GroupGraphListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/D3GroupGraphListView.java
@@ -141,6 +141,7 @@ public final class D3GroupGraphListView extends
AbstractD3GraphListView implemen
@Override
public void run() {
availabilityGraph.drawJsniChart();
+ buttonBarDateTimeRangeEditor.updateTimeRangeToNow();
}
}.schedule(150);
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupD3GraphListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupD3GraphListView.java
index 274354a..013696f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupD3GraphListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupD3GraphListView.java
@@ -103,6 +103,7 @@ public abstract class CompositeGroupD3GraphListView extends
EnhancedVLayout impl
}
public void populateData() {
+ buttonBarDateTimeRangeEditor.updateTimeRangeToNow();
ResourceGroupGWTServiceAsync groupService =
GWTServiceLookup.getResourceGroupService();
ResourceGroupCriteria criteria = new ResourceGroupCriteria();
@@ -142,6 +143,7 @@ public abstract class CompositeGroupD3GraphListView extends
EnhancedVLayout impl
Log.warn("# of charted graphs: " +
measurementForEachResource.size());
}
drawGraph();
+ buttonBarDateTimeRangeEditor.updateTimeRangeToNow();
}
});
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupD3MultiLineGraph.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupD3MultiLineGraph.java
index b89cc71..063cfdf 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupD3MultiLineGraph.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupD3MultiLineGraph.java
@@ -31,7 +31,7 @@ public class CompositeGroupD3MultiLineGraph extends
CompositeGroupD3GraphListVie
@Override
public native void drawJsniChart() /*-{
- console.log("Draw d3 MultiLine jsni chart");
+ //console.log("Draw d3 MultiLine jsni chart");
var MultiLineChartContext = function (chartId, chartHeight, metricsData,
xAxisLabel, chartTitle, yAxisUnits, minChartTitle, avgChartTitle, peakChartTitle,
dateLabel, timeLabel, chartHoverTimeFormat, chartHoverDateFormat, isPortalGraph, portalId,
buttonBarDateTimeFormat, chartXaxisTimeFormatHours, chartXaxisTimeFormatHoursMinutes) {
"use strict";
@@ -104,7 +104,7 @@ public class CompositeGroupD3MultiLineGraph extends
CompositeGroupD3GraphListVie
function determineScale() {
var xTicks, xTickSubDivide;
- console.log("DetermineScale for # resources: "+
chartContext.data.length);
+ //console.log("DetermineScale for # resources: "+
chartContext.data.length);
if (chartContext.data.length > 0) {
xTicks = 8;
@@ -299,16 +299,16 @@ public class CompositeGroupD3MultiLineGraph extends
CompositeGroupD3GraphListVie
draw: function (chartContext) {
"use strict";
// Guard condition that can occur when a portlet has not been
configured yet
- console.log("multi-resource chart handle:" +
chartContext.chartHandle);
+ //console.log("multi-resource chart handle:" +
chartContext.chartHandle);
if (chartContext.data.length > 0) {
- console.log("Creating MultiLine Chart: " +
chartContext.chartSelection + " --> " + chartContext.chartTitle);
+ //console.log("Creating MultiLine Chart: " +
chartContext.chartSelection + " --> " + chartContext.chartTitle);
determineScale();
createHeader(chartContext.chartTitle);
createYAxisGridLines();
createMultiLines(chartContext);
createXandYAxes();
createLegend();
- console.log("finished drawing multi-line graph");
+ //console.log("finished drawing multi-line graph");
}
}
}; // end public closure
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupMultiLineGraphListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupMultiLineGraphListView.java
deleted file mode 100644
index 101df60..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupMultiLineGraphListView.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2012 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.table;
-
-
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.Messages;
-
-/**
- * A MultiLine version of the Composite group single metric multiple resource charts.
- *
- * @author Mike Thompson
- */
-public final class CompositeGroupMultiLineGraphListView extends
CompositeGroupD3GraphListView
-{
- private static final Messages MSG = CoreGUI.getMessages();
-
- public CompositeGroupMultiLineGraphListView(int groupId, int defId, boolean
isAutogroup)
- {
- super(groupId, defId, isAutogroup);
- }
-
-
-
- @Override
- public native void drawJsniChart() /*-{
- console.log("Draw nvd3 charts for composite multiline graph");
- var chartId =
global.@org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.table.CompositeGroupD3GraphListView::getChartId()(),
- chartHandle = "#mChart-"+chartId,
- chartSelection = chartHandle + " svg",
- yAxisUnits =
this.@org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.table.CompositeGroupD3GraphListView::getYAxisUnits()(),
- xAxisLabel =
this.@org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.table.CompositeGroupD3GraphListView::getXAxisTitle()(),
- xAxisTimeFormat =
this.@org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.table.CompositeGroupMultiLineGraphListView::getXAxisTimeFormatHoursMinutes()();
- json =
eval(this.@org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.table.CompositeGroupD3GraphListView::getJsonMetrics()());
-
- $wnd.nv.addGraph(function() {
- var chart = $wnd.nv.models.lineChart();
-
- chart.xAxis.axisLabel(xAxisLabel)
- .tickFormat(function(d) { return
$wnd.d3.time.format(xAxisTimeFormat)(new Date(d)) });
-
- chart.yAxis
- .axisLabel(yAxisUnits)
- .tickFormat($wnd.d3.format('.02f'));
-
- $wnd.d3.select(chartSelection)
- .datum(json)
- .transition().duration(300)
- .call(chart);
-
- $wnd.nv.utils.windowResize(chart.update);
-
- return chart;
- });
-
- }-*/;
-
-
-
- public String getXAxisTimeFormatHoursMinutes() {
- return MSG.chart_xaxis_time_format_hours_minutes();
- }
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableView.java
index b29e59a..eb0540a 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/GroupMeasurementTableView.java
@@ -97,7 +97,7 @@ public class GroupMeasurementTableView extends
Table<GroupMetricsTableDataSource
AbstractMeasurementRangeEditor.MetricRangePreferences metricRangePreferences
= measurementUserPrefs.getMetricRangePreferences();
long timeRange = metricRangePreferences.end - metricRangePreferences.begin;
Date newStartDate = new Date(now.getTime() - timeRange);
- buttonBarDateTimeRangeEditor.updateDateTimeRangeDisplay(newStartDate, now);
+
buttonBarDateTimeRangeEditor.showUserFriendlyTimeRange(newStartDate.getTime(),
now.getTime());
buttonBarDateTimeRangeEditor.saveDateRange(newStartDate.getTime(),
now.getTime());
refreshData();
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityD3GraphView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityD3GraphView.java
index b914cd4..d46aa8c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityD3GraphView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityD3GraphView.java
@@ -47,8 +47,8 @@ public class AvailabilityD3GraphView<T extends
AvailabilityGraphType> extends En
}
@Override
- protected void onDraw() {
- super.onDraw();
+ protected void onInit() {
+ super.onInit();
removeMembers(getMembers());
addGraphMarkerComponent();
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
index f68e844..c8d56d3 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
@@ -73,7 +73,6 @@ public class MetricsResourceView extends AbstractD3GraphListView
implements
public void onInit() {
super.onInit();
- updateTimeRangeToNow();
final ResourceMetricAvailabilityView availabilityDetails = new
ResourceMetricAvailabilityView(resource);
availabilityDetails.hide();
@@ -162,6 +161,7 @@ public class MetricsResourceView extends AbstractD3GraphListView
implements
@Override
public void run() {
availabilityGraph.drawJsniChart();
+ buttonBarDateTimeRangeEditor.updateTimeRangeToNow();
}
}.schedule(150);
commit 093b388081bafff554293bd24ed52d1157aed376
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Sep 25 17:22:12 2013 -0400
revert rhq-server.properties and mgmt-users.properties on installation failure
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/file/FileReverter.java
b/modules/core/util/src/main/java/org/rhq/core/util/file/FileReverter.java
new file mode 100644
index 0000000..e05c914
--- /dev/null
+++ b/modules/core/util/src/main/java/org/rhq/core/util/file/FileReverter.java
@@ -0,0 +1,63 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.rhq.core.util.file;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+
+import org.rhq.core.util.stream.StreamUtil;
+
+/**
+ * This will slurp in the original content of a file and store it in memory. If, later,
you need to revert
+ * that file back to its original content, you can call #revert.
+ *
+ * NOTE: do not use this with large files. It will store the content in memory; large
files will result in
+ * out-of-memory exceptions.
+ *
+ * @author John Mazzitelli
+ *
+ */
+public class FileReverter {
+ private final File file;
+ private final byte[] originalContent;
+
+ public FileReverter(File file) {
+ this.file = file;
+ try {
+ this.originalContent = StreamUtil.slurp(new FileInputStream(file));
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to retrieve content from file: "
+ file);
+ }
+ }
+
+ public void revert() {
+ try {
+ StreamUtil.copy(new ByteArrayInputStream(this.originalContent), new
FileOutputStream(this.file));
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to revert file: " + file);
+ }
+ }
+}
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
index 6a8f70d..b45bca2 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
@@ -186,6 +186,10 @@ public abstract class ControlCommand {
return new File(baseDir, "jbossas/standalone/data/rhq.installed");
}
+ protected File getServerPropertiesFile() {
+ return new File(getBaseDir(), "bin/rhq-server.properties");
+ }
+
protected boolean isServerInstalled(File baseDir) {
File markerFile = getServerInstalledMarkerFile(baseDir);
return markerFile.exists();
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
index 7ff0990..3d56c60 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
@@ -46,6 +46,7 @@ import org.jboss.as.controller.client.ModelControllerClient;
import org.rhq.common.jbossas.client.controller.DeploymentJBossASClient;
import org.rhq.common.jbossas.client.controller.MCCHelper;
+import org.rhq.core.util.file.FileReverter;
import org.rhq.core.util.file.FileUtil;
import org.rhq.server.control.ControlCommand;
import org.rhq.server.control.RHQControlException;
@@ -183,7 +184,7 @@ public abstract class AbstractInstall extends ControlCommand {
Properties props = new Properties();
try {
- File propsFile = new File(getBaseDir(),
"bin/rhq-server.properties");
+ File propsFile = getServerPropertiesFile();
reader = new BufferedReader(new FileReader(propsFile));
props.load(reader);
@@ -427,10 +428,20 @@ public abstract class AbstractInstall extends ControlCommand {
try {
log.info("Installing RHQ server");
- // if the install fails, we will remove the install marker file allowing the
installer to be able to run again
+ // If the install fails, we will remove the install marker file allowing the
installer to be able to run again.
+ // We also need to revert mgmt-users.properties
+ File mgmtUserPropertiesFile = new File(getBaseDir(),
+ "jbossas/standalone/configuration/mgmt-users.properties");
+ final FileReverter mgmtUserPropertiesReverter = new
FileReverter(mgmtUserPropertiesFile);
addUndoTask(new Runnable() {
public void run() {
getServerInstalledMarkerFile(getBaseDir()).delete();
+ try {
+ mgmtUserPropertiesReverter.revert();
+ } catch (Exception e) {
+ throw new RuntimeException(
+ "Cannot revert mgmt user - you may have to revert
settings manually", e);
+ }
}
});
@@ -441,7 +452,7 @@ public abstract class AbstractInstall extends ControlCommand {
executor.execute(commandLine, new DefaultExecuteResultHandler());
log.info("The server installer is running");
- } catch (IOException e) {
+ } catch (Exception e) {
log.error("An error occurred while starting the server installer: "
+ e.getMessage());
}
}
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
index 4b1fd4e..88ec433 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
@@ -42,6 +42,7 @@ import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.exec.Executor;
import org.apache.commons.exec.PumpStreamHandler;
+import org.rhq.core.util.file.FileReverter;
import org.rhq.core.util.file.FileUtil;
import org.rhq.core.util.stream.StreamUtil;
import org.rhq.server.control.RHQControlException;
@@ -123,6 +124,19 @@ public class Install extends AbstractInstall {
return;
}
+ // If any failures occur, we know we need to reset rhq-server.properties.
+ final FileReverter serverPropFileReverter = new
FileReverter(getServerPropertiesFile());
+ addUndoTask(new Runnable() {
+ public void run() {
+ try {
+ serverPropFileReverter.revert();
+ } catch (Exception e) {
+ throw new RuntimeException(
+ "Cannot reset rhq-server.properties - you may have to
revert settings manually", e);
+ }
+ }
+ });
+
// if no options specified, then install whatever is not installed yet
if (!(commandLine.hasOption(STORAGE_OPTION) ||
commandLine.hasOption(SERVER_OPTION) || commandLine
.hasOption(AGENT_OPTION))) {
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
index 8bfa49e..1d2f817 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
@@ -43,6 +43,7 @@ import org.apache.commons.exec.PumpStreamHandler;
import org.rhq.core.util.PropertiesFileUpdate;
import org.rhq.core.util.exception.ThrowableUtil;
+import org.rhq.core.util.file.FileReverter;
import org.rhq.core.util.file.FileUtil;
import org.rhq.core.util.stream.StreamUtil;
import org.rhq.server.control.RHQControlException;
@@ -173,6 +174,19 @@ public class Upgrade extends AbstractInstall {
return;
}
+ // If any failures occur during upgrade, we know we need to reset
rhq-server.properties.
+ final FileReverter serverPropFileReverter = new
FileReverter(getServerPropertiesFile());
+ addUndoTask(new Runnable() {
+ public void run() {
+ try {
+ serverPropFileReverter.revert();
+ } catch (Exception e) {
+ throw new RuntimeException(
+ "Cannot reset rhq-server.properties - you may have to
revert settings manually", e);
+ }
+ }
+ });
+
// now upgrade everything and start them up again
upgradeStorage(commandLine);
upgradeServer(commandLine);
commit 87740ae36b3d268b125f390ae7072e924051b601
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Sep 25 13:39:05 2013 -0400
provide a way for the user to not clean up - this is useful for debugging an
installation failure.
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
index 9f12c25..2d8d54c 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
@@ -105,9 +105,13 @@ public class RHQControl {
if (undo && command != null) {
try {
- command.undo();
+ if (!Boolean.getBoolean("rhqctl.skip.undo")) {
+ command.undo();
+ } else {
+ throw new Exception("Was told by user to skip clean up
attempt.");
+ }
} catch (Throwable t) {
- log.warn("An attempt to clean up after the failed installation was
unsuccessful. "
+ log.warn("Failed to clean up after the failed installation attempt.
"
+ "You may have to clean up some things before attempting to
install again", t);
}
}
commit d1dc34f4c2fd223735ae2e1b2e242732611d03fc
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Sep 25 12:41:59 2013 -0400
don't show stderr from kill -0 that is executed to see if the process exists or
not
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
index 337c88e..6a8f70d 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
@@ -352,7 +352,8 @@ public abstract class ControlCommand {
Executor executor = new DefaultExecutor();
executor.setWorkingDirectory(getBinDir());
- executor.setStreamHandler(new PumpStreamHandler());
+ PumpStreamHandler streamHandler = new PumpStreamHandler(new NullOutputStream(),
new NullOutputStream());
+ executor.setStreamHandler(streamHandler);
org.apache.commons.exec.CommandLine commandLine = new
org.apache.commons.exec.CommandLine("/bin/kill")
.addArgument("-0")
.addArgument(pid);
commit f36fa3e0f783f179cb1409c22ab67c1c961578e1
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Sep 25 12:41:27 2013 -0400
why does this exist? it duplicates a method in the superclass hierarchy. removing it.
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
index 987e224..7ff0990 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
@@ -39,7 +39,6 @@ import org.apache.commons.cli.ParseException;
import org.apache.commons.cli.PosixParser;
import org.apache.commons.exec.DefaultExecuteResultHandler;
import org.apache.commons.exec.DefaultExecutor;
-import org.apache.commons.exec.ExecuteException;
import org.apache.commons.exec.Executor;
import org.apache.commons.exec.PumpStreamHandler;
@@ -136,31 +135,6 @@ public abstract class AbstractInstall extends ControlCommand {
}
- protected boolean isUnixPidRunning(String pid) {
-
- Executor executor = new DefaultExecutor();
- executor.setWorkingDirectory(getBinDir());
- executor.setStreamHandler(new PumpStreamHandler());
- org.apache.commons.exec.CommandLine commandLine;
-
- commandLine = new
org.apache.commons.exec.CommandLine("/bin/kill").addArgument("-0").addArgument(pid);
-
- try {
- int code = executor.execute(commandLine);
- if (code != 0) {
- return false;
- }
- } catch (ExecuteException ee) {
- if (ee.getExitValue() == 1) {
- // return code 1 means process does not exist
- return false;
- }
- } catch (IOException e) {
- log.error("Checking for running process failed: " +
e.getMessage());
- }
- return true;
- }
-
protected void waitForRHQServerToInitialize() throws Exception {
try {
final long messageInterval = 30000L;
commit 2361b825acc4f1da3a7ff5617638c8b2b98e42df
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Sep 25 10:21:14 2013 -0400
we don't need commons.io dep - just make our own simple null out stream
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
index 3f61ace..337c88e 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
@@ -28,6 +28,7 @@ package org.rhq.server.control;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
+import java.io.OutputStream;
import java.net.Socket;
import java.util.ArrayList;
import java.util.Collections;
@@ -46,7 +47,6 @@ import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.exec.ExecuteException;
import org.apache.commons.exec.Executor;
import org.apache.commons.exec.PumpStreamHandler;
-import org.apache.commons.io.output.NullOutputStream;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -341,22 +341,11 @@ public abstract class ControlCommand {
protected void killPid(String pid) throws IOException {
Executor executor = new DefaultExecutor();
executor.setWorkingDirectory(getBinDir());
- org.apache.commons.io.output.ByteArrayOutputStream buffer = new
org.apache.commons.io.output.ByteArrayOutputStream();
- NullOutputStream nullOs = new NullOutputStream();
- PumpStreamHandler streamHandler = new PumpStreamHandler(nullOs, buffer);
+ PumpStreamHandler streamHandler = new PumpStreamHandler(new NullOutputStream(),
new NullOutputStream());
executor.setStreamHandler(streamHandler);
org.apache.commons.exec.CommandLine commandLine;
commandLine = new
org.apache.commons.exec.CommandLine("kill").addArgument(pid);
- try {
- executor.execute(commandLine);
- } finally {
- try {
- nullOs.close();
- buffer.close();
- } catch (Throwable t) {
- // best effort
- }
- }
+ executor.execute(commandLine);
}
protected boolean isUnixPidRunning(String pid) {
@@ -399,4 +388,18 @@ public abstract class ControlCommand {
return true;
}
}
+
+ private class NullOutputStream extends OutputStream {
+ @Override
+ public void write(byte[] b, int off, int len) {
+ }
+
+ @Override
+ public void write(int b) {
+ }
+
+ @Override
+ public void write(byte[] b) throws IOException {
+ }
+ }
}
commit d7d3a9af3e1099fe590d0213859ffcfa501de294
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Sep 25 09:46:13 2013 -0400
try to hide kill output on console - we don't need to show it
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
index f251be6..3f61ace 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
@@ -46,6 +46,7 @@ import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.exec.ExecuteException;
import org.apache.commons.exec.Executor;
import org.apache.commons.exec.PumpStreamHandler;
+import org.apache.commons.io.output.NullOutputStream;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -340,11 +341,22 @@ public abstract class ControlCommand {
protected void killPid(String pid) throws IOException {
Executor executor = new DefaultExecutor();
executor.setWorkingDirectory(getBinDir());
- executor.setStreamHandler(new PumpStreamHandler());
+ org.apache.commons.io.output.ByteArrayOutputStream buffer = new
org.apache.commons.io.output.ByteArrayOutputStream();
+ NullOutputStream nullOs = new NullOutputStream();
+ PumpStreamHandler streamHandler = new PumpStreamHandler(nullOs, buffer);
+ executor.setStreamHandler(streamHandler);
org.apache.commons.exec.CommandLine commandLine;
-
commandLine = new
org.apache.commons.exec.CommandLine("kill").addArgument(pid);
- executor.execute(commandLine);
+ try {
+ executor.execute(commandLine);
+ } finally {
+ try {
+ nullOs.close();
+ buffer.close();
+ } catch (Throwable t) {
+ // best effort
+ }
+ }
}
protected boolean isUnixPidRunning(String pid) {
commit 52bd8ca8f3b5e16e4f79e011a906406410579844
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Sep 25 09:45:51 2013 -0400
add shutdown hook to perform the undo if the installer was aborted via kill signal
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
index fe12766..9f12c25 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
@@ -58,6 +58,8 @@ public class RHQControl {
public void exec(String[] args) {
ControlCommand command = null;
boolean undo = false;
+ AbortHook abortHook = new AbortHook();
+
try {
if (args.length == 0) {
printUsage();
@@ -81,6 +83,11 @@ public class RHQControl {
}
}
+ // in case the installer gets killed, prepare the shutdown hook to try
the undo
+ abortHook.setCommand(command);
+ Runtime.getRuntime().addShutdownHook(abortHook);
+
+ // run the command
command.exec(getCommandLine(commandName, args));
}
} catch (UsageException e) {
@@ -91,6 +98,9 @@ public class RHQControl {
} catch (Throwable t) {
log.error(t);
undo = true;
+ } finally {
+ abortHook.setCommand(null);
+ Runtime.getRuntime().removeShutdownHook(abortHook);
}
if (undo && command != null) {
@@ -144,4 +154,27 @@ public class RHQControl {
}
}
+ private class AbortHook extends Thread {
+ private ControlCommand command = null;
+
+ public AbortHook() {
+ super("Controller Abort Hook");
+ }
+
+ public void setCommand(ControlCommand cmd) {
+ this.command = cmd;
+ }
+
+ @Override
+ public void run() {
+ try {
+ if (this.command != null) {
+ this.command.undo();
+ }
+ } catch (Throwable t) {
+ log.warn("An attempt to clean up after an aborted installation was
unsuccessful. "
+ + "You may have to clean up some things before attempting to
install again", t);
+ }
+ }
+ }
}
commit d2410ab75b1274867bb9b7f378219974519e6426
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Sep 25 09:42:57 2013 -0400
fix bug - actually use nullOs rather than create it and ignore it
diff --git
a/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
b/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
index 99f4894..295c7ed 100644
---
a/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
+++
b/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
@@ -692,7 +692,7 @@ public class StorageInstaller {
Executor executor = new DefaultExecutor();
org.apache.commons.io.output.ByteArrayOutputStream buffer = new
org.apache.commons.io.output.ByteArrayOutputStream();
NullOutputStream nullOs = new NullOutputStream();
- PumpStreamHandler streamHandler = new PumpStreamHandler(new NullOutputStream(),
buffer);
+ PumpStreamHandler streamHandler = new PumpStreamHandler(nullOs, buffer);
executor.setWorkingDirectory(workingDir);
executor.setStreamHandler(streamHandler);
String result = "";
commit b130f6a4194d944fae8fc582fca8f561c37922f9
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Sep 24 16:11:25 2013 -0400
add undo logic so the installer tries to clean up in case it aborts mid-way through
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
index b3e09a2..f251be6 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
@@ -30,6 +30,7 @@ import java.io.FileReader;
import java.io.IOException;
import java.net.Socket;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Locale;
@@ -74,6 +75,25 @@ public abstract class ControlCommand {
private PropertiesConfiguration rhqctlConfig;
+ private ArrayList<Runnable> undoTasks = new ArrayList<Runnable>();
+
+ protected void undo() {
+ Collections.reverse(undoTasks); // do the undo tasks in the reverse order in
which they were added to the list
+ for (Runnable undoTask : undoTasks) {
+ try {
+ undoTask.run();
+ } catch (Throwable t) {
+ log.error("Failed to invoke undo task [" + undoTask
+ + "], will keep going but system may be in an indeterminate
state");
+ }
+ }
+ return;
+ }
+
+ protected void addUndoTask(Runnable r) {
+ undoTasks.add(r);
+ }
+
public ControlCommand() {
basedir = new File(System.getProperty("rhq.server.basedir"));
binDir = new File(basedir, "bin/internal");
@@ -161,9 +181,12 @@ public abstract class ControlCommand {
return isServerInstalled(getBaseDir());
}
- protected boolean isServerInstalled(File baseDir) {
- File markerFile = new File(baseDir,
"jbossas/standalone/data/rhq.installed");
+ protected File getServerInstalledMarkerFile(File baseDir) {
+ return new File(baseDir, "jbossas/standalone/data/rhq.installed");
+ }
+ protected boolean isServerInstalled(File baseDir) {
+ File markerFile = getServerInstalledMarkerFile(baseDir);
return markerFile.exists();
}
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
index 9f7c80f..fe12766 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
@@ -56,12 +56,14 @@ public class RHQControl {
}
public void exec(String[] args) {
+ ControlCommand command = null;
+ boolean undo = false;
try {
if (args.length == 0) {
printUsage();
} else {
String commandName = findCommand(commands, args);
- ControlCommand command = commands.get(commandName);
+ command = commands.get(commandName);
// perform any up front validation we can at this point. Not that after
this point we
// lose stdin due to the use of ProcessExecutions.
@@ -84,8 +86,23 @@ public class RHQControl {
} catch (UsageException e) {
printUsage();
} catch (RHQControlException e) {
- log.error(e.getMessage() + " [Cause: " + e.getCause() +
"]");
+ log.error(e.getMessage() + " [Cause: " + e.getCause() +
"]", e);
+ undo = true;
+ } catch (Throwable t) {
+ log.error(t);
+ undo = true;
}
+
+ if (undo && command != null) {
+ try {
+ command.undo();
+ } catch (Throwable t) {
+ log.warn("An attempt to clean up after the failed installation was
unsuccessful. "
+ + "You may have to clean up some things before attempting to
install again", t);
+ }
+ }
+
+ return;
}
private String findCommand(Commands commands, String[] args) throws
RHQControlException {
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
index cc599b3..987e224 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
@@ -34,6 +34,9 @@ import java.util.List;
import java.util.Properties;
import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.ParseException;
+import org.apache.commons.cli.PosixParser;
import org.apache.commons.exec.DefaultExecuteResultHandler;
import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.exec.ExecuteException;
@@ -44,6 +47,7 @@ import org.jboss.as.controller.client.ModelControllerClient;
import org.rhq.common.jbossas.client.controller.DeploymentJBossASClient;
import org.rhq.common.jbossas.client.controller.MCCHelper;
+import org.rhq.core.util.file.FileUtil;
import org.rhq.server.control.ControlCommand;
import org.rhq.server.control.RHQControlException;
@@ -198,7 +202,6 @@ public abstract class AbstractInstall extends ControlCommand {
}
}
- @SuppressWarnings("resource")
protected boolean isRHQServerInitialized() throws IOException {
BufferedReader reader = null;
@@ -259,7 +262,7 @@ public abstract class AbstractInstall extends ControlCommand {
startAgent(agentBasedir, false);
}
- protected void startAgent(File agentBasedir, boolean updateWindowsService) throws
Exception {
+ protected void startAgent(final File agentBasedir, boolean updateWindowsService)
throws Exception {
try {
File agentBinDir = new File(agentBasedir, "bin");
if (!agentBinDir.exists()) {
@@ -299,6 +302,17 @@ public abstract class AbstractInstall extends ControlCommand {
commandLine = getCommandLine("rhq-agent-wrapper",
"start");
executor.execute(commandLine);
+ // if any errors occur after now, we need to stop the agent
+ addUndoTask(new Runnable() {
+ public void run() {
+ try {
+ stopAgent(agentBasedir);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+
log.info("The agent has started up");
} catch (IOException e) {
log.error("An error occurred while starting the agent: " +
e.getMessage());
@@ -399,6 +413,8 @@ public abstract class AbstractInstall extends ControlCommand {
executor.execute(commandLine, new DefaultExecuteResultHandler());
}
+ addUndoTaskToStopComponent("--server"); // if any errors occur
after now, we need to stop the server
+
// Wait for the server to complete it's startup
log.info("Waiting for the RHQ Server to start in preparation of running
the server installer...");
commandLine = getCommandLine("rhq-installer", "--test");
@@ -437,6 +453,13 @@ public abstract class AbstractInstall extends ControlCommand {
try {
log.info("Installing RHQ server");
+ // if the install fails, we will remove the install marker file allowing the
installer to be able to run again
+ addUndoTask(new Runnable() {
+ public void run() {
+ getServerInstalledMarkerFile(getBaseDir()).delete();
+ }
+ });
+
org.apache.commons.exec.CommandLine commandLine =
getCommandLine("rhq-installer");
Executor executor = new DefaultExecutor();
executor.setWorkingDirectory(getBinDir());
@@ -450,7 +473,7 @@ public abstract class AbstractInstall extends ControlCommand {
}
private class StorageDataDirectories {
- public File basedir; // the other three will be under this base directory
+ public File basedir; // the other three will typically be under this base
directory
public File dataDir;
public File commitlogDir;
public File savedcachesDir;
@@ -463,40 +486,85 @@ public abstract class AbstractInstall extends ControlCommand {
storageDataDirs = new StorageDataDirectories();
storageDataDirs.basedir = new
File(commandLine.getOptionValue(STORAGE_DATA_ROOT_DIR));
storageDataDirs.dataDir = new File(storageDataDirs.basedir,
"data");
- storageDataDirs.commitlogDir = new File(storageDataDirs.basedir,
"commitlog");
+ storageDataDirs.commitlogDir = new File(storageDataDirs.basedir,
"commit_log");
storageDataDirs.savedcachesDir = new File(storageDataDirs.basedir,
"saved_caches");
}
return storageDataDirs;
}
- protected int installStorageNode(File storageBasedir, CommandLine rhqctlCommandLine)
throws IOException {
+ private StorageDataDirectories getStorageDataDirectoriesFromProperties(Properties
storageProperties) {
+ File basedirForData = new File(getBaseDir().getParentFile(),
"rhq-data");
+
+ // check that the data directories are set and convert to absolute dirs
+ File dataDirProp = new File(storageProperties.getProperty("data",
"data"));
+ File commitlogDirProp = new
File(storageProperties.getProperty("commitlog", "commit_log"));
+ File savedcachesDirProp = new
File(storageProperties.getProperty("saved-caches", "saved_caches"));
+
+ if (!dataDirProp.isAbsolute()) {
+ dataDirProp = new File(basedirForData, dataDirProp.getPath());
+ }
+ if (!commitlogDirProp.isAbsolute()) {
+ commitlogDirProp = new File(basedirForData, commitlogDirProp.getPath());
+ }
+ if (!savedcachesDirProp.isAbsolute()) {
+ savedcachesDirProp = new File(basedirForData, savedcachesDirProp.getPath());
+ }
+
+ StorageDataDirectories storageDataDirs = new StorageDataDirectories();
+ storageDataDirs.basedir = basedirForData;
+ storageDataDirs.dataDir = dataDirProp;
+ storageDataDirs.commitlogDir = commitlogDirProp;
+ storageDataDirs.savedcachesDir = savedcachesDirProp;
+ return storageDataDirs;
+ }
+
+ protected int installStorageNode(final File storageBasedir, CommandLine
rhqctlCommandLine) throws IOException {
try {
log.info("Preparing to install RHQ storage node.");
putProperty(RHQ_STORAGE_BASEDIR_PROP, storageBasedir.getAbsolutePath());
+ final Properties storageProperties = loadStorageProperties();
+
org.apache.commons.exec.CommandLine commandLine =
getCommandLine("rhq-storage-installer", "--dir",
storageBasedir.getAbsolutePath());
if (rhqctlCommandLine.hasOption(STORAGE_DATA_ROOT_DIR)) {
StorageDataDirectories dataDirs;
dataDirs = getCustomStorageDataDirectories(rhqctlCommandLine);
- commandLine.addArguments(new String[] { "--data",
dataDirs.dataDir.getAbsolutePath() });
- commandLine.addArguments(new String[] { "--commitlog",
dataDirs.commitlogDir.getAbsolutePath() });
- commandLine.addArguments(new String[] { "--saved-caches",
dataDirs.savedcachesDir.getAbsolutePath() });
+ storageProperties.setProperty("data",
dataDirs.dataDir.getAbsolutePath());
+ storageProperties.setProperty("commitlog",
dataDirs.commitlogDir.getAbsolutePath());
+ storageProperties.setProperty("saved-caches",
dataDirs.savedcachesDir.getAbsolutePath());
}
// add the properties set in rhq-storage.properties to the command line
- String[] args = toArray(loadStorageProperties());
+ String[] args = toArray(storageProperties);
commandLine.addArguments(args);
+ // if the install fails, we need to delete the data directories that were
created and
+ // purge the rhq-storage install directory that might have a "half"
installed storage node in it.
+ addUndoTask(new Runnable() {
+ public void run() {
+ StorageDataDirectories dataDirs =
getStorageDataDirectoriesFromProperties(storageProperties);
+ FileUtil.purge(dataDirs.dataDir, true);
+ FileUtil.purge(dataDirs.commitlogDir, true);
+ FileUtil.purge(dataDirs.savedcachesDir, true);
+
+ FileUtil.purge(storageBasedir, true);
+ }
+ });
+
+ // execute the storage installer now
Executor executor = new DefaultExecutor();
executor.setWorkingDirectory(getBinDir());
executor.setStreamHandler(new PumpStreamHandler());
-
int exitCode = executor.execute(commandLine);
log.info("The storage node installer has finished with an exit value of
" + exitCode);
+
+ // the storage node is installed AND running now so, if we fail later, we
need to shut the storage node down
+ addUndoTaskToStopComponent("--storage");
+
return exitCode;
} catch (IOException e) {
log.error("An error occurred while running the storage installer: "
+ e.getMessage());
@@ -508,6 +576,22 @@ public abstract class AbstractInstall extends ControlCommand {
}
}
+ protected void addUndoTaskToStopComponent(final String componentArgument) {
+ // component argument must be one of --storage, --server, --agent (a valid
argument to the Stop command)
+ addUndoTask(new Runnable() {
+ public void run() {
+ try {
+ Stop stopCommand = new Stop();
+ CommandLineParser parser = new PosixParser();
+ CommandLine cmdLine = parser.parse(stopCommand.getOptions(), new
String[] { componentArgument });
+ stopCommand.exec(cmdLine);
+ } catch (ParseException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+ }
+
private Properties loadStorageProperties() throws IOException {
Properties properties = new Properties();
FileInputStream fis = null;
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
index 451e880..4b1fd4e 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
@@ -42,6 +42,7 @@ import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.exec.Executor;
import org.apache.commons.exec.PumpStreamHandler;
+import org.rhq.core.util.file.FileUtil;
import org.rhq.core.util.stream.StreamUtil;
import org.rhq.server.control.RHQControlException;
@@ -273,7 +274,7 @@ public class Install extends AbstractInstall {
}
}
- private void installAgent(File agentBasedir) throws IOException {
+ private void installAgent(final File agentBasedir) throws IOException {
try {
log.info("Installing RHQ agent");
@@ -281,6 +282,13 @@ public class Install extends AbstractInstall {
putProperty(RHQ_AGENT_BASEDIR_PROP, agentBasedir.getAbsolutePath());
+ // if the install fails, we will completely delete any agent that might have
been "half" installed
+ addUndoTask(new Runnable() {
+ public void run() {
+ FileUtil.purge(agentBasedir, true);
+ }
+ });
+
org.apache.commons.exec.CommandLine commandLine = new
org.apache.commons.exec.CommandLine("java")
.addArgument("-jar").addArgument(agentInstallerJar.getAbsolutePath())
.addArgument("--install=" +
agentBasedir.getParentFile().getAbsolutePath())
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
index 9857645..8bfa49e 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
@@ -240,10 +240,16 @@ public class Upgrade extends AbstractInstall {
// If upgrading from a pre-cassandra then just install an initial storage node.
Otherwise, upgrade
if (isRhq48OrLater(rhqctlCommandLine)) {
try {
- // We need to be sure the storage is really stopped (long enough)
- // to not get a port conflict
+ // We need to be sure the storage is really stopped (long enough) to not
get a port conflict
waitForProcessToStop(getStoragePid());
+ // if the upgrade fails, we need to purge the new storage node basedir to
allow for user to try again later
+ addUndoTask(new Runnable() {
+ public void run() {
+ FileUtil.purge(getStorageBasedir(), true);
+ }
+ });
+
org.apache.commons.exec.CommandLine commandLine =
getCommandLine("rhq-storage-installer", "--upgrade",
getFromServerDir(rhqctlCommandLine).getAbsolutePath());
Executor executor = new DefaultExecutor();
@@ -576,7 +582,7 @@ public class Upgrade extends AbstractInstall {
log.info("Upgrading RHQ agent located at: " +
oldAgentDir.getAbsolutePath());
- File agentBasedir = getAgentBasedir();
+ final File agentBasedir = getAgentBasedir();
File agentInstallerJar = getFileDownload("rhq-agent",
"rhq-enterprise-agent");
org.apache.commons.exec.CommandLine commandLine = new
org.apache.commons.exec.CommandLine("java") //
@@ -601,6 +607,12 @@ public class Upgrade extends AbstractInstall {
}
}
+ addUndoTask(new Runnable() {
+ public void run() {
+ FileUtil.purge(agentBasedir, true);
+ }
+ });
+
log.info("The agent has been upgraded and placed in: " +
agentBasedir);
} catch (IOException e) {
commit 5f95e5c0e9db5d58aef69f53165514670b46b7b9
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Wed Sep 25 19:46:45 2013 +0200
[BZ 1002252] - JON server becomes unreachable with no explanation if storage node is
not yet running when JON server is started - Displaying what subsystems have failed during
the RHQ server startup on the root context webapp (localhost:7080/).
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
index 7c5c3d4..d8e5e33 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
@@ -38,6 +38,7 @@ import org.rhq.enterprise.gui.legacy.util.SessionUtils;
import org.rhq.enterprise.server.auth.SessionManager;
import org.rhq.enterprise.server.auth.SessionNotFoundException;
import org.rhq.enterprise.server.auth.SessionTimeoutException;
+import org.rhq.enterprise.server.core.StartupLocal;
import org.rhq.enterprise.server.util.LookupUtil;
/**
@@ -144,7 +145,7 @@ public class SessionAccessServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
- response.setContentType("text/plain");
+ response.setContentType("application/json");
response.addHeader("Pragma", "no-cache");
response.addHeader("Cache-Control", "no-cache");
response.addHeader("Cache-Control", "no-store");
@@ -152,12 +153,18 @@ public class SessionAccessServlet extends HttpServlet {
// some date in the past
response.addHeader("Expires", "Mon, 8 Aug 2006 10:00:00
GMT");
boolean serverInitialized;
+ String startupError = null;
try {
- serverInitialized = LookupUtil.getStartupLocal().isInitialized();
+ StartupLocal startupBean = LookupUtil.getStartupLocal();
+ serverInitialized = startupBean.isInitialized();
+ startupError = startupBean.getError();
} catch (Throwable t) {
serverInitialized = false; // this probably means we are still starting up
and app server hasn't made EJBs available yet
}
PrintWriter out = response.getWriter();
- out.println(serverInitialized);
+ out.println("{");
+ out.println(" \"serverInitialized\": " + serverInitialized +
",");
+ out.println(" \"startupError\": " + (startupError == null ?
"null" : "\"" + startupError + "\""));
+ out.println("}");
}
}
diff --git a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
index 4ded9d1..1f28f14 100644
--- a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
+++ b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
@@ -447,27 +447,41 @@
<body>

<script type="text/JavaScript">

<!--

- function httpGet() {

- var url = "/portal/sessionAccess";

- var xmlHttp = null;

- xmlHttp = new XMLHttpRequest();

- xmlHttp.open("GET", url, false);

- xmlHttp.send(null);

- return xmlHttp.responseText;

- }

- function checkIfRunning() {

- var response = httpGet();

- if (response.trim() === "true") {

- location.href = "/coregui";

- } else {

- var el = document.getElementById("progress");
- if (el != null) {

- el.innerHTML= el.innerHTML.trim() + ".";

- }

- setTimeout("checkIfRunning();", 4000);

- }

- }

- checkIfRunning();

+ function httpGet() {

+ var url = "/portal/sessionAccess";

+ var xmlHttp = null;

+ xmlHttp = new XMLHttpRequest();

+ xmlHttp.open("GET", url, false);

+ xmlHttp.send(null);

+ return xmlHttp;

+ }

+ function showError(msg) {

+ var elError = document.getElementById("error");

+ if (elError != null) {

+ if (msg) {

+ elError.innerHTML = "Following subsystems had problem to start:
<b>" + msg + "</b>";

+ if (msg.indexOf("storage") != -1) elError.innerHTML +=
"<br /><i>NOTE: Start at least one storage node as soon as
possible.</i>"

+ elError.setAttribute("style",
elError.getAttribute("style").replace(/display:.*/gi, "display:
visible;"));

+ } else elError.setAttribute("style",
elError.getAttribute("style").replace(/display:.*/gi, "display:
none;"));

+ }

+ }

+ function checkIfRunning(attemptNum) {

+ var response = httpGet();

+ if (response.status === 200) {

+ var json = JSON.parse(response.responseText);

+ if (json.serverInitialized) {

+ location.href = "/coregui";

+ } else {

+ showError(json.startupError);

+ }

+ }

+ var elProgress = document.getElementById("progress");

+ if (elProgress != null) {

+ elProgress.innerHTML = elProgress.innerHTML.trim() + "." +
(attemptNum % 180 == 0 ? "<br />" : "") ;

+ }

+ setTimeout("checkIfRunning(" + (attemptNum + 1) + ");",
3000);

+ }

+ checkIfRunning(16);

-->

</script>'/>
@@ -476,7 +490,8 @@
<div class="section">

<h1>EAP 6 Notification</h1>

<h3>Your RHQ Server is being started, please
wait.</h3>

- <p class="WarnBlock"
id="progress">Starting..</p>

+ <p class="WarnBlock" id="error"
style="background-color: #DE7272; display: none;"></p>

+ <p class="WarnBlock" id="progress">Starting
..</p>

<sub>You will be automatically redirected once the RHQ server is up
and running. If this takes more than 10 minutes, please check the server log for possible
issues.</sub>

</div>'/>
</target>
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
index cc581b3..c484e0a 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
@@ -112,6 +112,8 @@ public class StartupBean implements StartupLocal {
private volatile boolean initialized = false;
+ private String error = "";
+
@EJB
private AgentManagerLocal agentManager;
@@ -153,6 +155,11 @@ public class StartupBean implements StartupLocal {
return this.initialized;
}
+ @Override
+ public String getError() {
+ return error;
+ }
+
/**
* Modifies the naming subsystem to be able to check for Java security permissions on
JNDI lookup.
*/
@@ -183,6 +190,7 @@ public class StartupBean implements StartupLocal {
try {
resourceTypeManager.reloadResourceFacetsCache();
} catch (Throwable t) {
+ error += (error.isEmpty() ? "" : ", ") + "reloading
facets cache";
log.error("Could not load ResourceFacets cache.", t);
}
@@ -254,6 +262,7 @@ public class StartupBean implements StartupLocal {
conn = dataSource.getConnection();
DatabaseTypeFactory.setDefaultDatabaseType(DatabaseTypeFactory.getDatabaseType(conn));
} catch (Exception e) {
+ error += (error.isEmpty() ? "" : ", ") +
"server";
log.error("Could not initialize server.", e);
} finally {
if (conn != null) {
@@ -329,6 +338,7 @@ public class StartupBean implements StartupLocal {
try {
systemManager.enableHibernateStatistics();
} catch (Exception e) {
+ error += (error.isEmpty() ? "" : ", ") + "hibernate
statistics";
throw new RuntimeException("Cannot start hibernate statistics
monitoring!", e);
}
}
@@ -348,6 +358,7 @@ public class StartupBean implements StartupLocal {
PluginDeploymentScannerMBean deployer = getPluginDeploymentScanner();
deployer.startDeployment();
} catch (Exception e) {
+ error += (error.isEmpty() ? "" : ", ") + "plugin
deployer";
throw new RuntimeException("Cannot start the agent/server plugin
deployer!", e);
}
}
@@ -373,6 +384,7 @@ public class StartupBean implements StartupLocal {
// create a non-persistent periodic timer (we'll reset it ever startup)
with the scan period as configured in our scanner object
timerService.createIntervalTimer(scanPeriod, scanPeriod, new
TimerConfig(null, false));
} catch (Exception e) {
+ error += (error.isEmpty() ? "" : ", ") + "plugin
scanner";
throw new RuntimeException("Cannot schedule plugin scanning timer - new
plugins will not be detected!", e);
}
}
@@ -416,6 +428,7 @@ public class StartupBean implements StartupLocal {
iface, false);
jaas_mbean.upgradeRhqUserSecurityDomainIfNeeded();
} catch (Exception e) {
+ error += (error.isEmpty() ? "" : ", ") + "security
domain upgrade";
throw new RuntimeException("Cannot upgrade JAAS login modules!",
e);
}
}
@@ -431,6 +444,7 @@ public class StartupBean implements StartupLocal {
try {
schedulerBean.initQuartzScheduler();
} catch (SchedulerException e) {
+ error += (error.isEmpty() ? "" : ", ") + "scheduler
initialization";
throw new RuntimeException("Cannot initialize the scheduler!", e);
}
}
@@ -442,6 +456,9 @@ public class StartupBean implements StartupLocal {
*/
private boolean initStorageClient() {
boolean isStorageRunning = storageClientManager.init();
+ if (!isStorageRunning) {
+ error += (error.isEmpty() ? "" : ", ") +
"storage";
+ }
return isStorageRunning;
}
@@ -457,6 +474,7 @@ public class StartupBean implements StartupLocal {
try {
schedulerBean.startQuartzScheduler();
} catch (SchedulerException e) {
+ error += (error.isEmpty() ? "" : ", ") +
"scheduler";
throw new RuntimeException("Cannot start the scheduler!", e);
}
}
@@ -829,6 +847,7 @@ public class StartupBean implements StartupLocal {
ServerPluginServiceMBean mbean = LookupUtil.getServerPluginService();
mbean.startMasterPluginContainerWithoutSchedulingJobs();
} catch (Exception e) {
+ error += (error.isEmpty() ? "" : ", ") + "server
plugin container";
throw new RuntimeException("Cannot start the master server plugin
container!", e);
}
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupLocal.java
index bc98bbf..71b0357 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupLocal.java
@@ -33,6 +33,13 @@ public interface StartupLocal {
boolean isInitialized();
/**
+ * This method can be used for investigating the startup failure
+ *
+ * @return short text representation indicating what subsystem wasn't started
+ */
+ String getError();
+
+ /**
* Tells the startup bean to do its work. This will finish the initialization of the
server.
*/
void init();
commit c483b092d7ca520275e3424e8042f391c8fd360d
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Wed Sep 25 19:42:08 2013 +0200
[BZ 1002252] - JON server becomes unreachable with no explanation if storage node is
not yet running when JON server is started - Letting RHQ server to start even without
connection to storage cluster. In this case the quartz job is scheduled that will do the
necessary work once the storage is up (and cancel itself).
diff --git
a/modules/common/cassandra-schema/src/main/java/org/rhq/cassandra/schema/VersionManager.java
b/modules/common/cassandra-schema/src/main/java/org/rhq/cassandra/schema/VersionManager.java
index e71d12f..1d8b4ba 100644
---
a/modules/common/cassandra-schema/src/main/java/org/rhq/cassandra/schema/VersionManager.java
+++
b/modules/common/cassandra-schema/src/main/java/org/rhq/cassandra/schema/VersionManager.java
@@ -30,6 +30,7 @@ import java.util.UUID;
import com.datastax.driver.core.exceptions.AuthenticationException;
+import com.datastax.driver.core.exceptions.NoHostAvailableException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -284,6 +285,8 @@ class VersionManager extends AbstractManager {
+ ". Storage clutser has been updated beyond the capability of
the current server installation.");
throw new InstalledSchemaTooAdvancedException();
}
+ } catch (NoHostAvailableException e) {
+ throw e;
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
index d99bb7b..cc581b3 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
@@ -87,6 +87,7 @@ import
org.rhq.enterprise.server.scheduler.jobs.DynaGroupAutoRecalculationJob;
import org.rhq.enterprise.server.scheduler.jobs.PurgePluginsJob;
import org.rhq.enterprise.server.scheduler.jobs.PurgeResourceTypesJob;
import org.rhq.enterprise.server.scheduler.jobs.SavedSearchResultCountRecalculationJob;
+import org.rhq.enterprise.server.scheduler.jobs.StorageClusterInitJob;
import org.rhq.enterprise.server.scheduler.jobs.StorageClusterReadRepairJob;
import org.rhq.enterprise.server.storage.StorageClientManagerBean;
import org.rhq.enterprise.server.system.SystemManagerLocal;
@@ -187,7 +188,7 @@ public class StartupBean implements StartupLocal {
//Server depends on the storage cluster availability. Since the storage client
init just
//establishes connectivity with the storage cluster, then run it before the
server init.
- initStorageClient();
+ boolean isStorageRunning = initStorageClient();
// Before starting determine the operating mode of this server and
// take any necessary initialization action. Must happen before comm startup
since listeners
@@ -209,7 +210,7 @@ public class StartupBean implements StartupLocal {
upgradeRhqUserSecurityDomainIfNeeded();
startServerCommunicationServices();
startScheduler();
- scheduleJobs();
+ scheduleJobs(isStorageRunning);
//startAgentClients(); // this could be expensive if we have large number of
agents so skip it and we'll create them lazily
//startEmbeddedAgent(); // this is obsolete - we no longer have an embedded
agent
registerShutdownListener();
@@ -436,9 +437,12 @@ public class StartupBean implements StartupLocal {
/**
* Initalizes the storage client subsystem which is needed for reading/writing metric
data.
+ *
+ * @return true if the storage subsystem is running
*/
- private void initStorageClient() {
- storageClientManager.init();
+ private boolean initStorageClient() {
+ boolean isStorageRunning = storageClientManager.init();
+ return isStorageRunning;
}
/**
@@ -496,16 +500,44 @@ public class StartupBean implements StartupLocal {
new ExternalizableStrategyCommandListener(
org.rhq.core.domain.server.ExternalizableStrategy.Subsystem.AGENT));
} catch (Exception e) {
+ error += (error.isEmpty() ? "" : ", ") +
"communications services";
throw new RuntimeException("Cannot start the server-side communications
services.", e);
}
}
+ /**
+ * This seeds the agent clients cache with clients for all known agents. These
clients will be started so they can
+ * immediately begin to send any persisted guaranteed messages that might already
exist. This method must be called
+ * at a time when the server is ready to accept messages from agents because any
guaranteed messages that are
+ * delivered might trigger the agents to send messages back to the server.
+ *
+ * NOTE: we don't need to do this - so far, none of the messages the server sends
to the agent are marked
+ * with "guaranteed delivery" (this is on purpose and a good thing) so we
don't need to start all the agent clients
+ * in case they have persisted messages. Since the number of agents could be large
this cache could be huge and
+ * take some time to initialize. If we don't call this, it speeds up start up,
and doesn't bloat memory with
+ * clients we might not ever need (since agents might have affinity to other
servers). Agent clients
+ * can be created lazily at runtime when the server needs it.
+ */
+ private void startAgentClients() {
+ log.info("Starting agent clients - any persisted messages with guaranteed
delivery will be sent...");
+
+ List<Agent> agents = agentManager.getAllAgents();
+
+ if (agents != null) {
+ for (Agent agent : agents) {
+ agentManager.getAgentClient(agent); // this caches and starts the client
+ }
+ }
+
+ return;
+ }
+
/**
* This will make sure all jobs that need to periodically run are scheduled.
*
* @throws RuntimeException if unable to schedule a job
*/
- private void scheduleJobs() throws RuntimeException {
+ private void scheduleJobs(boolean isStorageRunning) throws RuntimeException {
log.info("Scheduling asynchronous jobs...");
/*
@@ -525,7 +557,7 @@ public class StartupBean implements StartupLocal {
final long initialDelay = 1000L * 60;
final long interval = 1000L * 60;
schedulerBean.scheduleSimpleRepeatingJob(SavedSearchResultCountRecalculationJob.class,
true, false,
- initialDelay, interval);
+ initialDelay, interval);
} catch (Exception e) {
log.error("Cannot schedule asynchronous resource deletion job.",
e);
}
@@ -563,7 +595,7 @@ public class StartupBean implements StartupLocal {
final long initialDelay = 1000L * 60;
final long interval = 1000L * 60;
schedulerBean.scheduleSimpleRepeatingJob(DynaGroupAutoRecalculationJob.class,
true, false, initialDelay,
- interval);
+ interval);
} catch (Exception e) {
log.error("Cannot schedule DynaGroup auto-recalculation job.", e);
}
@@ -654,6 +686,18 @@ public class StartupBean implements StartupLocal {
log.error("Cannot create alert availability duration job.", e);
}
+ if (!isStorageRunning) {
+ // Wait long enough to allow the Server instance jobs to start executing
first.
+ final long initialDelay = 1000L * 60 * 2; // 2 mins
+ final long interval = 1000L * 60; // 30 secs
+ try {
+ schedulerBean.scheduleSimpleRepeatingJob(StorageClusterInitJob.class,
true, false, initialDelay,
+ interval);
+ } catch (Exception e) {
+ log.error("Cannot create storage cluster init job", e);
+ }
+ }
+
try {
String cronString = "0 30 0 ? * SUN *"; // every sunday starting
at 00:30.
schedulerBean.scheduleSimpleCronJob(StorageClusterReadRepairJob.class, true,
true, cronString);
@@ -662,33 +706,6 @@ public class StartupBean implements StartupLocal {
}
}
- /**
- * This seeds the agent clients cache with clients for all known agents. These
clients will be started so they can
- * immediately begin to send any persisted guaranteed messages that might already
exist. This method must be called
- * at a time when the server is ready to accept messages from agents because any
guaranteed messages that are
- * delivered might trigger the agents to send messages back to the server.
- *
- * NOTE: we don't need to do this - so far, none of the messages the server sends
to the agent are marked
- * with "guaranteed delivery" (this is on purpose and a good thing) so we
don't need to start all the agent clients
- * in case they have persisted messages. Since the number of agents could be large
this cache could be huge and
- * take some time to initialize. If we don't call this, it speeds up start up,
and doesn't bloat memory with
- * clients we might not ever need (since agents might have affinity to other
servers). Agent clients
- * can be created lazily at runtime when the server needs it.
- */
- private void startAgentClients() {
- log.info("Starting agent clients - any persisted messages with guaranteed
delivery will be sent...");
-
- List<Agent> agents = agentManager.getAllAgents();
-
- if (agents != null) {
- for (Agent agent : agents) {
- agentManager.getAgentClient(agent); // this caches and starts the client
- }
- }
-
- return;
- }
-
/**
* Starts the embedded agent, but only if the embedded agent is installed and it is
enabled.
*
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/StorageClusterInitJob.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/StorageClusterInitJob.java
new file mode 100644
index 0000000..3a05b01
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/StorageClusterInitJob.java
@@ -0,0 +1,49 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.server.scheduler.jobs;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+
+import org.rhq.enterprise.server.util.LookupUtil;
+
+/**
+ * @author Jiri Kremser
+ */
+public class StorageClusterInitJob extends AbstractStatefulJob {
+
+ private Log log = LogFactory.getLog(StorageClusterInitJob.class);
+
+ @Override
+ public void executeJobCode(JobExecutionContext context) throws JobExecutionException
{
+ log.info("Preparing to run init job on storage cluster");
+ boolean isStorageRunning = LookupUtil.getStorageClientManager().init();
+ if (isStorageRunning) {
+ // cancel this job
+ try {
+ String clazzName = StorageClusterInitJob.class.getName();
+ LookupUtil.getSchedulerBean().deleteJob(clazzName, clazzName);
+ } catch (Exception e) {
+ log.error("Cannot cancel storage cluster init job", e);
+ }
+ }
+ }
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
index 4ec3583..943c53c 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
@@ -38,6 +38,7 @@ import javax.ejb.TransactionAttributeType;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.ProtocolOptions;
import com.datastax.driver.core.Session;
+import com.datastax.driver.core.exceptions.NoHostAvailableException;
import com.datastax.driver.core.policies.DefaultRetryPolicy;
import com.datastax.driver.core.policies.LoggingRetryPolicy;
import com.datastax.driver.core.policies.RoundRobinPolicy;
@@ -80,18 +81,21 @@ public class StorageClientManagerBean {
private boolean initialized;
private StorageClusterMonitor storageClusterMonitor;
- public synchronized void init() {
+ /**
+ * @return true if the storage subsystem is running
+ */
+ public synchronized boolean init() {
if (initialized) {
if (log.isDebugEnabled()) {
log.debug("Storage client subsystem is already initialized. Skipping
initialization.");
}
- return;
+ return initialized;
}
log.info("Initializing storage client subsystem");
- String username = getRequiredStorageProperty(USERNAME_PROP);
- String password = getRequiredStorageProperty(PASSWORD_PROP);
+ final String username = getRequiredStorageProperty(USERNAME_PROP);
+ final String password = getRequiredStorageProperty(PASSWORD_PROP);
List<StorageNode> storageNodes = new ArrayList<StorageNode>();
for (StorageNode storageNode : storageNodeManager.getStorageNodes()) {
@@ -115,9 +119,15 @@ public class StorageClientManagerBean {
+ "storage node to fix this issue.");
}
- checkSchemaCompability(username, password, storageNodes);
-
-
+ try {
+ checkSchemaCompability(username, password, storageNodes);
+ } catch (NoHostAvailableException e) {
+ initialized = false;
+ log.warn("Storage client subsystem wasn't initialized because it
wasn't possible to connect to the" +
+ " storage cluster. The RHQ server is set to MAINTENANCE mode.
Please start the storage cluster" +
+ " as soon as possible.");
+ return initialized;
+ }
Session wrappedSession = createSession(username, password, storageNodes);
session = new StorageSession(wrappedSession);
@@ -131,6 +141,7 @@ public class StorageClientManagerBean {
initialized = true;
log.info("Storage client subsystem is now initialized");
+ return initialized;
}
/**
@@ -150,6 +161,8 @@ public class StorageClientManagerBean {
SchemaManager schemaManager = new SchemaManager(username, password, nodes,
cqlPort);
try {
schemaManager.checkCompatibility();
+ } catch (NoHostAvailableException e) {
+ throw e;
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClusterMonitor.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClusterMonitor.java
index bcb03d8..976af28 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClusterMonitor.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClusterMonitor.java
@@ -7,6 +7,8 @@ import com.datastax.driver.core.exceptions.NoHostAvailableException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.rhq.enterprise.server.scheduler.jobs.StorageClusterInitJob;
+import org.rhq.enterprise.server.util.LookupUtil;
import org.rhq.server.metrics.StorageStateListener;
/**
@@ -39,7 +41,23 @@ public class StorageClusterMonitor implements StorageStateListener {
}
@Override
+ public void onStorageClusterUp() {
+ log.info("Storage cluster is up");
+ isClusterAvailable = true;
+ }
+
+ @Override
public void onStorageClusterDown(NoHostAvailableException e) {
isClusterAvailable = false;
+
+// // Wait long enough to allow the Server instance jobs to start executing
first.
+// final long initialDelay = 1000L * 60 * 2; // 2 mins
+// final long interval = 1000L * 60; // 30 secs
+// try {
+//
LookupUtil.getSchedulerBean().scheduleSimpleRepeatingJob(StorageClusterInitJob.class,
true, false, initialDelay,
+// interval);
+// } catch (Exception ex) {
+// log.error("Cannot create storage cluster init job", ex);
+// }
}
}
diff --git
a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/StorageSession.java
b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/StorageSession.java
index c3b64fa..60f3fbd 100644
---
a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/StorageSession.java
+++
b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/StorageSession.java
@@ -27,6 +27,8 @@ public class StorageSession implements Host.StateListener {
private List<StorageStateListener> listeners = new
ArrayList<StorageStateListener>();
+ private boolean isClusterAvailable = false;
+
public StorageSession(Session wrappedSession) {
this.wrappedSession = wrappedSession;
this.wrappedSession.getCluster().register(this);
@@ -82,18 +84,28 @@ public class StorageSession implements Host.StateListener {
@Override
public void onAdd(Host host) {
- log.info(host + " added");
- for (StorageStateListener listener : listeners) {
- listener.onStorageNodeUp(host.getAddress());
- }
+ addOrUp(host, " added");
}
@Override
public void onUp(Host host) {
- log.info(host + " is up");
+ addOrUp(host, " is up");
+ }
+
+ private void addOrUp(Host host, String msg) {
+ log.info(host + msg);
+ if (!isClusterAvailable) {
+ log.info("Storage cluster is up");
+ }
for (StorageStateListener listener : listeners) {
+ if (!isClusterAvailable) {
+ listener.onStorageClusterUp();
+ }
listener.onStorageNodeUp(host.getAddress());
}
+ if (!isClusterAvailable) {
+ isClusterAvailable = true;
+ }
}
@Override
@@ -113,6 +125,7 @@ public class StorageSession implements Host.StateListener {
}
void fireClusterDownEvent(NoHostAvailableException e) {
+ isClusterAvailable = false;
for (StorageStateListener listener : listeners) {
listener.onStorageClusterDown(e);
}
diff --git
a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/StorageStateListener.java
b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/StorageStateListener.java
index 6a3a216..5a59142 100644
---
a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/StorageStateListener.java
+++
b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/StorageStateListener.java
@@ -17,4 +17,6 @@ public interface StorageStateListener {
void onStorageClusterDown(NoHostAvailableException e);
+ void onStorageClusterUp();
+
}
commit 7ac4b8940baa7e04e5b872ad3c33a76f399e19c8
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Sep 25 10:30:53 2013 -0400
BZ 1002255 - mask passwords that are in the comm debug log
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsService.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsService.java
index 13bd6c0..dc66d91 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsService.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsService.java
@@ -812,7 +812,8 @@ public class ServerCommunicationsService implements
ServerCommunicationsServiceM
value = determineSecurityAlgorithm(value);
preferences_node.put(key, value);
- LOG.debug(ServerI18NResourceKeys.CONFIG_PREFERENCE_OVERRIDE, key,
value);
+ LOG.debug(ServerI18NResourceKeys.CONFIG_PREFERENCE_OVERRIDE, key,
+ (key.toLowerCase().contains("password")) ? "***"
: value);
}
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerConfiguration.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerConfiguration.java
index 41e7387..9efe243 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerConfiguration.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerConfiguration.java
@@ -679,7 +679,11 @@ public class ServerConfiguration {
buf.append(key);
buf.append('=');
- buf.append(m_preferences.get(key,
LOG.getMsgString(ServerI18NResourceKeys.UNKNOWN)));
+ if (key.toLowerCase().contains("password")) {
+ buf.append("***");
+ } else {
+ buf.append(m_preferences.get(key,
LOG.getMsgString(ServerI18NResourceKeys.UNKNOWN)));
+ }
if ((i + 1) < keys.length) {
buf.append(',');
commit 8e3e7bbe8ac0da80c27ceed4427183b04c62b86a
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Sep 25 14:07:41 2013 +0200
BZ 996177 Don't bail out if group is removed and added in the same operation
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java
index b56dce4..2e5d060 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java
@@ -229,7 +229,7 @@ public class RoleManagerBean implements RoleManagerLocal,
RoleManagerRemote {
alertNotificationManager.cleanseAlertNotificationByRole(doomedRole.getId());
// Fetch the lazy Sets on the Role to be returned.
- //[BZ 754693:] we must fetch the lazy sets of LDAP Groups here for
correct cascade removal
+ //[BZ 754693:] we must fetch the lazy sets of LDAP Groups here for
correct cascade removal
doomedRole.getResourceGroups().size();
doomedRole.getSubjects().size();
doomedRole.getLdapGroups().size();
@@ -465,21 +465,25 @@ public class RoleManagerBean implements RoleManagerLocal,
RoleManagerRemote {
// wrap in new HashSet to avoid ConcurrentModificationExceptions.
Set<LdapGroup> currentLdapGroups = new
HashSet<LdapGroup>(attachedRole.getLdapGroups());
for (LdapGroup ldapGroup : currentLdapGroups) {
+ // Delete removed groups
if (!newLdapGroups.contains(ldapGroup)) {
attachedRole.removeLdapGroup(ldapGroup);
entityManager.remove(ldapGroup);
}
}
+ // Add new groups, but filter those that are still attached
for (LdapGroup ldapGroup : newLdapGroups) {
LdapGroup attachedLdapGroup = (ldapGroup.getId() != 0) ?
entityManager.find(LdapGroup.class,
ldapGroup.getId()) : null;
- if (attachedLdapGroup == null) {
+ if (attachedLdapGroup == null &&
!currentLdapGroups.contains(ldapGroup)) {
ldapGroup.setRole(attachedRole);
entityManager.persist(ldapGroup);
attachedLdapGroup = ldapGroup;
}
- attachedRole.addLdapGroup(attachedLdapGroup);
+ if (attachedLdapGroup!=null) {
+ attachedRole.addLdapGroup(attachedLdapGroup);
+ }
}
}
commit 7b316f3eece2289bb8f9864d547dbceb21cb47e0
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Sep 25 11:39:39 2013 +0200
Fix a small translation issue.
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
index ea31a41..4886551 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
@@ -815,7 +815,7 @@ view_admin_systemSettings_AlertPurge_name = Bereinigen der Alarme, die
älter si
view_admin_systemSettings_AvailabilityPurge_name = Lösche Verfügbarkeitsdaten, die älter
sind als
##view_admin_systemSettings_DriftFilePurge_desc = How old unused and orphaned drift files
must be before being purged from backend storage. This is specified in days.
view_admin_systemSettings_DriftFilePurge_name = Bereinige ungenutzte Drift-Dateine, die
älter sind als
-view_admin_systemSettings_LDAPBaseDN_name = view_admin_systemSettings_LDAPBindPW_name =
Passwort
+view_admin_systemSettings_LDAPBaseDN_name = Basis für Suche
##view_admin_systemSettings_RHQSessionTimeout_desc = If this amount of time passes
without any user interaction in the browser, the session is considered as expired and user
is aked to log in again. This value is specified in hours.
##view_admin_systemSettings_RHQSessionTimeout_name = GUI Session Timeout
view_admin_systemSettings_TraitPurge_name = Bereinigen der Trait-Daten, die älter sind
als
commit 2c186bc8b4b0e35200bab2ab60183df148ad8828
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Sep 24 21:56:52 2013 +0200
BZ 1002233 "on the null" -> "on the platform" if the
propertyName is null.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/storage/StorageNodeTableView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/storage/StorageNodeTableView.java
index aaf99da..023d6c4 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/storage/StorageNodeTableView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/storage/StorageNodeTableView.java
@@ -109,7 +109,7 @@ public class StorageNodeTableView extends
TableSection<StorageNodeDatasource> {
});
}
}
-
+
ListGrid listGrid = getListGrid();
listGrid.setAutoSaveEdits(false);
listGrid.setFields(fields.toArray(new ListGridField[fields.size()]));
@@ -197,8 +197,8 @@ public class StorageNodeTableView extends
TableSection<StorageNodeDatasource> {
protected Canvas getExpansionComponent(final ListGridRecord record) {
if (record.getAttribute(FIELD_RESOURCE_ID.propertyName()) == null) {
// no resource set
- return new HTMLFlow("There is no load data available for this
node. Is the agent running on the "
- + record.getAttributeAsString(FIELD_ADDRESS.propertyName() +
"?"));
+ return new HTMLFlow("There is no load data available for this
node. Is the agent running on the " +
+ "platform?");
}
int id = record.getAttributeAsInt(FIELD_ID);
return new StorageNodeLoadComponent(id, null);
commit 231750d9a3f4a1e4216bdc74ee8acd3b8b2bd768
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Sep 24 15:10:40 2013 -0400
fix an issue causing a server itest failure.
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml
b/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml
index 671853f..ebf7189 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml
@@ -148,9 +148,9 @@
<data ID="62" PROPERTY_KEY="STORAGE_GOSSIP_PORT"
FREAD_ONLY="TRUE"/>
- <data ID="63" PROPERTY_KEY="STORAGE_USERNAME"
FREAD_ONLY="TRUE"/>
+ <data ID="63" PROPERTY_KEY="STORAGE_USERNAME"
PROPERTY_VALUE="" DEFAULT_PROPERTY_VALUE=""
FREAD_ONLY="TRUE"/>
- <data ID="64" PROPERTY_KEY="STORAGE_PASSWORD"
FREAD_ONLY="TRUE"/>
+ <data ID="64" PROPERTY_KEY="STORAGE_PASSWORD"
PROPERTY_VALUE="" DEFAULT_PROPERTY_VALUE=""
FREAD_ONLY="TRUE"/>
</table>
commit 3adffa913e73cd163bc54513cd2f4711bd06a449
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Sep 24 15:10:01 2013 -0400
fix an issue using -Ditest.use-external-storage-node with server itests.
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-arquillian/src/main/java/org/rhq/cassandra/ccm/arquillian/CCMSuiteDeploymentExtension.java
b/modules/common/cassandra-ccm/cassandra-ccm-arquillian/src/main/java/org/rhq/cassandra/ccm/arquillian/CCMSuiteDeploymentExtension.java
index d051d9d..50aaab1 100644
---
a/modules/common/cassandra-ccm/cassandra-ccm-arquillian/src/main/java/org/rhq/cassandra/ccm/arquillian/CCMSuiteDeploymentExtension.java
+++
b/modules/common/cassandra-ccm/cassandra-ccm-arquillian/src/main/java/org/rhq/cassandra/ccm/arquillian/CCMSuiteDeploymentExtension.java
@@ -152,7 +152,9 @@ public class CCMSuiteDeploymentExtension implements LoadableExtension
{
String cqlPortString =
System.getProperty("rhq.storage.cql-port", "9042");
cqlPort = Integer.parseInt(cqlPortString);
- //jmxPorts = parseNodeJmxPorts(seed);
+ String jmxPortString =
System.getProperty("rhq.storage.jmx-port", "7299");
+ jmxPorts = new int[] { Integer.parseInt(jmxPortString) };
+
schemaManager = new SchemaManager("rhqadmin",
"1eeb2f255e832171df8592078de921bc", nodes, cqlPort);
} catch (Exception e) {
commit 9d5d89cf8c6385028e939ccb76174058cc008d26
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Tue Sep 24 12:02:13 2013 -0400
Modifying LdapManagerBeanTest to use original settings since the right fix affects
other tests as well.
diff --git
a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/resource/group/test/LdapGroupManagerBeanTest.java
b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/resource/group/test/LdapGroupManagerBeanTest.java
index 7452247..6c0fd5e 100644
---
a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/resource/group/test/LdapGroupManagerBeanTest.java
+++
b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/resource/group/test/LdapGroupManagerBeanTest.java
@@ -29,7 +29,6 @@ import org.testng.annotations.Test;
import org.rhq.core.domain.common.SystemConfiguration;
import org.rhq.core.domain.common.composite.SystemSetting;
-import org.rhq.core.domain.common.composite.SystemSettings;
import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.resource.group.LdapGroupManagerBean;
import org.rhq.enterprise.server.resource.group.LdapGroupManagerLocal;
@@ -440,10 +439,9 @@ public class LdapGroupManagerBeanTest extends AbstractEJB3Test {
* Helper methods
---------------*/
private void setSystemConfigProperty(final String name, final String value) throws
Exception {
- SystemSettings sysConfig =
systemManager.getSystemSettings(LookupUtil.getSubjectManager().getOverlord());
- SystemSetting retrievedKey = SystemSetting.valueOf(name);
- sysConfig.put(retrievedKey, value);
- systemManager.setSystemSettings(LookupUtil.getSubjectManager().getOverlord(),
sysConfig);
+ Properties sysConfig =
systemManager.getSystemConfiguration(LookupUtil.getSubjectManager().getOverlord());
+ sysConfig.setProperty(name, value);
+
systemManager.setSystemConfiguration(LookupUtil.getSubjectManager().getOverlord(),
sysConfig, true);
}
private void setLdapGroupFilter(String filter) throws Exception {
commit 110e9a621fdbbef84ba9d7f4d3a3c9532291f700
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Sep 24 11:51:45 2013 -0400
add back plugin config for groovy script to generate additional storage nodes
diff --git a/modules/enterprise/server/appserver/pom.xml
b/modules/enterprise/server/appserver/pom.xml
index 0bd95ff..be8c43c 100644
--- a/modules/enterprise/server/appserver/pom.xml
+++ b/modules/enterprise/server/appserver/pom.xml
@@ -319,6 +319,23 @@
</executions>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>groovy-maven-plugin</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>storage-setup</id>
+ <phase>package</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+
<source>${project.basedir}/src/main/scripts/storage_setup.groovy</source>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</profile>
diff --git a/modules/enterprise/server/appserver/src/main/scripts/storage_setup.groovy
b/modules/enterprise/server/appserver/src/main/scripts/storage_setup.groovy
index 857c268..c20e0ed 100644
--- a/modules/enterprise/server/appserver/src/main/scripts/storage_setup.groovy
+++ b/modules/enterprise/server/appserver/src/main/scripts/storage_setup.groovy
@@ -23,7 +23,7 @@
* You can also run the setup for additional storage nodes after you have already built
* your dev-container by executing
*
- * $ mvn -o groovy:execute -Pdev -Dsource=src/main/script/storage_setup.groovy
-Drhq.storage.num-nodes=4
+ * $ mvn -o groovy:execute -Pdev -Dsource=src/main/scripts/storage_setup.groovy
-Drhq.storage.num-nodes=4
*
* The script will detect that you already have rhq-server-2 and rhq-server-3 setup; so,
it
* will only set up rhq-server-4.
commit ed3f9f8dfa208f301f31a3aafc4f97b449df053f
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Sep 24 10:15:41 2013 -0400
Simplify 'rhqctl install' by removing --storage-config and --server-config
The rhq-server.properties file was already assumed to exist and be the
properties file to use during install *and* at runtime. Allowing an override
at install-time only did not make a lot of sense and really just adds
to install confusion. So, the option is removed and only the expected
rhq-server.properties file should be used at all points.
Analogously, we've now introduced rhq-storage.properties as an expected
properties file for storage installation. There was already confusion
about whether this file should or should not exist, and if so, what it
should contain. This file will now always exist, is fully commented, and
for dev builds will be preset with dev settings.
- both files are now generated in rhq-container.build.xml.
- storage_setup.groovy previously generated the dev version of the file. It is now
used
to add storage nodes in dev envs, or to generate test envs.
- add some up rhqctl up front verification that these expected files exist.
More detailed validation of file contents is forthcoming...
diff --git a/modules/enterprise/server/appserver/pom.xml
b/modules/enterprise/server/appserver/pom.xml
index 421ae6c..0bd95ff 100644
--- a/modules/enterprise/server/appserver/pom.xml
+++ b/modules/enterprise/server/appserver/pom.xml
@@ -18,6 +18,8 @@
<description>The full RHQ appserver container build, including the JBossAS
server and all config/deploy files</description>
<properties>
+ <rhq.rootDir>../../../..</rhq.rootDir>
+
<rhq.dev.data.dir>${rhq.rootDir}/rhq-data</rhq.dev.data.dir>
<jgroups.initial.version>3.2.7.Final</jgroups.initial.version>
<jgroups.patch.version>3.2.10.Final</jgroups.patch.version>
@@ -134,6 +136,7 @@
<property name="project.version"
value="${project.version}" />
<property name="dev.profile.active"
value="${dev.profile.active}" />
<property name="developer"
value="${developer}" />
+ <property name="rhq.rootDir"
value="${rhq.rootDir}" />
<property name="rhq.earName"
value="${rhq.earName}" />
<!-- dependency versions -->
@@ -166,8 +169,8 @@
<property name="rhq.server.http.port"
value="${rhq.server.http.port}" />
<property name="rhq.server.https.port"
value="${rhq.server.https.port}" />
<property
name="rhq.sync.endpoint-address"
value="${rhq.sync.endpoint-address}" />
- <property name="jgroups.initial.version"
value="${jgroups.initial.version}" />
- <property name="jgroups.patch.version"
value="${jgroups.patch.version}" />
+ <property name="jgroups.initial.version"
value="${jgroups.initial.version}" />
+ <property name="jgroups.patch.version"
value="${jgroups.patch.version}" />
</ant>
</target>
</configuration>
@@ -258,7 +261,6 @@
<id>dev</id>
<properties>
- <rhq.rootDir>../../../..</rhq.rootDir>
<rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
<rhq.containerServerDir>${rhq.containerDir}/rhq-server</rhq.containerServerDir>
<rhq.storage.num-nodes>1</rhq.storage.num-nodes>
@@ -317,23 +319,6 @@
</executions>
</plugin>
- <plugin>
- <groupId>org.codehaus.gmaven</groupId>
- <artifactId>groovy-maven-plugin</artifactId>
- <version>2.0-SNAPSHOT</version>
- <executions>
- <execution>
- <id>storage-setup</id>
- <phase>package</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
-
<source>${project.basedir}/src/main/scripts/storage_setup.groovy</source>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
</profile>
diff --git a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
index f3fb2d1..4ded9d1 100644
--- a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
+++ b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
@@ -2,8 +2,9 @@
<project name="rhq-appserver-container" basedir=".">
- <property name="default.rhq.server.database.hibernate-dialect"
value="org.hibernate.dialect.PostgreSQLDialect" />
- <property name="default.rhq.server.database.connection-url"
value="jdbc:postgresql://127.0.0.1:5432/rhq" />
+ <!-- rhq-server.properties defaults -->
+ <property name="default.rhq.server.database.hibernate-dialect"
value="org.hibernate.dialect.PostgreSQLDialect" />
+ <property name="default.rhq.server.database.connection-url"
value="jdbc:postgresql://127.0.0.1:5432/rhq" />
<property name="default.rhq.server.database.user-name"
value="rhqadmin" />
<property name="default.rhq.server.database.password"
value="rhqadmin" />
<property name="default.rhq.server.database.password.encrypted"
value="1eeb2f255e832171df8592078de921bc" />
@@ -17,15 +18,23 @@
<property name="default.rhq.server.quartz.selectWithLockSQL"
value="SELECT * FROM {0}LOCKS ROWLOCK WHERE LOCK_NAME = ? FOR UPDATE" />
<property name="default.rhq.server.quartz.lockHandlerClass"
value="org.quartz.impl.jdbcjobstore.StdRowLockSemaphore" />
- <property name="rhq.sync.endpoint-address" value="false"/>
+ <property name="default.rhq.server.drift.binary.content"
value="false"/>
- <property name="default.rhq.server.drift.binary.content"
value="false"/>
-
- <property name="default.rhq.storage.username" value=""/>
- <property name="default.rhq.storage.password" value=""/>
+ <property name="default.rhq.storage.username"
value=""/>
+ <property name="default.rhq.storage.password"
value=""/>
<property name="default.jboss.bind.address" value=""/>
+ <property name="default.rhq.storage.commitlog"
value=""/>
+ <property name="default.rhq.storage.data"
value=""/>
+ <property name="default.rhq.storage.saved-caches"
value=""/>
+ <property name="default.rhq.storage.heap-size"
value=""/>
+ <property name="default.rhq.storage.heap-new-size"
value=""/>
+ <property name="default.rhq.storage.hostname"
value=""/>
+ <property name="default.rhq.storage.jmx-port"
value=""/>
+ <property name="default.rhq.storage.seeds"
value=""/>
+ <property name="default.rhq.storage.verify-data-dirs-empty"
value=""/>
+
<target name="set-predeploy-prop">
<condition property="predeploy" value="true">
<or>
@@ -36,7 +45,7 @@
</target>
<target name="set-dev-server-props" if="predeploy">
- <echo>*** Using dev database settings in
rhq-server.properties...</echo>
+ <echo>*** Using dev settings in rhq-server.properties...</echo>
<property name="rhq.server.database.hibernate-dialect"
value="${rhq.dev.ds.hibernate-dialect}" />
<property name="rhq.server.database.connection-url"
value="${rhq.dev.ds.connection-url}" />
<property name="rhq.server.database.user-name"
value="${rhq.dev.ds.user-name}" />
@@ -54,10 +63,22 @@
<property name="rhq.storage.password"
value="1eeb2f255e832171df8592078de921bc"/>
<!-- this is only set explicitly in dev envs, prod envs must set these
manually for security -->
<property name="jboss.bind.address"
value="0.0.0.0"/>
+
+ <echo>*** Using dev settings in rhq-storage.properties...</echo>
+ <property name="rhq.storage.commitlog"
value="${rhq.rootDir}/rhq-data/storage-1/commitlog"/>
+ <property name="rhq.storage.data"
value="${rhq.rootDir}/rhq-data/storage-1/data"/>
+ <property name="rhq.storage.saved-caches"
value="${rhq.rootDir}/rhq-data/storage-1/saved_caches"/>
+ <property name="rhq.storage.heap-size"
value="256M"/>
+ <property name="rhq.storage.heap-new-size"
value="64M"/>
+ <property name="rhq.storage.hostname"
value="127.0.0.1"/>
+ <property name="rhq.storage.jmx-port"
value="7299"/>
+ <property name="rhq.storage.seeds"
value="127.0.0.1"/>
+ <property name="rhq.storage.verify-data-dirs-empty"
value="false"/>
+ <property name="comment"
value=""/>
</target>
<target name="set-default-server-props"
unless="predeploy">
- <echo>*** Using default database settings in
rhq-server.properties...</echo>
+ <echo>*** Using default settings in rhq-server.properties...</echo>
<property name="rhq.server.database.hibernate-dialect"
value="${default.rhq.server.database.hibernate-dialect}" />
<property name="rhq.server.database.connection-url"
value="${default.rhq.server.database.connection-url}" />
<property name="rhq.server.database.user-name"
value="${default.rhq.server.database.user-name}" />
@@ -75,6 +96,18 @@
<property name="rhq.storage.password"
value="${default.rhq.storage.password}"/>
<!-- this is only set by default in dev envs, prod envs must set these
manually for security -->
<property name="jboss.bind.address"
value="${default.jboss.bind.address}"/>
+
+ <echo>*** Using default settings in rhq-storage.properties...</echo>
+ <property name="rhq.storage.commitlog"
value="${default.rhq.storage.commitlog}"/>
+ <property name="rhq.storage.data"
value="${default.rhq.storage.data}"/>
+ <property name="rhq.storage.saved-caches"
value="${default.rhq.storage.saved-caches}"/>
+ <property name="rhq.storage.heap-size"
value="${default.rhq.storage.heap-size}"/>
+ <property name="rhq.storage.heap-new-size"
value="${default.rhq.storage.heap-new-size}"/>
+ <property name="rhq.storage.hostname"
value="${default.rhq.storage.hostname}"/>
+ <property name="rhq.storage.jmx-port"
value="${default.rhq.storage.jmx-port}"/>
+ <property name="rhq.storage.seeds"
value="${default.rhq.storage.seeds}"/>
+ <property name="rhq.storage.verify-data-dirs-empty"
value="${default.rhq.storage.verify-data-dirs-empty}"/>
+ <property name="comment"
value="#"/>
</target>
<target name="initialize" depends="set-predeploy-prop,
set-dev-server-props, set-default-server-props">
@@ -471,6 +504,8 @@
<target name="prepare-bin-dir">
<echo>*** Preparing bin dir ***</echo>
+ <!-- TODO: This should likely go away and the storage props should be defined
at the top of this file like
+ the other props. -->
<loadproperties>
<zipentry
zipfile="${settings.localRepository}/org/rhq/rhq-cassandra-ccm-core/${project.version}/rhq-cassandra-ccm-core-${project.version}.jar"
name="cassandra.properties"/>
@@ -785,6 +820,108 @@ rhq.storage.gossip-port=${rhq.cassandra.storage.port}
# rhq.cassandra.client.compression-enabled=false
</echo>
+ <echo
file="${rhq.bin.dir}/rhq-storage.properties">#################### RHQ Storage
Configuration Properties ####################
+
+#############################################################################
+# Storage Node Installation Options
+#
+# The following settings are all OPTIONAL. Defaults are described below for
+# each property.
+#############################################################################
+
+#############################################################################
+# Data Directory Settings
+# -----------------
+# Note, the RHQ_HOME directory as used below is the parent directory
+# of the RHQ server installation. It is recommended that RHQ be installed
+# under an umbrella "rhq" directory. For example, if using a home directory
+# of /opt/rhq then the default installation structure would be:
+# /opt/rhq
+# /opt/rhq/rhq-server-RHQ-VERSION
+# /opt/rhq/rhq-server-RHQ-VERSION/rhq-storage
+# /opt/rhq/rhq-agent
+# /opt/rhq/rhq-data/
+# /opt/rhq/rhq-data/storage/commitlog
+# /opt/rhq/rhq-data/storage/data
+# /opt/rhq/rhq-data/storage/saved_caches
+#
+# commitlog The directory where the storage node keeps commit log files.
+# Defaults to: RHQ_HOME/rhq-data/storage/commitlog
+# data The directory where the storage node keeps data files.
+# Defaults to: RHQ_HOME/rhq-data/storage/data
+# saved-caches The directory where the storage node keeps saved cache files.
+# Defaults to: RHQ_HOME/rhq-data/storage/saved_caches
+#############################################################################
+${comment}commitlog=${rhq.storage.commitlog}
+${comment}data=${rhq.storage.data}
+${comment}saved-caches=${rhq.storage.saved-caches}
+
+#############################################################################
+# Heap/Memory Settings
+# -----------------
+#
+# heap-size The value to use for both the min and max heap. This value is
+# passed directly to the -Xms and -Xmx options of the Java
+# executable.
+# Defaults to 512M.
+# heap-new-size The value to use for the new generation of the heap. This
+# value is passed directly to the -Xmn option of the Java
+# executable.
+# Defaults to 256M.
+# stack-size The value to use for the thread stack size. This value is
+# passed directly to the -Xss option of the Java executable.
+# Defaults to 256k.
+#############################################################################
+${comment}heap-size=${rhq.storage.heap-size}
+${comment}heap-new-size=${rhq.storage.heap-new-size}
+#stack-size=
+
+#############################################################################
+# Port Settings
+# -----------------
+#
+# client-port The port on which to listen for client requests.
+# Defaults to 9142
+# jmx-port The port on which to listen for JMX connections.
+# Defaults to 7299.
+# storage-port The port on which to listen for requests from other nodes.
+# Defaults to 7100
+# ssl-storage-port The port on which to listen for encrypted requests from
+# other nodes. Only used when encryption is enabled.
+# Defaults to 7101
+#############################################################################
+#client-port=
+${comment}jmx-port=${rhq.storage.jmx-port}
+#storage-port=
+#ssl-storage-port=
+
+#############################################################################
+# Address/Host Settings
+# -----------------
+#
+# hostname The hostname or IP address on which the node will listen
+# for requests.
+# Defaults to the hostname for localhost.
+# seeds A comma-delimited list of hostnames or IP addresses that
+# serve as contact points. Nodes use this list to find each
+# other and to learn the cluster topology. It does not need
+# to specify all nodes in the cluster.
+# Defaults to this node's hostname.
+#############################################################################
+${comment}hostname=${rhq.storage.hostname}
+${comment}seeds=${rhq.storage.seeds}
+
+#############################################################################
+# Advanced Settings
+# -----------------
+#
+# verify-data-dirs-empty If true then allow installation only when the data
+# directories are empty. Only upgrade is allowed.
+# Defaults to true.
+#############################################################################
+${comment}verify-data-dirs-empty=${rhq.storage.verify-data-dirs-empty}
+</echo>
+
</target>
<target name="unzip-jboss" unless="jboss.uptodate">
@@ -838,17 +975,6 @@ rhq.server.agent-update.nonstrict-version-check=true
</path>
<pathconvert targetos="unix" property="safe.datadir"
refid="path.datadir"/>
-<!--<echo
file="${project.build.outputDirectory}/bin/rhq-storage.properties"
append="true"># storage installer options for dev deployment-->
-<!--commitlog=${safe.datadir}/storage/commit_log-->
-<!--data=${safe.datadir}/storage/data-->
-<!--saved-caches=${safe.datadir}/storage/saved_caches-->
-<!--heap-size=256M-->
-<!--heap-new-size=64M-->
-<!--hostname=127.0.0.1-->
-<!--</echo>-->
-
-<!--<echo file="${project.build.outputDirectory}/bin/rhqctl.properties"
append="true">rhqctl.install.storage-config=bin/rhq-storage.properties</echo>-->
-
</target>
<target name="prepare-release"
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
index 542708f..9f7c80f 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
@@ -25,6 +25,7 @@
package org.rhq.server.control;
+import java.io.File;
import java.util.LinkedList;
import java.util.List;
@@ -62,6 +63,22 @@ public class RHQControl {
String commandName = findCommand(commands, args);
ControlCommand command = commands.get(commandName);
+ // perform any up front validation we can at this point. Not that after
this point we
+ // lose stdin due to the use of ProcessExecutions.
+ if ("install".equalsIgnoreCase(command.getName())) {
+ File serverProperties = new
File("bin/rhq-server.properties");
+ File storageProperties = new
File("bin/rhq-storage.properties");
+
+ if (!serverProperties.isFile()) {
+ throw new RHQControlException("Missing required
configuration file, can not continue: ["
+ + serverProperties.getAbsolutePath() + "]");
+ }
+ if (!storageProperties.isFile()) {
+ throw new RHQControlException("Missing required
configuration file, can not continue: ["
+ + storageProperties.getAbsolutePath() + "]");
+ }
+ }
+
command.exec(getCommandLine(commandName, args));
}
} catch (UsageException e) {
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
index 301c24f..cc599b3 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
@@ -54,11 +54,8 @@ import org.rhq.server.control.RHQControlException;
*/
public abstract class AbstractInstall extends ControlCommand {
- protected final String STORAGE_CONFIG_OPTION = "storage-config";
protected final String STORAGE_DATA_ROOT_DIR = "storage-data-root-dir";
- protected final String STORAGE_CONFIG_PROP =
"rhqctl.install.storage-config";
-
protected void installWindowsService(File workingDir, String batFile, boolean
replaceExistingService, boolean start)
throws Exception {
Executor executor = new DefaultExecutor();
@@ -490,13 +487,9 @@ public abstract class AbstractInstall extends ControlCommand {
commandLine.addArguments(new String[] { "--saved-caches",
dataDirs.savedcachesDir.getAbsolutePath() });
}
- if (rhqctlCommandLine.hasOption(STORAGE_CONFIG_OPTION)) {
- String[] args =
toArray(loadStorageProperties(rhqctlCommandLine.getOptionValue(STORAGE_CONFIG_OPTION)));
- commandLine.addArguments(args);
- } else if (hasProperty(STORAGE_CONFIG_PROP)) {
- String[] args =
toArray(loadStorageProperties(getProperty(STORAGE_CONFIG_PROP)));
- commandLine.addArguments(args);
- }
+ // add the properties set in rhq-storage.properties to the command line
+ String[] args = toArray(loadStorageProperties());
+ commandLine.addArguments(args);
Executor executor = new DefaultExecutor();
executor.setWorkingDirectory(getBinDir());
@@ -515,11 +508,11 @@ public abstract class AbstractInstall extends ControlCommand {
}
}
- private Properties loadStorageProperties(String path) throws IOException {
+ private Properties loadStorageProperties() throws IOException {
Properties properties = new Properties();
FileInputStream fis = null;
try {
- fis = new FileInputStream(new File(path));
+ fis = new FileInputStream(new File("bin/rhq-storage.properties"));
properties.load(fis);
} finally {
if (null != fis) {
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
index 57e3dad..451e880 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
@@ -54,8 +54,6 @@ public class Install extends AbstractInstall {
private final String AGENT_PREFERENCE = "agent-preference";
private final String AGENT_AUTOSTART_OPTION = "agent-auto-start";
- private final String SERVER_CONFIG_OPTION = "server-config";
-
private Options options;
// some known agent preference setting names
@@ -79,19 +77,10 @@ public class Install extends AbstractInstall {
"Install RHQ server. If you have not yet installed an RHQ storage
node somewhere in your network, you must specify --storage to install one.")
.addOption(null, "agent", false,
"Install RHQ agent. The install directory will be [" +
getAgentBasedir() + "]")
- .addOption(null, SERVER_CONFIG_OPTION, true,
- "An alternate properties file to use in place of the default
rhq-server.properties")
.addOption(null, AGENT_CONFIG_OPTION, true,
"An alternate XML file to use in place of the default
agent-configuration.xml")
.addOption(
null,
- STORAGE_CONFIG_OPTION,
- true,
- "A properties file with keys that correspond to option names "
- + "of the storage installer. Each property will be translated
into an option that is passed to the "
- + "storage installer.")
- .addOption(
- null,
AGENT_PREFERENCE,
true,
"An agent preference setting (whose argument is in the form
'name=value') to be set in the agent. More than one of these is allowed.")
@@ -137,8 +126,6 @@ public class Install extends AbstractInstall {
if (!(commandLine.hasOption(STORAGE_OPTION) ||
commandLine.hasOption(SERVER_OPTION) || commandLine
.hasOption(AGENT_OPTION))) {
- replaceServerPropertiesIfNecessary(commandLine);
-
if (!isStorageInstalled()) {
installStorageNode(getStorageBasedir(), commandLine);
} else if (isWindows()) {
@@ -180,7 +167,6 @@ public class Install extends AbstractInstall {
log.info("Skipping storage node installation.");
}
} else {
- replaceServerPropertiesIfNecessary(commandLine);
installStorageNode(getStorageBasedir(), commandLine);
}
@@ -208,7 +194,6 @@ public class Install extends AbstractInstall {
}
} else {
- replaceServerPropertiesIfNecessary(commandLine);
startRHQServerForInstallation();
runRHQServerInstaller();
waitForRHQServerToInitialize();
@@ -253,27 +238,12 @@ public class Install extends AbstractInstall {
validateCustomStorageDataDirectories(commandLine, errors);
- if (commandLine.hasOption(SERVER_CONFIG_OPTION) &&
!isServerInstalled()) {
- File serverConfig = new
File(commandLine.getOptionValue(SERVER_CONFIG_OPTION));
- validateServerConfigOption(serverConfig, errors);
- }
-
if (commandLine.hasOption(AGENT_CONFIG_OPTION) &&
!isAgentInstalled()) {
File agentConfig = new
File(commandLine.getOptionValue(AGENT_CONFIG_OPTION));
validateAgentConfigOption(agentConfig, errors);
}
-
- if (commandLine.hasOption(STORAGE_CONFIG_OPTION) &&
!isStorageInstalled()) {
- File storageConfig = new
File(commandLine.getOptionValue(STORAGE_CONFIG_OPTION));
- validateStorageConfigOption(storageConfig, errors);
- }
} else {
if (commandLine.hasOption(STORAGE_OPTION)) {
- if (!isStorageInstalled() &&
commandLine.hasOption(STORAGE_CONFIG_OPTION)) {
- File storageConfig = new
File(commandLine.getOptionValue(STORAGE_CONFIG_OPTION));
- validateStorageConfigOption(storageConfig, errors);
- }
-
if (!isAgentInstalled() &&
commandLine.hasOption(AGENT_CONFIG_OPTION)) {
File agentConfig = new
File(commandLine.getOptionValue(AGENT_CONFIG_OPTION));
validateAgentConfigOption(agentConfig, errors);
@@ -282,12 +252,6 @@ public class Install extends AbstractInstall {
validateCustomStorageDataDirectories(commandLine, errors);
}
- if (commandLine.hasOption(SERVER_OPTION) && !isStorageInstalled()
- && commandLine.hasOption(SERVER_CONFIG_OPTION)) {
- File serverConfig = new
File(commandLine.getOptionValue(SERVER_CONFIG_OPTION));
- validateServerConfigOption(serverConfig, errors);
- }
-
if (commandLine.hasOption(AGENT_OPTION) && !isAgentInstalled()
&& commandLine.hasOption(AGENT_CONFIG_OPTION)) {
File agentConfig = new
File(commandLine.getOptionValue(AGENT_CONFIG_OPTION));
@@ -298,17 +262,6 @@ public class Install extends AbstractInstall {
return errors;
}
- private void validateServerConfigOption(File serverConfig, List<String> errors)
{
- if (!serverConfig.exists()) {
- errors.add("The --server-config option has as its value a file that does
not exist ["
- + serverConfig.getAbsolutePath() + "]");
- } else if (serverConfig.isDirectory()) {
- errors.add("The --server-config option has as its value a path that is a
directory ["
- + serverConfig.getAbsolutePath() + "]. It should be a properties
file that replaces the "
- + "default rhq-server.properties");
- }
- }
-
private void validateAgentConfigOption(File agentConfig, List<String> errors)
{
if (!agentConfig.exists()) {
errors.add("The --agent-config option has as its value a file that does
not exist ["
@@ -320,17 +273,6 @@ public class Install extends AbstractInstall {
}
}
- private void validateStorageConfigOption(File storageConfig, List<String>
errors) {
- if (!storageConfig.exists()) {
- errors.add("The --storage-config option has as its value a file that
does not exist ["
- + storageConfig.getAbsolutePath() + "]");
- } else if (storageConfig.isDirectory()) {
- errors.add("The --storage-config option has as its value a path that is
a directory ["
- + storageConfig.getAbsolutePath() + "]. It should be a properties
file with keys that "
- + "correspond to options for the storage installer.");
- }
- }
-
private void installAgent(File agentBasedir) throws IOException {
try {
log.info("Installing RHQ agent");
@@ -469,22 +411,6 @@ public class Install extends AbstractInstall {
return agentPrefs;
}
- private void replaceServerPropertiesIfNecessary(CommandLine commandLine) {
- if (commandLine.hasOption(SERVER_CONFIG_OPTION) && !isServerInstalled())
{
- replaceServerProperties(new
File(commandLine.getOptionValue(SERVER_CONFIG_OPTION)));
- }
- }
-
- private void replaceServerProperties(File newServerProperties) {
- File defaultServerProps = new
File(System.getProperty("rhq.server.properties-file"));
- defaultServerProps.delete();
- try {
- StreamUtil.copy(new FileReader(newServerProperties), new
FileWriter(defaultServerProps));
- } catch (IOException e) {
- throw new RHQControlException("Failed to replace " +
defaultServerProps + " with " + newServerProperties, e);
- }
- }
-
private void replaceAgentConfigIfNecessary(CommandLine commandLine) {
if (!commandLine.hasOption(AGENT_CONFIG_OPTION)) {
return;
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
index f31636d..9857645 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
@@ -94,13 +94,6 @@ public class Upgrade extends AbstractInstall {
+ "not writable for the current user (/var/lib on Linux) or if
you simply prefer a different location. ")
.addOption(
null,
- STORAGE_CONFIG_OPTION,
- true,
- "This option is valid only when upgrading from older systems that
did not have storage nodes. Use this option to specify non-default storage "
- + "installer options. It is the path to a properties file with
keys that correspond to option names of the "
- + "storage installer. Each property will be translated into an
option that is passed to the storage installer.")
- .addOption(
- null,
RUN_DATA_MIGRATION,
true,
"This option is valid only when upgrading from older systems that
did not have storage nodes. The existing metric data needs to migrate to "
@@ -251,8 +244,7 @@ public class Upgrade extends AbstractInstall {
// to not get a port conflict
waitForProcessToStop(getStoragePid());
- org.apache.commons.exec.CommandLine commandLine =
getCommandLine("rhq-storage-installer",
- "--upgrade",
+ org.apache.commons.exec.CommandLine commandLine =
getCommandLine("rhq-storage-installer", "--upgrade",
getFromServerDir(rhqctlCommandLine).getAbsolutePath());
Executor executor = new DefaultExecutor();
executor.setWorkingDirectory(getBinDir());
@@ -654,11 +646,6 @@ public class Upgrade extends AbstractInstall {
+ " is valid only for upgrades from older systems that did not
have storage nodes.");
}
- if (commandLine.hasOption(STORAGE_CONFIG_OPTION)) {
- errors.add("The option --" + STORAGE_CONFIG_OPTION
- + " is valid only for upgrades from older systems that did not
have storage nodes.");
- }
-
if (commandLine.hasOption(RUN_DATA_MIGRATION)) {
errors.add("The option --" + RUN_DATA_MIGRATION
+ " is valid only for upgrades from older systems that did not
have storage nodes.");
commit abc2c8263f6fd36c09b738c197e967a0b340dca2
Author: mtho11 <mikecthompson(a)gmail.com>
Date: Mon Sep 23 14:21:37 2013 -0700
[BZ 1010336] - Availability axes can sometimes get overwritten when moving from
Resource to Resource and changing the time period.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
index 8870e58..f68e844 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
@@ -181,8 +181,7 @@ public class MetricsResourceView extends AbstractD3GraphListView
implements
@Override
public void onViewRendered() {
-
// refresh the graphs on subtab nav because we are a cached view not new
- drawGraphs();
+ availabilityGraph.parentResized();
}
}
commit 069d7409716b5dc4e68ca3ea11277eddcb985be5
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Mon Sep 23 21:00:44 2013 +0200
Bumping Clirr maven plugin version to remove the need for our patched version.
diff --git a/pom.xml b/pom.xml
index 7380d63..cd099f6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -260,7 +260,7 @@
<animal.sniffer.java.signature.artifactId>java16</animal.sniffer.java.signature.artifactId>
<animal.sniffer.java.signature.version>1.0</animal.sniffer.java.signature.version>
<!-- API checks -->
- <clirr.version>2.5</clirr.version>
+ <clirr.version>2.6</clirr.version>
<!-- a default value for the child modules indicating that the module is not
part of our public API and is therefore not API-checked. -->
<rhq.internal>true</rhq.internal>