[rhq] Branch 'release_jon3.0.0-test-build' - 70 commits - .classpath etc/cli-scripts modules/common modules/core modules/enterprise modules/helpers modules/integration-tests modules/plugins modules/pom.xml modules/test-utils pom.xml publish_release.sh release.sh
by Simeon Pinder
.classpath | 1
etc/cli-scripts/drift.js | 164 --
etc/cli-scripts/measurement_utils.js | 134 --
etc/cli-scripts/util.js | 95 -
modules/common/ant-bundle/pom.xml | 2
modules/common/drift/pom.xml | 2
modules/common/filetemplate-bundle/pom.xml | 2
modules/common/jboss-as/pom.xml | 2
modules/common/pom.xml | 2
modules/core/client-api/pom.xml | 2
modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/DriftMetadataParser.java | 3
modules/core/client-api/src/test/java/org/rhq/core/clientapi/agent/metadata/test/PluginMetadataParserTest.java | 3
modules/core/comm-api/pom.xml | 2
modules/core/dbutils/pom.xml | 2
modules/core/domain/pom.xml | 2
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java | 2
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDetails.java | 126 ++
modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftConfigurationTest.java | 20
modules/core/gui/pom.xml | 2
modules/core/native-system/pom.xml | 2
modules/core/plugin-api/pom.xml | 2
modules/core/plugin-container/pom.xml | 5
modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftInputStream.java | 93 +
modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java | 144 +-
modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/ScheduleQueueImpl.java | 21
modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DriftManagerTest.java | 133 ++
modules/core/plugin-validator/pom.xml | 2
modules/core/pom.xml | 2
modules/core/util/pom.xml | 2
modules/enterprise/agent/ant-run.xml | 15
modules/enterprise/agent/pom.xml | 5
modules/enterprise/agentupdate/pom.xml | 2
modules/enterprise/binding/pom.xml | 4
modules/enterprise/comm/pom.xml | 2
modules/enterprise/gui/base-perspective-jar/pom.xml | 2
modules/enterprise/gui/base-perspective-war/pom.xml | 2
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/CoreGUI.java | 26
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ImageManager.java | 48
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java | 23
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java | 9
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java | 73 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/buttons/BackButton.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/AbstractTableSection.java | 9
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/StringIDTableSection.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java | 25
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java | 28
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/queue/AutodiscoveryPortlet.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformMetricDataSource.java | 17
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java | 80 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/AbstractRecentDriftsPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftConfigurationView.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java | 259 ++--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DriftGWTService.java | 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java | 15
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TestGWTService.java | 34
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java | 20
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/AbstractTwoLevelTabSetView.java | 22
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeDataSource.java | 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ChildHistoryView.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryDataSource.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/AutodiscoveryQueueDataSource.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java | 14
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java | 15
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/FlexSearchBar.java | 31
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java | 68 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestRpcView.java | 52
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java | 9
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DriftGWTServiceImpl.java | 22
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TestGWTServiceImpl.java | 43
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties | 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties | 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties | 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties | 3
modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml | 8
modules/enterprise/gui/coregui/src/main/webapp/css/search.css | 7
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/CreateChild_16.png |binary
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/CreateChild_failed_16.png |binary
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/CreateChild_success_16.png |binary
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/DeleteChild_16.png |binary
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/DeleteChild_failed_16.png |binary
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/DeleteChild_success_16.png |binary
modules/enterprise/gui/installer-war/pom.xml | 2
modules/enterprise/gui/pom.xml | 2
modules/enterprise/gui/portal-war/pom.xml | 2
modules/enterprise/gui/portal-war/src/main/webapp/images/icn_create_child.png |binary
modules/enterprise/gui/portal-war/src/main/webapp/images/icn_create_child_failed.png |binary
modules/enterprise/gui/portal-war/src/main/webapp/images/icn_create_child_success.png |binary
modules/enterprise/gui/portal-war/src/main/webapp/images/icn_delete_child.png |binary
modules/enterprise/gui/portal-war/src/main/webapp/images/icn_delete_child_failed.png |binary
modules/enterprise/gui/portal-war/src/main/webapp/images/icn_delete_child_success.png |binary
modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Drift_16.png |binary
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp | 4
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp | 9
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp | 17
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventDriftJSON.jsp | 59 +
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp | 35
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventInventoryJSON.jsp | 52
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp | 10
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp | 2
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp | 40
modules/enterprise/pom.xml | 2
modules/enterprise/remoting/cli/pom.xml | 2
modules/enterprise/remoting/cli/src/main/samples/README.txt | 24
modules/enterprise/remoting/cli/src/main/samples/drift.js | 257 ++++
modules/enterprise/remoting/cli/src/main/samples/measurement_utils.js | 134 ++
modules/enterprise/remoting/cli/src/main/samples/util.js | 112 +
modules/enterprise/remoting/cli/src/main/scripts/rhq-client.build.xml | 11
modules/enterprise/remoting/client-api/pom.xml | 2
modules/enterprise/remoting/client-deps/pom.xml | 2
modules/enterprise/remoting/pom.xml | 2
modules/enterprise/remoting/webservices/pom.xml | 2
modules/enterprise/server/client-api/pom.xml | 4
modules/enterprise/server/container-lib/pom.xml | 2
modules/enterprise/server/container/pom.xml | 8
modules/enterprise/server/container/src/main/scripts/rhq-container.assembly.xml | 7
modules/enterprise/server/ear/pom.xml | 2
modules/enterprise/server/jar/pom.xml | 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java | 124 ++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java | 12
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java | 11
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerLocal.java | 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java | 121 +-
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBeanTest.java | 8
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/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/groovy-script/pom.xml | 4
modules/enterprise/server/plugins/jboss-software/pom.xml | 2
modules/enterprise/server/plugins/packagetype-cli/pom.xml | 4
modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml | 2
modules/enterprise/server/plugins/perspectives/core/pom.xml | 2
modules/enterprise/server/plugins/pom.xml | 2
modules/enterprise/server/plugins/rhnhosted/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/safe-invoker/pom.xml | 2
modules/enterprise/server/sars/agent-sar/pom.xml | 2
modules/enterprise/server/sars/pom.xml | 2
modules/enterprise/server/xml-schemas/pom.xml | 2
modules/helpers/bundleGen/pom.xml | 4
modules/helpers/perftest-support/pom.xml | 4
modules/helpers/pom.xml | 2
modules/helpers/rtfilter/pom.xml | 2
modules/integration-tests/apache-plugin-test/pom.xml | 4
modules/integration-tests/mod_cluster-plugin-test/pom.xml | 396 ++++++
modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModClusterPluginIntegrationTest.java | 229 +++
modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java | 210 ---
modules/plugins/aliases/pom.xml | 4
modules/plugins/ant-bundle/pom.xml | 2
modules/plugins/apache/pom.xml | 4
modules/plugins/augeas/pom.xml | 8
modules/plugins/byteman/pom.xml | 2
modules/plugins/cobbler/pom.xml | 4
modules/plugins/cron/pom.xml | 4
modules/plugins/database/pom.xml | 2
modules/plugins/filetemplate-bundle/pom.xml | 2
modules/plugins/grub/pom.xml | 4
modules/plugins/hadoop/pom.xml | 2
modules/plugins/hibernate/pom.xml | 2
modules/plugins/hosts/pom.xml | 4
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/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java | 13
modules/plugins/kickstart/pom.xml | 2
modules/plugins/mod-cluster/pom.xml | 66 -
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java | 121 ++
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanComponent.java | 64 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java | 109 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java | 102 -
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java | 118 --
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java | 155 ++
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java | 92 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterDiscoveryComponent.java | 85 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java | 70 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServiceComponent.java | 51
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java | 45
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ProxyInfo.java | 310 -----
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextComponent.java | 117 ++
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextDiscoveryComponent.java | 105 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java | 81 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java | 92 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java | 253 ++++
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/helper/JBossHelper.java | 49
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/model/ProxyInfo.java | 310 +++++
modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml | 581 ++++++++--
modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ProxyInfoTest.java | 2
modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java | 91 +
modules/plugins/mod-cluster/src/test/resources/xml_config/mod_cluster-jboss-beans.xml | 337 +++++
modules/plugins/mod-cluster/src/test/resources/xml_config/server.xml | 157 ++
modules/plugins/mysql/pom.xml | 2
modules/plugins/netservices/pom.xml | 2
modules/plugins/oracle/pom.xml | 2
modules/plugins/pattern-generator/pom.xml | 2
modules/plugins/perftest/pom.xml | 78 +
modules/plugins/platform/pom.xml | 2
modules/plugins/pom.xml | 2
modules/plugins/postfix/pom.xml | 4
modules/plugins/postgres/pom.xml | 2
modules/plugins/rhq-agent/pom.xml | 2
modules/plugins/rhq-server/pom.xml | 2
modules/plugins/samba/pom.xml | 4
modules/plugins/script/pom.xml | 2
modules/plugins/script2/pom.xml | 2
modules/plugins/snmptrapd/pom.xml | 2
modules/plugins/sshd/pom.xml | 4
modules/plugins/sudoers/pom.xml | 4
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 | 9
publish_release.sh | 61 -
release.sh | 61 -
250 files changed, 5875 insertions(+), 2126 deletions(-)
New commits:
commit 85ccbd1698c68a5a7850a32fe364973a5ef704be
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Sep 1 16:55:06 2011 -0400
[BZ 735232] Message portlet should not be displayed on default dashboard in JON
(https://bugzilla.redhat.com/show_bug.cgi?id=735232); fix layout issues in About
modal window; load ProductInfo once in CoreGUI init and cache it
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
index 2a52e4d..88801e0 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
@@ -33,6 +33,7 @@ import com.google.gwt.user.client.History;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.Window.Location;
+import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.core.KeyIdentifier;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.util.KeyCallback;
@@ -41,10 +42,12 @@ import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.layout.VLayout;
+import org.rhq.core.domain.common.ProductInfo;
import org.rhq.enterprise.gui.coregui.client.admin.AdministrationView;
import org.rhq.enterprise.gui.coregui.client.alert.AlertHistoryView;
import org.rhq.enterprise.gui.coregui.client.bundle.BundleTopView;
import org.rhq.enterprise.gui.coregui.client.dashboard.DashboardsView;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.help.HelpView;
import org.rhq.enterprise.gui.coregui.client.inventory.InventoryView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.ResourceGroupDetailView;
@@ -109,6 +112,7 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String>, Event.Na
private MenuBarView menuBarView;
private Footer footer;
private int rpcTimeout;
+ private ProductInfo productInfo;
public void onModuleLoad() {
String hostPageBaseURL = GWT.getHostPageBaseURL();
@@ -262,6 +266,28 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String>, Event.Na
return coreGUI;
}
+ public void init() {
+ if (productInfo == null) {
+ GWTServiceLookup.getSystemService().getProductInfo(new AsyncCallback<ProductInfo>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(MSG.view_aboutBox_failedToLoad(), caught);
+ buildCoreUI();
+ }
+
+ public void onSuccess(ProductInfo result) {
+ productInfo = result;
+ buildCoreUI();
+ }
+ });
+ } else {
+ buildCoreUI();
+ }
+ }
+
+ public ProductInfo getProductInfo() {
+ return productInfo;
+ }
+
public void buildCoreUI() {
// If the core gui is already built (eg. from previous login) skip the build and just refire event
if (rootCanvas == null) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java
index 56c3658..7bdcb6e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java
@@ -84,7 +84,7 @@ public class UserSessionManager {
// We want the CoreGUI session timeout to rule them all. The rhq subject session is refreshed on each SLSB
// call. But the HTTP session will die after 30 minutes. Keep it alive until logout by pinging SessionAccessServlet
- // occasionaly, as specified by this interval (which must be less than the 30 minutes).
+ // occasionally, as specified by this interval (which must be less than the 30 minutes).
// Currently: 20 minutes
private static int SESSION_ACCESS_REFRESH = 20 * 60 * 1000;
@@ -454,7 +454,7 @@ public class UserSessionManager {
scheduleWebUserUpdate(loggedInSubject);
}
- CoreGUI.get().buildCoreUI();
+ CoreGUI.get().init();
}
public void onFailure(Throwable caught) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
index 6a614bb..b476f66 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2010 Red Hat, Inc.
+ * Copyright (C) 2010-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -18,25 +18,18 @@
*/
package org.rhq.enterprise.gui.coregui.client.components;
-import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.Version;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.types.VerticalAlignment;
-import com.smartgwt.client.widgets.Button;
-import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.HTMLFlow;
-import com.smartgwt.client.widgets.IButton;
-import com.smartgwt.client.widgets.Window;
+import com.smartgwt.client.widgets.HTMLPane;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
-import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.common.ProductInfo;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.Messages;
-import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHLayout;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
@@ -52,8 +45,6 @@ public class AboutModalWindow extends LocatableWindow {
private static final Messages MSG = CoreGUI.getMessages();
- private static ProductInfo PRODUCT_INFO;
-
/**
* <pre>
* ID Format: "simpleClassname_locatorId"
@@ -78,37 +69,19 @@ public class AboutModalWindow extends LocatableWindow {
@Override
protected void onInit() {
- super.onInit();
-
- if (PRODUCT_INFO == null) {
- GWTServiceLookup.getSystemService().getProductInfo(new AsyncCallback<ProductInfo>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(MSG.view_aboutBox_failedToLoad(), caught);
- }
-
- public void onSuccess(ProductInfo result) {
- PRODUCT_INFO = result;
- setTitle(MSG.view_aboutBox_title(PRODUCT_INFO.getFullName()));
+ ProductInfo productInfo = CoreGUI.get().getProductInfo();
- finishOnInit();
- }
- });
- } else {
- finishOnInit();
- }
- }
+ setTitle(MSG.view_aboutBox_title(productInfo.getFullName()));
- private void finishOnInit() {
LocatableVLayout contentPane = new LocatableVLayout(extendLocatorId("Content"));
- contentPane.setPadding(13);
- contentPane.setMembersMargin(25);
-
- HTMLFlow htmlFlow = new HTMLFlow();
- String html = "<span class=\"DisplaySubhead\">\n" + " <a href=\"" + PRODUCT_INFO.getUrl() + "\" title=\""
- + PRODUCT_INFO.getFullName() + " " + PRODUCT_INFO.getUrl() + "\" target=\"_blank\">"
- + PRODUCT_INFO.getFullName() + "</a>\n" + "</span><br/>\n" + "<span class=\"DisplayLabel\">"
- + MSG.view_aboutBox_version() + " " + PRODUCT_INFO.getVersion() + "</span><br/>\n"
- + "<span class=\"DisplayLabel\">" + MSG.view_aboutBox_buildNumber() + " " + PRODUCT_INFO.getBuildNumber()
+ contentPane.setPadding(10);
+
+ HTMLPane htmlPane = new HTMLPane();
+ String html = "<span class=\"DisplaySubhead\">\n" + " <a href=\"" + productInfo.getUrl() + "\" title=\""
+ + productInfo.getFullName() + " " + productInfo.getUrl() + "\" target=\"_blank\">"
+ + productInfo.getFullName() + "</a>\n" + "</span><br/>\n" + "<span class=\"DisplayLabel\">"
+ + MSG.view_aboutBox_version() + " " + productInfo.getVersion() + "</span><br/>\n"
+ + "<span class=\"DisplayLabel\">" + MSG.view_aboutBox_buildNumber() + " " + productInfo.getBuildNumber()
+ "</span><p/>\n" + "<span class=\"DisplayLabel\">GWT " + MSG.common_title_version() + ": "
+ MSG.common_buildInfo_gwtVersion() + "</span><br/>\n" + "<span class=\"DisplayLabel\">SmartGWT "
+ MSG.common_title_version() + ": " + Version.getVersion() + "</span><br/>\n"
@@ -116,17 +89,19 @@ public class AboutModalWindow extends LocatableWindow {
+ " <img height=\"55\" alt=\"" + MSG.view_aboutBox_jbossByRedHat()
+ "\" src=\"/images/jboss_logo.png\">\n" + "</a></p>\n" + "<div style=\"top-margin: 10px\">"
+ MSG.view_aboutBox_allRightsReserved() + "</div>\n";
- htmlFlow.setContents(html);
- contentPane.addMember(htmlFlow);
+ htmlPane.setContents(html);
+ htmlPane.setHeight(220);
+ contentPane.addMember(htmlPane);
LocatableHLayout buttonBar = new LocatableHLayout(contentPane.extendLocatorId("ButtonBar"));
+ buttonBar.setHeight(30);
buttonBar.setAlign(Alignment.RIGHT);
LocatableIButton closeButton = new LocatableIButton(buttonBar.extendLocatorId("Close"),
MSG.common_button_close());
closeButton.setShowRollOver(true);
closeButton.setShowDown(true);
- closeButton.setWidth("60");
+ closeButton.setWidth(60);
closeButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
hide();
@@ -143,4 +118,5 @@ public class AboutModalWindow extends LocatableWindow {
// Layout class.
addItem(contentPane);
}
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
index 7d0ec7a..424b256 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2009 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -45,6 +45,7 @@ import com.smartgwt.client.widgets.tab.events.TabSelectedEvent;
import com.smartgwt.client.widgets.tab.events.TabSelectedHandler;
import org.rhq.core.domain.authz.Permission;
+import org.rhq.core.domain.common.ProductInfo;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.criteria.DashboardCriteria;
import org.rhq.core.domain.dashboard.Dashboard;
@@ -361,21 +362,32 @@ public class DashboardsView extends LocatableVLayout implements DashboardContain
dashboard.setColumnWidths("32%");
dashboard.getConfiguration().put(new PropertySimple(Dashboard.CFG_BACKGROUND, "#F1F2F3"));
+ ProductInfo productInfo = CoreGUI.get().getProductInfo();
+ boolean isRHQ = (productInfo != null) && "RHQ".equals(productInfo.getShortName());
+
// Left Column
- DashboardPortlet welcome = new DashboardPortlet(MessagePortlet.NAME, MessagePortlet.KEY, 250);
- dashboard.addPortlet(welcome, 0, 0);
+ int columnIndex = 0;
+ int rowIndex = 0;
+
+ if (isRHQ) {
+ DashboardPortlet welcome = new DashboardPortlet(MessagePortlet.NAME, MessagePortlet.KEY, 250);
+ dashboard.addPortlet(welcome, columnIndex, rowIndex++);
+ }
DashboardPortlet summary = new DashboardPortlet(InventorySummaryPortlet.NAME, InventorySummaryPortlet.KEY, 250);
- dashboard.addPortlet(summary, 0, 1);
+ dashboard.addPortlet(summary, columnIndex, rowIndex++);
DashboardPortlet news = new DashboardPortlet(MashupPortlet.NAME, MashupPortlet.KEY, 300);
news.getConfiguration().put(
new PropertySimple("address", "http://rhq-project.org/display/RHQ/RHQ+News?decorator=popup"));
- dashboard.addPortlet(news, 0, 2);
+ dashboard.addPortlet(news, columnIndex, rowIndex++);
// Right Column
+ columnIndex = 1;
+ rowIndex = 0;
+
DashboardPortlet recentAlerts = new DashboardPortlet(RecentAlertsPortlet.NAME, RecentAlertsPortlet.KEY, 250);
- dashboard.addPortlet(recentAlerts, 1, 0);
+ dashboard.addPortlet(recentAlerts, columnIndex, rowIndex++);
DashboardPortlet problemResources = new DashboardPortlet(ProblemResourcesPortlet.NAME,
ProblemResourcesPortlet.KEY, 250);
@@ -388,11 +400,11 @@ public class DashboardsView extends LocatableVLayout implements DashboardContain
.put(
new PropertySimple(ProblemResourcesPortlet.PROBLEM_RESOURCE_SHOW_HRS,
ProblemResourcesPortlet.defaultValue));
- dashboard.addPortlet(problemResources, 1, 1);
+ dashboard.addPortlet(problemResources, columnIndex, rowIndex++);
DashboardPortlet operations = new DashboardPortlet(OperationHistoryPortlet.NAME, OperationHistoryPortlet.KEY,
200);
- dashboard.addPortlet(operations, 1, 2);
+ dashboard.addPortlet(operations, columnIndex, rowIndex++);
return dashboard;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
index 22a0c13..8f4df4b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -26,7 +26,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.MissingResourceException;
-import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.Label;
@@ -41,7 +40,6 @@ import org.rhq.enterprise.gui.coregui.client.components.view.NavigationItem;
import org.rhq.enterprise.gui.coregui.client.components.view.NavigationSection;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewFactory;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewName;
-import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/**
@@ -96,20 +94,8 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
"[SKIN]/../actions/help.png", new ViewFactory() {
public Canvas createView() {
final AboutModalWindow aboutModalWindow = new AboutModalWindow(extendLocatorId("AboutModalWindow"));
- if (PRODUCT_INFO == null) {
- GWTServiceLookup.getSystemService().getProductInfo(new AsyncCallback<ProductInfo>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(MSG.view_aboutBox_failedToLoad(), caught);
- }
-
- public void onSuccess(ProductInfo result) {
- PRODUCT_INFO = result;
- aboutModalWindow.setTitle(MSG.view_aboutBox_title(PRODUCT_INFO.getFullName()));
- }
- });
- } else {
- aboutModalWindow.setTitle(MSG.view_aboutBox_title(PRODUCT_INFO.getFullName()));
- }
+ ProductInfo productInfo = CoreGUI.get().getProductInfo();
+ aboutModalWindow.setTitle(MSG.view_aboutBox_title(productInfo.getFullName()));
aboutModalWindow.show();
return aboutModalWindow;
}
commit 6f0df962341bc372463d2b2444a8626b0f472985
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Sep 1 15:55:25 2011 -0400
Fixing syntax error
diff --git a/publish_release.sh b/publish_release.sh
index 3a12b7a..2be9db9 100755
--- a/publish_release.sh
+++ b/publish_release.sh
@@ -219,7 +219,7 @@ export LANG
echo
echo "========================== Environment Variables =============================="
echo "JAVA_HOME=$JAVA_HOME"
-[ "$RELEASE_TYPE" = "enterprise" ]"
+[ "$RELEASE_TYPE" = "enterprise" ]
#[ "$RELEASE_TYPE" = "enterprise" ] && echo "JAVA5_HOME=$JAVA5_HOME"
echo "M2_HOME=$M2_HOME"
echo "MAVEN_OPTS=$MAVEN_OPTS"
commit 723ed5e890b66339daa4a20170afcea4343629dd
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Sep 1 13:30:39 2011 -0400
[BZ 608798, 608803] changes to LoginView and MenuBarView to allow RHQ logos to
be replaced with JON logos, even if the JON logo images are not the same width
and height as the RHQ logo images
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
index 5e915c6..c5b8f43 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
@@ -35,6 +35,7 @@ import com.google.gwt.http.client.URL;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.FormErrorOrientation;
+import com.smartgwt.client.types.ImageStyle;
import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.HTMLFlow;
import com.smartgwt.client.widgets.IButton;
@@ -119,9 +120,16 @@ public class LoginView extends LocatableCanvas {
form.setShowErrorText(true);
form.setErrorOrientation(FormErrorOrientation.BOTTOM);
+ // NOTE: This image will either be an RHQ logo or a JON logo.
+ Img logoImg = new Img("header/rhq_logo_28px.png");
+ // NOTE: Don't explicitly specify a width, so the width will be scaled proportionally to the height.
+ logoImg.setImageType(ImageStyle.NORMAL);
+ logoImg.setImageHeight(40);
+
CanvasItem logo = new CanvasItem();
- logo.setCanvas(new Img("header/rhq_logo_28px.png", 80, 28));
logo.setShowTitle(false);
+ logo.setHeight(logoImg.getImageHeight() + 4);
+ logo.setCanvas(logoImg);
HeaderItem header = new HeaderItem();
header.setValue(MSG.view_login_prompt());
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
index 5687c75..6a614bb 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
@@ -20,6 +20,7 @@ package org.rhq.enterprise.gui.coregui.client.components;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.Version;
+import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.Button;
@@ -99,12 +100,12 @@ public class AboutModalWindow extends LocatableWindow {
private void finishOnInit() {
LocatableVLayout contentPane = new LocatableVLayout(extendLocatorId("Content"));
- contentPane.setPadding(15);
+ contentPane.setPadding(13);
contentPane.setMembersMargin(25);
HTMLFlow htmlFlow = new HTMLFlow();
String html = "<span class=\"DisplaySubhead\">\n" + " <a href=\"" + PRODUCT_INFO.getUrl() + "\" title=\""
- + PRODUCT_INFO.getFullName() + " " + MSG.view_aboutBox_homepage() + "\" target=\"_blank\">"
+ + PRODUCT_INFO.getFullName() + " " + PRODUCT_INFO.getUrl() + "\" target=\"_blank\">"
+ PRODUCT_INFO.getFullName() + "</a>\n" + "</span><br/>\n" + "<span class=\"DisplayLabel\">"
+ MSG.view_aboutBox_version() + " " + PRODUCT_INFO.getVersion() + "</span><br/>\n"
+ "<span class=\"DisplayLabel\">" + MSG.view_aboutBox_buildNumber() + " " + PRODUCT_INFO.getBuildNumber()
@@ -119,12 +120,7 @@ public class AboutModalWindow extends LocatableWindow {
contentPane.addMember(htmlFlow);
LocatableHLayout buttonBar = new LocatableHLayout(contentPane.extendLocatorId("ButtonBar"));
- buttonBar.setAlign(VerticalAlignment.BOTTOM);
- contentPane.addMember(buttonBar);
-
- Canvas spacer = new Canvas();
- spacer.setWidth("*");
- buttonBar.addMember(spacer);
+ buttonBar.setAlign(Alignment.RIGHT);
LocatableIButton closeButton = new LocatableIButton(buttonBar.extendLocatorId("Close"),
MSG.common_button_close());
@@ -138,6 +134,11 @@ public class AboutModalWindow extends LocatableWindow {
});
buttonBar.addMember(closeButton);
+ VLayout bottom = new VLayout();
+ bottom.setAlign(VerticalAlignment.BOTTOM);
+ bottom.addMember(buttonBar);
+ contentPane.addMember(bottom);
+
// NOTE: Since this is a subclass of Window, we MUST use addItem(), rather than addMember() from the
// Layout class.
addItem(contentPane);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
index f138f6a..3bd11d2 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
@@ -22,6 +22,8 @@ import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.user.client.History;
import com.smartgwt.client.types.Alignment;
+import com.smartgwt.client.types.ImageStyle;
+import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.Img;
@@ -99,13 +101,22 @@ public class MenuBarView extends LocatableVLayout {
private Canvas getLogoSection() {
final AboutModalWindow aboutModalWindow = new AboutModalWindow(extendLocatorId("AboutModalWindow"));
- Img logo = new Img("header/rhq_logo_28px.png", 80, 28);
+ HLayout logoSection = new HLayout();
+ logoSection.setOverflow(Overflow.VISIBLE);
+
+ // NOTE: This image will either be an RHQ logo or a JON logo.
+ Img logo = new Img("header/rhq_logo_28px.png");
+ // NOTE: Don't explicitly specify a width, so the width will be scaled proportionally to the height.
+ logo.setImageType(ImageStyle.NORMAL);
+ logo.setImageHeight(28);
logo.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
aboutModalWindow.show();
}
});
- return logo;
+
+ logoSection.addMember(logo);
+ return logoSection;
}
private Canvas getLinksSection() {
commit 8b92144361a72e581ed0106c56e848bb7a0a7415
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Sep 1 12:37:01 2011 -0500
BZ684320 - Updated permissions only for the zip archives of server and agent to 744.
diff --git a/modules/enterprise/agent/ant-run.xml b/modules/enterprise/agent/ant-run.xml
index 384e283..418009d 100644
--- a/modules/enterprise/agent/ant-run.xml
+++ b/modules/enterprise/agent/ant-run.xml
@@ -211,7 +211,7 @@ Ant Script that provides ways to package the Agent.
<delete file="${basedir}/target/rhq-enterprise-agent-${project.version}.zip" />
<zip destfile="${basedir}/target/rhq-enterprise-agent-${project.version}.zip" >
<!-- The zip task does not mantain file permissions, we have to make sure they are set here -->
- <zipfileset dir="${basedir}/target">
+ <zipfileset dir="${basedir}/target" filemode="744" dirmode="744">
<include name="rhq-agent/**"/>
<exclude name="rhq-agent/bin/*.sh"/>
<exclude name="rhq-agent/lib/*.so"/>
@@ -220,7 +220,7 @@ Ant Script that provides ways to package the Agent.
<exclude name="rhq-agent/lib/*.dylib"/>
<exclude name="rhq-agent/lib/augeas/**" />
</zipfileset>
- <zipfileset dir="${basedir}/target" filemode="755">
+ <zipfileset dir="${basedir}/target" filemode="755" dirmode="744">
<include name="rhq-agent/bin/*.sh"/>
<include name="rhq-agent/lib/*.so"/>
<include name="rhq-agent/lib/*.sl"/>
diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml
index d27c157..42cc43c 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -8,7 +8,7 @@
<version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
-
+
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-container</artifactId>
<packaging>pom</packaging>
@@ -250,6 +250,10 @@
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
+ <archiverConfig>
+ <!-- permissions for archiver configuration are in decimal (not octal) -->
+ <defaultDirectoryMode>484</defaultDirectoryMode>
+ </archiverConfig>
<descriptors>
<descriptor>src/main/scripts/rhq-container.assembly.xml</descriptor>
</descriptors>
diff --git a/modules/enterprise/server/container/src/main/scripts/rhq-container.assembly.xml b/modules/enterprise/server/container/src/main/scripts/rhq-container.assembly.xml
index a6dbf98..816ab0d 100644
--- a/modules/enterprise/server/container/src/main/scripts/rhq-container.assembly.xml
+++ b/modules/enterprise/server/container/src/main/scripts/rhq-container.assembly.xml
@@ -20,8 +20,10 @@
<exclude>**/*.sl</exclude>
<exclude>**/*.dylib</exclude>
</excludes>
+ <fileMode>0744</fileMode>
+ <directoryMode>0744</directoryMode>
</fileSet>
- <fileSet>
+ <fileSet>
<directory>${project.build.outputDirectory}</directory>
<outputDirectory>/</outputDirectory>
<includes>
@@ -30,7 +32,8 @@
<include>**/*.sl</include>
<include>**/*.dylib</include>
</includes>
- <fileMode>0755</fileMode>
+ <fileMode>0744</fileMode>
+ <directoryMode>0744</directoryMode>
</fileSet>
</fileSets>
</assembly>
\ No newline at end of file
commit 153c9845c2ac28079b9629b4cc445d7eccca8901
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Sep 1 10:11:40 2011 -0400
[BZ 734879 - Drift display issue ... Change Sets-->Context Menu--->Details]
Even if the table view is not visible, it may not be hidden. Instead, it
may be the case that its parent (the encompassing Table/HLayout) may not
be visible. This is unusual because typically we switch between the table
and detail view while under the subtab, but if we navigate to the detail
view from another subtab (for example, the drift tree context
menu) the Table may not be visible and the table view may not be hidden.
To make a long story short, ensure the table view is hidden when
displaying the details view.
- Also, convert History,newItem occurrences in BackButton and
StringIdTableSection to CoreGUI.gotToView. We should not be using
History.newItem in most places because it bypasses some view processing
we do in goToView prior to calling History.newItem. I see more
occurrences of this but will hold off changing until after the pending
release.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/buttons/BackButton.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/buttons/BackButton.java
index 7054d2e..aaa6688 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/buttons/BackButton.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/buttons/BackButton.java
@@ -22,10 +22,10 @@
*/
package org.rhq.enterprise.gui.coregui.client.components.buttons;
-import com.google.gwt.user.client.History;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableStretchImgButton;
/**
@@ -43,7 +43,7 @@ public class BackButton extends LocatableStretchImgButton {
setTitle("<b>" + title + "</b>");
addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
- History.newItem((anchor.startsWith("#")) ? anchor.substring(1) : anchor);
+ CoreGUI.goToView(anchor);
}
});
setAutoFit(true);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/AbstractTableSection.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/AbstractTableSection.java
index 8c4ee37..2ccfb53 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/AbstractTableSection.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/AbstractTableSection.java
@@ -329,6 +329,7 @@ public abstract class AbstractTableSection<DS extends RPCDataSource, ID> extends
// If the Table has not yet been initialized then ignore
if (contents != null) {
+ // If the table view is visible then gracefully switch to the details view.
if (contents.isVisible()) {
contents.animateHide(AnimationEffect.WIPE, new AnimationCallback() {
@Override
@@ -337,6 +338,14 @@ public abstract class AbstractTableSection<DS extends RPCDataSource, ID> extends
}
});
} else {
+ // Even if the table view is not visible, it may not be hidden. Instead, it may be the
+ // case that its parent (the encompassing Table/HLayout) may not be visible. This is unusual
+ // because typically we switch between the table and detail view while under the subtab, but
+ // if we navigate to the detail view from another subtab (for example, the drift tree context
+ // menu) the Table may not be visible and the table view may not be hidden. To make a long
+ // story short, ensure the table view is hidden when displaying the details view.
+ contents.hide();
+
/*
* if the programmer chooses to go directly from the detailView in create-mode to the
* detailsView in edit-mode, the content canvas will already be hidden, which means the
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/StringIDTableSection.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/StringIDTableSection.java
index 1c5a333..1235751 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/StringIDTableSection.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/StringIDTableSection.java
@@ -19,7 +19,6 @@
package org.rhq.enterprise.gui.coregui.client.components.table;
-import com.google.gwt.user.client.History;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.data.SortSpecifier;
import com.smartgwt.client.widgets.Canvas;
@@ -38,6 +37,7 @@ import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
*
* @author John Mazzitelli
*/
+@SuppressWarnings("unchecked")
public abstract class StringIDTableSection<DS extends RPCDataSource> extends AbstractTableSection<DS, String> {
public StringIDTableSection(String locatorId, String tableTitle, boolean autoFetchData) {
@@ -93,7 +93,7 @@ public abstract class StringIDTableSection<DS extends RPCDataSource> extends Abs
@Override
public void showDetails(String id) {
if (id != null && id.length() > 0) {
- History.newItem(getBasePath() + "/" + convertIDToCurrentViewPath(id));
+ CoreGUI.goToView(getBasePath() + "/" + convertIDToCurrentViewPath(id));
} else {
String msg = MSG.view_tableSection_error_badId(this.getClass().toString(), (id == null) ? "null" : id
.toString());
commit b6125949237abceab2abd2fcee70f339f12c4fa6
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Aug 31 22:33:19 2011 -0400
[BZ 734881] Need to check for empty content because oracle blobs don't handle it
When a file is empty we still persist a row for it in rhq_drift_file.
The blob is set to null. This works fine on postgresql, but results in
the NPE reported in BZ 734881. To work around this, we now check the
size which is also stored in the rhq_drift_file table, and if the size
is zero, DriftManagerBean.getDriftFileContent just returns an empty
stream instead of opening an input stream on the blob.
This required one additional change. We previously were not storing the
size in rhq_drift_file. I have updated
JPADriftServerBean.persistDriftFileData to save the size now as well.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
index daa7a68..16e0d73 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
@@ -211,12 +211,13 @@ public class JPADriftServerBean implements JPADriftServerLocal {
@Override
@TransactionAttribute(REQUIRES_NEW)
- public void persistDriftFileData(JPADriftFile driftFile, InputStream data) throws Exception {
+ public void persistDriftFileData(JPADriftFile driftFile, InputStream data, long numBytes) throws Exception {
JPADriftFileBits df = entityManager.find(JPADriftFileBits.class, driftFile.getHashId());
if (null == df) {
throw new IllegalArgumentException("JPADriftFile not found [" + driftFile.getHashId() + "]");
}
+ df.setDataSize(numBytes);
df.setData(Hibernate.createBlob(new BufferedInputStream(data)));
df.setStatus(LOADED);
}
@@ -377,7 +378,7 @@ public class JPADriftServerBean implements JPADriftServerLocal {
for (File file : dir.listFiles()) {
JPADriftFile driftFile = new JPADriftFile(file.getName());
try {
- JPADriftServer.persistDriftFileData(driftFile, new FileInputStream(file));
+ JPADriftServer.persistDriftFileData(driftFile, new FileInputStream(file), file.length());
} catch (Exception e) {
LogFactory.getLog(getClass()).info("Skipping bad drift file", e);
}
@@ -400,6 +401,9 @@ public class JPADriftServerBean implements JPADriftServerLocal {
try {
JPADriftFileBits content = (JPADriftFileBits) entityManager.createNamedQuery(
JPADriftFileBits.QUERY_FIND_BY_ID).setParameter("hashId", hash).getSingleResult();
+ if (content.getDataSize() == null || content.getDataSize() < 1) {
+ return "";
+ }
byte[] bytes = StreamUtil.slurp(content.getBlob().getBinaryStream());
return new String(bytes);
} catch (SQLException e) {
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerLocal.java
index 7142ead..9da1a5b 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerLocal.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerLocal.java
@@ -85,7 +85,7 @@ public interface JPADriftServerLocal {
* @param data
* @throws Exception
*/
- void persistDriftFileData(JPADriftFile driftFile, InputStream data) throws Exception;
+ void persistDriftFileData(JPADriftFile driftFile, InputStream data, long numBytes) throws Exception;
/**
* This method stores the provided change-set file for the resource. The version will be incremented based
commit 59387081b9bf66be0970958473d8cc52debae774
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Aug 31 17:33:18 2011 -0400
[BZ 734610] remove validator on username field that was disallowing usernames
less than 6 characters long (https://bugzilla.redhat.com/show_bug.cgi?id=734610)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
index b0d418f..5e915c6 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -55,7 +55,6 @@ import com.smartgwt.client.widgets.form.fields.SubmitItem;
import com.smartgwt.client.widgets.form.fields.TextItem;
import com.smartgwt.client.widgets.form.fields.events.KeyPressEvent;
import com.smartgwt.client.widgets.form.fields.events.KeyPressHandler;
-import com.smartgwt.client.widgets.form.validator.LengthRangeValidator;
import com.smartgwt.client.widgets.form.validator.RegExpValidator;
import com.smartgwt.client.widgets.layout.HStack;
@@ -495,16 +494,6 @@ public class LoginView extends LocatableCanvas {
for (FormItem item : form.getFields()) {
String name = item.getName();
if ((name != null) && (!name.isEmpty())) {
- if (name.equals(USERNAME)) {
- LengthRangeValidator validator = new LengthRangeValidator();
- validator.setMin(6);
- item.setValidators(validator);
- }
- if (name.equals(FIRST)) {
- LengthRangeValidator validator = new LengthRangeValidator();
- validator.setMin(1);
- item.setValidators(validator);
- }
if (name.equals(EMAIL)) {
RegExpValidator emailValidator = new RegExpValidator();
emailValidator.setErrorMessage(MSG.view_login_invalidEmail());
commit f4fdec760496263f02cba9e1e713f124e597a83b
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Aug 31 17:18:11 2011 -0400
[BZ 722548] add new #Test/Rpc view that can be used to invoke a new sleep() RPC
method that sleeps for a specified number of seconds; increase default RPC
timeout from 10s to 30s; use custom timeouts for autodiscovery queue,
config history list, group schedules list views, which may exceed even the new
default timeout (https://bugzilla.redhat.com/show_bug.cgi?id=722548)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
index 8f5dbc1..c516592 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -58,6 +58,10 @@ public class GWTServiceLookup {
return secure(ConfigurationGWTServiceAsync.Util.getInstance());
}
+ public static ConfigurationGWTServiceAsync getConfigurationService(int timeout) {
+ return secure(ConfigurationGWTServiceAsync.Util.getInstance(), timeout);
+ }
+
public static DriftGWTServiceAsync getDriftService() {
return secure(DriftGWTServiceAsync.Util.getInstance());
}
@@ -190,6 +194,10 @@ public class GWTServiceLookup {
return secure(AgentGWTServiceAsync.Util.getInstance());
}
+ public static TestGWTServiceAsync getTestService() {
+ return secure(TestGWTServiceAsync.Util.getInstance());
+ }
+
@SuppressWarnings("unchecked")
private static <T> T secure(Object sdt) {
return (T) secure(sdt, -1);
@@ -208,7 +216,8 @@ public class GWTServiceLookup {
public static class SessionRpcRequestBuilder extends RpcRequestBuilder {
private static int DEBUG_TIMEOUT_FUDGE_FACTOR = 30000;
- private static int DEFAULT_RPC_TIMEOUT = 10000;
+ private static int DEFAULT_RPC_TIMEOUT = 30000;
+
private int timeout;
public SessionRpcRequestBuilder(int timeout) {
@@ -221,7 +230,7 @@ public class GWTServiceLookup {
this.timeout = (timeout <= 0) ? DEFAULT_RPC_TIMEOUT : timeout;
}
- if (CoreGUI.isDebugMode()) {
+ if (CoreGUI.isDebugMode() && (this.timeout != 0)) {
// debug mode is slow, so give requests more time to complete otherwise you'll get
// weird exceptions whose messages are extremely unhelpful in finding root cause
this.timeout += DEBUG_TIMEOUT_FUDGE_FACTOR;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TestGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TestGWTService.java
new file mode 100644
index 0000000..168edfa
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TestGWTService.java
@@ -0,0 +1,34 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 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.enterprise.gui.coregui.client.gwt;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+
+/**
+ * @author Ian Springer
+ */
+public interface TestGWTService extends RemoteService {
+
+ void sleep(int seconds) throws RuntimeException;
+
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java
index 1f4d491..c21484d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2010 Red Hat, Inc.
+ * Copyright (C) 2010-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -43,7 +43,10 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message;
* @author Ian Springer
*/
public class SchedulesDataSource extends AbstractMeasurementScheduleCompositeDataSource {
- private MeasurementDataGWTServiceAsync measurementService = GWTServiceLookup.getMeasurementDataService();
+
+ // Specify 60s timeout to compensate for schedule updates taking a long time for large groups.
+ // TODO (ips, 08/31/11): Remove this once updating of group schedules has been optimized.
+ private MeasurementDataGWTServiceAsync measurementService = GWTServiceLookup.getMeasurementDataService(60 * 1000);
private int resourceGroupId;
public SchedulesDataSource(int resourceGroupId) {
@@ -157,4 +160,5 @@ public class SchedulesDataSource extends AbstractMeasurementScheduleCompositeDat
}
});
}
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryDataSource.java
index b92fb94..9991f9c 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryDataSource.java
@@ -78,7 +78,9 @@ public abstract class AbstractConfigurationHistoryDataSource<T extends AbstractR
public static final String RESOURCE_ID = "resourceId";
}
- private ConfigurationGWTServiceAsync configurationService = GWTServiceLookup.getConfigurationService();
+ // Specify 60s timeout to compensate for Configurations being fetched for all of the config updates.
+ // TODO (ips, 08/31/11): Remove this once fetching of Configurations has been disabled.
+ private ConfigurationGWTServiceAsync configurationService = GWTServiceLookup.getConfigurationService(60 * 1000);
protected ConfigurationGWTServiceAsync getConfigurationService() {
return this.configurationService;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/AutodiscoveryQueueDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/AutodiscoveryQueueDataSource.java
index 6769b9c..cccc08a 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/AutodiscoveryQueueDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/AutodiscoveryQueueDataSource.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -65,7 +65,11 @@ public class AutodiscoveryQueueDataSource extends DataSource {
private int unlimited = -1;
private int maximumPlatformsToDisplay = -1;
- private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService(1000000);
+
+ // Specify 60s timeout to compensate for slow loading of this view due to lack of paging of results.
+ // TODO (ips, 08/31/11): Remove this once paging has been implemented.
+ private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService(60 * 1000);
+
private PermissionsLoader permissionsLoader = new PermissionsLoader();
private TreeGrid dataContainerReference = null;
private static final Permission MANAGE_INVENTORY = Permission.MANAGE_INVENTORY;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java
index 4daa3c6..9b0cfe3 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java
@@ -79,7 +79,14 @@ public class ResourceAutodiscoveryView extends LocatableVLayout implements Refre
// This allows the selection handler to ignore selection changes initiated by us, as opposed to by the user.
private boolean selectionChangedHandlerDisabled;
- private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService(1000000);
+ private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService();
+
+ // Specify 3m timeout to compensate for import taking a long time for a large number of Resources.
+ // TODO (ips, 08/31/11): Remove this once import has been refactored to be partially asynchronous, i.e. where the
+ // call to importResources() flips all the Resources to a new COMMITTING inventory status
+ // and then kicks off a background job to do the actual work of committing (syncing to
+ // Agents, etc.).
+ private ResourceGWTServiceAsync importResourceService = GWTServiceLookup.getResourceService(3 * 60 * 1000);
public ResourceAutodiscoveryView(String locatorId) {
super(locatorId);
@@ -317,11 +324,14 @@ public class ResourceAutodiscoveryView extends LocatableVLayout implements Refre
importButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
disableButtons(selectAllButton, deselectAllButton, importButton, ignoreButton, unignoreButton);
+ // TODO (ips): Make the below message sticky, but add a new ClearSticky Message option that the
+ // below callback methods can use to clear it once the importResources() call has
+ // completed.
CoreGUI.getMessageCenter().notify(
new Message(MSG.view_autoDiscoveryQ_importInProgress(), Message.Severity.Info, EnumSet
.of(Message.Option.Transient)));
- resourceService.importResources(getSelectedIds(), new AsyncCallback<Void>() {
+ importResourceService.importResources(getSelectedIds(), new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError(MSG.view_autoDiscoveryQ_importFailure(), caught);
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestRpcView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestRpcView.java
new file mode 100644
index 0000000..b3c333f
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestRpcView.java
@@ -0,0 +1,52 @@
+package org.rhq.enterprise.gui.coregui.client.test;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.ButtonItem;
+import com.smartgwt.client.widgets.form.fields.FormItem;
+import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
+import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.gwt.TestGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
+
+/**
+ * @author Ian Springer
+ */
+public class TestRpcView extends LocatableVLayout {
+
+ public TestRpcView(String locatorId) {
+ super(locatorId);
+ setMargin(10);
+
+ DynamicForm form = new DynamicForm();
+ form.setWidth(400);
+
+ final FormItem item = new FormItem("seconds");
+ item.setTitle("Seconds to sleep");
+ item.setRequired(true);
+
+ ButtonItem button = new ButtonItem("execute", "Execute");
+ button.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent event) {
+ TestGWTServiceAsync testService = GWTServiceLookup.getTestService();
+ final int seconds = Integer.valueOf((String)item.getValue());
+ testService.sleep(seconds, new AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("sleep(" + seconds + ") RPC call failed.", caught);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new Message("sleep(" + seconds + ") RPC completed."));
+ }
+ });
+ }
+ });
+ form.setItems(item, button);
+
+ addMember(form);
+ }
+
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java
index 58a6cd6..a9e131b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java
@@ -79,6 +79,7 @@ public class TestTopView extends AbstractSectionedLeftNavigationView {
private static final ViewName MISC_SECTION_VIEW_ID = new ViewName("Misc");
private static final ViewName PAGE_PLURALIZATION_TEST = new ViewName("PluralizationTest");
private static final ViewName PAGE_ASYNC = new ViewName("Async");
+ private static final ViewName PAGE_RPC = new ViewName("Rpc");
public TestTopView() {
// This is a top level view, so our locator id can simply be our view id.
@@ -235,7 +236,13 @@ public class TestTopView extends AbstractSectionedLeftNavigationView {
}
});
- return new NavigationSection(MISC_SECTION_VIEW_ID, pluralizationItem, asyncItem);
+ NavigationItem rpcItem = new NavigationItem(PAGE_RPC, null, new ViewFactory() {
+ public Canvas createView() {
+ return new TestRpcView(extendLocatorId(PAGE_RPC.getName()));
+ }
+ });
+
+ return new NavigationSection(MISC_SECTION_VIEW_ID, pluralizationItem, asyncItem, rpcItem);
}
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TestGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TestGWTServiceImpl.java
new file mode 100644
index 0000000..8f9a518
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TestGWTServiceImpl.java
@@ -0,0 +1,43 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 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.enterprise.gui.coregui.server.gwt;
+
+import org.rhq.enterprise.gui.coregui.client.gwt.TestGWTService;
+
+/**
+ * @author Ian Springer
+ */
+public class TestGWTServiceImpl extends AbstractGWTServiceImpl implements TestGWTService {
+
+ private static final long serialVersionUID = 1L;
+
+ public void sleep(int seconds) throws RuntimeException {
+ try {
+ Thread.sleep(seconds * 1000);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw getExceptionToThrowToClient(e);
+ }
+ }
+
+}
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
index c4943ed..ebc12f5 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
+++ b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
@@ -161,6 +161,10 @@
<servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI DriftGWTService</servlet-name>
<servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.DriftGWTServiceImpl</servlet-class>
</servlet>
+ <servlet>
+ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI TestGWTService</servlet-name>
+ <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.TestGWTServiceImpl</servlet-class>
+ </servlet>
<servlet-mapping>
@@ -311,6 +315,10 @@
<servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI DriftGWTService</servlet-name>
<url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/DriftGWTService</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI TestGWTService</servlet-name>
+ <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/TestGWTService</url-pattern>
+ </servlet-mapping>
<welcome-file-list>
commit 3bcea7dc24cf65119b17b2f19a95e21777980082
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Aug 31 14:25:07 2011 -0400
[BZ 734814] Adding docs
diff --git a/modules/enterprise/remoting/cli/src/main/samples/drift.js b/modules/enterprise/remoting/cli/src/main/samples/drift.js
index 5a1e6e0a..ff7c31a 100644
--- a/modules/enterprise/remoting/cli/src/main/samples/drift.js
+++ b/modules/enterprise/remoting/cli/src/main/samples/drift.js
@@ -1,10 +1,64 @@
-// This script has a dependency on rhq/etc/cl-scripts/util.js. The following
-// command needs to be run in order to load the functions in util.js:
-//
-// exec -f /path/to/rhq/etc/cli-scripts/util.js
-//
-// Then the same exec command can be run to load functions in this script.
+/**
+ * file: drift.js
+ *
+ * description: This script contains functions that illustrate and highlight
+ * drift monitoring functionality. Some of the functionality demonstrated in
+ * this script is currently available only via RHQ's remote client (and CLI)
+ * at the time of this writing. This script has a dependency on util.js. To
+ * load this script's functions into your CLI session execute the following
+ * from the CLI shell,
+ *
+ * $ login <username> <password>
+ * $ exec -f samples/util.js
+ * $ exec -f samples/drift.js
+ *
+ * Note that you must login before you can load the scripts. Also please note
+ * that if a function is not documented, then it is not intended for public
+ * use. It is used only as an internal helper function.
+ *
+ * author: jsanda(a)redhat.com
+ */
+/**
+ * description: Generates a snapshot of changes sets belonging to a particular
+ * drift configuration of a specific resource. By default all change sets are
+ * included in the snapshot. An optional third argument can be specified to
+ * limit or control the number of change sets included in the snapshot.
+ *
+ * Note that a snapshot is an accumulation or aggregation of change sets that
+ * provides a view of a resource, or more precisely, all files being monitored
+ * for drift, at a particular version or point in time.
+ *
+ * arguments:
+ * rid: A resource id, expected to be an integer
+ *
+ * cname: The drift configuration name as a string
+ *
+ * filters: (optional) A map or JS object that limits the number of
+ * change sets included in the snapshot
+ *
+ * return: A org.rhq.core.domamin.drift.DriftSnapshot object
+ *
+ * usage:
+ * // generates a snapshot that includes all change sets belonging to the
+ * // mydrift drift configuration.
+ * createSnapshot(123, 'mydrift')
+ *
+ * // generates a snapshot starting a change set version 3 and including
+ * // everything more recent than it.
+ * createSnapshot(123, 'mydrift', {"startVersion": 3})
+ *
+ * // generates a snapshot that includes change sets 3 through 5 inclusive.
+ * createSnapshot(123, 'mydrift', {"startVersion": 3, "endVersion": 5})
+ *
+ * // generates a snaphot that includes everything after the specified
+ * // timestamp. Note that the timestamp should be specified in milliseconds.
+ * createSnapshot(123, 'mydrift', {"createdAfter": 1314811734365})
+ *
+ * // generates a snapshot that includes all change sets that were created
+ * // between the two timestamps.
+ * createSnapshot(123, 'mydrift', {"createdAfter": 1314811734365, "createdBefore": 9994811734365})
+ */
function createSnapshot(rid, cname) {
var config = findDriftConfig(rid, function(c) { return cname.equals(c.name) });
@@ -35,6 +89,39 @@ function findDriftConfig(rid, filter) {
});
}
+/**
+ * description: Generates a diff report that is printed to the console. By
+ * default this function generates a snapshot diff. The function expects two
+ * arguments which should be DriftSnapshot objects. A diff between those two
+ * snapshots is generated and printed to the console. A path can be specified
+ * as an optional third argument. If a path is a specified as a third argument,
+ * then a file diff will be performed using the file that matches the path in
+ * each change set. The format will be a unified diff.
+ *
+ * Note that the snapshots can be from the same or from different resources;
+ * however, if they are from different resources, it is assumed that the
+ * resources are of the same type.
+ *
+ * arguments:
+ * s1: A DriftSnapshot object
+ *
+ * s2: A DriftSnapshot object
+ *
+ * path: (optional) A string that specifies a path that exists in both s1 and
+ * s2.
+ *
+ * return: This function does not return a useful value. It may be an empty
+ * string or it could be null. Instead of returns its results, the function
+ * prints them to the CLI console. As such, this function is intended for
+ * use from the interactive CLI shell.
+ *
+ * usage:
+ * // Generates a snapshot diff report
+ * diff(s1, s2)
+ *
+ * // Generates a file diff report in the unified format
+ * diff(s1, s2, 'jboss_home/bin/run.conf')
+ */
function diff(s1, s2) {
var theDiff = s1.diff(s2);
@@ -73,12 +160,40 @@ function diff(s1, s2) {
report('elements not in right', theDiff.elementsNotInRight);
}
+/**
+ * description: Generates and returns the drift history for a file being
+ * monitored for drift. This function takes three arguments. The first two, the
+ * resource id drift configuration name, uniquely identify the drift
+ * configuration. The third argument specifies a path that is set up for
+ * monitoring by the drift configuration.
+ *
+ * arguments:
+ * rid: A resource id
+ *
+ * configName: A drift configuration name
+ *
+ * path: A path that is set up for drift monitoring by the drift
+ * configuration that is identified by the first two arguments. The path
+ * should be specified as relative to the base directory from which
+ * monitoring is done.
+ *
+ * return: A History object, which is a native JS object. This object contains
+ * a few methods for working with the file history:
+ *
+ * list: prints a short summary of all versions of the file
+ * view: returns the contents of a particular version of the file
+ * compare: compares two versions of the file and prints a unified diff
+ *
+ * usage:
+ * $ history = fetchHistory(123, 'mydrift', 'bin/run.conf')
+ * $ history.list() // prints a summary of all versions of 'bin/run.conf'
+ * $ history.view(1) // returns the full contents of version 1 of the file
+ * $ history.compare(1, 2) // generates and prints a unified diff of versions 1 and 2
+ */
function fetchHistory(rid, configName, path) {
function History() {
var entries = [];
- this.echo = function(msg) {println(msg);}
-
function findDrift(version) {
return find(entries, function(drift) {
return drift.changeSet.version == version
@@ -139,26 +254,4 @@ function fetchHistory(rid, configName, path) {
}
return new History();
-
-/*
- var criteria = GenericDriftCriteria();
- criteria.addFilterResourceIds([rid]);
- criteria.fetchChangeSet(true);
- criteria.addFilterPath(path);
-
- var drifts = DriftManager.findDriftsByCriteria(criteria);
- var history = [];
- foreach(drifts, function(drift) {
- if (drift.changeSet.driftConfiguration.name == configName &&
- drift.path == path) {
- history.push(drift);
- }
- });
-
- history.sort(function(d1, d2) {
- return d1.changeSet.version <= d2.changeSet.version
- });
-
- return history;
-*/
}
diff --git a/modules/enterprise/remoting/cli/src/main/samples/util.js b/modules/enterprise/remoting/cli/src/main/samples/util.js
index e0bb219..0369fe8 100644
--- a/modules/enterprise/remoting/cli/src/main/samples/util.js
+++ b/modules/enterprise/remoting/cli/src/main/samples/util.js
@@ -1,4 +1,21 @@
/**
+ * file: util.js
+ *
+ * description: This script contains functions that provide core, low-level
+ * functionality such as iterating over a collection or searching a collection.
+ * This has no other script or library dependencies. To load the functions into
+ * your CLI session execute the following from the CLI shell,
+ *
+ * $ login <username> <password>
+ * $ exec -f samples/util.js
+ *
+ * Note that you must login before you can load the script.
+ *
+ * author: jsanda(a)redhat.com
+ */
+
+
+/**
* If obj is a JS array or a java.util.Collection, each element is passed to
* the callback function. If obj is a java.util.Map, each map entry is passed
* to the callback function as a key/value pair. If obj is none of the
commit 5d4fbbefb4f9ee8767e3fb8e18c87a95bdd80d79
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Aug 31 12:49:03 2011 -0400
[BZ 734842] Adding more detailed logging around drift detection
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java
index 4bffe9e..d2956d3 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java
@@ -243,8 +243,8 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri
@Override
public void detectDrift(int resourceId, DriftConfiguration driftConfiguration) {
- if (log.isDebugEnabled()) {
- log.debug("Received request to schedule drift detection immediately for [resourceId: " + resourceId
+ if (log.isInfoEnabled()) {
+ log.info("Received request to schedule drift detection immediately for [resourceId: " + resourceId
+ ", driftConfigurationId: " + driftConfiguration.getId() + ", driftConfigurationName: "
+ driftConfiguration.getName() + "]");
}
@@ -258,16 +258,41 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri
}
log.debug("Resetting " + schedule + " for immediate detection.");
schedule.resetSchedule();
- schedulesQueue.addSchedule(schedule);
+ boolean queueUpdated = schedulesQueue.addSchedule(schedule);
+
+ if (queueUpdated) {
+ if (log.isDebugEnabled()) {
+ log.debug(schedule + " has been added to " + schedulesQueue + " for immediate detection.");
+ }
+ } else {
+ log.warn("Failed to add " + schedule + " to " + schedulesQueue + " for immediate detection.");
+ }
}
@Override
public void scheduleDriftDetection(int resourceId, DriftConfiguration driftConfiguration) {
- schedulesQueue.addSchedule(new DriftDetectionSchedule(resourceId, driftConfiguration));
+ DriftDetectionSchedule schedule = new DriftDetectionSchedule(resourceId, driftConfiguration);
+ if (log.isInfoEnabled()) {
+ log.info("Scheduling drift detection for " + schedule);
+ }
+ boolean added = schedulesQueue.addSchedule(schedule);
+
+ if (added) {
+ if (log.isDebugEnabled()) {
+ log.debug(schedule + " has been added to " + schedulesQueue);
+ } else {
+ log.warn("Failed to add " + schedule + " to " + schedulesQueue);
+ }
+ }
}
@Override
public boolean requestDriftFiles(int resourceId, Headers headers, List<? extends DriftFile> driftFiles) {
+ if (log.isInfoEnabled()) {
+ log.info("Server is requesting files for [resourceId: " + resourceId + ", driftConfigurationId: " +
+ headers.getDriftCofigurationId() + ", driftConfigurationName: " + headers.getDriftConfigurationName() +
+ "]");
+ }
DriftFilesSender sender = new DriftFilesSender();
sender.setResourceId(resourceId);
sender.setDriftClient(this);
@@ -282,8 +307,8 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri
@Override
public void unscheduleDriftDetection(final int resourceId, final DriftConfiguration driftConfiguration) {
- log.debug("Received request to unschedule drift detection for [resourceId:" + resourceId +
- ", driftConfigurationId:" + driftConfiguration.getId() + ", driftConfigurationName: " +
+ log.info("Received request to unschedule drift detection for [resourceId:" + resourceId +
+ ", driftConfigurationId: " + driftConfiguration.getId() + ", driftConfigurationName: " +
driftConfiguration.getName() + "].");
DriftDetectionSchedule schedule = schedulesQueue.removeAndExecute(resourceId, driftConfiguration,
@@ -298,15 +323,29 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri
}
});
- log.debug("Removed " + schedule + " from the schedule queue.");
+ if (log.isDebugEnabled()) {
+ log.debug("Removed " + schedule + " from the queue " + schedulesQueue);
+ }
}
@Override
public void updateDriftDetection(int resourceId, DriftConfiguration driftConfiguration) {
+ log.info("Received request to update schedule for [resourceId: " + resourceId + ", driftConfigurationId: " +
+ driftConfiguration.getId() + ", driftConfigurationName: " + driftConfiguration.getName() + "]");
DriftDetectionSchedule updatedSchedule = schedulesQueue.update(resourceId, driftConfiguration);
if (updatedSchedule == null) {
updatedSchedule = new DriftDetectionSchedule(resourceId, driftConfiguration);
- schedulesQueue.addSchedule(updatedSchedule);
+ if (log.isInfoEnabled()) {
+ log.info("Adding " + updatedSchedule + " to " + schedulesQueue);
+ }
+ boolean added = schedulesQueue.addSchedule(updatedSchedule);
+ if (added) {
+ if (log.isDebugEnabled()) {
+ log.debug(updatedSchedule + " has been added to " + schedulesQueue);
+ }
+ } else {
+ log.warn("Failed to add " + updatedSchedule + " to " + schedulesQueue);
+ }
}
InventoryManager inventoryMgr = PluginContainer.getInstance().getInventoryManager();
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/ScheduleQueueImpl.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/ScheduleQueueImpl.java
index f944299..003868d 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/ScheduleQueueImpl.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/ScheduleQueueImpl.java
@@ -166,4 +166,25 @@ public class ScheduleQueueImpl implements ScheduleQueue {
lock.writeLock().unlock();
}
}
+
+ @Override
+ public String toString() {
+ try {
+ lock.readLock().lock();
+ if (queue.isEmpty()) {
+ return "ScheduleQueue[]";
+ }
+ StringBuilder buffer = new StringBuilder("ScheduleQueue[");
+ for (DriftDetectionSchedule schedule : queue) {
+ buffer.append(schedule).append(", ");
+ }
+ int end = buffer.length();
+ buffer.delete(end - 2, end);
+ buffer.append("]");
+
+ return buffer.toString();
+ } finally {
+ lock.readLock().unlock();
+ }
+ }
}
commit e7acb51347c550e38c5a35d6a5fbba61e5908110
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Wed Aug 31 18:03:07 2011 +0200
BZ 707669 - Forgot to check in the plugin-container pom that actually fetches the augeas-native as its dependency.
diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml
index 1d12869..5e8397b 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -104,7 +104,8 @@
<dependency>
<groupId>net.augeas</groupId>
<artifactId>augeas-native</artifactId>
- <version>0.7.1.1</version>
+ <version>${augeas.version}</version>
+ <classifier>${augeas.classifier}</classifier>
<type>zip</type>
</dependency>
commit 405c128a92bd65d24dad5ae40b26e2b6bfc12a84
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Wed Aug 31 17:27:43 2011 +0200
BZ 707669 - The bundled native augeas libraries have been bumped to version 0.9.0.
diff --git a/modules/enterprise/agent/ant-run.xml b/modules/enterprise/agent/ant-run.xml
index 20617c5..384e283 100644
--- a/modules/enterprise/agent/ant-run.xml
+++ b/modules/enterprise/agent/ant-run.xml
@@ -12,8 +12,11 @@ Ant Script that provides ways to package the Agent.
<property name="settings.localRepository" location="${user.home}/.m2/repository"/>
<property name="project.version" value="2.0.0-SNAPSHOT"/>
<property name="sigar.version" value="1.6.5.132"/>
- <property name="augeas.version" value="0.7.1.1"/>
- <property name="augeas.zip.version" value="0.7.1"/>
+ <property name="augeas.version" value="0.9.0"/>
+ <property name="augeas.classifier" value="el5"/>
+ <property name="augeas.zip.location" value="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}/"/>
+ <property name="augeas.zip.mask" value="*-${augeas.classifier}.zip"/>
+ <property name="augeas.zip.version" value="0.9.0"/>
<property name="getopt.version" value="1.0.13"/>
<property name="jaxb-api.version" value="2.1"/>
<property name="jaxb-impl.version" value="2.1"/>
@@ -79,8 +82,8 @@ Ant Script that provides ways to package the Agent.
<include name="org/hyperic/sigar-dist/${sigar.version}/sigar-dist-${sigar.version}.zip" />
</fileset>
- <fileset dir="${settings.localRepository}" id="augeas.native.fileset">
- <include name="net/augeas/augeas-native/${augeas.version}/augeas-native-${augeas.version}.zip" />
+ <fileset dir="${augeas.zip.location}" id="augeas.native.fileset">
+ <include name="${augeas.zip.mask}" />
</fileset>
<fileset dir="${settings.localRepository}" id="plugins.fileset">
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index 17690d3..199a996 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -188,6 +188,9 @@ Build-Number=${buildNumber}
<property name="jaxb-impl.version" value="${jaxb-impl.version}" />
<property name="jline.version" value="${jline.version}" />
<property name="augeas.version" value="${augeas.version}" />
+ <property name="augeas.classifier" value="${augeas.classifier}"/>
+ <property name="augeas.zip.location" value="${augeas.zip.location}"/>
+ <property name="augeas.zip.mask" value="${augeas.zip.mask}"/>
<property name="augeas.zip.version" value="${augeas.zip.version}" />
</ant>
</tasks>
diff --git a/modules/integration-tests/apache-plugin-test/pom.xml b/modules/integration-tests/apache-plugin-test/pom.xml
index bba3c06..206a7a7 100644
--- a/modules/integration-tests/apache-plugin-test/pom.xml
+++ b/modules/integration-tests/apache-plugin-test/pom.xml
@@ -198,8 +198,8 @@
<unzip dest="target/itest/lib">
<fileset
- dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}"
- includes="*.zip" />
+ dir="${augeas.zip.location}"
+ includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index 959fa3c..d983b6a 100644
--- a/modules/plugins/aliases/pom.xml
+++ b/modules/plugins/aliases/pom.xml
@@ -114,7 +114,7 @@
<delete dir="target/itest/lib/hyperic-sigar-${sigar.zip.version}" />
<unzip dest="target/itest/lib">
- <fileset dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}" includes="*.zip" />
+ <fileset dir="${augeas.zip.location}" includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index 0694d78..e68547f 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -178,7 +178,7 @@
<delete dir="target/itest/lib/hyperic-sigar-${sigar.zip.version}" />
<unzip dest="target/itest/lib">
- <fileset dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}" includes="*.zip" />
+ <fileset dir="${augeas.zip.location}" includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index 66d35d1..ff7d21f 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -18,7 +18,7 @@
<description>An abstract plugin for configuring resources via Augeas</description>
<properties>
- <augeas.version>0.0.2</augeas.version>
+ <augeas-bindings.version>0.0.2</augeas-bindings.version>
</properties>
<dependencies>
@@ -50,7 +50,7 @@
<dependency>
<groupId>net.augeas</groupId>
<artifactId>augeas</artifactId>
- <version>${augeas.version}</version>
+ <version>${augeas-bindings.version}</version>
</dependency>
<dependency>
@@ -84,7 +84,7 @@
<artifactItem>
<groupId>net.augeas</groupId>
<artifactId>augeas</artifactId>
- <version>${augeas.version}</version>
+ <version>${augeas-bindings.version}</version>
</artifactItem>
</artifactItems>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index 9a45599..78156f3 100644
--- a/modules/plugins/cobbler/pom.xml
+++ b/modules/plugins/cobbler/pom.xml
@@ -120,7 +120,7 @@
<delete dir="target/itest/lib/hyperic-sigar-${sigar.zip.version}" />
<unzip dest="target/itest/lib">
- <fileset dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}" includes="*.zip" />
+ <fileset dir="${augeas.zip.location}" includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index e42d480..5f2c454 100644
--- a/modules/plugins/cron/pom.xml
+++ b/modules/plugins/cron/pom.xml
@@ -108,7 +108,7 @@
<delete dir="target/itest/lib/hyperic-sigar-${sigar.zip.version}" />
<unzip dest="target/itest/lib">
- <fileset dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}" includes="*.zip" />
+ <fileset dir="${augeas.zip.location}" includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index 93b5dd3..d197727 100644
--- a/modules/plugins/grub/pom.xml
+++ b/modules/plugins/grub/pom.xml
@@ -105,7 +105,7 @@
<delete dir="target/itest/lib/hyperic-sigar-${sigar.zip.version}" />
<unzip dest="target/itest/lib">
- <fileset dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}" includes="*.zip" />
+ <fileset dir="${augeas.zip.location}" includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 31af33b..0c7ec29 100644
--- a/modules/plugins/hosts/pom.xml
+++ b/modules/plugins/hosts/pom.xml
@@ -115,7 +115,7 @@
<delete dir="target/itest/lib/hyperic-sigar-${sigar.zip.version}" />
<unzip dest="target/itest/lib">
- <fileset dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}" includes="*.zip" />
+ <fileset dir="${augeas.zip.location}" includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index 5ef7252..2a0eb28 100644
--- a/modules/plugins/postfix/pom.xml
+++ b/modules/plugins/postfix/pom.xml
@@ -113,7 +113,7 @@
<delete dir="target/itest/lib/hyperic-sigar-${sigar.zip.version}" />
<unzip dest="target/itest/lib">
- <fileset dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}" includes="*.zip" />
+ <fileset dir="${augeas.zip.location}" includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 84fc9b7..90337ed 100644
--- a/modules/plugins/samba/pom.xml
+++ b/modules/plugins/samba/pom.xml
@@ -113,7 +113,7 @@
<delete dir="target/itest/lib/hyperic-sigar-${sigar.zip.version}" />
<unzip dest="target/itest/lib">
- <fileset dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}" includes="*.zip" />
+ <fileset dir="${augeas.zip.location}" includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index 83da74a..3a1df45 100644
--- a/modules/plugins/sshd/pom.xml
+++ b/modules/plugins/sshd/pom.xml
@@ -105,7 +105,7 @@
<delete dir="target/itest/lib/hyperic-sigar-${sigar.zip.version}" />
<unzip dest="target/itest/lib">
- <fileset dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}" includes="*.zip" />
+ <fileset dir="${augeas.zip.location}" includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 1b69180..9429831 100644
--- a/modules/plugins/sudoers/pom.xml
+++ b/modules/plugins/sudoers/pom.xml
@@ -103,7 +103,7 @@
<delete dir="target/itest/lib/hyperic-sigar-${sigar.zip.version}" />
<unzip dest="target/itest/lib">
- <fileset dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}" includes="*.zip" />
+ <fileset dir="${augeas.zip.location}" includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/pom.xml b/pom.xml
index c57a43b..ab342f5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -99,8 +99,11 @@
<commons-codec.version>1.4</commons-codec.version>
<testng.version>5.13.1</testng.version>
<cobertura.version>1.9.4.1</cobertura.version>
- <augeas.version>0.7.1.1</augeas.version>
- <augeas.zip.version>0.7.1</augeas.zip.version>
+ <augeas.version>0.9.0</augeas.version>
+ <augeas.classifier>el5</augeas.classifier>
+ <augeas.zip.version>0.9.0</augeas.zip.version>
+ <augeas.zip.location>${settings.localRepository}/net/augeas/augeas-native/${augeas.version}</augeas.zip.location>
+ <augeas.zip.mask>*-${augeas.classifier}.zip</augeas.zip.mask>
<ant.contrib.version>1.0b3</ant.contrib.version>
<rhq.db.admin.username>rhqadmin</rhq.db.admin.username>
commit 044113ead28a4449d07651e9f402eddac928c646
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Aug 30 21:42:31 2011 -0400
fixing test failures
diff --git a/modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftConfigurationTest.java b/modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftConfigurationTest.java
index 1cf29d6..b59dd01 100644
--- a/modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftConfigurationTest.java
+++ b/modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftConfigurationTest.java
@@ -1,12 +1,5 @@
package org.rhq.core.domain.drift;
-import static java.util.Arrays.asList;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.PROP_BASEDIR;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.PROP_BASEDIR_VALUECONTEXT;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.PROP_BASEDIR_VALUENAME;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
-import static org.testng.Assert.assertEquals;
-
import java.util.List;
import org.testng.annotations.Test;
@@ -18,6 +11,13 @@ import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.drift.DriftConfigurationComparator.CompareMode;
import org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext;
+import static java.util.Arrays.asList;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.PROP_BASEDIR;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.PROP_BASEDIR_VALUECONTEXT;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.PROP_BASEDIR_VALUENAME;
+import static org.testng.Assert.assertEquals;
+
public class DriftConfigurationTest {
@Test
public void getCompareIgnoreIncludesExcludes() {
@@ -28,7 +28,7 @@ public class DriftConfigurationTest {
// make sure our comparator can deal with all the nulls that are in empty configs
assert comparator.compare(dc1, dc2) == 0 : dc1 + " should equal " + dc2;
- dc1.setEnabled(true);
+ dc1.setEnabled(false);
assert comparator.compare(dc1, dc2) != 0 : dc1 + " should not equal " + dc2;
assert comparator.compare(dc2, dc1) != 0 : dc2 + " should not equal " + dc1;
dc1.setInterval(1000L);
@@ -38,14 +38,14 @@ public class DriftConfigurationTest {
assert comparator.compare(dc1, dc2) != 0 : dc1 + " should not equal " + dc2;
assert comparator.compare(dc2, dc1) != 0 : dc2 + " should not equal " + dc1;
- dc2.setEnabled(true);
+ dc2.setEnabled(false);
dc2.setInterval(1000L);
dc2.setName("the-name");
assert comparator.compare(dc1, dc2) == 0 : dc1 + " should equal " + dc2;
dc1.setEnabled(!dc2.isEnabled());
- assert comparator.compare(dc1, dc2) < 0 : dc1 + " should have different enabled than " + dc2;
+ assert comparator.compare(dc1, dc2) > 0 : dc1 + " should have different enabled than " + dc2;
dc1.setEnabled(dc2.isEnabled()); // put them back to the same value
dc1.setInterval(dc2.getInterval() + 2222L);
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBeanTest.java
index 511df03..ca9ee2a 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBeanTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBeanTest.java
@@ -168,7 +168,7 @@ public class ResourceMetadataManagerBeanTest extends MetadataBeanTest {
for (ConfigurationTemplate drift : drifts) {
if (drift.getName().equals("drift-pc")) {
driftConfig = new DriftConfiguration(drift.getConfiguration());
- assertFalse(driftConfig.isEnabled());
+ assertTrue(driftConfig.isEnabled());
assertEquals(BaseDirValueContext.pluginConfiguration, driftConfig.getBasedir().getValueContext());
assertEquals("connectionPropertyX", driftConfig.getBasedir().getValueName());
assertEquals(123456L, driftConfig.getInterval());
@@ -185,7 +185,7 @@ public class ResourceMetadataManagerBeanTest extends MetadataBeanTest {
assertEquals("", filter.getPattern());
} else if (drift.getName().equals("drift-fs")) {
driftConfig = new DriftConfiguration(drift.getConfiguration());
- assertFalse(driftConfig.isEnabled());
+ assertTrue(driftConfig.isEnabled());
assertEquals(BaseDirValueContext.fileSystem, driftConfig.getBasedir().getValueContext());
assertEquals("/", driftConfig.getBasedir().getValueName());
assertEquals(DriftConfigurationDefinition.DEFAULT_INTERVAL, driftConfig.getInterval());
@@ -290,7 +290,7 @@ public class ResourceMetadataManagerBeanTest extends MetadataBeanTest {
for (ConfigurationTemplate drift : drifts) {
if (drift.getName().equals("drift-rc")) {
driftConfig = new DriftConfiguration(drift.getConfiguration());
- assertFalse(driftConfig.isEnabled());
+ assertTrue(driftConfig.isEnabled());
assertEquals(BaseDirValueContext.resourceConfiguration, driftConfig.getBasedir().getValueContext());
assertEquals("resourceConfig1", driftConfig.getBasedir().getValueName());
assertEquals(DriftConfigurationDefinition.DEFAULT_INTERVAL, driftConfig.getInterval());
@@ -298,7 +298,7 @@ public class ResourceMetadataManagerBeanTest extends MetadataBeanTest {
assertEquals(0, driftConfig.getExcludes().size());
} else if (drift.getName().equals("drift-mt")) {
driftConfig = new DriftConfiguration(drift.getConfiguration());
- assertFalse(driftConfig.isEnabled());
+ assertTrue(driftConfig.isEnabled());
assertEquals(BaseDirValueContext.measurementTrait, driftConfig.getBasedir().getValueContext());
assertEquals("trait1", driftConfig.getBasedir().getValueName());
assertEquals(DriftConfigurationDefinition.DEFAULT_INTERVAL, driftConfig.getInterval());
commit 4b12e68d2d7648ed08921f482bb02e3525a3cf81
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Aug 30 21:03:24 2011 -0400
[BZ 734194] Check that content is loaded in db on drift details view
The drift details view page displays links for viewing the current and
previous version of a file as well as a diff between those versions.
The initial implementation failed to take into account that the file
content referenced by the drift may not be in the database. The page
previously attempted to generate a diff report on load instead of on
demand. This of course resulted in an exception getting thrown.
With this commit, links for viewing file content and for viewing a diff
are shown when the file content is available. If the file content is not
available, a message is instead displayed that says the content is not
available.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDetails.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDetails.java
new file mode 100644
index 0000000..283f53f
--- /dev/null
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDetails.java
@@ -0,0 +1,126 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 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.core.domain.drift;
+
+import java.io.Serializable;
+
+/**
+ * Encapsulates information and details about drift that can be used in the UI. This class
+ * the Drift object, the change set to which the drift belongs, and the change set in which
+ * the file with drift was last referenced. This class also store statuses of the current
+ * and previous versions of the file to indicate whether or not the content is in the
+ * database. Lastly, it has a flag to indicate whether or not the file is a binary file.
+ */
+public class DriftDetails implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private Drift drift;
+
+ private DriftChangeSet previousChangeSet;
+
+ private DriftFileStatus newFileStatus;
+
+ private DriftFileStatus oldFileStatus;
+
+ private boolean isBinary;
+
+ /** @return The drift object */
+ public Drift getDrift() {
+ return drift;
+ }
+
+ /** @param drift The Drift object to which the details belong */
+ public void setDrift(Drift drift) {
+ this.drift = drift;
+ }
+
+ /** @return The change set to which the drift is part of */
+ public DriftChangeSet getChangeSet() {
+ return drift.getChangeSet();
+ }
+
+ /**
+ * Returns the previous change set for which there was an occurrence of drift on the
+ * file referenced by the Drift object. This can be null if there was no previous
+ * drift.
+ *
+ * @return The previous change set for which there was drift on the file referenced by
+ * the Drift object or null if there is not previous drift on the file.
+ */
+ public DriftChangeSet getPreviousChangeSet() {
+ return previousChangeSet;
+ }
+
+ /**
+ * @param changeSet The previous change set in which drift occurred on the file
+ * referenced by the Drift object.
+ */
+ public void setPreviousChangeSet(DriftChangeSet changeSet) {
+ previousChangeSet = changeSet;
+ }
+
+ /**
+ * @return The status of the file as reported in the current change set. Indicates
+ * whether or not the file has been loaded into the database. Can be null if the type
+ * of drift is a {@link DriftCategory#FILE_REMOVED deletion}.
+ */
+ public DriftFileStatus getNewFileStatus() {
+ return newFileStatus;
+ }
+
+ /**
+ * @param status The status of the file reported in the change set.
+ */
+ public void setNewFileStatus(DriftFileStatus status) {
+ newFileStatus = status;
+ }
+
+ /**
+ * @return The status of the file as reported in the previous change set. Indicates
+ * whether or not the file has been loaded into the database. Can be null if the type
+ * of drift is a {@link DriftCategory#FILE_ADDED addition}.
+ */
+ public DriftFileStatus getOldFileStatus() {
+ return oldFileStatus;
+ }
+
+ /**
+ * @param status The status of the file as reported in the last change set in which the
+ * file was referenced.
+ */
+ public void setOldFileStatus(DriftFileStatus status) {
+ oldFileStatus = status;
+ }
+
+ /**
+ * @return true if the file is a binary file.
+ */
+ public boolean isBinaryFile() {
+ return isBinary;
+ }
+
+ /**
+ * @param binaryFile True if the file is a binary type, false otherwise.
+ */
+ public void setBinaryFile(boolean binaryFile) {
+ isBinary = binaryFile;
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java
index 31c888d..1c0b54e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java
@@ -36,24 +36,20 @@ import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
import com.smartgwt.client.widgets.layout.VLayout;
-import org.rhq.core.domain.criteria.GenericDriftChangeSetCriteria;
-import org.rhq.core.domain.criteria.GenericDriftCriteria;
import org.rhq.core.domain.drift.Drift;
-import org.rhq.core.domain.drift.DriftChangeSet;
+import org.rhq.core.domain.drift.DriftDetails;
+import org.rhq.core.domain.drift.DriftFileStatus;
import org.rhq.core.domain.drift.FileDiffReport;
-import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.PopupWindow;
import org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter;
import org.rhq.enterprise.gui.coregui.client.gwt.DriftGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
-import static org.rhq.core.domain.drift.DriftCategory.FILE_CHANGED;
+import static org.rhq.core.domain.drift.DriftFileStatus.LOADED;
import static org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter.DATE_TIME_FORMAT_FULL;
/**
@@ -75,165 +71,30 @@ public class DriftDetailsView extends LocatableVLayout {
show(this.driftId);
}
- private void show(String driftId) {
+ private void show(final String driftId) {
final DriftGWTServiceAsync driftService = GWTServiceLookup.getDriftService();
-
- GenericDriftCriteria criteria = new GenericDriftCriteria();
- criteria.addFilterId(driftId);
- criteria.fetchChangeSet(true);
- driftService.findDriftsByCriteria(criteria,
- new AsyncCallback<PageList<? extends Drift>>() {
- @Override
- public void onSuccess(PageList<? extends Drift> result) {
- if (result.getTotalSize() != 1) {
- CoreGUI.getMessageCenter().notify(
- new Message("Got [" + result.getTotalSize()
- + "] results. Should have been 1. The details shown here might not be correct.",
- Severity.Warning));
- }
- final Drift drift = result.get(0);
- if (drift.getCategory() == FILE_CHANGED) {
- GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
- criteria.addFilterResourceId(drift.getChangeSet().getResourceId());
- criteria.addFilterDriftConfigurationId(drift.getChangeSet().getDriftConfigurationId());
- criteria.addFilterVersion(Integer.toString(drift.getChangeSet().getVersion() - 1));
-
- driftService.findDriftChangeSetsByCriteria(criteria,
- new AsyncCallback<PageList<? extends DriftChangeSet>>() {
- @Override
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to load change set", caught);
- }
-
- @Override
- public void onSuccess(PageList<? extends DriftChangeSet> changeSets) {
- show(drift, changeSets.get(0));
- }
- });
- } else {
- show(drift, null);
- }
- }
-
- @Override
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(MSG.view_drift_failure_load(), caught);
- }
- });
- }
-
- private void show(final Drift drift, final DriftChangeSet previousVersion) {
- for (Canvas child : getMembers()) {
- removeMember(child);
- child.destroy();
- }
-
- // the change set to which the drift belongs
-
- DynamicForm changeSetForm = new LocatableDynamicForm(extendLocatorId("changeSetForm"));
- changeSetForm.setIsGroup(true);
- changeSetForm.setGroupTitle(MSG.view_drift_table_changeSet());
- changeSetForm.setWrapItemTitles(false);
-
- StaticTextItem changeSetId = new StaticTextItem("changeSetId", MSG.common_title_id());
- changeSetId.setValue(drift.getChangeSet().getId());
- StaticTextItem changeSetCategory = new StaticTextItem("changeSetCategory", MSG.common_title_category());
- changeSetCategory.setValue(drift.getChangeSet().getCategory().name());
- StaticTextItem changeSetVersion = new StaticTextItem("changeSetVersion", MSG.common_title_version());
- changeSetVersion.setValue(drift.getChangeSet().getVersion());
- changeSetForm.setItems(changeSetId, changeSetCategory, changeSetVersion);
-
- addMember(changeSetForm);
-
- GWTServiceLookup.getDriftService().isBinaryFile(drift, new AsyncCallback<Boolean>() {
+ driftService.getDriftDetails(driftId, new AsyncCallback<DriftDetails>() {
@Override
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to look up file type", caught);
+ CoreGUI.getErrorHandler().handleError("Failed to load drift details for drift id: " + driftId, caught);
}
@Override
- public void onSuccess(Boolean isBinary) {
- if (isBinary) {
- addMember(createDriftFormForBinaryFile(drift, previousVersion));
- } else {
- addMember(createDriftFormForTextFile(drift, previousVersion));
- }
+ public void onSuccess(final DriftDetails details) {
+ show(details);
}
});
- }
-
- private DynamicForm createDriftFormForBinaryFile(Drift drift, DriftChangeSet previousVersion) {
- DynamicForm driftForm = new LocatableDynamicForm(extendLocatorId("form"));
- driftForm.setIsGroup(true);
- driftForm.setGroupTitle(MSG.view_drift());
- driftForm.setWrapItemTitles(false);
- driftForm.setNumCols(4);
-
- SpacerItem spacer = new SpacerItem();
-
- StaticTextItem id = new StaticTextItem("id", MSG.common_title_id());
- id.setValue(drift.getId());
-
- StaticTextItem path = new StaticTextItem("path", MSG.common_title_path());
- path.setValue(drift.getPath());
- StaticTextItem timestamp = new StaticTextItem("timestamp", MSG.common_title_timestamp());
- timestamp.setValue(TimestampCellFormatter.format(drift.getCtime(), DATE_TIME_FORMAT_FULL));
-
- StaticTextItem category = new StaticTextItem("category", MSG.common_title_category());
-
- LinkedHashMap<String, String> catIconsMap = new LinkedHashMap<String, String>(3);
- catIconsMap.put(DriftDataSource.CATEGORY_ICON_ADD, DriftDataSource.CATEGORY_ICON_ADD);
- catIconsMap.put(DriftDataSource.CATEGORY_ICON_CHANGE, DriftDataSource.CATEGORY_ICON_CHANGE);
- catIconsMap.put(DriftDataSource.CATEGORY_ICON_REMOVE, DriftDataSource.CATEGORY_ICON_REMOVE);
- LinkedHashMap<String, String> catValueMap = new LinkedHashMap<String, String>(3);
- catValueMap.put(DriftDataSource.CATEGORY_ICON_ADD, MSG.view_drift_category_fileAdded());
- catValueMap.put(DriftDataSource.CATEGORY_ICON_CHANGE, MSG.view_drift_category_fileChanged());
- catValueMap.put(DriftDataSource.CATEGORY_ICON_REMOVE, MSG.view_drift_category_fileRemoved());
- category.setValueMap(catValueMap);
- category.setValueIcons(catIconsMap);
- category.setShowIcons(true);
-
- StaticTextItem oldFile = new StaticTextItem("oldFile", MSG.view_drift_table_oldFile());
- FormItem oldFileLink = null;
-
- StaticTextItem newFile = new StaticTextItem("newFile", MSG.view_drift_table_newFile());
- FormItem newFileLink = null;
+ }
- switch (drift.getCategory()) {
- case FILE_ADDED:
- category.setValue(DriftDataSource.CATEGORY_ICON_ADD);
- oldFile.setValue(MSG.common_label_none());
- oldFileLink = spacer;
- newFile.setValue(drift.getNewDriftFile().getHashId());
- newFileLink = spacer;
- break;
-
- case FILE_CHANGED:
- category.setValue(DriftDataSource.CATEGORY_ICON_CHANGE);
- oldFile.setValue(drift.getOldDriftFile().getHashId());
- oldFileLink = createViewFileLink(drift.getOldDriftFile().getHashId(), drift.getPath(),
- previousVersion.getVersion());
- newFile.setValue(drift.getNewDriftFile().getHashId());
- newFileLink = spacer;
- break;
-
- case FILE_REMOVED:
- category.setValue(DriftDataSource.CATEGORY_ICON_REMOVE);
- oldFile.setValue(drift.getOldDriftFile().getHashId());
- oldFileLink = spacer;
- newFile.setValue(MSG.common_label_none());
- newFileLink = spacer;
- break;
+ private void show(DriftDetails driftDetails) {
+ for (Canvas child : getMembers()) {
+ removeMember(child);
+ child.destroy();
}
- driftForm.setItems(id, spacer, path, spacer, category, spacer, timestamp, spacer, oldFile, oldFileLink,
- newFile, newFileLink);
-
- return driftForm;
- }
+ addMember(createChangeSetForm(driftDetails.getDrift()));
- private DynamicForm createDriftFormForTextFile(Drift drift, DriftChangeSet previousVersion) {
DynamicForm driftForm = new LocatableDynamicForm(extendLocatorId("form"));
driftForm.setIsGroup(true);
driftForm.setGroupTitle(MSG.view_drift());
@@ -243,13 +104,13 @@ public class DriftDetailsView extends LocatableVLayout {
SpacerItem spacer = new SpacerItem();
StaticTextItem id = new StaticTextItem("id", MSG.common_title_id());
- id.setValue(drift.getId());
+ id.setValue(driftDetails.getDrift().getId());
StaticTextItem path = new StaticTextItem("path", MSG.common_title_path());
- path.setValue(drift.getPath());
+ path.setValue(driftDetails.getDrift().getPath());
StaticTextItem timestamp = new StaticTextItem("timestamp", MSG.common_title_timestamp());
- timestamp.setValue(TimestampCellFormatter.format(drift.getCtime(), DATE_TIME_FORMAT_FULL));
+ timestamp.setValue(TimestampCellFormatter.format(driftDetails.getDrift().getCtime(), DATE_TIME_FORMAT_FULL));
StaticTextItem category = new StaticTextItem("category", MSG.common_title_category());
@@ -271,55 +132,102 @@ public class DriftDetailsView extends LocatableVLayout {
StaticTextItem newFile = new StaticTextItem("newFile", MSG.view_drift_table_newFile());
FormItem newFileLink = null;
- switch (drift.getCategory()) {
- case FILE_ADDED:
- category.setValue(DriftDataSource.CATEGORY_ICON_ADD);
- oldFile.setValue(MSG.common_label_none());
- oldFileLink = spacer;
- newFile.setValue(drift.getNewDriftFile().getHashId());
- newFileLink = createViewFileLink(drift.getNewDriftFile().getHashId(), drift.getPath(),
- drift.getChangeSet().getVersion());
- break;
-
- case FILE_CHANGED:
- category.setValue(DriftDataSource.CATEGORY_ICON_CHANGE);
- oldFile.setValue(drift.getOldDriftFile().getHashId());
- oldFileLink = createViewFileLink(drift.getOldDriftFile().getHashId(), drift.getPath(),
- previousVersion.getVersion());
- newFile.setValue(drift.getNewDriftFile().getHashId());
- newFileLink = createViewFileLink(drift.getNewDriftFile().getHashId(), drift.getPath(),
- drift.getChangeSet().getVersion());
- break;
-
- case FILE_REMOVED:
- category.setValue(DriftDataSource.CATEGORY_ICON_REMOVE);
- oldFile.setValue(drift.getOldDriftFile().getHashId());
- oldFileLink = createViewFileLink(drift.getOldDriftFile().getHashId(), drift.getPath(),
- drift.getChangeSet().getVersion());
- newFile.setValue(MSG.common_label_none());
- newFileLink = spacer;
- break;
+ if (driftDetails.isBinaryFile()) {
+ switch (driftDetails.getDrift().getCategory()) {
+ case FILE_ADDED:
+ category.setValue(DriftDataSource.CATEGORY_ICON_ADD);
+ oldFile.setValue(MSG.common_label_none());
+ oldFileLink = spacer;
+ newFile.setValue(driftDetails.getDrift().getNewDriftFile().getHashId());
+ newFileLink = spacer;
+ break;
+ case FILE_CHANGED:
+ category.setValue(DriftDataSource.CATEGORY_ICON_CHANGE);
+ oldFile.setValue(driftDetails.getDrift().getOldDriftFile().getHashId());
+ oldFileLink = createViewFileLink(driftDetails.getDrift().getOldDriftFile().getHashId(),
+ driftDetails.getDrift().getPath(), driftDetails.getPreviousChangeSet().getVersion());
+ newFile.setValue(driftDetails.getDrift().getNewDriftFile().getHashId());
+ newFileLink = spacer;
+ break;
+ case FILE_REMOVED:
+ category.setValue(DriftDataSource.CATEGORY_ICON_REMOVE);
+ oldFile.setValue(driftDetails.getDrift().getOldDriftFile().getHashId());
+ oldFileLink = spacer;
+ newFile.setValue(MSG.common_label_none());
+ newFileLink = spacer;
+ break;
+ }
+ driftForm.setItems(id, spacer, path, spacer, category, spacer, timestamp, spacer, oldFile, oldFileLink,
+ newFile, newFileLink);
+ } else {
+ FormItem viewDiffLink = spacer;
+ switch (driftDetails.getDrift().getCategory()) {
+ case FILE_ADDED:
+ category.setValue(DriftDataSource.CATEGORY_ICON_ADD);
+ oldFile.setValue(MSG.common_label_none());
+ oldFileLink = spacer;
+ newFile.setValue(driftDetails.getDrift().getNewDriftFile().getHashId());
+ newFileLink = createViewFileLink(driftDetails.getDrift().getNewDriftFile().getHashId(),
+ driftDetails.getDrift().getPath(), driftDetails.getChangeSet().getVersion(),
+ driftDetails.getNewFileStatus());
+ break;
+ case FILE_CHANGED:
+ category.setValue(DriftDataSource.CATEGORY_ICON_CHANGE);
+ oldFile.setValue(driftDetails.getDrift().getOldDriftFile().getHashId());
+ oldFileLink = createViewFileLink(driftDetails.getDrift().getOldDriftFile().getHashId(),
+ driftDetails.getDrift().getPath(), driftDetails.getPreviousChangeSet().getVersion(),
+ driftDetails.getOldFileStatus());
+ newFile.setValue(driftDetails.getDrift().getNewDriftFile().getHashId());
+ newFileLink = createViewFileLink(driftDetails.getDrift().getNewDriftFile().getHashId(),
+ driftDetails.getDrift().getPath(), driftDetails.getChangeSet().getVersion(),
+ driftDetails.getNewFileStatus());
+ if (driftDetails.getNewFileStatus() == LOADED && driftDetails.getOldFileStatus() == LOADED) {
+ viewDiffLink = createViewDiffLink(driftDetails.getDrift(),
+ driftDetails.getPreviousChangeSet().getVersion());
+ }
+ break;
+ case FILE_REMOVED:
+ category.setValue(DriftDataSource.CATEGORY_ICON_REMOVE);
+ oldFile.setValue(driftDetails.getDrift().getOldDriftFile().getHashId());
+ oldFileLink = createViewFileLink(driftDetails.getDrift().getOldDriftFile().getHashId(),
+ driftDetails.getDrift().getPath(), driftDetails.getChangeSet().getVersion(),
+ driftDetails.getOldFileStatus());
+ newFile.setValue(MSG.common_label_none());
+ newFileLink = spacer;
+ break;
+ }
+ driftForm.setItems(id, spacer, path, spacer, category, spacer, timestamp, spacer, oldFile, oldFileLink,
+ newFile, newFileLink, spacer, spacer, spacer, viewDiffLink);
}
+ addMember(driftForm);
+ }
- if (drift.getCategory() == FILE_CHANGED) {
- StaticTextItem numberOfChanges = new StaticTextItem("numberOfChanges", "Number of Changes");
- numberOfChanges.setValue("Loading...");
+ private DynamicForm createChangeSetForm(Drift drift) {
+ DynamicForm changeSetForm = new LocatableDynamicForm(extendLocatorId("changeSetForm"));
+ changeSetForm.setIsGroup(true);
+ changeSetForm.setGroupTitle(MSG.view_drift_table_changeSet());
+ changeSetForm.setWrapItemTitles(false);
- LinkItem viewDiffLink = new LinkItem("viewDiff");
- viewDiffLink.setLinkTitle("(view diff)");
- viewDiffLink.setShowTitle(false);
- viewDiffLink.setDisabled(true);
+ StaticTextItem changeSetId = new StaticTextItem("changeSetId", MSG.common_title_id());
+ changeSetId.setValue(drift.getChangeSet().getId());
+ StaticTextItem changeSetCategory = new StaticTextItem("changeSetCategory", MSG.common_title_category());
+ changeSetCategory.setValue(drift.getChangeSet().getCategory().name());
+ StaticTextItem changeSetVersion = new StaticTextItem("changeSetVersion", MSG.common_title_version());
+ changeSetVersion.setValue(drift.getChangeSet().getVersion());
+ changeSetForm.setItems(changeSetId, changeSetCategory, changeSetVersion);
- driftForm.setItems(id, spacer, path, spacer, category, spacer, timestamp, spacer, oldFile, oldFileLink,
- newFile, newFileLink, numberOfChanges, viewDiffLink);
+ return changeSetForm;
+ }
- generateDiff(drift, previousVersion.getVersion(), numberOfChanges, viewDiffLink);
- } else {
- driftForm.setItems(id, spacer, path, spacer, category, spacer, timestamp, spacer, oldFile, oldFileLink,
- newFile, newFileLink);
+ private FormItem createViewFileLink(String hash, String path, int version, DriftFileStatus status) {
+ if (status == LOADED) {
+ return createViewFileLink(hash, path, version);
}
+ StaticTextItem item = new StaticTextItem(hash + "_fileLink");
+ item.setShowTitle(false);
+ item.setValue("(file not ready for viewing)");
- return driftForm;
+ return item;
}
private LinkItem createViewFileLink(final String hash, final String path, final int version) {
@@ -333,7 +241,11 @@ public class DriftDetailsView extends LocatableVLayout {
GWTServiceLookup.getDriftService().getDriftFileBits(hash, new AsyncCallback<String>() {
@Override
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to load file", caught);
+ try {
+ throw caught;
+ } catch (Throwable r) {
+ CoreGUI.getErrorHandler().handleError("Failed to load file", r);
+ }
}
@Override
@@ -397,31 +309,32 @@ public class DriftDetailsView extends LocatableVLayout {
return window;
}
- private void generateDiff(final Drift drift, final int oldVersion, final StaticTextItem changes,
- final LinkItem viewDiff) {
- GWTServiceLookup.getDriftService().generateUnifiedDiff(drift, new AsyncCallback<FileDiffReport>() {
- @Override
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to load change report", caught);
- }
+ private LinkItem createViewDiffLink(final Drift drift, final int oldVersion) {
+ LinkItem viewDiffLink = new LinkItem("viewDiff");
+ viewDiffLink.setLinkTitle("(view diff)");
+ viewDiffLink.setShowTitle(false);
+ viewDiffLink.addClickHandler(new ClickHandler() {
@Override
- public void onSuccess(final FileDiffReport diffReport) {
- changes.setValue(diffReport.getNumberOfChanges());
- viewDiff.setDisabled(false);
- viewDiff.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ GWTServiceLookup.getDriftService().generateUnifiedDiff(drift, new AsyncCallback<FileDiffReport>() {
@Override
- public void onClick(ClickEvent clickEvent) {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to generate diff", caught);
+ }
+
+ @Override
+ public void onSuccess(FileDiffReport diffReport) {
int newVersion = drift.getChangeSet().getVersion();
String diffContents = toHtml(diffReport.getDiff(), oldVersion, newVersion);
-
- //LocatableWindow window = createFileViewer(diffReport.getDiff());
- LocatableWindow window = createDiffViewer(diffContents, drift.getPath(), oldVersion, newVersion);
+ LocatableWindow window = createDiffViewer(diffContents, drift.getPath(), oldVersion,
+ newVersion);
window.show();
}
});
}
});
+ return viewDiffLink;
}
private String toHtml(List<String> deltas, int oldVersion, int newVersion) {
@@ -441,7 +354,6 @@ public class DriftDetailsView extends LocatableVLayout {
diff.append(line).append("<br/>");
}
}
-
return diff.toString();
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DriftGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DriftGWTService.java
index 9b96231..d4faced 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DriftGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DriftGWTService.java
@@ -29,6 +29,7 @@ import org.rhq.core.domain.drift.Drift;
import org.rhq.core.domain.drift.DriftChangeSet;
import org.rhq.core.domain.drift.DriftComposite;
import org.rhq.core.domain.drift.DriftConfiguration;
+import org.rhq.core.domain.drift.DriftDetails;
import org.rhq.core.domain.drift.DriftSnapshot;
import org.rhq.core.domain.drift.FileDiffReport;
import org.rhq.core.domain.util.PageList;
@@ -115,4 +116,6 @@ public interface DriftGWTService extends RemoteService {
boolean isBinaryFile(Drift drift) throws RuntimeException;
+ DriftDetails getDriftDetails(String driftId) throws RuntimeException;
+
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DriftGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DriftGWTServiceImpl.java
index e8531be..55f9f7e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DriftGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DriftGWTServiceImpl.java
@@ -27,6 +27,7 @@ import org.rhq.core.domain.drift.Drift;
import org.rhq.core.domain.drift.DriftChangeSet;
import org.rhq.core.domain.drift.DriftComposite;
import org.rhq.core.domain.drift.DriftConfiguration;
+import org.rhq.core.domain.drift.DriftDetails;
import org.rhq.core.domain.drift.DriftSnapshot;
import org.rhq.core.domain.drift.FileDiffReport;
import org.rhq.core.domain.util.PageList;
@@ -160,6 +161,16 @@ public class DriftGWTServiceImpl extends AbstractGWTServiceImpl implements Drift
}
@Override
+ public DriftDetails getDriftDetails(String driftId) throws RuntimeException {
+ try {
+ DriftDetails details = driftManager.getDriftDetails(getSessionSubject(), driftId);
+ return SerialUtility.prepare(details, "DriftService.getDriftDetails");
+ } catch (Throwable t) {
+ throw getExceptionToThrowToClient(t);
+ }
+ }
+
+ @Override
public boolean isBinaryFile(Drift drift) throws RuntimeException {
try {
return driftManager.isBinaryFile(drift);
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
index b1a7415..898a4c2 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
@@ -47,6 +47,8 @@ import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.criteria.DriftChangeSetCriteria;
import org.rhq.core.domain.criteria.DriftConfigurationCriteria;
import org.rhq.core.domain.criteria.DriftCriteria;
+import org.rhq.core.domain.criteria.GenericDriftChangeSetCriteria;
+import org.rhq.core.domain.criteria.GenericDriftCriteria;
import org.rhq.core.domain.drift.Drift;
import org.rhq.core.domain.drift.DriftChangeSet;
import org.rhq.core.domain.drift.DriftComposite;
@@ -54,6 +56,7 @@ import org.rhq.core.domain.drift.DriftConfiguration;
import org.rhq.core.domain.drift.DriftConfigurationComparator;
import org.rhq.core.domain.drift.DriftConfigurationComparator.CompareMode;
import org.rhq.core.domain.drift.DriftConfigurationDefinition;
+import org.rhq.core.domain.drift.DriftDetails;
import org.rhq.core.domain.drift.DriftFile;
import org.rhq.core.domain.drift.DriftSnapshot;
import org.rhq.core.domain.drift.FileDiffReport;
@@ -115,6 +118,7 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
binaryFileTypes.add("jpg");
binaryFileTypes.add("png");
binaryFileTypes.add("jpeg");
+ binaryFileTypes.add("gif");
binaryFileTypes.add("pdf");
binaryFileTypes.add("swf");
binaryFileTypes.add("bpm");
@@ -389,12 +393,14 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
@Override
@TransactionAttribute(NOT_SUPPORTED)
public String getDriftFileBits(String hash) {
+ log.debug("Retrieving drift file content for " + hash);
DriftServerPluginFacet driftServerPlugin = getServerPlugin();
return driftServerPlugin.getDriftFileBits(hash);
}
@Override
public FileDiffReport generateUnifiedDiff(Drift drift) {
+ log.debug("Generating diff for " + drift);
String oldContent = getDriftFileBits(drift.getOldDriftFile().getHashId());
List<String> oldList = asList(oldContent.split("\\n"));
String newContent = getDriftFileBits(drift.getNewDriftFile().getHashId());
@@ -495,6 +501,69 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
return binaryFileTypes.contains(path.substring(index + 1, path.length()));
}
+ @Override
+ @TransactionAttribute(NOT_SUPPORTED)
+ public DriftDetails getDriftDetails(Subject subject, String driftId) {
+ log.debug("Loading drift details for drift id: " + driftId);
+
+ GenericDriftCriteria criteria = new GenericDriftCriteria();
+ criteria.addFilterId(driftId);
+ criteria.fetchChangeSet(true);
+
+ DriftDetails driftDetails = new DriftDetails();
+ DriftServerPluginFacet driftServerPlugin = getServerPlugin();
+
+ DriftFile newFile = null;
+ DriftFile oldFile = null;
+
+ PageList<? extends Drift<?, ?>> results = driftServerPlugin.findDriftsByCriteria(subject, criteria);
+ if (results.size() == 0) {
+ log.warn("Unable to get the drift details for drift id " + driftId + ". No drift object found with that id.");
+ return null;
+ }
+
+ Drift drift = results.get(0);
+ driftDetails.setDrift(drift);
+ try {
+ switch (drift.getCategory()) {
+ case FILE_ADDED:
+ newFile = driftServerPlugin.getDriftFile(subject, drift.getNewDriftFile().getHashId());
+ driftDetails.setNewFileStatus(newFile.getStatus());
+ break;
+ case FILE_CHANGED:
+ newFile = driftServerPlugin.getDriftFile(subject, drift.getNewDriftFile().getHashId());
+ oldFile = driftServerPlugin.getDriftFile(subject, drift.getOldDriftFile().getHashId());
+
+ driftDetails.setNewFileStatus(newFile.getStatus());
+ driftDetails.setOldFileStatus(oldFile.getStatus());
+
+ driftDetails.setPreviousChangeSet(loadPreviousChangeSet(subject, drift));
+ break;
+ case FILE_REMOVED:
+ oldFile = driftServerPlugin.getDriftFile(subject, drift.getOldDriftFile().getHashId());
+ driftDetails.setOldFileStatus(oldFile.getStatus());
+ break;
+ }
+ } catch (Exception e) {
+ log.error("An error occurred while loading the drift details for drift id " + driftId + ": " +
+ e.getMessage());
+ throw new RuntimeException("An error occurred while loading th drift details for drift id " + driftId, e);
+ }
+ driftDetails.setBinaryFile(isBinaryFile(drift));
+ return driftDetails;
+ }
+
+ private DriftChangeSet loadPreviousChangeSet(Subject subject, Drift drift) {
+ GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
+ criteria.addFilterResourceId(drift.getChangeSet().getResourceId());
+ criteria.addFilterDriftConfigurationId(drift.getChangeSet().getDriftConfigurationId());
+ criteria.addFilterVersion(Integer.toString(drift.getChangeSet().getVersion() - 1));
+
+ PageList<? extends DriftChangeSet<?>> results = findDriftChangeSetsByCriteria(subject, criteria);
+ // TODO handle empty results
+ return results.get(0);
+ }
+
private DriftServerPluginFacet getServerPlugin() {
MasterServerPluginContainer masterPC = LookupUtil.getServerPluginService().getMasterPluginContainer();
if (masterPC == null) {
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java
index 663b626..5d9838f 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java
@@ -28,6 +28,7 @@ import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.criteria.DriftConfigurationCriteria;
import org.rhq.core.domain.drift.Drift;
import org.rhq.core.domain.drift.DriftConfiguration;
+import org.rhq.core.domain.drift.DriftDetails;
import org.rhq.core.domain.drift.FileDiffReport;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.server.plugin.pc.drift.DriftServerPluginFacet;
@@ -130,5 +131,14 @@ public interface DriftManagerLocal extends DriftServerPluginFacet, DriftManagerR
*/
FileDiffReport generateUnifiedDiff(Drift drift);
+ /**
+ * Returns an object that encapsulates the information needed for viewing drift details
+ *
+ * @param subject
+ * @param driftId
+ * @return
+ */
+ DriftDetails getDriftDetails(Subject subject, String driftId);
+
boolean isBinaryFile(Drift drift);
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
index c3a34bf..daa7a68 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
@@ -77,6 +77,7 @@ import org.rhq.enterprise.server.util.CriteriaQueryGenerator;
import org.rhq.enterprise.server.util.CriteriaQueryRunner;
import static javax.ejb.TransactionAttributeType.REQUIRES_NEW;
+import static org.rhq.core.domain.drift.DriftFileStatus.LOADED;
/**
* The SLSB method implementation needed to support the JPA (RHQ Default) Drift Server Plugin.
@@ -217,7 +218,7 @@ public class JPADriftServerBean implements JPADriftServerLocal {
throw new IllegalArgumentException("JPADriftFile not found [" + driftFile.getHashId() + "]");
}
df.setData(Hibernate.createBlob(new BufferedInputStream(data)));
- df.setStatus(DriftFileStatus.LOADED);
+ df.setStatus(LOADED);
}
@Override
commit 85882c6e0e00d5d788032d9c4192577c21e4fcc6
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Aug 30 13:27:27 2011 -0400
[BZ 733613 - Add button got disabled, if user cancel the drift creation]
Regression due to new footer disablement in Table, on footer action. The
footer actions are now responsible for footer re-enablement upon action
completion (or as soon as it is safe). This commit fixes various instances
of the problem when canceling out of wizards. At the moment there are
no other known occurrences since most actions do perform some sort of
Table refresh on completion.
- Change Table.refreshTableActions public as opposed to private. This allows
actions to update button enablement without requiring a full refresh/cache
invalidation.
- Add jdoc in Table to let adders of table actions know they are responsible
for the necessary refresh.
- Fixed for Group creation, Drift config creation, Child resource create
and import, bundle creation.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java
index bf9db3e..9db4577 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java
@@ -138,6 +138,9 @@ public class BundlesListView extends Table<BundlesWithLatestVersionDataSource> {
(hasAuth) ? TableActionEnablement.ALWAYS : TableActionEnablement.NEVER) {
public void executeAction(ListGridRecord[] selection, Object actionValue) {
new BundleCreateWizard().startWizard();
+ // we can refresh the table buttons immediately since the wizard is a dialog, the
+ // user can't access enabled buttons anyway.
+ BundlesListView.this.refreshTableInfo();
}
});
@@ -185,6 +188,9 @@ public class BundlesListView extends Table<BundlesWithLatestVersionDataSource> {
public void executeAction(ListGridRecord[] selection, Object actionValue) {
if (selection.length == 0) {
new BundleDeployWizard().startWizard();
+ // we can refresh the table buttons immediately since the wizard is a dialog, the
+ // user can't access enabled buttons anyway.
+ BundlesListView.this.refreshTableInfo();
return;
}
@@ -207,6 +213,9 @@ public class BundlesListView extends Table<BundlesWithLatestVersionDataSource> {
return;
}
new BundleDeployWizard(result.get(0).getId()).startWizard();
+ // we can refresh the table buttons immediately since the wizard is a dialog, the
+ // user can't access enabled buttons anyway.
+ BundlesListView.this.refreshTableInfo();
}
});
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
index 0caeb61..933aa01 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
@@ -801,14 +801,32 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
this.titleComponent = canvas;
}
+ /**
+ * Note: To prevent user action while a current action completes, all widgets on the footer are disabled
+ * when footer actions take place, typically a button click. It is up to the action to ensure the page
+ * (via refresh() or CoreGUI.refresh()) or footer (via refreshTableActions) are refreshed as needed at action
+ * completion. Failure to do so may leave the widgets disabled.
+ */
public void addTableAction(String locatorId, String title, TableAction tableAction) {
this.addTableAction(locatorId, title, null, null, tableAction);
}
+ /**
+ * Note: To prevent user action while a current action completes, all widgets on the footer are disabled
+ * when footer actions take place, typically a button click. It is up to the action to ensure the page
+ * (via refresh() or CoreGUI.refresh()) or footer (via refreshTableActions) are refreshed as needed at action
+ * completion. Failure to do so may leave the widgets disabled.
+ */
public void addTableAction(String locatorId, String title, String confirmation, TableAction tableAction) {
this.addTableAction(locatorId, title, confirmation, null, tableAction);
}
+ /**
+ * Note: To prevent user action while a current action completes, all widgets on the footer are disabled
+ * when footer actions take place, typically a button click. It is up to the action to ensure the page
+ * (via refresh() or CoreGUI.refresh()) or footer (via refreshTableActions) are refreshed as needed at action
+ * completion. Failure to do so may leave the widgets disabled.
+ */
public void addTableAction(String locatorId, String title, String confirmation,
LinkedHashMap<String, ? extends Object> valueMap, TableAction tableAction) {
// If the specified locator ID is qualified, strip off the ancestry prefix, so we can make sure its locator ID
@@ -831,6 +849,11 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
/**
* Adds extra widgets to the bottom of the table view.
+ * <br/><br/>
+ * Note: To prevent user action while a current action completes, all widgets on the footer are disabled
+ * when footer actions take place, typically a button click. It is up to the action to ensure the page
+ * (via refresh() or CoreGUI.refresh()) or footer (via refreshTableActions) are refreshed as needed at action
+ * completion. Failure to do so may leave the widgets disabled.
*
* @param widget the new widget to add to the table view
* @param aboveFooter if true, the widget will be placed in a second toolstrip just above the main footer.
@@ -880,7 +903,7 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
return this.tableActionDisableOverride;
}
- protected void refreshTableInfo() {
+ public void refreshTableInfo() {
if (this.showFooter && (this.listGrid != null)) {
if (this.tableActionDisableOverride) {
this.listGrid.setSelectionType(SelectionStyle.NONE);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
index 653df07..1b23485 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
@@ -354,7 +354,7 @@ public class GroupConfigurationUpdatesPortlet extends LocatableVLayout implement
}
@Override
- protected void refreshTableInfo() {
+ public void refreshTableInfo() {
super.refreshTableInfo();
if (getTableInfo() != null) {
int count = getListGrid().getSelection().length;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java
index 901c38d..9cfa362 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java
@@ -366,7 +366,7 @@ class GroupOperationsCriteriaHistoryListView extends GroupOperationHistoryListVi
}
@Override
- protected void refreshTableInfo() {
+ public void refreshTableInfo() {
super.refreshTableInfo();
if (getTableInfo() != null) {
int count = getListGrid().getSelection().length;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
index 7b3b86d..b165048 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
@@ -16,9 +16,9 @@ import com.smartgwt.client.widgets.form.events.SubmitValuesHandler;
import com.smartgwt.client.widgets.form.fields.CheckboxItem;
import com.smartgwt.client.widgets.form.fields.FormItem;
import com.smartgwt.client.widgets.form.fields.SelectItem;
-
import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGridRecord;
+
import org.rhq.core.domain.alert.Alert;
import org.rhq.core.domain.alert.AlertPriority;
import org.rhq.core.domain.authz.Permission;
@@ -281,7 +281,7 @@ public abstract class AbstractRecentAlertsPortlet extends AlertHistoryView imple
}
@Override
- protected void refreshTableInfo() {
+ public void refreshTableInfo() {
super.refreshTableInfo();
if (getTableInfo() != null) {
int count = getListGrid().getSelection().length;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/AbstractRecentDriftsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/AbstractRecentDriftsPortlet.java
index 94cec23..f26e9b4 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/AbstractRecentDriftsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/AbstractRecentDriftsPortlet.java
@@ -293,7 +293,7 @@ public abstract class AbstractRecentDriftsPortlet extends DriftHistoryView imple
}
@Override
- protected void refreshTableInfo() {
+ public void refreshTableInfo() {
super.refreshTableInfo();
if (getTableInfo() != null) {
int count = getListGrid().getSelection().length;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java
index 7b0cb59..150f869 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java
@@ -249,7 +249,7 @@ public abstract class AbstractOperationHistoryPortlet extends OperationHistoryVi
}
@Override
- protected void refreshTableInfo() {
+ public void refreshTableInfo() {
super.refreshTableInfo();
if (getTableInfo() != null) {
int count = getListGrid().getSelection().length;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java
index 6c25762..7c91dc1 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java
@@ -310,7 +310,7 @@ public class ProblemResourcesPortlet extends Table<ProblemResourcesDataSource> i
return definition;
}
- protected void refreshTableInfo() {
+ public void refreshTableInfo() {
if (isShowFooter()) {
long begin = 0;
List<Long> bounds = MeasurementUtility.calculateTimeFrame(getDataSource()
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java
index 448f357..002d600 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java
@@ -148,7 +148,7 @@ public class ResourceConfigurationUpdatesPortlet extends GroupConfigurationUpdat
}
@Override
- protected void refreshTableInfo() {
+ public void refreshTableInfo() {
super.refreshTableInfo();
if (getTableInfo() != null) {
int count = getListGrid().getSelection().length;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftConfigurationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftConfigurationView.java
index abdc35e..364d25d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftConfigurationView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftConfigurationView.java
@@ -170,6 +170,9 @@ public class DriftConfigurationView extends TableSection<DriftConfigurationDataS
private void add() {
DriftAddConfigWizard.showWizard(context, this);
+ // we can refresh the table buttons immediately since the wizard is a dialog, the
+ // user can't access enabled buttons anyway.
+ DriftConfigurationView.this.refreshTableInfo();
}
private void delete(ListGridRecord[] records) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java
index c0ae2d7..72442eb 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java
@@ -201,6 +201,9 @@ public class ResourceGroupListView extends Table<ResourceGroupCompositeDataSourc
Permission.MANAGE_INVENTORY) {
public void executeAction(ListGridRecord[] selection, Object actionValue) {
new GroupCreateWizard(ResourceGroupListView.this).startWizard();
+ // we can refresh the table buttons immediately since the wizard is a dialog, the
+ // user can't access enabled buttons anyway.
+ ResourceGroupListView.this.refreshTableInfo();
}
});
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java
index 15ab3dc..beeb982 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java
@@ -152,6 +152,9 @@ public class ResourceCompositeSearchView extends ResourceSearchView {
public void executeAction(ListGridRecord[] selection, Object actionValue) {
ResourceFactoryImportWizard.showImportWizard(parentResourceComposite.getResource(),
(ResourceType) actionValue);
+ // we can refresh the table buttons immediately since the wizard is a dialog, the
+ // user can't access enabled buttons anyway.
+ ResourceCompositeSearchView.this.refreshTableInfo();
}
});
}
@@ -172,6 +175,9 @@ public class ResourceCompositeSearchView extends ResourceSearchView {
public void executeAction(ListGridRecord[] selection, Object actionValue) {
ResourceFactoryCreateWizard.showCreateWizard(parentResourceComposite.getResource(),
(ResourceType) actionValue);
+ // we can refresh the table buttons immediately since the wizard is a dialog, the
+ // user can't access enabled buttons anyway.
+ ResourceCompositeSearchView.this.refreshTableInfo();
}
});
}
commit 075070dce17f82c63f868db83de2a2f51c6f01c2
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Tue Aug 30 12:22:20 2011 -0400
reverting back to SNAPSHOT version.
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index c7a482f..1eb86ef 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/drift/pom.xml b/modules/common/drift/pom.xml
index 80e6d65..73ab33a 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml
index 57fa2b7..352de33 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index 4c3474f..184c5ad 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index 47c5535..bd88fa0 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index f90deb3..9f5f66a 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index 4bdd540..5a8b356 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index 335dff6..aa20853 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-dbutils</artifactId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index 9cd0ba2..42d28e1 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index 914a15d..bb4dc2c 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index a47bf81..7d83f3d 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index a9876b9..fc78701 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml
index c8be3c2..1d12869 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml
index 1f1a904..f2953a6 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 61c6295..62a73be 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index 5d17ff7..dfa5bb8 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index 4b54d70..17690d3 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml
index 485a79e..8b7ffe8 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/binding/pom.xml b/modules/enterprise/binding/pom.xml
index 71bac05..d96cf83 100644
--- a/modules/enterprise/binding/pom.xml
+++ b/modules/enterprise/binding/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-enterprise-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-script-bindings</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 a895109..f424704 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml
index 23b19cb..cebd439 100644
--- a/modules/enterprise/gui/base-perspective-jar/pom.xml
+++ b/modules/enterprise/gui/base-perspective-jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml
index 80b21bb..b66da2c 100644
--- a/modules/enterprise/gui/base-perspective-war/pom.xml
+++ b/modules/enterprise/gui/base-perspective-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 9eb9c9c..db7d757 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml
index 9cd93ba..de77f3f 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml
index 8fdc07e..900d476 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index 3e0b1c7..8e8cf66 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 286b89b..4e2ac9f 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index da9d486..01fb7f6 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml
index 01c9861..24fbb60 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 ada9309..1a1c88c 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 5da2901..3fe07b7 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index 265fcfa..f4b1866 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml
index 02ce1cc..dee43bc 100644
--- a/modules/enterprise/remoting/webservices/pom.xml
+++ b/modules/enterprise/remoting/webservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 15a32c1..c57eaba 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-server-client-api</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml
index c7a52f0..1aebae1 100644
--- a/modules/enterprise/server/container-lib/pom.xml
+++ b/modules/enterprise/server/container-lib/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml
index e45f641..d27c157 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml
index 68eeb76..8cdaf8b 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml
index 8e783e0..d2f2bc5 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 7cbd947..b380393 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>alert-cli</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 3e2d017..e1e1890 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.server</groupId>
<artifactId>alert-email</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 ab8d837..1b609e1 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-irc</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 5b8e1bd..1a27831 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-log4j</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 44da984..ab68d6b 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-microblog</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 02fcb76..0adccaf 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-mobicents</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 9eb3e7c..2c9bcfa 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-operations</artifactId>
<packaging>jar</packaging>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 021dc8a..06bab65 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-roles</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 03b1aeb..3763c54 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-snmp</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 e566893..bb595b5 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-subject</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Subject Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index 37c3b3b..c4e59b2 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 019ae28..381f64c 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>rhq-serverplugin-cobbler</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 95f29fa..403ef41 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 b287def..9c9d3b6 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 2dfde0e..ad1c570 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/groovy-script/pom.xml b/modules/enterprise/server/plugins/groovy-script/pom.xml
index c9beef5..0d2bf4b 100644
--- a/modules/enterprise/server/plugins/groovy-script/pom.xml
+++ b/modules/enterprise/server/plugins/groovy-script/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>groovy-script-server-plugin</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Groovy Script Plugin</name>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml
index 6701d43..dacaec2 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 5168456..9a51242 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>packagetype-cli</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server CLI Package Type Plugin</name>
diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
index 64b3881..f73ecb8 100644
--- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml
index 8ef3970..c2d5c7e 100644
--- a/modules/enterprise/server/plugins/perspectives/core/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml
index 91cdcf6..3fa05d3 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml
index 226e1dd..04df0b8 100644
--- a/modules/enterprise/server/plugins/rhnhosted/pom.xml
+++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml
index a657f95..79ccf2b 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 455279f..9e221a0 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 3b9f1ef..ce8468c 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml
index 434fa4d..05cb339 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml
index 9be1e89..00344d4 100644
--- a/modules/enterprise/server/sars/agent-sar/pom.xml
+++ b/modules/enterprise/server/sars/agent-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml
index 1f928c1..2377858 100644
--- a/modules/enterprise/server/sars/pom.xml
+++ b/modules/enterprise/server/sars/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 ebbe06a..90c0da6 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/bundleGen/pom.xml b/modules/helpers/bundleGen/pom.xml
index b5f2ebb..9e80f1f 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.helpers</groupId>
<artifactId>bundleGen</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<build>
<plugins>
diff --git a/modules/helpers/perftest-support/pom.xml b/modules/helpers/perftest-support/pom.xml
index 4716515..e488bb0 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>perftest-support</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 da93cb6..0c73fd3 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index 9a7a0c6..417a3df 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index 0d7441c..959fa3c 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index b0ebced..ff8c753 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index d1365b5..0694d78 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index c32e484..66d35d1 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/byteman/pom.xml b/modules/plugins/byteman/pom.xml
index fce9e17..46bcb55 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index 1f0beb7..9a45599 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index a150183..e42d480 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index 2c63916..6c1812b 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml
index a6f0084..c1e0a3d 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index 9e2cf83..93b5dd3 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hadoop/pom.xml b/modules/plugins/hadoop/pom.xml
index 4ba3845..840e619 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index 92e17a4..e482d30 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 0363fe8..31af33b 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index edd4a4d..b097071 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-hudson-plugin</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>RHQ Hudson Plugin</name>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index f2b629b..2cdc32a 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/irc/pom.xml b/modules/plugins/irc/pom.xml
index 044280b..edf12ea 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 d135fa0..6ec0096 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 408e30c..ca63c5e 100644
--- a/modules/plugins/jboss-as-7/pom.xml
+++ b/modules/plugins/jboss-as-7/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index c9dbafa..57c8bb3 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 d0d137a..1a3a1df 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index 152d019..ae06793 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index 44cd378..1daf86d 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/kickstart/pom.xml b/modules/plugins/kickstart/pom.xml
index 9ccd94e..dc87ed7 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index 901f34c..3a6deaa 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index 8c0b60d..d8ebb5d 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index 6f49a19..f1675e4 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index aaca2d2..8a3b3c0 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pattern-generator/pom.xml b/modules/plugins/pattern-generator/pom.xml
index f19c719..6b0791d 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index c4d6307..63dd974 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index 90a262f..99f36d0 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index 68814d8..f32159e 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index 414de6e..5ef7252 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index 91e7108..365f6c4 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index ac71a33..60471c2 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index e6cbd4d..e88b97f 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index a2699d1..84fc9b7 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index f9041bb..d31afb9 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script2/pom.xml b/modules/plugins/script2/pom.xml
index ec6ca02..2cf689c 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index ba8606f..05ed401 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index f087ca3..83da74a 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 6a0391e..1b69180 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index 6921318..f6dfebd 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index a6f6f6b..50ff9b6 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</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 e5fcd01..6565a7b 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/virt/pom.xml b/modules/plugins/virt/pom.xml
index 3e56790..8700a19 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index e90b1d9..2b45c62 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index a34707c..5c6e85c 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.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<artifactId>test-utils</artifactId>
diff --git a/pom.xml b/pom.xml
index a77185e..c57a43b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.1-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RHQ</name>
commit 2dc925b34f5bb87639c8628654ed05eeb100b2c8
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Aug 30 12:05:19 2011 -0400
add support for dev profile to perftest plugin's pom
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index 590a89b..c4d6307 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -130,7 +130,81 @@
</build>
<profiles>
- <profile>
+
+ <profile>
+ <id>dev</id>
+
+ <properties>
+ <rhq.rootDir>../../..</rhq.rootDir>
+ <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+ <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/rhq-downloads/rhq-plugins</rhq.deploymentDir>
+ </properties>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+
+ <execution>
+ <id>deploy</id>
+ <phase>compile</phase>
+ <configuration>
+ <tasks>
+ <mkdir dir="${rhq.deploymentDir}" />
+ <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
+ <echo>*** Updating ${deployment.file}...</echo>
+ <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}" update="true" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <execution>
+ <id>deploy-jar-meta-inf</id>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
+ <echo>*** Updating META-INF dir in ${deployment.file}...</echo>
+ <unjar src="${project.build.directory}/${project.build.finalName}.jar" dest="${project.build.outputDirectory}">
+ <patternset><include name="META-INF/**" /></patternset>
+ </unjar>
+ <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true">
+ </jar>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <execution>
+ <id>undeploy</id>
+ <phase>clean</phase>
+ <configuration>
+ <tasks>
+ <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
+ <echo>*** Deleting ${deployment.file}...</echo>
+ <delete file="${deployment.file}" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
<id>cobertura-plugins</id>
<activation>
<activeByDefault>false</activeByDefault>
commit c7d3cebb0fe0318de2ac02cd73a7cf18061ac264
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Aug 26 08:54:53 2011 -0400
[BZ 676761] add better error handling when user enters an invalid search expression on the Inventory>Children subtab (https://bugzilla.redhat.com/show_bug.cgi?id=676761)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeDataSource.java
index 5c94399..81afa7c 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeDataSource.java
@@ -52,9 +52,10 @@ import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository.TypesLoadedCallback;
import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
- * A DataSource basically the same as ResourceDatasource in the fields it defines, but that works with
+ * A DataSource, basically the same as ResourceDatasource in the fields it defines, but that works with
* ResourceComposite as opposed to Resource records. In this way the Records can provide additional info,
* like the user's resource permissions, for the resources.
*
@@ -91,7 +92,12 @@ public class ResourceCompositeDataSource extends RPCDataSource<ResourceComposite
getResourceService().findResourceCompositesByCriteria(criteria,
new AsyncCallback<PageList<ResourceComposite>>() {
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(MSG.view_inventory_resources_loadFailed(), caught);
+ if (caught.getMessage().contains("SearchExpressionException")) {
+ Message message = new Message("Invalid search expression.", Message.Severity.Error);
+ CoreGUI.getMessageCenter().notify(message);
+ } else {
+ CoreGUI.getErrorHandler().handleError(MSG.view_inventory_resources_loadFailed(), caught);
+ }
response.setStatus(RPCResponse.STATUS_FAILURE);
processResponse(request.getRequestId(), response);
}
commit 7a5d54bd65c18664068b83c1ab08130f37abbd21
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Tue Aug 30 11:11:22 2011 -0400
also removing JAVA5 logic from publish_release. Same reason as earlier commit.
diff --git a/publish_release.sh b/publish_release.sh
index 3e5b0c4..3a12b7a 100755
--- a/publish_release.sh
+++ b/publish_release.sh
@@ -84,35 +84,36 @@ fi
# TODO: Check that JDK version is < 1.7.
+# spinder 8/30/11: commenting out the JAVA5 support, but leaving logic in place for when we need the same backwards
+# compatibility logic for JD6 vs. JDK7 support.
# If this is an enterprise release, make sure JAVA5_HOME points to a valid JDK 1.5 install.
# We need this to validate only Java 5 or earlier APIs are used in all modules, except the CLI, which requires Java 6.
-
-if [ "$RELEASE_TYPE" = "enterprise" ]; then
- if [ -z "$JAVA5_HOME" ]; then
- abort "JAVA5_HOME environment variable is not set - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
- fi
-
- if [ ! -d "$JAVA5_HOME" ]; then
- abort "JAVA5_HOME ($JAVA5_HOME) does not exist or is not a directory - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
- fi
-
- if [ ! -x "$JAVA5_HOME/bin/java" ]; then
- abort "$JAVA5_HOME/bin/java does not exist or is not executable - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
- fi
-
- if [ ! -x "$JAVA5_HOME/bin/javac" ]; then
- abort "$JAVA5_HOME/bin/javac does not exist or is not executable - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
- fi
-
- if ! "$JAVA5_HOME/bin/javap" java.lang.Enum >/dev/null 2>&1; then
- abort "java.lang.Enum not found - JAVA5_HOME ($JAVA5_HOME) version appears to be less than 1.5 - version must be 1.5.x."
- fi
-
- if "$JAVA5_HOME/bin/javap" java.util.Deque >/dev/null 2>&1; then
- abort "java.util.Deque found - JAVA5_HOME ($JAVA5_HOME) version appears to be greater than or equal to 1.6 - version must be 1.5.x."
- fi
-fi
-
+#
+#if [ "$RELEASE_TYPE" = "enterprise" ]; then
+# if [ -z "$JAVA5_HOME" ]; then
+# abort "JAVA5_HOME environment variable is not set - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
+# fi
+#
+# if [ ! -d "$JAVA5_HOME" ]; then
+# abort "JAVA5_HOME ($JAVA5_HOME) does not exist or is not a directory - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
+# fi
+#
+# if [ ! -x "$JAVA5_HOME/bin/java" ]; then
+# abort "$JAVA5_HOME/bin/java does not exist or is not executable - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
+# fi
+#
+# if [ ! -x "$JAVA5_HOME/bin/javac" ]; then
+# abort "$JAVA5_HOME/bin/javac does not exist or is not executable - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
+# fi
+#
+# if ! "$JAVA5_HOME/bin/javap" java.lang.Enum >/dev/null 2>&1; then
+# abort "java.lang.Enum not found - JAVA5_HOME ($JAVA5_HOME) version appears to be less than 1.5 - version must be 1.5.x."
+# fi
+#
+# if "$JAVA5_HOME/bin/javap" java.util.Deque >/dev/null 2>&1; then
+# abort "java.util.Deque found - JAVA5_HOME ($JAVA5_HOME) version appears to be greater than or equal to 1.6 - version must be 1.5.x."
+# fi
+#fi
# Make sure M2_HOME points to a valid Maven 2.1.x or 2.2.x install.
@@ -184,7 +185,8 @@ if [ "$MODE" = "test" ]; then
fi
if [ "$RELEASE_TYPE" = "enterprise" ]; then
- MAVEN_ARGS="$MAVEN_ARGS -Dexclude-webdav -Djava5.home=$JAVA5_HOME/jre"
+ MAVEN_ARGS="$MAVEN_ARGS -Dexclude-webdav "
+ #MAVEN_ARGS="$MAVEN_ARGS -Dexclude-webdav -Djava5.home=$JAVA5_HOME/jre"
fi
if [ -n "$RELEASE_DEBUG" ]; then
MAVEN_ARGS="$MAVEN_ARGS --debug"
@@ -217,7 +219,8 @@ export LANG
echo
echo "========================== Environment Variables =============================="
echo "JAVA_HOME=$JAVA_HOME"
-[ "$RELEASE_TYPE" = "enterprise" ] && echo "JAVA5_HOME=$JAVA5_HOME"
+[ "$RELEASE_TYPE" = "enterprise" ]"
+#[ "$RELEASE_TYPE" = "enterprise" ] && echo "JAVA5_HOME=$JAVA5_HOME"
echo "M2_HOME=$M2_HOME"
echo "MAVEN_OPTS=$MAVEN_OPTS"
echo "PATH=$PATH"
commit 51caaf3c21c4ee0b6c6f2948e01f32016312473a
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Tue Aug 30 10:43:08 2011 -0400
removing JAVA5 backwards compatiblity support. Only commenting out logic as similar logic needed for JDK6 vs JDK7 in the near future.
diff --git a/release.sh b/release.sh
index 316af14..b26b3ed 100755
--- a/release.sh
+++ b/release.sh
@@ -85,35 +85,36 @@ fi
# TODO: Check that JDK version is < 1.7.
-
+# spinder 8/30/11: commenting out the JAVA5 support, but leaving logic in place for when we need the same backwards
+# compatibility logic for JD6 vs. JDK7 support.
# If this is an enterprise release, make sure JAVA5_HOME points to a valid JDK 1.5 install.
# We need this to validate only Java 5 or earlier APIs are used in all modules, except the CLI, which requires Java 6.
-
-if [ "$RELEASE_TYPE" = "enterprise" ]; then
- if [ -z "$JAVA5_HOME" ]; then
- abort "JAVA5_HOME environment variable is not set - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
- fi
-
- if [ ! -d "$JAVA5_HOME" ]; then
- abort "JAVA5_HOME ($JAVA5_HOME) does not exist or is not a directory - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
- fi
-
- if [ ! -x "$JAVA5_HOME/bin/java" ]; then
- abort "$JAVA5_HOME/bin/java does not exist or is not executable - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
- fi
-
- if [ ! -x "$JAVA5_HOME/bin/javac" ]; then
- abort "$JAVA5_HOME/bin/javac does not exist or is not executable - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
- fi
-
- if ! "$JAVA5_HOME/bin/javap" java.lang.Enum >/dev/null 2>&1; then
- abort "java.lang.Enum not found - JAVA5_HOME ($JAVA5_HOME) version appears to be less than 1.5 - version must be 1.5.x."
- fi
-
- if "$JAVA5_HOME/bin/javap" java.util.Deque >/dev/null 2>&1; then
- abort "java.util.Deque found - JAVA5_HOME ($JAVA5_HOME) version appears to be greater than or equal to 1.6 - version must be 1.5.x."
- fi
-fi
+#
+#if [ "$RELEASE_TYPE" = "enterprise" ]; then
+# if [ -z "$JAVA5_HOME" ]; then
+# abort "JAVA5_HOME environment variable is not set - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
+# fi
+#
+# if [ ! -d "$JAVA5_HOME" ]; then
+# abort "JAVA5_HOME ($JAVA5_HOME) does not exist or is not a directory - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
+# fi
+#
+# if [ ! -x "$JAVA5_HOME/bin/java" ]; then
+# abort "$JAVA5_HOME/bin/java does not exist or is not executable - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
+# fi
+#
+# if [ ! -x "$JAVA5_HOME/bin/javac" ]; then
+# abort "$JAVA5_HOME/bin/javac does not exist or is not executable - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
+# fi
+#
+# if ! "$JAVA5_HOME/bin/javap" java.lang.Enum >/dev/null 2>&1; then
+# abort "java.lang.Enum not found - JAVA5_HOME ($JAVA5_HOME) version appears to be less than 1.5 - version must be 1.5.x."
+# fi
+#
+# if "$JAVA5_HOME/bin/javap" java.util.Deque >/dev/null 2>&1; then
+# abort "java.util.Deque found - JAVA5_HOME ($JAVA5_HOME) version appears to be greater than or equal to 1.6 - version must be 1.5.x."
+# fi
+#fi
# Make sure M2_HOME points to a valid Maven 2.1.x or 2.2.x install.
@@ -184,7 +185,8 @@ MAVEN_ARGS="--settings $MAVEN_SETTINGS_FILE --batch-mode --errors -Penterprise,d
#fi
MAVEN_ARGS="$MAVEN_ARGS -DskipTests=true"
if [ "$RELEASE_TYPE" = "enterprise" ]; then
- MAVEN_ARGS="$MAVEN_ARGS -Dexclude-webdav -Djava5.home=$JAVA5_HOME/jre"
+ MAVEN_ARGS="$MAVEN_ARGS -Dexclude-webdav "
+ #MAVEN_ARGS="$MAVEN_ARGS -Dexclude-webdav -Djava5.home=$JAVA5_HOME/jre"
fi
if [ -n "$RELEASE_DEBUG" ]; then
MAVEN_ARGS="$MAVEN_ARGS --debug"
@@ -222,7 +224,8 @@ export LANG
echo
echo "========================== Environment Variables =============================="
echo "JAVA_HOME=$JAVA_HOME"
-[ "$RELEASE_TYPE" = "enterprise" ] && echo "JAVA5_HOME=$JAVA5_HOME"
+[ "$RELEASE_TYPE" = "enterprise" ]
+#[ "$RELEASE_TYPE" = "enterprise" ] && echo "JAVA5_HOME=$JAVA5_HOME"
echo "M2_HOME=$M2_HOME"
echo "MAVEN_OPTS=$MAVEN_OPTS"
echo "PATH=$PATH"
commit 42c454258e2ead6c6ccbf6be91132094b34db020
Merge: 535d831 6db75f8
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Aug 30 05:35:30 2011 -0500
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 535d831af59702ddaf0cd85c675b98befd3065e2
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Aug 30 05:35:04 2011 -0500
Add proxy information metric to make the mod_cluster component dyna group friendly for complex queries (eg. group based on httpd proxy).
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
index 0db722e..b79f751 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
@@ -18,7 +18,14 @@
*/
package org.rhq.plugins.modcluster;
+import java.util.Set;
+
+import org.mc4j.ems.connection.bean.EmsBean;
+
import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.domain.measurement.MeasurementDataTrait;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
import org.rhq.plugins.jmx.MBeanResourceComponent;
import org.rhq.plugins.modcluster.helper.JBossHelper;
import org.rhq.plugins.modcluster.model.ProxyInfo;
@@ -30,6 +37,21 @@ import org.rhq.plugins.modcluster.model.ProxyInfo;
@SuppressWarnings({ "rawtypes" })
public class ModClusterServerComponent extends MBeanResourceComponent {
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void getValues(MeasurementReport report, Set requests, EmsBean bean) {
+ for (MeasurementScheduleRequest request : (Set<MeasurementScheduleRequest>) requests) {
+ if (request.getName().equals("ProxyInformation")) {
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(bean);
+ report.addData(new MeasurementDataTrait(request, rawProxyInfo));
+ requests.remove(request);
+ break;
+ }
+ }
+
+ super.getValues(report, requests, bean);
+ }
+
@Override
public AvailabilityType getAvailability() {
String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index b0ad1f2..536e747 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -24,6 +24,9 @@
<operation name="reset" displayName="Reset the node" description="Move this application server out of an error state." />
<operation name="refresh" displayName="Refresh configuration" description="Refresh configuration for this application server." />
+
+ <metric property="ProxyInformation" displayName="Proxy Information" displayType="summary" dataType="trait" />
+
<!-- Start - Configuration for HAModClusterService -->
<service name="HA Service" discovery="ClassNameMBeanDiscoveryComponent"
commit 6db75f8bfbefbdeb7dd6c89a39fc1b8a8bf28c57
Merge: c1ddd73 9446ab1
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Tue Aug 30 02:01:44 2011 -0400
Merge branch 'jon3_test-build' into track_master4
commit c1ddd73fa51dbbdd185558a78b97314b2efa33cf
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Aug 29 17:44:34 2011 -0400
[BZ 34054 - Throws 'Globally uncaught exception' while adding 'Platform Utilization' on dashboard]
More restructuring of this portlet and its datasource to get it to work
both in the report view and in the portlet view.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformMetricDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformMetricDataSource.java
index 84786cf..3d5e107 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformMetricDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformMetricDataSource.java
@@ -18,22 +18,19 @@
*/
package org.rhq.enterprise.gui.coregui.client.dashboard.portlets.platform;
+import java.util.ArrayList;
import java.util.List;
import com.smartgwt.client.data.DataSourceField;
-import com.smartgwt.client.data.fields.DataSourceTextField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.resource.Resource;
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.Messages;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDatasource;
/**
* @author Greg Hinkle
*/
public class PlatformMetricDataSource extends ResourceDatasource {
- private static final Messages MSG = CoreGUI.getMessages();
PlatformSummaryPortlet view;
@@ -47,17 +44,7 @@ public class PlatformMetricDataSource extends ResourceDatasource {
@Override
protected List<DataSourceField> addDataSourceFields() {
- List<DataSourceField> fields = super.addDataSourceFields();
-
- DataSourceTextField cpuField = new DataSourceTextField("cpu", MSG.dataSource_platforms_field_cpu());
- fields.add(cpuField);
- DataSourceTextField memoryField = new DataSourceTextField("memory", MSG.dataSource_platforms_field_memory());
- fields.add(memoryField);
-
- DataSourceTextField swapField = new DataSourceTextField("swap", MSG.dataSource_platforms_field_swap());
- fields.add(swapField);
-
- return fields;
+ return new ArrayList<DataSourceField>();
}
@Override
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java
index 5bd705e..69ed9f5 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java
@@ -18,6 +18,7 @@
*/
package org.rhq.enterprise.gui.coregui.client.dashboard.portlets.platform;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.Set;
@@ -84,43 +85,18 @@ public class PlatformSummaryPortlet extends LocatableListGrid implements Portlet
setWidth100();
setHeight100();
- prefetch();
-
setShowRecordComponents(true);
setShowRecordComponentsByCell(true);
- setUseAllDataSourceFields(true);
setAutoFitData(Autofit.VERTICAL);
setOverflow(Overflow.AUTO);
setAutoFetchData(false);
setDataSource(new PlatformMetricDataSource(this));
- setInitialCriteria(new Criteria(ResourceDataSourceField.CATEGORY.propertyName(), ResourceCategory.PLATFORM
- .name()));
- }
-
- private void prefetch() {
-
- ResourceTypeCriteria typeCriteria = new ResourceTypeCriteria();
- typeCriteria.addFilterCategory(ResourceCategory.PLATFORM);
- typeCriteria.fetchMetricDefinitions(true);
- typeCriteria.fetchOperationDefinitions(true);
-
- // TODO GH: Find a way to pass resource type criteria lookups through the type cache
- typeService.findResourceTypesByCriteria(typeCriteria, new AsyncCallback<PageList<ResourceType>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(MSG.view_portlet_platform_type_error_1(), caught);
- }
-
- public void onSuccess(PageList<ResourceType> result) {
- setTypes(result);
- fetchData(new Criteria(ResourceDataSourceField.CATEGORY.propertyName(), ResourceCategory.PLATFORM
- .name()));
- }
- });
}
protected void onDraw() {
+ ArrayList<ListGridField> fields = new ArrayList<ListGridField>(5);
ListGridField nameField = new ListGridField(ResourceDataSourceField.NAME.propertyName(), MSG
.common_title_name());
@@ -130,13 +106,21 @@ public class PlatformSummaryPortlet extends LocatableListGrid implements Portlet
+ "</a>";
}
});
- nameField.setWidth("20%");
- setFields(nameField);
+ fields.add(nameField);
+
+ ListGridField versionField = new ListGridField(ResourceDataSourceField.VERSION.propertyName(), MSG
+ .common_title_version());
+ fields.add(versionField);
- ListGridField cpuField = getField(FIELD_CPU);
- ListGridField memoryField = getField(FIELD_MEMORY);
- ListGridField swapField = getField(FIELD_SWAP);
+ ListGridField cpuField = new ListGridField("cpu", MSG.dataSource_platforms_field_cpu());
+ fields.add(cpuField);
+ ListGridField memoryField = new ListGridField("memory", MSG.dataSource_platforms_field_memory());
+ fields.add(memoryField);
+ ListGridField swapField = new ListGridField("swap", MSG.dataSource_platforms_field_swap());
+ fields.add(swapField);
+ nameField.setWidth("20%");
+ versionField.setWidth("20%");
cpuField.setWidth("20%");
memoryField.setWidth("20%");
swapField.setWidth("20%");
@@ -146,12 +130,30 @@ public class PlatformSummaryPortlet extends LocatableListGrid implements Portlet
memoryField.setCanSort(false);
swapField.setCanSort(false);
- hideField("id");
- hideField(ResourceDataSourceField.TYPE.propertyName()); // we could show this, do we want to indicate the kind of platform?
- hideField(ResourceDataSourceField.DESCRIPTION.propertyName()); // we could show this, but it makes the table wider
- hideField(ResourceDataSourceField.PLUGIN.propertyName()); // its always the platform plugin, no need to show this
- hideField(ResourceDataSourceField.CATEGORY.propertyName()); // we only ever show platforms, no need to show this
- hideField(ResourceDataSourceField.AVAILABILITY.propertyName()); // the icon badging will indicate availability
+ setFields(fields.toArray(new ListGridField[fields.size()]));
+
+ initialFetch();
+ }
+
+ private void initialFetch() {
+
+ ResourceTypeCriteria typeCriteria = new ResourceTypeCriteria();
+ typeCriteria.addFilterCategory(ResourceCategory.PLATFORM);
+ typeCriteria.fetchMetricDefinitions(true);
+ typeCriteria.fetchOperationDefinitions(true);
+
+ // TODO GH: Find a way to pass resource type criteria lookups through the type cache
+ typeService.findResourceTypesByCriteria(typeCriteria, new AsyncCallback<PageList<ResourceType>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(MSG.view_portlet_platform_type_error_1(), caught);
+ }
+
+ public void onSuccess(PageList<ResourceType> result) {
+ setTypes(result);
+ fetchData(new Criteria(ResourceDataSourceField.CATEGORY.propertyName(), ResourceCategory.PLATFORM
+ .name()));
+ }
+ });
}
protected void loadMetricsForResource(Resource resource, final Record record) {
@@ -330,6 +332,7 @@ public class PlatformSummaryPortlet extends LocatableListGrid implements Portlet
this.property = property;
}
+ @SuppressWarnings("unused")
public String getProperty() {
return property;
}
@@ -344,6 +347,7 @@ public class PlatformSummaryPortlet extends LocatableListGrid implements Portlet
this.property = property;
}
+ @SuppressWarnings("unused")
public String getProperty() {
return property;
}
@@ -358,6 +362,7 @@ public class PlatformSummaryPortlet extends LocatableListGrid implements Portlet
this.property = property;
}
+ @SuppressWarnings("unused")
public String getProperty() {
return property;
}
@@ -369,6 +374,7 @@ public class PlatformSummaryPortlet extends LocatableListGrid implements Portlet
MeasurementDefinition freeSwap, usedSwap, totalSwap;
MeasurementDefinition idleCpu, systemCpu, userCpu, waitCpu;
+ @SuppressWarnings("unused")
MeasurementDefinition[] definitions = new MeasurementDefinition[] { freeMemory, usedMemory, totalMemory,
freeSwap, usedSwap, totalSwap, idleCpu, systemCpu, userCpu, waitCpu };
commit 8768b15bed6ba114ba094b9661eda7d79b338b01
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Aug 29 15:57:14 2011 -0400
[BZ 734092 - 'Discovery Queue' portlet refresh is not working on dashboard]
Fix the refresh method for AD portlet
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/queue/AutodiscoveryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/queue/AutodiscoveryPortlet.java
index 9ff9d84..1a63686 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/queue/AutodiscoveryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/queue/AutodiscoveryPortlet.java
@@ -215,10 +215,7 @@ public class AutodiscoveryPortlet extends ResourceAutodiscoveryView implements C
@Override
public void refresh() {
if (!isRefreshing()) {
- if (null != dataSource) {
- dataSource.invalidateCache();
- }
- markForRedraw();
+ super.refresh();
}
}
}
commit 5d9aa72083fc7e364735f26cf22c8995293b2838
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Aug 29 15:36:45 2011 -0400
[BZ 734034 - Saved search name should be removed from search bar after user deletes it]
fix mistaken == comparison on Integer objects
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/FlexSearchBar.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/FlexSearchBar.java
index 1a99b85..d5ab23a 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/FlexSearchBar.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/FlexSearchBar.java
@@ -89,7 +89,7 @@ public class FlexSearchBar extends AbstractSearchBar {
private final PopupPanel savedSearchesPanel = new PopupPanel(true);
private SavedSearchGrid savedSearchesGrid;
- private Integer currentSearchId = 0;
+ private int currentSearchId = 0;
private SearchSubsystem searchSubsystem;
private String defaultSearchText;
@@ -271,7 +271,7 @@ public class FlexSearchBar extends AbstractSearchBar {
starImage.setUrl(STAR_OFF_URL);
} else {
// NOTE: currently do not support updated a saved search pattern
- if (currentSearchId == 0) {
+ if (0 == currentSearchId) {
String pattern = autoCompletePatternField.getText();
createSavedSearch(name, pattern);
} else if (nameJustUpdated) {
commit d2b1f45803c91eec3a8eb962d36e8b1ca649609d
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Aug 29 14:33:18 2011 -0400
Package sample/demo scripts with CLI
diff --git a/etc/cli-scripts/drift.js b/etc/cli-scripts/drift.js
deleted file mode 100644
index 5a1e6e0a..0000000
--- a/etc/cli-scripts/drift.js
+++ /dev/null
@@ -1,164 +0,0 @@
-// This script has a dependency on rhq/etc/cl-scripts/util.js. The following
-// command needs to be run in order to load the functions in util.js:
-//
-// exec -f /path/to/rhq/etc/cli-scripts/util.js
-//
-// Then the same exec command can be run to load functions in this script.
-
-function createSnapshot(rid, cname) {
- var config = findDriftConfig(rid, function(c) { return cname.equals(c.name) });
-
- var criteria = GenericDriftChangeSetCriteria();
- criteria.addFilterResourceId(rid);
- criteria.addFilterDriftConfigurationId(config.id);
-
- if (arguments.length > 2) {
- var filters = arguments[2];
- for (key in filters) {
- criteria['addFilter' + key[0].toUpperCase() + key.substring(1)](filters[key]);
- }
- }
-
- return DriftManager.createSnapshot(criteria);
-}
-
-function findDriftConfig(rid, filter) {
- var criteria = ResourceCriteria();
- criteria.addFilterId(rid);
- criteria.fetchDriftConfigurations(true);
-
- var resources = ResourceManager.findResourcesByCriteria(criteria);
- var resource = resources.get(0);
-
- return find(resource.driftConfigurations, function(config) {
- return filter(DriftConfiguration(config));
- });
-}
-
-function diff(s1, s2) {
- var theDiff = s1.diff(s2);
-
- if (arguments.length > 2) {
- var path = arguments[2];
-
- if (theDiff.elementsInConflict.size() == 0) {
- // If the snapshot diff reports no files in conflict, then there
- // is no need to call the server to perform the file diff. We can
- // instead return quickly.
- println("There are no differences to report");
- return "";
- }
-
- var pathFilter = function(entry) { return entry.path == path; };
- var e1 = find(s1.entries, pathFilter);
- var e2 = find(s2.entries, pathFilter);
-
- var fileDiff = DriftManager.generateUnifiedDiff(e1, e2);
- foreach(fileDiff.diff, println);
- return "";
- }
-
- function printEntry(entry) {
- println(entry.newDriftFile.hashId + '\t' + entry.path);
- }
-
- function report(header, elements) {
- println(header + ':');
- foreach(elements, printEntry);
- println('\n');
- }
-
- report('elements in conflict', theDiff.elementsInConflict);
- report('elements not in left', theDiff.elementsNotInLeft);
- report('elements not in right', theDiff.elementsNotInRight);
-}
-
-function fetchHistory(rid, configName, path) {
- function History() {
- var entries = [];
-
- this.echo = function(msg) {println(msg);}
-
- function findDrift(version) {
- return find(entries, function(drift) {
- return drift.changeSet.version == version
- });
- }
-
-
- var generate = function() {
- entries = [];
- var criteria = GenericDriftCriteria();
- criteria.addFilterResourceIds([rid]);
- criteria.fetchChangeSet(true);
- criteria.addFilterPath(path);
-
- var drifts = DriftManager.findDriftsByCriteria(criteria);
- foreach(drifts, function(drift) {
- if (drift.changeSet.driftConfiguration.name == configName &&
- drift.path == path) {
- entries.push(drift);
- }
- });
-
- entries.sort(function(d1, d2) {
- return d1.changeSet.version <= d2.changeSet.version
- });
- }
-
- this.list = function() {
- var format = java.text.DateFormat.getDateTimeInstance();
- println(path + "\n-----------------------------------");
- foreach(entries, function(drift) {
- println(drift.changeSet.version + "\t" + format.format(drift.ctime));
- });
- }
-
- this.view = function(version) {
- var drift = findDrift(version);
- if (drift == null) {
- return "Could not find version " + version;
- }
- return DriftManager.getDriftFileBits(drift.newDriftFile.hashId);
- }
-
- this.compare = function(v1, v2) {
- var d1 = findDrift(v1);
- if (d1 == null) {
- return "Could not find version " + v1;
- }
- var d2 = findDrift(v2);
- if (d2 == null) {
- return "Could not find version " + v2;
- }
- var fileDiff = DriftManager.generateUnifiedDiff(d1, d2);
- foreach(fileDiff.diff, println);
- }
-
- generate();
- }
-
- return new History();
-
-/*
- var criteria = GenericDriftCriteria();
- criteria.addFilterResourceIds([rid]);
- criteria.fetchChangeSet(true);
- criteria.addFilterPath(path);
-
- var drifts = DriftManager.findDriftsByCriteria(criteria);
- var history = [];
- foreach(drifts, function(drift) {
- if (drift.changeSet.driftConfiguration.name == configName &&
- drift.path == path) {
- history.push(drift);
- }
- });
-
- history.sort(function(d1, d2) {
- return d1.changeSet.version <= d2.changeSet.version
- });
-
- return history;
-*/
-}
diff --git a/etc/cli-scripts/measurement_utils.js b/etc/cli-scripts/measurement_utils.js
deleted file mode 100644
index 261aa8e..0000000
--- a/etc/cli-scripts/measurement_utils.js
+++ /dev/null
@@ -1,134 +0,0 @@
-testUpdates = {
- context: 'Resource',
- id: 10033,
- schedules: {
- 'Late Collections': interval(15, minutes),
- 'Failed Collections per Minute': interval(15, minutes),
- 'Currently Schedule Measurements': 'enabled'
- }
-}
-
-testGroupUpdates = {
- context: 'Group',
- id: 10031,
- schedules: {
- 'Used Swap Space': 'disabled',
- 'Total Memory': interval(3, minutes)
- }
-}
-
-/**
- * MeasurementModule is a class that provides properties and methods for working with
- * measurements.
- */
-function MeasurementModule() {
-
- /**
- * Performs the actual updates, calling MeasurementScheduleManager.
- *
- * @param updates
- * @param criteria
- * @param enableSchedules
- * @param disableSchedules
- * @param updateSchedules
- */
- function doScheduleUpdates(updates, criteria, enableSchedules, disableSchedules, updateSchedules) {
- criteria.fetchDefinition(true);
- var schedules = MeasurementScheduleManager.findSchedulesByCriteria(criteria);
-
- foreach(schedules, function (schedule) {
- var measurementName = schedule.definition.displayName;
-
- if (updates.schedules[measurementName]) {
- switch (updates.schedules[measurementName]) {
- case 'enabled':
- MeasurementScheduleManager[enableSchedules](updates.id, [schedule.definition.id]);
- break;
- case 'disabled':
- MeasurementScheduleManager[disableSchedules](updates.id,
- [schedule.definition.id]);
- break;
- default:
- var interval = updates.schedules[measurementName];
- MeasurementScheduleManager[updateSchedules](updates.id,
- [schedule.definition.id], interval);
- }
- }
- });
-
- }
-
- /**
- * Intended for use with the interval method.
- */
- this.time = {
- seconds: 1000,
- minutes: 60 * seconds,
- hours: 60 * minutes
- }
-
- /**
- * A helper method that calculates a shedule's interval in milliseconds
- * @param num
- * @param time
- */
- this.interval = function (num, time) {
- return num * time;
- }
-
- /**
- * Updates the metric schedule as specified in the updates object. The object is expected
- * to contain three properties or keys. The first of these required keys is <context>.
- * Accepted values are the strings 'Resource' or 'Group'.
- *
- * The next required key is <id>, and its values is expected to be an integer. The
- * interpretation of its values is dependent on the value of <context>. When the value of
- * <context> is 'Resource', then <id> is treated as a resource id. If the value of
- * <context> is 'Group', then <id> is treated as a compatible group id.
- *
- * The third required key is <schedules>, and it a nested object that specifies the
- * schedules to be updated. The keys of <schedules> are the measurement display names.
- * Expected values are 'enabled', 'disabled', or an integer which specifies the
- * collection interval in milliseconds.
- *
- * Here is an example to illustrate what the updates object should look like:
- *
- * resourceSchedulesUpdates = {
- * context: 'Resource',
- * id: 123,
- * schedules: {
- * 'Measurement A': 'enabled',
- * 'Measurement B': 'disabled,
- * 'Measurement C': interval(20, time.minutes)
- * }
- * }
- *
- * @param updates The updates to perform
- */
- this.updateSchedules = function (updates) {
- if (!updates.id) {
- throw '<id> is a required property';
- }
-
- if (!updates.schedules) {
- throw '<schedules> is a required property';
- }
-
- if (updates.context == 'Resource') {
- var criteria = MeasurementScheduleCriteria();
- criteria.addFilterResourceId(updates.id);
- doScheduleUpdates(updates, criteria, 'enableSchedulesForResource',
- 'disableSchedulesForResource', 'updateSchedulesForResource');
- }
- else if (updates.context == 'Group') {
- var criteria = MeasurementScheduleCriteria();
- criteria.addFilterResourceGroupId(updates.id);
- doScheduleUpdates(updates, criteria, 'enableSchedulesForCompatibleGroup',
- 'disableSchedulesForCompatibleGroup', 'updateSchedulesForCompatibleGroup');
- }
- else {
- throw "Unrecognized value for context: " + updates.context + " - expected either " +
- "<Resource> or <Group>";
- }
- }
-}
diff --git a/etc/cli-scripts/util.js b/etc/cli-scripts/util.js
deleted file mode 100644
index e0bb219..0000000
--- a/etc/cli-scripts/util.js
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * If obj is a JS array or a java.util.Collection, each element is passed to
- * the callback function. If obj is a java.util.Map, each map entry is passed
- * to the callback function as a key/value pair. If obj is none of the
- * aforementioned types, it is treated as a generic object and each of its
- * properties is passed to the callback function as a name/value pair.
- */
-function foreach(obj, fn) {
- if (obj instanceof Array) {
- for (i in obj) {
- fn(obj[i]);
- }
- }
- else if (obj instanceof java.util.Collection) {
- var iterator = obj.iterator();
- while (iterator.hasNext()) {
- fn(iterator.next());
- }
- }
- else if (obj instanceof java.util.Map) {
- var iterator = obj.entrySet().iterator()
- while (iterator.hasNext()) {
- var entry = iterator.next();
- fn(entry.key, entry.value);
- }
- }
- else { // assume we have a generic object
- for (i in obj) {
- fn(i, obj[i]);
- }
- }
-}
-
-/**
- * Iterates over obj similar to foreach. fn should be a predicate that evaluates
- * to true or false. The first match that is found is returned.
- */
-function find(obj, fn) {
- if (obj instanceof Array) {
- for (i in obj) {
- if (fn(obj[i])) {
- return obj[i]
- }
- }
- }
- else if (obj instanceof java.util.Collection) {
- var iterator = obj.iterator();
- while (iterator.hasNext()) {
- var next = iterator.next();
- if (fn(next)) {
- return next;
- }
- }
- }
- else if (obj instanceof java.util.Map) {
- var iterator = obj.entrySet().iterator();
- while (iterator.hasNext()) {
- var entry = iterator.next();
- if (fn(entry.key, entry.value)) {
- return {key: entry.key, value: entry.value};
- }
- }
- }
- else {
- for (i in obj) {
- if (fn(i, obj[i])) {
- return {key: i, value: obj[i]};
- }
- }
- }
- return null;
-}
-
-/**
- * Iterates over obj similar to foreach. fn should be a predicate that evaluates
- * to true or false. All of the matches are returned in a java.util.List.
- */
-function findAll(obj, fn) {
- var matches = java.util.ArrayList();
- if ((obj instanceof Array) || (obj instanceof java.util.Collection)) {
- foreach(obj, function(element) {
- if (fn(element)) {
- matches.add(element);
- }
- });
- }
- else {
- foreach(obj, function(key, value) {
- if (fn(theKey, theValue)) {
- matches.add({key: theKey, value: theValue});
- }
- });
- }
- return matches;
-}
diff --git a/modules/enterprise/remoting/cli/src/main/samples/README.txt b/modules/enterprise/remoting/cli/src/main/samples/README.txt
new file mode 100644
index 0000000..235650a
--- /dev/null
+++ b/modules/enterprise/remoting/cli/src/main/samples/README.txt
@@ -0,0 +1,24 @@
+Overview
+---------
+The scripts located in the samples directory are intended for demonstration
+purposes to illustrate functionality and features in the CLI. These scripts
+have not undergone the same level of testing as other parts of the code base.
+As such, the quality may not meet RHQ standards in some cases. Please consider
+this when using these scripts for anything other than demonstration or testing.
+
+There may be inter-dependencies between some of the scripts. There is currently
+no mechanism in place to automatically handle script-level dependencies;
+consequently, you need to make sure to run scripts in the correct order. If a
+script has a dependency on other scripts, it will be documented within the
+script itself so that you know which scripts need to be run and in what order.
+
+
+Feedback
+--------
+The CLI is still a relatively new, young feature. We welcome and encourage
+feedback. Please send questions, comments, etc. to
+rhq-users(a)lists.fedorahosted.org or and/or to rhq-devel.lists.fedorahosted.org.
+
+Thanks
+
+RHQ development team
diff --git a/modules/enterprise/remoting/cli/src/main/samples/drift.js b/modules/enterprise/remoting/cli/src/main/samples/drift.js
new file mode 100644
index 0000000..5a1e6e0a
--- /dev/null
+++ b/modules/enterprise/remoting/cli/src/main/samples/drift.js
@@ -0,0 +1,164 @@
+// This script has a dependency on rhq/etc/cl-scripts/util.js. The following
+// command needs to be run in order to load the functions in util.js:
+//
+// exec -f /path/to/rhq/etc/cli-scripts/util.js
+//
+// Then the same exec command can be run to load functions in this script.
+
+function createSnapshot(rid, cname) {
+ var config = findDriftConfig(rid, function(c) { return cname.equals(c.name) });
+
+ var criteria = GenericDriftChangeSetCriteria();
+ criteria.addFilterResourceId(rid);
+ criteria.addFilterDriftConfigurationId(config.id);
+
+ if (arguments.length > 2) {
+ var filters = arguments[2];
+ for (key in filters) {
+ criteria['addFilter' + key[0].toUpperCase() + key.substring(1)](filters[key]);
+ }
+ }
+
+ return DriftManager.createSnapshot(criteria);
+}
+
+function findDriftConfig(rid, filter) {
+ var criteria = ResourceCriteria();
+ criteria.addFilterId(rid);
+ criteria.fetchDriftConfigurations(true);
+
+ var resources = ResourceManager.findResourcesByCriteria(criteria);
+ var resource = resources.get(0);
+
+ return find(resource.driftConfigurations, function(config) {
+ return filter(DriftConfiguration(config));
+ });
+}
+
+function diff(s1, s2) {
+ var theDiff = s1.diff(s2);
+
+ if (arguments.length > 2) {
+ var path = arguments[2];
+
+ if (theDiff.elementsInConflict.size() == 0) {
+ // If the snapshot diff reports no files in conflict, then there
+ // is no need to call the server to perform the file diff. We can
+ // instead return quickly.
+ println("There are no differences to report");
+ return "";
+ }
+
+ var pathFilter = function(entry) { return entry.path == path; };
+ var e1 = find(s1.entries, pathFilter);
+ var e2 = find(s2.entries, pathFilter);
+
+ var fileDiff = DriftManager.generateUnifiedDiff(e1, e2);
+ foreach(fileDiff.diff, println);
+ return "";
+ }
+
+ function printEntry(entry) {
+ println(entry.newDriftFile.hashId + '\t' + entry.path);
+ }
+
+ function report(header, elements) {
+ println(header + ':');
+ foreach(elements, printEntry);
+ println('\n');
+ }
+
+ report('elements in conflict', theDiff.elementsInConflict);
+ report('elements not in left', theDiff.elementsNotInLeft);
+ report('elements not in right', theDiff.elementsNotInRight);
+}
+
+function fetchHistory(rid, configName, path) {
+ function History() {
+ var entries = [];
+
+ this.echo = function(msg) {println(msg);}
+
+ function findDrift(version) {
+ return find(entries, function(drift) {
+ return drift.changeSet.version == version
+ });
+ }
+
+
+ var generate = function() {
+ entries = [];
+ var criteria = GenericDriftCriteria();
+ criteria.addFilterResourceIds([rid]);
+ criteria.fetchChangeSet(true);
+ criteria.addFilterPath(path);
+
+ var drifts = DriftManager.findDriftsByCriteria(criteria);
+ foreach(drifts, function(drift) {
+ if (drift.changeSet.driftConfiguration.name == configName &&
+ drift.path == path) {
+ entries.push(drift);
+ }
+ });
+
+ entries.sort(function(d1, d2) {
+ return d1.changeSet.version <= d2.changeSet.version
+ });
+ }
+
+ this.list = function() {
+ var format = java.text.DateFormat.getDateTimeInstance();
+ println(path + "\n-----------------------------------");
+ foreach(entries, function(drift) {
+ println(drift.changeSet.version + "\t" + format.format(drift.ctime));
+ });
+ }
+
+ this.view = function(version) {
+ var drift = findDrift(version);
+ if (drift == null) {
+ return "Could not find version " + version;
+ }
+ return DriftManager.getDriftFileBits(drift.newDriftFile.hashId);
+ }
+
+ this.compare = function(v1, v2) {
+ var d1 = findDrift(v1);
+ if (d1 == null) {
+ return "Could not find version " + v1;
+ }
+ var d2 = findDrift(v2);
+ if (d2 == null) {
+ return "Could not find version " + v2;
+ }
+ var fileDiff = DriftManager.generateUnifiedDiff(d1, d2);
+ foreach(fileDiff.diff, println);
+ }
+
+ generate();
+ }
+
+ return new History();
+
+/*
+ var criteria = GenericDriftCriteria();
+ criteria.addFilterResourceIds([rid]);
+ criteria.fetchChangeSet(true);
+ criteria.addFilterPath(path);
+
+ var drifts = DriftManager.findDriftsByCriteria(criteria);
+ var history = [];
+ foreach(drifts, function(drift) {
+ if (drift.changeSet.driftConfiguration.name == configName &&
+ drift.path == path) {
+ history.push(drift);
+ }
+ });
+
+ history.sort(function(d1, d2) {
+ return d1.changeSet.version <= d2.changeSet.version
+ });
+
+ return history;
+*/
+}
diff --git a/modules/enterprise/remoting/cli/src/main/samples/measurement_utils.js b/modules/enterprise/remoting/cli/src/main/samples/measurement_utils.js
new file mode 100644
index 0000000..261aa8e
--- /dev/null
+++ b/modules/enterprise/remoting/cli/src/main/samples/measurement_utils.js
@@ -0,0 +1,134 @@
+testUpdates = {
+ context: 'Resource',
+ id: 10033,
+ schedules: {
+ 'Late Collections': interval(15, minutes),
+ 'Failed Collections per Minute': interval(15, minutes),
+ 'Currently Schedule Measurements': 'enabled'
+ }
+}
+
+testGroupUpdates = {
+ context: 'Group',
+ id: 10031,
+ schedules: {
+ 'Used Swap Space': 'disabled',
+ 'Total Memory': interval(3, minutes)
+ }
+}
+
+/**
+ * MeasurementModule is a class that provides properties and methods for working with
+ * measurements.
+ */
+function MeasurementModule() {
+
+ /**
+ * Performs the actual updates, calling MeasurementScheduleManager.
+ *
+ * @param updates
+ * @param criteria
+ * @param enableSchedules
+ * @param disableSchedules
+ * @param updateSchedules
+ */
+ function doScheduleUpdates(updates, criteria, enableSchedules, disableSchedules, updateSchedules) {
+ criteria.fetchDefinition(true);
+ var schedules = MeasurementScheduleManager.findSchedulesByCriteria(criteria);
+
+ foreach(schedules, function (schedule) {
+ var measurementName = schedule.definition.displayName;
+
+ if (updates.schedules[measurementName]) {
+ switch (updates.schedules[measurementName]) {
+ case 'enabled':
+ MeasurementScheduleManager[enableSchedules](updates.id, [schedule.definition.id]);
+ break;
+ case 'disabled':
+ MeasurementScheduleManager[disableSchedules](updates.id,
+ [schedule.definition.id]);
+ break;
+ default:
+ var interval = updates.schedules[measurementName];
+ MeasurementScheduleManager[updateSchedules](updates.id,
+ [schedule.definition.id], interval);
+ }
+ }
+ });
+
+ }
+
+ /**
+ * Intended for use with the interval method.
+ */
+ this.time = {
+ seconds: 1000,
+ minutes: 60 * seconds,
+ hours: 60 * minutes
+ }
+
+ /**
+ * A helper method that calculates a shedule's interval in milliseconds
+ * @param num
+ * @param time
+ */
+ this.interval = function (num, time) {
+ return num * time;
+ }
+
+ /**
+ * Updates the metric schedule as specified in the updates object. The object is expected
+ * to contain three properties or keys. The first of these required keys is <context>.
+ * Accepted values are the strings 'Resource' or 'Group'.
+ *
+ * The next required key is <id>, and its values is expected to be an integer. The
+ * interpretation of its values is dependent on the value of <context>. When the value of
+ * <context> is 'Resource', then <id> is treated as a resource id. If the value of
+ * <context> is 'Group', then <id> is treated as a compatible group id.
+ *
+ * The third required key is <schedules>, and it a nested object that specifies the
+ * schedules to be updated. The keys of <schedules> are the measurement display names.
+ * Expected values are 'enabled', 'disabled', or an integer which specifies the
+ * collection interval in milliseconds.
+ *
+ * Here is an example to illustrate what the updates object should look like:
+ *
+ * resourceSchedulesUpdates = {
+ * context: 'Resource',
+ * id: 123,
+ * schedules: {
+ * 'Measurement A': 'enabled',
+ * 'Measurement B': 'disabled,
+ * 'Measurement C': interval(20, time.minutes)
+ * }
+ * }
+ *
+ * @param updates The updates to perform
+ */
+ this.updateSchedules = function (updates) {
+ if (!updates.id) {
+ throw '<id> is a required property';
+ }
+
+ if (!updates.schedules) {
+ throw '<schedules> is a required property';
+ }
+
+ if (updates.context == 'Resource') {
+ var criteria = MeasurementScheduleCriteria();
+ criteria.addFilterResourceId(updates.id);
+ doScheduleUpdates(updates, criteria, 'enableSchedulesForResource',
+ 'disableSchedulesForResource', 'updateSchedulesForResource');
+ }
+ else if (updates.context == 'Group') {
+ var criteria = MeasurementScheduleCriteria();
+ criteria.addFilterResourceGroupId(updates.id);
+ doScheduleUpdates(updates, criteria, 'enableSchedulesForCompatibleGroup',
+ 'disableSchedulesForCompatibleGroup', 'updateSchedulesForCompatibleGroup');
+ }
+ else {
+ throw "Unrecognized value for context: " + updates.context + " - expected either " +
+ "<Resource> or <Group>";
+ }
+ }
+}
diff --git a/modules/enterprise/remoting/cli/src/main/samples/util.js b/modules/enterprise/remoting/cli/src/main/samples/util.js
new file mode 100644
index 0000000..e0bb219
--- /dev/null
+++ b/modules/enterprise/remoting/cli/src/main/samples/util.js
@@ -0,0 +1,95 @@
+/**
+ * If obj is a JS array or a java.util.Collection, each element is passed to
+ * the callback function. If obj is a java.util.Map, each map entry is passed
+ * to the callback function as a key/value pair. If obj is none of the
+ * aforementioned types, it is treated as a generic object and each of its
+ * properties is passed to the callback function as a name/value pair.
+ */
+function foreach(obj, fn) {
+ if (obj instanceof Array) {
+ for (i in obj) {
+ fn(obj[i]);
+ }
+ }
+ else if (obj instanceof java.util.Collection) {
+ var iterator = obj.iterator();
+ while (iterator.hasNext()) {
+ fn(iterator.next());
+ }
+ }
+ else if (obj instanceof java.util.Map) {
+ var iterator = obj.entrySet().iterator()
+ while (iterator.hasNext()) {
+ var entry = iterator.next();
+ fn(entry.key, entry.value);
+ }
+ }
+ else { // assume we have a generic object
+ for (i in obj) {
+ fn(i, obj[i]);
+ }
+ }
+}
+
+/**
+ * Iterates over obj similar to foreach. fn should be a predicate that evaluates
+ * to true or false. The first match that is found is returned.
+ */
+function find(obj, fn) {
+ if (obj instanceof Array) {
+ for (i in obj) {
+ if (fn(obj[i])) {
+ return obj[i]
+ }
+ }
+ }
+ else if (obj instanceof java.util.Collection) {
+ var iterator = obj.iterator();
+ while (iterator.hasNext()) {
+ var next = iterator.next();
+ if (fn(next)) {
+ return next;
+ }
+ }
+ }
+ else if (obj instanceof java.util.Map) {
+ var iterator = obj.entrySet().iterator();
+ while (iterator.hasNext()) {
+ var entry = iterator.next();
+ if (fn(entry.key, entry.value)) {
+ return {key: entry.key, value: entry.value};
+ }
+ }
+ }
+ else {
+ for (i in obj) {
+ if (fn(i, obj[i])) {
+ return {key: i, value: obj[i]};
+ }
+ }
+ }
+ return null;
+}
+
+/**
+ * Iterates over obj similar to foreach. fn should be a predicate that evaluates
+ * to true or false. All of the matches are returned in a java.util.List.
+ */
+function findAll(obj, fn) {
+ var matches = java.util.ArrayList();
+ if ((obj instanceof Array) || (obj instanceof java.util.Collection)) {
+ foreach(obj, function(element) {
+ if (fn(element)) {
+ matches.add(element);
+ }
+ });
+ }
+ else {
+ foreach(obj, function(key, value) {
+ if (fn(theKey, theValue)) {
+ matches.add({key: theKey, value: theValue});
+ }
+ });
+ }
+ return matches;
+}
diff --git a/modules/enterprise/remoting/cli/src/main/scripts/rhq-client.build.xml b/modules/enterprise/remoting/cli/src/main/scripts/rhq-client.build.xml
index baf99e5..803afe6 100644
--- a/modules/enterprise/remoting/cli/src/main/scripts/rhq-client.build.xml
+++ b/modules/enterprise/remoting/cli/src/main/scripts/rhq-client.build.xml
@@ -8,6 +8,7 @@
<property name="conf.home" location="${output.dir}/conf" />
<property name="jboss.home" location="${basedir}/target/jboss-${jboss.version}" />
<property name="lib.home" location="${output.dir}/lib" />
+ <property name="samples.home" location="${output.dir}/samples"/>
<target name="prepare-dist">
<condition property="exclude.cli.jar" value="true">
@@ -20,6 +21,7 @@
<antcall target="prepare-bin-dir" />
<antcall target="prepare-conf-dir" />
<antcall target="prepare-lib-dir" />
+ <antcall target="prepare-samples-dir" />
</target>
<target name="prepare-bin-dir">
@@ -68,5 +70,14 @@
<copy file="${settings.localRepository}/hibernate-annotations/hibernate-annotations/${hibernate-annotations.version}/hibernate-annotations-${hibernate-annotations.version}.jar" todir="${lib.home}" verbose="true" />
</target>
+ <target name="prepare-samples-dir">
+ <echo>*** Creating samples dir...</echo>
+ <mkdir dir="${samples.home}" />
+ <echo>*** Populating sample scripts...</echo>
+ <copy verbose="true" toDir="${samples.home}">
+ <fileset dir="${basedir}/src/main/samples/" includes="*.*" />
+ </copy>
+ </target>
+
</project>
commit 94fe685ea78d43c0c5d24204662f07816b4c3265
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Aug 29 13:13:31 2011 -0400
Enable drift configurations by default
diff --git a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/DriftMetadataParser.java b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/DriftMetadataParser.java
index c7c0a12..4d95331 100644
--- a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/DriftMetadataParser.java
+++ b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/DriftMetadataParser.java
@@ -56,7 +56,8 @@ public class DriftMetadataParser {
}
private void initEnabled(ConfigurationTemplate template) {
- template.getConfiguration().put(new PropertySimple(DriftConfigurationDefinition.PROP_ENABLED, false));
+ template.getConfiguration().put(new PropertySimple(DriftConfigurationDefinition.PROP_ENABLED,
+ DriftConfigurationDefinition.DEFAULT_ENABLED));
}
private void initName(DriftDescriptor descriptor, ConfigurationTemplate template) {
diff --git a/modules/core/client-api/src/test/java/org/rhq/core/clientapi/agent/metadata/test/PluginMetadataParserTest.java b/modules/core/client-api/src/test/java/org/rhq/core/clientapi/agent/metadata/test/PluginMetadataParserTest.java
index 572bb10..7adf6fa 100644
--- a/modules/core/client-api/src/test/java/org/rhq/core/clientapi/agent/metadata/test/PluginMetadataParserTest.java
+++ b/modules/core/client-api/src/test/java/org/rhq/core/clientapi/agent/metadata/test/PluginMetadataParserTest.java
@@ -22,6 +22,7 @@ import static org.rhq.core.clientapi.shared.PluginDescriptorUtil.toPluginDescrip
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
import java.util.HashMap;
import java.util.List;
@@ -823,7 +824,7 @@ public class PluginMetadataParserTest {
"The value is wrong for the <name> property that represents the drift configuration name");
assertNotNull(enabled, "Expected to find simple property <enabled> for the drift configuration");
- assertFalse(enabled.getBooleanValue(), "The <enabled> property should be set to a default value of false");
+ assertTrue(enabled.getBooleanValue(), "The <enabled> property should be set to a default value of true");
test.assertDriftTemplate(driftTemplate);
}
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
index dfdc54a..e669a9a 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
@@ -62,7 +62,7 @@ public class DriftConfigurationDefinition implements Serializable {
// Thus, we only allow config names to only include spaces or "." or "-" or alphanumeric or "_" characters.
public static final String PROP_NAME_REGEX_PATTERN = "[ \\.\\-\\w]+";
- public static final boolean DEFAULT_ENABLED = false;
+ public static final boolean DEFAULT_ENABLED = true;
public static final long DEFAULT_INTERVAL = 1800L;
/**
commit 03ebe5d1e03ac836c8618df6761f248d3ef364a8
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Aug 29 12:48:40 2011 -0400
[BZ 733144 - links to non-default subtabs don't work]
The problem occurred, I believe, when you navigated from resource A,
default tab/subtab to resource A, non-default tab/subtab.
An easy example of this would be 1) Favorites Button->resources->A,
bringing you to A->Summary-Activity and then 2) Click on the alert def
name for a recent alert in the alerts portlet.
This scenario manged to generate a smartgwt tabbing event that did not play
well with others. As a response, I've expanded the net ignoring certain
smatgwt tabbing events to catch this as well. Tree/Tab/Subtab
nav should be well exercised (tree/context menu/tabs/subtabs) to ensure
thia change solves the problem without causing others.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/AbstractTwoLevelTabSetView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/AbstractTwoLevelTabSetView.java
index e580b9c..cade8fe 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/AbstractTwoLevelTabSetView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/AbstractTwoLevelTabSetView.java
@@ -201,15 +201,20 @@ public abstract class AbstractTwoLevelTabSetView<T, U extends Layout> extends Lo
this.tabName = null;
}
+ // We are either navigating to a new detail view (new entity: resource or group) or switching tabs
+ // for the current entity. Changing entities may change the available tabs as the same tab set may not
+ // be supported by the new entity's type. To maintain a valid tab selection for the TabSet, smartgwt will
+ // generate events if the current tab is removed (which can happen say, when navigating from a resource of
+ // type A to a resource of type B). We need to ignore tab selection events generated by smartgwt because we
+ // already perform explicit tab management at a higher level. To do this we explicitly set events to be be
+ // ignored. We re-enable the event handling when safe. (see selectTab()). Similarly, even when navigating
+ // within the same entity, when changing tabs we need to suppress smartgwt generated tab events (when
+ // calling TabSet.selectTab). That event can conflict with our subtab management, navigating the user
+ // to the default subtab for the tab and overriding our explicit navigation to a non-default subtab.
+ this.tabSet.setIgnoreSelectEvents(true);
+
if (getSelectedItemId() == null || getSelectedItemId() != id) {
// A different entity (resource or group), load it and try to navigate to the same tabs if possible.
- // Changing entities may change the available tabs as the same tab set may not be supported by the
- // new entity's type. To maintain a valid tab selection for the TabSet, smartgwt will generate an
- // events if the current tab is removed (which can happen say, when navigating from a resource of type A
- // to a resource of type B). We need to ignore tab selection events generated by smartgwt because we
- // handle this at a higher level. To do this we explicitly set events to be be ignored. We re-enable
- // the event handling when safe. (see selectTab()).
- this.tabSet.setIgnoreSelectEvents(true);
this.loadSelectedItem(id, viewPath);
} else {
@@ -261,7 +266,8 @@ public abstract class AbstractTwoLevelTabSetView<T, U extends Layout> extends Lo
// the requested tab/subtab are valid, continue with this path
- // select the tab and subTab (no event fired, we're already dealing with the correct path)
+ // select the tab and subTab (we are suppressing event handling, so the smartgwt fired event is ignored,
+ // alowing us to perform the desired subtab management below)
this.tabSet.selectTab(tab);
// this call adds the subtab canvas as a member of the subtablayout
// don't show the subtab canvas until after we perform any necessary rendering.
commit 0f2a13bb458c38ad5acc6bd53224b44318f7be76
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Aug 29 11:59:22 2011 -0400
we have create-child and delete-child icons - use those rather than re-use the inventory icons
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
index c2b33eb..0bfd413 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
@@ -249,13 +249,13 @@ public class PermissionsEditor extends LocatableVStack {
records.add(record);
record = createResourcePermissionRecord(MSG.view_adminRoles_permissions_perm_createChildResources(),
- "subsystems/inventory/Inventory", Permission.VIEW_RESOURCE, MSG
+ "subsystems/inventory/CreateChild", Permission.VIEW_RESOURCE, MSG
.view_adminRoles_permissions_permReadDesc_createChildResources(), Permission.CREATE_CHILD_RESOURCES,
MSG.view_adminRoles_permissions_permWriteDesc_createChildResources());
records.add(record);
record = createResourcePermissionRecord(MSG.view_adminRoles_permissions_perm_deleteChildResources(),
- "subsystems/inventory/Inventory", Permission.VIEW_RESOURCE, MSG
+ "subsystems/inventory/DeleteChild", Permission.VIEW_RESOURCE, MSG
.view_adminRoles_permissions_permReadDesc_deleteChildResources(), Permission.DELETE_RESOURCE, MSG
.view_adminRoles_permissions_permWriteDesc_deleteChildResources());
records.add(record);
commit a98c893d118b6375bd429986ec177a9be576fbaa
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Sun Aug 28 13:29:12 2011 -0500
BZ733775 - Update the plugin configuration file to have correct descriptions for each service available. Also added a new class to verify the availability of a className mbean resource.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanComponent.java
new file mode 100644
index 0000000..fc8b818
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanComponent.java
@@ -0,0 +1,64 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.mc4j.ems.connection.bean.EmsBean;
+
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.plugins.jmx.JMXComponent;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+@SuppressWarnings({ "rawtypes", "deprecation" })
+public class ClassNameMBeanComponent extends MBeanResourceComponent<JMXComponent> {
+ private static final Log log = LogFactory.getLog(WebappContextComponent.class);
+
+ private static final String CLASS_NAME = "className";
+
+ @Override
+ public AvailabilityType getAvailability() {
+ AvailabilityType beanAvailability = super.getAvailability();
+
+ if (beanAvailability.equals(AvailabilityType.UP)) {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
+
+ String className = this.resourceContext.getPluginConfiguration().getSimple(CLASS_NAME).getStringValue();
+ EmsBean emsBean = getEmsBean();
+
+ if (className.equals(emsBean.getClassTypeName())) {
+ return AvailabilityType.UP;
+ }
+ } catch (Exception e) {
+ log.info(e);
+ return AvailabilityType.DOWN;
+ } finally {
+ Thread.currentThread().setContextClassLoader(cl);
+ }
+ }
+
+ return AvailabilityType.DOWN;
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
index b854398..686642a 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
@@ -20,6 +20,8 @@ package org.rhq.plugins.modcluster;
import java.util.Set;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.mc4j.ems.connection.EmsConnection;
import org.mc4j.ems.connection.bean.EmsBean;
@@ -36,6 +38,8 @@ import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
@SuppressWarnings("rawtypes")
public class ClassNameMBeanDiscoveryComponent<T extends JMXComponent> extends MBeanResourceDiscoveryComponent<T> {
+ private static final Log log = LogFactory.getLog(FileConfiguredMBeanResourceComponent.class);
+
private static final String CLASS_NAME = "className";
/* (non-Javadoc)
@@ -62,12 +66,22 @@ public class ClassNameMBeanDiscoveryComponent<T extends JMXComponent> extends MB
* @return
*/
public boolean isBeanConfiguredClassName(ResourceDiscoveryContext<T> context, String objectName) {
- String className = context.getDefaultPluginConfiguration().getSimple(CLASS_NAME).getStringValue();
-
EmsConnection connection = context.getParentResourceComponent().getEmsConnection();
EmsBean emsBean = loadBean(connection, objectName);
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+
+ try {
+ Thread.currentThread().setContextClassLoader(emsBean.getClass().getClassLoader());
- return className.equals(emsBean.getClassTypeName());
+ String className = context.getDefaultPluginConfiguration().getSimple(CLASS_NAME).getStringValue();
+
+ return className.equals(emsBean.getClassTypeName());
+ } catch (Exception e) {
+ log.info(e);
+ return false;
+ } finally {
+ Thread.currentThread().setContextClassLoader(cl);
+ }
}
/**
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
index cc7ea37..046b1fb 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
@@ -30,16 +30,14 @@ import org.rhq.core.domain.configuration.definition.PropertyDefinition;
import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
import org.rhq.core.util.exception.ThrowableUtil;
-import org.rhq.plugins.jmx.JMXComponent;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
/**
* @author Stefan Negrea
*
*/
-@SuppressWarnings({ "deprecation", "rawtypes" })
-public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent<JMXComponent> {
+@SuppressWarnings({ "deprecation" })
+public class FileConfiguredMBeanResourceComponent extends ClassNameMBeanComponent {
private static final Log log = LogFactory.getLog(FileConfiguredMBeanResourceComponent.class);
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index dafb18f..b0ad1f2 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -29,7 +29,7 @@
<service name="HA Service" discovery="ClassNameMBeanDiscoveryComponent"
class="ModClusterServiceComponent"
supportsManualAdd="true"
- description="HA Service Listener" singleton="true">
+ description="HA Service" singleton="true">
<plugin-configuration>
<c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
@@ -150,7 +150,8 @@
</resource-configuration>
</service>
- <service name="HA Service Configuration" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true" description="HA Service Configuration" singleton="true">
+ <service name="HA Service Configuration" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true"
+ description="HA Service Configuration" singleton="true">
<plugin-configuration>
<c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
@@ -199,11 +200,12 @@
<!-- End - Configuration for HAModClusterService -->
<!-- Start - Configuration for ModClusterService -->
- <service name="Service" discovery="ClassNameMBeanDiscoveryComponent" class="ModClusterServiceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
+ <service name="Service" discovery="ClassNameMBeanDiscoveryComponent" class="ModClusterServiceComponent" supportsManualAdd="true"
+ description="Service" singleton="true">
<plugin-configuration>
<c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
- <c:simple-property name="nameTemplate" default="HA Service" />
+ <c:simple-property name="nameTemplate" default="Service" />
<c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.ModClusterService" />
<c:simple-property name="proxyInfoProperty" readOnly="true" default="ProxyInfo" />
</plugin-configuration>
@@ -280,11 +282,12 @@
<metric property="ProxyInfo" displayName="Proxy Info" displayType="summary" dataType="trait" />
</service>
- <service name="Service Configuration" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true" description="HA Service Configuration" singleton="true">
+ <service name="Service Configuration" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true"
+ description="Service Configuration" singleton="true">
<plugin-configuration>
<c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
- <c:simple-property name="nameTemplate" default="HA Service Configuration" />
+ <c:simple-property name="nameTemplate" default="Service Configuration" />
<c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.ModClusterService" />
<c:simple-property name="dependencyClassName" readOnly="true" default="org.jboss.modcluster.config.ModClusterConfig" />
<c:simple-property name="proxyInfoProperty" readOnly="true" default="ProxyInfo" />
@@ -325,11 +328,12 @@
</service>
<!-- End - Configuration for ModClusterService -->
- <service name="Catalina Service" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="CatalinaServiceComponent" supportsManualAdd="true" description="Catalina Service Listener" singleton="true">
+ <service name="Catalina Service" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="CatalinaServiceComponent" supportsManualAdd="true"
+ description="Catalina Service" singleton="true">
<plugin-configuration>
<c:simple-property name="objectName" readOnly="true" default="Catalina:type=ModClusterListener,*" />
- <c:simple-property name="nameTemplate" default="mod_cluster Catalina Listener" />
+ <c:simple-property name="nameTemplate" default="Catalina Service" />
</plugin-configuration>
<operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
@@ -397,7 +401,8 @@
</resource-configuration>
</service>
- <service name="Dynamic Load Balancer Factor" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true" description="Dynamic Load balancer factor for mod_cluster" singleton="true">
+ <service name="Dynamic Load Balancer Factor" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true"
+ description="Dynamic Load balancer factor for mod_cluster" singleton="true">
<plugin-configuration>
<c:simple-property name="objectName" readOnly="true" default="jboss.web:provider=LoadBalanceFactor,service=ModCluster,*" />
@@ -411,7 +416,8 @@
</resource-configuration>
</service>
- <service name="Simple Load Balancer Factor" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true" description="Simple load balancer factor for mod_cluster" singleton="true">
+ <service name="Simple Load Balancer Factor" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true"
+ description="Simple load balancer factor for mod_cluster" singleton="true">
<plugin-configuration>
<c:simple-property name="objectName" readOnly="true" default="jboss.web:provider=LoadBalanceFactor,service=ModCluster,*" />
commit 7568e5955dc14df637cd00adc7baaf63d78d12b5
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Sun Aug 28 11:27:49 2011 -0500
BZ727963 - Updated the code to declare the logger locally before using it. The logger declared at parent level was issuing usage warnings on the agent container.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java
index 76eb731..957f09b 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java
@@ -20,6 +20,9 @@ package org.rhq.plugins.modcluster;
import java.util.concurrent.TimeUnit;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
import org.rhq.core.domain.configuration.PropertySimple;
@@ -32,6 +35,9 @@ import org.rhq.plugins.modcluster.config.JBossWebServerFile;
@SuppressWarnings({ "rawtypes", "deprecation" })
public class CatalinaServiceComponent extends MBeanResourceComponent {
+
+ private static final Log log = LogFactory.getLog(CatalinaServiceComponent.class);
+
private static final String SERVER_HOME_DIR = "serverHomeDir";
private static final String CONFIGURATION_FILE_RELATIVE_PATH = "/deploy/jboss-web.deployer/server.xml";
commit 65d155d21c05b5b1ed31feeabb2a55bf86d32e74
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Sun Aug 28 11:20:19 2011 -0500
BZ729051 - Extended the default MBean resource component implementation to support TimeUnit arguments.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java
index 6e90103..76eb731 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java
@@ -18,6 +18,8 @@
*/
package org.rhq.plugins.modcluster;
+import java.util.concurrent.TimeUnit;
+
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
import org.rhq.core.domain.configuration.PropertySimple;
@@ -53,6 +55,15 @@ public class CatalinaServiceComponent extends MBeanResourceComponent {
}
}
+ @Override
+ protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
+ if (typeName.equals(TimeUnit.class.getName())) {
+ return TimeUnit.valueOf(propSimple.getStringValue());
+ }
+
+ return super.getPropertyValueAsType(propSimple, typeName);
+ }
+
private void saveResouceConfigurationToFile(ConfigurationUpdateReport report, boolean ignoreReadOnly) {
ConfigurationDefinition configurationDefinition = this.getResourceContext().getResourceType()
.getResourceConfigurationDefinition();
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServiceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServiceComponent.java
index d9da81c..6ac8318 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServiceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServiceComponent.java
@@ -42,7 +42,6 @@ public class ModClusterServiceComponent extends FileConfiguredMBeanResourceCompo
@Override
protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
- System.out.println(typeName);
if (typeName.equals(TimeUnit.class.getName())) {
return TimeUnit.valueOf(propSimple.getStringValue());
}
commit f2bae4b6b175464b5a0e44281727cd7611e3a7f5
Merge: 438c31b 6abff41
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Sun Aug 28 10:59:41 2011 -0500
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 438c31bc4e4fb1bde6585b5a153d0d921e7318a4
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Sun Aug 28 10:59:14 2011 -0500
BZ728621 - The correct procedure to update mod_cluster properties for JBoss 42 is:
1) update JMX properties
2) invoke refresh command to propagate updates to https
3) persist changes server configuration file so that they are reloaded after a restart
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java
index 1b390c5..6e90103 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java
@@ -18,6 +18,7 @@
*/
package org.rhq.plugins.modcluster;
+import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
@@ -34,11 +35,21 @@ public class CatalinaServiceComponent extends MBeanResourceComponent {
@Override
public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ //Update JMX properties
super.updateResourceConfiguration(report);
- try {
- saveResouceConfigurationToFile(report, true);
- } catch (Exception e) {
+ if (report.getStatus() == ConfigurationUpdateStatus.SUCCESS) {
+ //Propagate the JMX configuration updates to HTTPD
+ try {
+ super.invokeOperation("refresh", new Configuration());
+ } catch (Exception e) {
+ report.setErrorMessage("Failed to save the resource configuration to file. " + e.getMessage());
+ }
+
+ //Persist configuration changes to configuration file
+ if (report.getStatus() == ConfigurationUpdateStatus.SUCCESS) {
+ saveResouceConfigurationToFile(report, true);
+ }
}
}
@@ -63,8 +74,7 @@ public class CatalinaServiceComponent extends MBeanResourceComponent {
}
} catch (Exception e) {
property.setErrorMessage(ThrowableUtil.getStackAsString(e));
- report
- .setErrorMessage("Failed setting resource configuration - see property error messages for details");
+ report.setErrorMessage("Failed setting resource configuration. " + e.getMessage());
log.info("Failure setting MBean Resource configuration value for " + key, e);
}
}
@@ -72,6 +82,7 @@ public class CatalinaServiceComponent extends MBeanResourceComponent {
jbossWebServerFile.saveConfigurationFile();
} catch (Exception e) {
+ report.setErrorMessage("Failed to save the resource configuration to file. " + e.getMessage());
log.debug("Unable to save mod_cluster configuration file.", e);
}
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
index b87bfcd..cc7ea37 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
@@ -141,8 +141,7 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
}
} catch (Exception e) {
property.setErrorMessage(ThrowableUtil.getStackAsString(e));
- report
- .setErrorMessage("Failed setting resource configuration - see property error messages for details");
+ report.setErrorMessage("Failed setting resource configuration. " + e.getMessage());
log.info("Failure setting MBean Resource configuration value for " + key, e);
}
}
@@ -150,6 +149,7 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
modClusterBeanFile.saveConfigurationFile();
} catch (Exception e) {
+ report.setErrorMessage("Failed to save the resource configuration to file. " + e.getMessage());
log.debug("Unable to save mod_cluster configuration file.", e);
}
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterDiscoveryComponent.java
index b9a73b5..9e4d87e 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterDiscoveryComponent.java
@@ -52,17 +52,32 @@ public class ModClusterDiscoveryComponent extends MBeanResourceDiscoveryComponen
@SuppressWarnings("static-access")
public String findServerHomeDirectory(ResourceComponent parentResourceComponent) {
- if (parentResourceComponent instanceof ApplicationServerComponent) {
- ApplicationServerComponent parentComponent = (ApplicationServerComponent) parentResourceComponent;
+ try {
+ if (parentResourceComponent instanceof ApplicationServerComponent) {
+ ApplicationServerComponent parentComponent = (ApplicationServerComponent) parentResourceComponent;
- return parentComponent.getResourceContext().getPluginConfiguration().getSimple("serverHomeDir")
- .getStringValue();
+ return parentComponent.getResourceContext().getPluginConfiguration().getSimple("serverHomeDir")
+ .getStringValue();
- } else if (parentResourceComponent instanceof JBossASServerComponent) {
- JBossASServerComponent parentComponent = (JBossASServerComponent) parentResourceComponent;
+ }
+ } catch (java.lang.NoClassDefFoundError e) {
+ //Do absolutely nothing, that means the class loader does not have this module loaded.
+ //Just continue with the next discovery attempt.
+ }
+
+ try {
+ if (parentResourceComponent instanceof JBossASServerComponent) {
+
+ JBossASServerComponent parentComponent = (JBossASServerComponent) parentResourceComponent;
+
+ System.out.println(parentComponent.getPluginConfiguration()
+ .getSimple(parentComponent.CONFIGURATION_PATH_CONFIG_PROP).getStringValue());
- return parentComponent.getPluginConfiguration().getSimple(parentComponent.JBOSS_HOME_DIR_CONFIG_PROP)
- .getStringValue();
+ return parentComponent.getPluginConfiguration()
+ .getSimple(parentComponent.CONFIGURATION_PATH_CONFIG_PROP).getStringValue();
+ }
+ } catch (java.lang.NoClassDefFoundError e) {
+ //Do absolutely nothing, that means the class loader does not have this module loaded.
}
return null;
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
index 01f992e..d5f8680 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
@@ -16,7 +16,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-
package org.rhq.plugins.modcluster.config;
import java.io.File;
@@ -24,7 +23,6 @@ import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
-import org.apache.commons.lang.NotImplementedException;
import org.w3c.dom.Attr;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
@@ -73,7 +71,7 @@ public class JBossWebServerFile extends AbstractConfigurationFile {
@Override
public String getPropertyValue(String propertyName) {
- throw new NotImplementedException(
+ throw new UnsupportedOperationException(
"Property values should be retrieved from the JMX interface not from the configuration file.");
}
commit 6abff4105f7a878cb0fb2b8b25a4814c880cc60b
Author: John Sanda <jsanda(a)redhat.com>
Date: Fri Aug 26 22:00:26 2011 -0400
[BZ 732078] Adding support for detecting "viewable" files
This commit introduces a simple approach for determing whether or not a
file is viewable. The approach taken is try and determine whether or not
the file is a binary file. DriftManagerBean uses a hard coded list of
known file extensions for binary files. This is in no way as robust as
it could be but it may be sufficient. Since the solution is not robust,
I think it is important to try and detect if a file is a binary type as
opposed to detecting whether or not it is a text file suitable for
viewing. The rationale behind that is we do not want to prevent a user
from viewing a file or viewing a diff of a file when they should be able
to.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java
index 1dd9e56..31c888d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java
@@ -145,8 +145,95 @@ public class DriftDetailsView extends LocatableVLayout {
addMember(changeSetForm);
- // the drift history item itself
+ GWTServiceLookup.getDriftService().isBinaryFile(drift, new AsyncCallback<Boolean>() {
+ @Override
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to look up file type", caught);
+ }
+
+ @Override
+ public void onSuccess(Boolean isBinary) {
+ if (isBinary) {
+ addMember(createDriftFormForBinaryFile(drift, previousVersion));
+ } else {
+ addMember(createDriftFormForTextFile(drift, previousVersion));
+ }
+ }
+ });
+ }
+
+ private DynamicForm createDriftFormForBinaryFile(Drift drift, DriftChangeSet previousVersion) {
+ DynamicForm driftForm = new LocatableDynamicForm(extendLocatorId("form"));
+ driftForm.setIsGroup(true);
+ driftForm.setGroupTitle(MSG.view_drift());
+ driftForm.setWrapItemTitles(false);
+ driftForm.setNumCols(4);
+
+ SpacerItem spacer = new SpacerItem();
+
+ StaticTextItem id = new StaticTextItem("id", MSG.common_title_id());
+ id.setValue(drift.getId());
+
+ StaticTextItem path = new StaticTextItem("path", MSG.common_title_path());
+ path.setValue(drift.getPath());
+
+ StaticTextItem timestamp = new StaticTextItem("timestamp", MSG.common_title_timestamp());
+ timestamp.setValue(TimestampCellFormatter.format(drift.getCtime(), DATE_TIME_FORMAT_FULL));
+
+ StaticTextItem category = new StaticTextItem("category", MSG.common_title_category());
+
+ LinkedHashMap<String, String> catIconsMap = new LinkedHashMap<String, String>(3);
+ catIconsMap.put(DriftDataSource.CATEGORY_ICON_ADD, DriftDataSource.CATEGORY_ICON_ADD);
+ catIconsMap.put(DriftDataSource.CATEGORY_ICON_CHANGE, DriftDataSource.CATEGORY_ICON_CHANGE);
+ catIconsMap.put(DriftDataSource.CATEGORY_ICON_REMOVE, DriftDataSource.CATEGORY_ICON_REMOVE);
+ LinkedHashMap<String, String> catValueMap = new LinkedHashMap<String, String>(3);
+ catValueMap.put(DriftDataSource.CATEGORY_ICON_ADD, MSG.view_drift_category_fileAdded());
+ catValueMap.put(DriftDataSource.CATEGORY_ICON_CHANGE, MSG.view_drift_category_fileChanged());
+ catValueMap.put(DriftDataSource.CATEGORY_ICON_REMOVE, MSG.view_drift_category_fileRemoved());
+ category.setValueMap(catValueMap);
+ category.setValueIcons(catIconsMap);
+ category.setShowIcons(true);
+
+ StaticTextItem oldFile = new StaticTextItem("oldFile", MSG.view_drift_table_oldFile());
+ FormItem oldFileLink = null;
+
+ StaticTextItem newFile = new StaticTextItem("newFile", MSG.view_drift_table_newFile());
+ FormItem newFileLink = null;
+
+ switch (drift.getCategory()) {
+ case FILE_ADDED:
+ category.setValue(DriftDataSource.CATEGORY_ICON_ADD);
+ oldFile.setValue(MSG.common_label_none());
+ oldFileLink = spacer;
+ newFile.setValue(drift.getNewDriftFile().getHashId());
+ newFileLink = spacer;
+ break;
+
+ case FILE_CHANGED:
+ category.setValue(DriftDataSource.CATEGORY_ICON_CHANGE);
+ oldFile.setValue(drift.getOldDriftFile().getHashId());
+ oldFileLink = createViewFileLink(drift.getOldDriftFile().getHashId(), drift.getPath(),
+ previousVersion.getVersion());
+ newFile.setValue(drift.getNewDriftFile().getHashId());
+ newFileLink = spacer;
+ break;
+
+ case FILE_REMOVED:
+ category.setValue(DriftDataSource.CATEGORY_ICON_REMOVE);
+ oldFile.setValue(drift.getOldDriftFile().getHashId());
+ oldFileLink = spacer;
+ newFile.setValue(MSG.common_label_none());
+ newFileLink = spacer;
+ break;
+ }
+
+ driftForm.setItems(id, spacer, path, spacer, category, spacer, timestamp, spacer, oldFile, oldFileLink,
+ newFile, newFileLink);
+
+ return driftForm;
+ }
+ private DynamicForm createDriftFormForTextFile(Drift drift, DriftChangeSet previousVersion) {
DynamicForm driftForm = new LocatableDynamicForm(extendLocatorId("form"));
driftForm.setIsGroup(true);
driftForm.setGroupTitle(MSG.view_drift());
@@ -232,7 +319,7 @@ public class DriftDetailsView extends LocatableVLayout {
newFile, newFileLink);
}
- addMember(driftForm);
+ return driftForm;
}
private LinkItem createViewFileLink(final String hash, final String path, final int version) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DriftGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DriftGWTService.java
index f8e2b20..9b96231 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DriftGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DriftGWTService.java
@@ -111,6 +111,8 @@ public interface DriftGWTService extends RemoteService {
String getDriftFileBits(String hash) throws RuntimeException;
- FileDiffReport generateUnifiedDiff(Drift drift);
+ FileDiffReport generateUnifiedDiff(Drift drift) throws RuntimeException;
+
+ boolean isBinaryFile(Drift drift) throws RuntimeException;
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DriftGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DriftGWTServiceImpl.java
index a71bba2..e8531be 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DriftGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DriftGWTServiceImpl.java
@@ -151,11 +151,20 @@ public class DriftGWTServiceImpl extends AbstractGWTServiceImpl implements Drift
}
@Override
- public FileDiffReport generateUnifiedDiff(Drift drift) {
+ public FileDiffReport generateUnifiedDiff(Drift drift) throws RuntimeException {
try {
return driftManager.generateUnifiedDiff(drift);
} catch (Throwable t) {
throw getExceptionToThrowToClient(t);
}
}
+
+ @Override
+ public boolean isBinaryFile(Drift drift) throws RuntimeException {
+ try {
+ return driftManager.isBinaryFile(drift);
+ } catch (Throwable t) {
+ throw getExceptionToThrowToClient(t);
+ }
+ }
}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
index 3f8ffa7..b1a7415 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
@@ -20,7 +20,9 @@ package org.rhq.enterprise.server.drift;
import java.io.File;
import java.io.InputStream;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import javax.ejb.EJB;
import javax.ejb.Stateless;
@@ -92,6 +94,47 @@ import static javax.ejb.TransactionAttributeType.REQUIRES_NEW;
@Stateless
public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
+ private static Set<String> binaryFileTypes = new HashSet<String>();
+
+ static {
+ binaryFileTypes.add("jar");
+ binaryFileTypes.add("war");
+ binaryFileTypes.add("ear");
+ binaryFileTypes.add("sar"); // jboss service
+ binaryFileTypes.add("har"); // hibernate archive
+ binaryFileTypes.add("rar"); // resource adapter
+ binaryFileTypes.add("wsr"); // jboss web service archive
+ binaryFileTypes.add("zip");
+ binaryFileTypes.add("tar");
+ binaryFileTypes.add("bz2");
+ binaryFileTypes.add("gz");
+ binaryFileTypes.add("rpm");
+ binaryFileTypes.add("so");
+ binaryFileTypes.add("dll");
+ binaryFileTypes.add("exe");
+ binaryFileTypes.add("jpg");
+ binaryFileTypes.add("png");
+ binaryFileTypes.add("jpeg");
+ binaryFileTypes.add("pdf");
+ binaryFileTypes.add("swf");
+ binaryFileTypes.add("bpm");
+ binaryFileTypes.add("tiff");
+ binaryFileTypes.add("svg");
+ binaryFileTypes.add("doc");
+ binaryFileTypes.add("mp3");
+ binaryFileTypes.add("wav");
+ binaryFileTypes.add("m4a");
+ binaryFileTypes.add("mov");
+ binaryFileTypes.add("mpeg");
+ binaryFileTypes.add("avi");
+ binaryFileTypes.add("mp4");
+ binaryFileTypes.add("wmv");
+ binaryFileTypes.add("deb");
+ binaryFileTypes.add("sit");
+ binaryFileTypes.add("iso");
+ binaryFileTypes.add("dmg");
+ }
+
// TODO Should security checks be handled here instead of delegating to the drift plugin?
// Currently any security checks that need to be performed are delegated to the plugin.
// This is fine *so far* since the only plugin is the default which is our existing SLSB
@@ -440,6 +483,18 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
}
}
+ @Override
+ public boolean isBinaryFile(Drift drift) {
+ String path = drift.getPath();
+ int index = path.lastIndexOf('.');
+
+ if (index == -1 || index == path.length() - 1) {
+ return false;
+ }
+
+ return binaryFileTypes.contains(path.substring(index + 1, path.length()));
+ }
+
private DriftServerPluginFacet getServerPlugin() {
MasterServerPluginContainer masterPC = LookupUtil.getServerPluginService().getMasterPluginContainer();
if (masterPC == null) {
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java
index c6fc043..663b626 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java
@@ -129,4 +129,6 @@ public interface DriftManagerLocal extends DriftServerPluginFacet, DriftManagerR
* referenced by drift
*/
FileDiffReport generateUnifiedDiff(Drift drift);
+
+ boolean isBinaryFile(Drift drift);
}
commit 66085d0afba8abd80f7288924ec1b34c2b7f7043
Author: John Sanda <jsanda(a)redhat.com>
Date: Fri Aug 26 13:53:47 2011 -0400
Updating clean up code in DriftManager to not delete files until streams are closed
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftInputStream.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftInputStream.java
new file mode 100644
index 0000000..126ab58
--- /dev/null
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftInputStream.java
@@ -0,0 +1,93 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 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.core.pc.drift;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * DriftInputStream is a simple wrapper the delegates to another input stream and executes
+ * a task after the underlying stream is closed. {@link DriftManager} uses this class to perform
+ * clean up after streaming change set reports and change set content to the server.
+ */
+// TODO come up with a better, more intuitive class name
+public class DriftInputStream extends InputStream {
+
+ private InputStream stream;
+
+ private Runnable cleanupTask;
+
+ /**
+ * Createa a new DriftInputStream.
+ *
+ * @param stream The stream to which this object delegates all calls
+ * @param cleanupTask A task to execute immediately after the stream is closed
+ */
+ public DriftInputStream(InputStream stream, Runnable cleanupTask) {
+ this.stream = stream;
+ this.cleanupTask = cleanupTask;
+ }
+
+ @Override
+ public int read() throws IOException {
+ return stream.read();
+ }
+
+ @Override
+ public int read(byte[] b) throws IOException {
+ return stream.read(b);
+ }
+
+ @Override
+ public int read(byte[] b, int off, int len) throws IOException {
+ return stream.read(b, off, len);
+ }
+
+ @Override
+ public long skip(long n) throws IOException {
+ return stream.skip(n);
+ }
+
+ @Override
+ public int available() throws IOException {
+ return stream.available();
+ }
+
+ @Override
+ public void close() throws IOException {
+ stream.close();
+ cleanupTask.run();
+ }
+
+ @Override
+ public void mark(int readlimit) {
+ stream.mark(readlimit);
+ }
+
+ @Override
+ public void reset() throws IOException {
+ stream.reset();
+ }
+
+ @Override
+ public boolean markSupported() {
+ return stream.markSupported();
+ }
+}
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java
index a3512dc..4bffe9e 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java
@@ -24,7 +24,6 @@ import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
-import java.io.FilenameFilter;
import java.io.IOException;
import java.util.List;
import java.util.Set;
@@ -52,7 +51,6 @@ import org.rhq.core.pc.inventory.ResourceContainer;
import org.rhq.core.pc.measurement.MeasurementManager;
import org.rhq.core.util.stream.StreamUtil;
-import static org.rhq.core.util.ZipUtil.zipFileOrDirectory;
import static org.rhq.core.util.file.FileUtil.purge;
public class DriftManager extends AgentService implements DriftAgentService, DriftClient, ContainerService {
@@ -130,6 +128,15 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri
/**
* This method is provided as a test hook.
+ *
+ * @param changeSetMgr
+ */
+ void setChangeSetMgr(ChangeSetManager changeSetMgr) {
+ this.changeSetMgr = changeSetMgr;
+ }
+
+ /**
+ * This method is provided as a test hook.
* @return The schedule queue
*/
ScheduleQueue getSchedulesQueue() {
@@ -165,12 +172,29 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri
DriftServerService driftServer = pluginContainerConfiguration.getServerServices().getDriftServerService();
// TODO Include the version in the change set file name to ensure the file name is unique
- File zipFile = new File(pluginContainerConfiguration.getTemporaryDirectory(), "changeset-" + resourceId
- + driftConfiguration.getName() + ".zip");
- zipFileOrDirectory(changeSetFile, zipFile);
+ String fileName = "changeset_" + System.currentTimeMillis() + ".zip";
+ final File zipFile = new File(changeSetFile.getParentFile(), fileName);
+ ZipOutputStream stream = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFile)));
+
+ FileInputStream fis = new FileInputStream(changeSetFile);
+ stream.putNextEntry(new ZipEntry(changeSetFile.getName()));
+ StreamUtil.copy(fis, stream, false);
+ fis.close();
+ stream.close();
+
+ // We want to clean up after we send the zip file to the server. We do this by
+ // deleting the files in the content directory and the content zip itself. They
+ // are no longer needed after being sent to the server. We cannot immediately
+ // delete the content zip file though because it is sent asynchronously, and we
+ // wind up deleting it before it is sent. The following approach allows us to
+ // safely delete it when the comm layer closes the remote input stream.
+ //
+ // jsanda
+ DriftInputStream inputStream = new DriftInputStream(new BufferedInputStream(new FileInputStream(zipFile)),
+ new DeleteFile(zipFile));
+
+ driftServer.sendChangesetZip(resourceId, zipFile.length(), remoteInputStream(inputStream));
- driftServer.sendChangesetZip(resourceId, zipFile.length(), remoteInputStream(new BufferedInputStream(
- new FileInputStream(zipFile))));
} catch (IOException e) {
log.error("An error occurred while trying to send changeset[resourceId: " + resourceId
+ ", driftConfiguration: " + driftConfiguration.getName() + "]", e);
@@ -180,17 +204,11 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri
@Override
public void sendChangeSetContentToServer(int resourceId, String driftConfigurationName, final File contentDir) {
try {
- File zipFile = new File(contentDir, "content.zip");
+ String contentFileName = "content_" + System.currentTimeMillis() + ".zip";
+ final File zipFile = new File(contentDir.getParentFile(), contentFileName);
ZipOutputStream stream = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFile)));
- FilenameFilter contentZipFilter = new FilenameFilter() {
- @Override
- public boolean accept(File dir, String name) {
- return dir.equals(contentDir) && !name.equals("content.zip");
- }
- };
-
- for (File file : contentDir.listFiles(contentZipFilter)) {
+ for (File file : contentDir.listFiles()) {
FileInputStream fis = new FileInputStream(file);
stream.putNextEntry(new ZipEntry(file.getName()));
StreamUtil.copy(fis, stream, false);
@@ -198,9 +216,19 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri
}
stream.close();
+ // We want to clean up after we send the zip file to the server. We do this by
+ // deleting the files in the content directory and the content zip itself. They
+ // are no longer needed after being sent to the server. We cannot immediately
+ // delete the content zip file though because it is sent asynchronously, and we
+ // wind up deleting it before it is sent. The following approach allows us to
+ // safely delete it when the comm layer closes the remote input stream.
+ //
+ // jsanda
+ DriftInputStream inputStream = new DriftInputStream(new BufferedInputStream(new FileInputStream(zipFile)),
+ new DeleteFile(zipFile));
+
DriftServerService driftServer = pluginContainerConfiguration.getServerServices().getDriftServerService();
- driftServer.sendFilesZip(resourceId, zipFile.length(), remoteInputStream(new BufferedInputStream(
- new FileInputStream(zipFile))));
+ driftServer.sendFilesZip(resourceId, zipFile.length(), remoteInputStream(inputStream));
} catch (IOException e) {
log.error("An error occurred while trying to send content for changeset[resourceId: " + resourceId
+ ", driftConfiguration: " + driftConfigurationName + "]", e);
@@ -381,4 +409,18 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri
protected MeasurementManager getMeasurementManager() {
return PluginContainer.getInstance().getMeasurementManager();
}
+
+ private static class DeleteFile implements Runnable {
+
+ private File file;
+
+ public DeleteFile(File file) {
+ this.file = file;
+ }
+
+ @Override
+ public void run() {
+ file.delete();
+ }
+ }
}
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DriftManagerTest.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DriftManagerTest.java
index 5a53ee6..226e84b 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DriftManagerTest.java
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DriftManagerTest.java
@@ -20,6 +20,7 @@
package org.rhq.core.pc.drift;
import java.io.File;
+import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
@@ -31,6 +32,8 @@ import org.rhq.core.domain.drift.DriftConfiguration;
import org.rhq.core.pc.PluginContainerConfiguration;
import org.rhq.core.pc.ServerServices;
+import static org.apache.commons.io.FileUtils.deleteDirectory;
+import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
import static org.rhq.core.util.ZipUtil.unzipFile;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
@@ -64,15 +67,72 @@ public class DriftManagerTest extends DriftTest {
driftMgr.setConfiguration(pcConfig);
}
-// @AfterMethod
-// public void shutDownDriftManager() {
-// driftMgr.shutdown();
-// }
+ @Test
+ public void writeChangeSetZipFileToChangeSetDirectory() throws Exception {
+ final DriftConfiguration config = driftConfiguration("write-changeset-file", resourceDir.getAbsolutePath());
+ final File changeSetDir = changeSetDir(config.getName());
+ createRandomFile(changeSetDir, "changeset.txt");
+
+ setDriftServiceCallback(new DriftServiceCallback() {
+ @Override
+ public void execute() {
+ assertThatZipFileExists(changeSetDir, "changeset_",
+ "Expected to find change set zip file " +
+ "in " + changeSetDir.getPath() + ". The file name should follow the pattern " +
+ "changeset_<integer_timestamp>.zip");
+ }
+ });
+
+ driftMgr.setChangeSetMgr(changeSetMgr);
+ driftMgr.getSchedulesQueue().addSchedule(new DriftDetectionSchedule(resourceId(), config));
+ driftMgr.sendChangeSetToServer(resourceId(), config, COVERAGE);
+ }
+
+ @Test
+ public void sendChangeSetReportInZipFile() throws Exception {
+ final DriftConfiguration config = driftConfiguration("send-changeset-in-zip", resourceDir.getAbsolutePath());
+ final File changeSetDir = changeSetDir(config.getName());
+ final File changeSetFile = createRandomFile(changeSetDir, "changeset.txt");
+
+ setDriftServiceCallback(new DriftServiceCallback() {
+ @Override
+ public void execute() {
+ assertZipFileMatches(driftServerService.inputStream, changeSetFile);
+ }
+ });
+
+ driftMgr.setChangeSetMgr(changeSetMgr);
+ driftMgr.getSchedulesQueue().addSchedule(new DriftDetectionSchedule(resourceId(), config));
+ driftMgr.sendChangeSetToServer(resourceId(), config, COVERAGE);
+ }
+
+ @Test
+ public void cleanUpAfterSendingChangeSetToServer() throws Exception {
+ final DriftConfiguration config = driftConfiguration("send-changeset-in-zip", resourceDir.getAbsolutePath());
+ final File changeSetDir = changeSetDir(config.getName());
+ createRandomFile(changeSetDir, "changeset.txt");
+
+ driftMgr.setChangeSetMgr(changeSetMgr);
+ driftMgr.getSchedulesQueue().addSchedule(new DriftDetectionSchedule(resourceId(), config));
+ driftMgr.sendChangeSetToServer(resourceId(), config, COVERAGE);
+
+ // clean up should not happen until after the input stream is closed. The remote
+ // input stream is consumed asynchronously; so, we have to wait until the stream
+ // is closed. We could otherwise disrupt the transmission of bits.
+
+ File changeSetZip = assertThatZipFileExists(changeSetDir, "changeset_", "Expected to find change set zip " +
+ "zip file in " + changeSetDir.getPath() + ". The file name should follow the pattern " +
+ "changeset_<integer_timestamp>.zip");
+
+ driftServerService.inputStream.close();
+
+ assertFalse(changeSetZip.exists(), "The change set zip should be deleted when the remote input stream is closed.");
+ }
@Test
public void writeContentZipFileToChangeSetContentDirectory() throws Exception {
String configName = "send-content-in-zip";
- File changeSetDir = changeSetDir(configName);
+ final File changeSetDir = changeSetDir(configName);
final File contentDir = mkdir(changeSetDir, "content");
createRandomFile(contentDir, "content-1");
@@ -81,9 +141,9 @@ public class DriftManagerTest extends DriftTest {
setDriftServiceCallback(new DriftServiceCallback() {
@Override
public void execute() {
- File contentZip = new File(contentDir, "content.zip");
- assertTrue(contentZip.exists(), "Expected content zip file to be written to the change set content " +
- "directory: " + contentDir.getPath());
+ assertThatZipFileExists(changeSetDir, "content_", "Expected to find content zip file in " +
+ changeSetDir.getPath() + ". The file name should follow the pattern " +
+ "content_<integer_timestamp>.zip");
}
});
@@ -102,7 +162,7 @@ public class DriftManagerTest extends DriftTest {
setDriftServiceCallback(new DriftServiceCallback() {
@Override
public void execute() {
- assertZipFileMatches(driftServerService.filesZipStream, content1, content2);
+ assertZipFileMatches(driftServerService.inputStream, content1, content2);
}
});
@@ -120,6 +180,16 @@ public class DriftManagerTest extends DriftTest {
driftMgr.sendChangeSetContentToServer(resourceId(), configName, contentDir);
+ // clean up should not happen until after the input stream is closed. The remote
+ // input stream is consumed asynchronously; so, we have to wait until the stream
+ // is closed. We could otherwise disrupt the transmission of bits.
+ File contentZipFile = assertThatZipFileExists(changeSetDir, "content_",
+ "Expected to find content zip file in " +
+ changeSetDir.getPath() + ". The file name should have a pattern of content_integer_timestamp>.zip");
+
+ driftServerService.inputStream.close();
+
+ assertFalse(contentZipFile.exists(), "The content zip should be deleted when the remote input stream is closed");
assertThatDirectoryIsEmpty(contentDir);
}
@@ -183,9 +253,11 @@ public class DriftManagerTest extends DriftTest {
private void assertZipFileMatches(InputStream zipStream, File... expectedFiles) {
File zipDir = new File(tmpDir, "output");
try {
+ deleteDirectory(zipDir);
+ zipDir.mkdirs();
unzipFile(zipStream, zipDir);
} catch (IOException e) {
- fail("Failed to unzip zip file from intput stream into " + zipDir.getPath(), e);
+ fail("An error occurred while trying to unzip " + zipDir.getPath(), e);
}
assertEquals(zipDir.listFiles().length, expectedFiles.length, "The zip file has the wrong number of files");
@@ -217,6 +289,28 @@ public class DriftManagerTest extends DriftTest {
}
/**
+ * This method searches the specified directory for a zip file with the specified
+ * prefix. The file name must start with the prefix and end with an extension of .zip.
+ * This method assumes that there should be one and only one match. If there is not
+ * exactly one match, it will fail the test.
+ *
+ * @param dir The directory to search (sub directories are not searched)
+ * @param fileNamePrefix The zip file name prefix
+ * @param msg An error message
+ * @return The matching zip file
+ */
+ private File assertThatZipFileExists(final File dir, final String fileNamePrefix, String msg) {
+ File[] files = dir.listFiles(new FilenameFilter() {
+ @Override
+ public boolean accept(File dir, String name) {
+ return name.startsWith(fileNamePrefix) && name.endsWith(".zip");
+ }
+ });
+ assertEquals(files.length, 1, msg);
+ return files[0];
+ }
+
+ /**
* Sets a callback that will be invoked immediately after DriftManager calls
* {@link DriftServerService#sendChangesetZip(int, long, java.io.InputStream)} or
* {@link DriftServerService#sendFilesZip(int, long, java.io.InputStream)}. The callback
@@ -231,21 +325,28 @@ public class DriftManagerTest extends DriftTest {
private static class TestDriftServerService implements DriftServerService {
- public int filesZipResourceId;
- public long filesZipSize;
- public InputStream filesZipStream;
+ public int resourceId;
+ public long fileSize;
+ public InputStream inputStream;
public DriftServiceCallback callback;
@Override
public void sendChangesetZip(int resourceId, long zipSize, InputStream zipStream) {
+ this.resourceId = resourceId;
+ fileSize = zipSize;
+ inputStream = zipStream;
+
+ if (callback != null) {
+ callback.execute();
+ }
}
@Override
public void sendFilesZip(int resourceId, long zipSize, InputStream zipStream) {
- filesZipResourceId = resourceId;
- filesZipSize = zipSize;
- filesZipStream = zipStream;
+ this.resourceId = resourceId;
+ fileSize = zipSize;
+ inputStream = zipStream;
if (callback != null) {
callback.execute();
commit 300308759921d5cc2315dbb85b49a29e9f0983c3
Merge: 5956151 8db63e0
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 18:29:29 2011 -0500
Merge branch 'mod_cluster_plugin'
commit 8db63e00ec03b5c0257925becda0b984351b6664
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 18:27:05 2011 -0500
Refactoring configuration file classes to accept files in the constructor to allow testing. Also, added basic configuration files for testing.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
index dee2f81..d49ce88 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
@@ -39,11 +39,16 @@ import org.xml.sax.SAXException;
* @author Stefan Negrea
*/
public abstract class AbstractConfigurationFile {
- private String fileName;
+ private File configurationFile;
private Document document;
public AbstractConfigurationFile(String fileName) throws ParserConfigurationException, SAXException, IOException {
- this.fileName = fileName;
+ this(new File(fileName));
+ }
+
+ public AbstractConfigurationFile(File configurationFile) throws ParserConfigurationException, SAXException,
+ IOException {
+ this.configurationFile = configurationFile;
loadConfiguratonFile();
}
@@ -53,13 +58,6 @@ public abstract class AbstractConfigurationFile {
abstract String getPropertyValue(String propertyName);
/**
- * @return the fileName
- */
- public String getFileName() {
- return fileName;
- }
-
- /**
* @return the doc
*/
public Document getDocument() {
@@ -67,8 +65,7 @@ public abstract class AbstractConfigurationFile {
}
public void saveConfigurationFile() throws Exception {
- File file = new File(this.getFileName());
- StreamResult result = new StreamResult(file);
+ StreamResult result = new StreamResult(this.configurationFile);
Source source = new DOMSource(this.getDocument());
Transformer transformer = TransformerFactory.newInstance().newTransformer();
@@ -79,6 +76,6 @@ public abstract class AbstractConfigurationFile {
private void loadConfiguratonFile() throws ParserConfigurationException, SAXException, IOException {
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
- this.document = docBuilder.parse(this.getFileName());
+ this.document = docBuilder.parse(this.configurationFile);
}
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
index 45204e1..01f992e 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
@@ -19,6 +19,7 @@
package org.rhq.plugins.modcluster.config;
+import java.io.File;
import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
@@ -47,6 +48,12 @@ public class JBossWebServerFile extends AbstractConfigurationFile {
listenerNode = this.getListenerNode();
}
+ public JBossWebServerFile(File configurationFile) throws ParserConfigurationException, SAXException, IOException {
+ super(configurationFile);
+
+ listenerNode = this.getListenerNode();
+ }
+
@Override
public void setPropertyValue(String propertyName, String value) {
NamedNodeMap attributeList = listenerNode.getAttributes();
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
index c2cf3a8..9ff7752 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -18,6 +18,7 @@
*/
package org.rhq.plugins.modcluster.config;
+import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@@ -44,7 +45,19 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @throws SAXException
* @throws IOException
*/
- public ModClusterBeanFile(String className, String configurationFile) throws ParserConfigurationException,
+ public ModClusterBeanFile(String className, String configurationFileName) throws ParserConfigurationException,
+ SAXException, IOException {
+ this(className, new File(configurationFileName));
+ }
+
+ /**
+ * @param className
+ * @param configurationFile
+ * @throws ParserConfigurationException
+ * @throws SAXException
+ * @throws IOException
+ */
+ public ModClusterBeanFile(String className, File configurationFile) throws ParserConfigurationException,
SAXException, IOException {
super(configurationFile);
@@ -59,7 +72,20 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @throws SAXException
* @throws IOException
*/
- public ModClusterBeanFile(String className, String constructorArgumentClassName, String configurationFile)
+ public ModClusterBeanFile(String className, String constructorArgumentClassName, String configurationFileName)
+ throws ParserConfigurationException, SAXException, IOException {
+ this(className, constructorArgumentClassName, new File(configurationFileName));
+ }
+
+ /**
+ * @param className
+ * @param constructorArgumentClassName
+ * @param configurationFile
+ * @throws ParserConfigurationException
+ * @throws SAXException
+ * @throws IOException
+ */
+ public ModClusterBeanFile(String className, String constructorArgumentClassName, File configurationFile)
throws ParserConfigurationException, SAXException, IOException {
super(configurationFile);
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
index b8fca4c..871b082 100644
--- a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
@@ -18,6 +18,9 @@
*/
package org.rhq.plugins.modcluster.test;
+import java.io.File;
+import java.net.URL;
+
import org.testng.annotations.Test;
import org.rhq.plugins.modcluster.config.JBossWebServerFile;
@@ -26,12 +29,12 @@ import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
public class ServerConfigTest {
@Test
- public void TestModClusterConfig() {
-
+ public void TestSimpleBeanModClusterConfig() {
try {
- //Test simple bean configuration
- ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
- "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+ URL testConfigURL = getClass().getResource("/xml_config/mod_cluster-jboss-beans.xml");
+ File testFile = new File(testConfigURL.toURI());
+
+ ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService", testFile);
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
@@ -40,11 +43,19 @@ public class ServerConfigTest {
config.setPropertyValue("processStatusFrequency", null);
config.saveConfigurationFile();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Test
+ public void TestBeanWithDependenciesModClusterConfig() {
+ try {
+ URL testConfigURL = getClass().getResource("/xml_config/mod_cluster-jboss-beans.xml");
+ File testFile = new File(testConfigURL.toURI());
- //Test bean configuration with constructor dependency
- config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
- "org.jboss.modcluster.config.ha.HAModClusterConfig",
- "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+ ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
+ "org.jboss.modcluster.config.ha.HAModClusterConfig", testFile);
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
@@ -53,18 +64,17 @@ public class ServerConfigTest {
config.setPropertyValue("processStatusFrequency", null);
config.saveConfigurationFile();
} catch (Exception e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
}
@Test
public void TestJBossWebConfig() {
-
try {
- //Test simple bean configuration
- JBossWebServerFile config = new JBossWebServerFile(
- "/home/snegrea/Downloads/jboss42/server/all/deploy/jboss-web.deployer/server.xml");
+ URL testConfigURL = getClass().getResource("/xml_config/server.xml");
+ File testFile = new File(testConfigURL.toURI());
+
+ JBossWebServerFile config = new JBossWebServerFile(testFile);
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
@@ -74,7 +84,6 @@ public class ServerConfigTest {
config.saveConfigurationFile();
} catch (Exception e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
}
diff --git a/modules/plugins/mod-cluster/src/test/resources/xml_config/mod_cluster-jboss-beans.xml b/modules/plugins/mod-cluster/src/test/resources/xml_config/mod_cluster-jboss-beans.xml
new file mode 100644
index 0000000..1ef344b
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/test/resources/xml_config/mod_cluster-jboss-beans.xml
@@ -0,0 +1,337 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ Beans that provide JBoss AS-side functionality for mod_cluster. These
+ beans are all "On Demand", i.e. that are not installed unless requested.
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!-- Entry point: catalina lifecycle listener -->
+ <bean class="org.jboss.modcluster.catalina.CatalinaEventHandlerAdapter" name="ModClusterListener">
+ <constructor>
+ <parameter class="org.jboss.modcluster.ContainerEventHandler">
+<inject bean="HAModClusterService"/>
+</parameter>
+ <parameter class="javax.management.MBeanServer">
+<inject bean="JMXKernel" property="mbeanServer"/>
+</parameter>
+ </constructor>
+ <depends>WebServer</depends>
+ </bean>
+
+ <!-- The core mod_cluster service -->
+ <bean class="org.jboss.modcluster.ModClusterService" mode="On Demand" name="ModClusterService">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster",exposedInterface=org.jboss.modcluster.ModClusterServiceMBean.class)</annotation>
+ <constructor>
+ <parameter class="org.jboss.modcluster.config.ModClusterConfig">
+<inject bean="ModClusterConfig"/>
+</parameter>
+ <parameter class="org.jboss.modcluster.load.LoadBalanceFactorProvider">
+<inject bean="DynamicLoadBalanceFactorProvider"/>
+</parameter>
+ </constructor>
+ </bean>
+
+ <!-- The core mod_cluster service, implemented as an HA singleton -->
+ <bean class="org.jboss.modcluster.ha.HAModClusterService" mode="On Demand" name="HAModClusterService">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster",exposedInterface=org.jboss.modcluster.ha.HAModClusterServiceMBean.class)</annotation>
+ <constructor>
+ <parameter class="org.jboss.modcluster.config.ha.HAModClusterConfig">
+<inject bean="ModClusterConfig"/>
+</parameter>
+ <parameter class="org.jboss.modcluster.load.LoadBalanceFactorProvider">
+<inject bean="DynamicLoadBalanceFactorProvider"/>
+</parameter>
+ <parameter class="org.jboss.ha.framework.interfaces.HAPartition">
+<inject bean="HAPartition"/>
+</parameter>
+ <parameter class="org.jboss.ha.framework.interfaces.HASingletonElectionPolicy">
+<bean class="org.jboss.ha.singleton.HASingletonElectionPolicySimple"/>
+</parameter>
+ </constructor>
+
+</bean>
+
+ <!-- Configure this node's communication with the load balancer -->
+ <bean class="org.jboss.modcluster.config.ha.HAModClusterConfig" mode="On Demand" name="ModClusterConfig">
+
+ <!-- Comma separated list of address:port listing the httpd servers
+ where mod_cluster is running. -->
+ <property name="proxyList">${jboss.mod_cluster.proxyList,jboss.modcluster.proxyList:}</property>
+ <!-- URL prefix to send with commands to mod_cluster. Default is no prefix. -->
+ <!--property name="proxyURL"></property-->
+
+ <!-- mod_advertise is a small httpd module that advertises the
+ availability of httpd servers via multicast, allowing
+ ModClusterService to discover the httpd front-end instead of/in
+ addition to having them defined in proxyList. -->
+ <!-- Whether to listen for advertise messages -->
+ <property name="advertise">${jboss.mod_cluster.advertise:true}</property>
+ <!-- Multicast address on which to listen for advertisements -->
+ <property name="advertiseGroupAddress">${jboss.mod_cluster.advertise.address,jboss.modcluster.advertise.address,jboss.partition.udpGroup:224.0.1.105}</property>
+ <!-- Port to listen to for advertisements -->
+ <property name="advertisePort">${jboss.mod_cluster.advertise.port,jboss.modcluster.advertise.port:23364}</property>
+
+ <!-- Comma delimited list of contexts that should *not* be auto-registered with httpd. -->
+ <!-- ROOT indicates the root context. -->
+ <!-- Context may be qualified by host using a colon, e.g. host1:context1 -->
+ <!-- If no host is defined, localhost is assumed. -->
+ <property name="excludedContexts">${jboss.mod_cluster.excludedContexts,jboss.modcluster.excludedContexts:ROOT,admin-console,invoker,jbossws,jmx-console}</property>
+ <property name="autoEnableContexts">${jboss.mod_cluster.autoEnableContexts:true}</property>
+
+ <!-- Security key the proxy is going to send with advertise messages.
+ Default is none. -->
+ <!--property name="advertiseSecurityKey"></property-->
+
+ <!-- Whether to use SSL to communicate with mod_cluster. Note this
+ has nothing to do with handling of https requests by JBoss Web -->
+ <property name="ssl">false</property>
+
+ <!-- Configuration values for the load balancer itself (must be the
+ same on all nodes in the cluster). These will be passed to the
+ load balancer. -->
+ <property name="stickySession">true</property>
+ <property name="stickySessionForce">false</property>
+ <property name="stickySessionRemove">false</property>
+ <property name="maxAttempts">1</property>
+ <property name="workerTimeout">-1</property>
+ </bean>
+
+ <!-- Provides information to ModClusterService informing it how much load
+ this server should take. This impl calculates load factor from a
+ number of metrics and adjusts the value periodically based on runtime
+ conditions, using to the JBossWeb engine's backgroundProcessorDelay. -->
+ <bean class="org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProvider" mode="On Demand" name="DynamicLoadBalanceFactorProvider">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor",exposedInterface=org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProviderMBean.class)</annotation>
+ <constructor>
+ <parameter>
+ <!-- Define the load metrics to use in your load balance factor calculation here -->
+ <set elementClass="org.jboss.modcluster.load.metric.LoadMetric">
+ <inject bean="BusyConnectorsLoadMetric"/>
+ <inject bean="HeapMemoryUsageLoadMetric"/>
+ </set>
+ </parameter>
+ </constructor>
+ <!-- The number of historical load values used to determine load factor -->
+ <!--property name="history">9</property-->
+ <!-- The exponential decay factor for historical load values -->
+ <!--property name="decayFactor">2</property-->
+ </bean>
+
+ <!-- Default load metrics/sources -->
+ <!-- The JBossWeb connector thread pool usage as a ratio of busy threads to max thread pool size -->
+ <!-- Analogous to method=B in mod_jk -->
+ <bean class="org.jboss.modcluster.load.metric.impl.BusyConnectorsLoadMetric" mode="On Demand" name="BusyConnectorsLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=BusyConnectors",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="ThreadPoolLoadMetricSource"/>
+</parameter>
+ </constructor>
+ <!-- The weight determines the significance of this metric with respect
+ to others in the overall load balance factor calculation -->
+ <property name="weight">2</property>
+ </bean>
+ <!-- Queries all JBossWeb ThreadPool mbeans -->
+ <bean class="org.jboss.modcluster.load.metric.impl.ThreadPoolLoadMetricSource" mode="On Demand" name="ThreadPoolLoadMetricSource">
+ <constructor>
+ <parameter class="javax.management.MBeanServer">
+<inject bean="JMXKernel" property="mbeanServer"/>
+</parameter>
+ <!-- Object name pattern for connector thread pools -->
+ <!--parameter>jboss.web:type=ThreadPool,*</parameter-->
+ </constructor>
+ </bean>
+
+ <!-- The heap memory usage as a ratio of used heap to max heap size -->
+ <!-- N.B. This load metric is its own source -->
+ <bean class="org.jboss.modcluster.load.metric.impl.HeapMemoryUsageLoadMetric" mode="On Demand" name="HeapMemoryUsageLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=HeapMemoryUsage",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <!--property name="weight">1</property-->
+ </bean>
+
+
+ <!-- Alternative load balance factor providers -->
+
+ <!-- Basic impl that returns a static load balance factor.
+ This would replace the DynamicLoadBalanceFactorProvider
+ used above.
+ -->
+ <bean class="org.jboss.modcluster.load.impl.SimpleLoadBalanceFactorProvider" mode="On Demand" name="SimpleLoadBalanceFactorProvider">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor",exposedInterface=org.jboss.modcluster.load.impl.SimpleLoadBalanceFactorProviderMBean.class)</annotation>
+ <property name="loadBalanceFactor">1</property>
+ </bean>
+
+ <!--
+ Alternative load metrics, grouped by source.
+ To use these, inject them into the set passed to the
+ DynamicLoadBalanceFactorProvider bean's constructor above.
+ -->
+
+ <!-- CPU usage -->
+ <!-- Perhaps the best metric for determining system load - but only available on Java 1.6 or later -->
+ <bean class="org.jboss.modcluster.load.metric.impl.AverageSystemLoadMetric" mode="On Demand" name="AverageSystemLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=AverageSystemLoad",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="OperatingSystemLoadMetricSource"/>
+</parameter>
+ </constructor>
+ </bean>
+ <!-- The system memory usage as ratio of used memory to total memory size -->
+ <!-- Requires com.sun.management.OperatingSystemMXBean, i.e. Sun or OpenJDK JVM -->
+ <bean class="org.jboss.modcluster.load.metric.impl.SystemMemoryUsageLoadMetric" mode="On Demand" name="SystemMemoryUsageLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=SystemMemoryUsage",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="OperatingSystemLoadMetricSource"/>
+</parameter>
+ </constructor>
+ </bean>
+ <!-- Uses the platform's OperatingSystemMXBean -->
+ <bean class="org.jboss.modcluster.load.metric.impl.OperatingSystemLoadMetricSource" mode="On Demand" name="OperatingSystemLoadMetricSource">
+ </bean>
+
+
+ <!-- The number of requests/sec processed by the JBossWeb connectors, with respect to the defined capacity -->
+ <!-- Analogous to method=R in mod_jk -->
+ <bean class="org.jboss.modcluster.load.metric.impl.RequestCountLoadMetric" mode="On Demand" name="RequestCountLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=RequestCount",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource">
+<inject bean="RequestProcessorLoadMetricSource"/>
+</parameter>
+ <!--parameter>requestCount</parameter-->
+ </constructor>
+ <!-- This metric requires an explicit capacity, e.g. maximum capacity of 1000 requests/sec -->
+ <property name="capacity">1000</property>
+ </bean>
+ <!-- The incoming traffic received by JBossWeb connectors in KB/sec, with respect to the defined capacity -->
+ <!-- Analogous to method=T in mod_jk -->
+ <bean class="org.jboss.modcluster.load.metric.impl.ReceiveTrafficLoadMetric" mode="On Demand" name="ReceiveTrafficLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=ReceiveTraffic",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource">
+<inject bean="RequestProcessorLoadMetricSource"/>
+</parameter>
+ <!--parameter>bytesReceived</parameter-->
+ </constructor>
+ <!-- This metric requires an explicit capacity, e.g. max capacity of 1024 KB/s -->
+ <property name="capacity">1024</property>
+ </bean>
+ <!-- The outgoing traffic sent by JBossWeb connectors in KB/sec, with respect to the defined capacity -->
+ <bean class="org.jboss.modcluster.load.metric.impl.SendTrafficLoadMetric" mode="On Demand" name="SendTrafficLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=SendTraffic",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource">
+<inject bean="RequestProcessorLoadMetricSource"/>
+</parameter>
+ <!--parameter>bytesSent</parameter-->
+ </constructor>
+ <!-- This metric requires an explicit capacity, e.g. max capacity of 512 KB/s -->
+ <property name="capacity">512</property>
+ </bean>
+ <!-- Queries all JBossWeb GlobalRequestProcessor mbeans -->
+ <bean class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource" mode="On Demand" name="RequestProcessorLoadMetricSource">
+ <constructor>
+ <parameter class="javax.management.MBeanServer">
+<inject bean="JMXKernel" property="mbeanServer"/>
+</parameter>
+ <!-- Object name pattern for request processors -->
+ <!--parameter>jboss.web:type=GlobalRequestProcessor,*</parameter-->
+ </constructor>
+ </bean>
+
+
+ <!-- The number of active sessions, with respect to the defined capacity -->
+ <!-- Analogous to method=S in mod_jk -->
+ <bean class="org.jboss.modcluster.load.metric.impl.ActiveSessionsLoadMetric" mode="On Demand" name="ActiveSessionsLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=ActiveSessions",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="SessionLoadMetricSource"/>
+</parameter>
+ <!--parameter>activeSessions</parameter-->
+ </constructor>
+ <!-- This metric requires an explicit capacity, e.g. max capacity of 1000 active sessions -->
+ <property name="capacity">1000</property>
+ </bean>
+ <!-- Queries all JBossWeb session manager mbeans -->
+ <bean class="org.jboss.modcluster.load.metric.impl.SessionLoadMetricSource" mode="On Demand" name="SessionLoadMetricSource">
+ <constructor>
+ <parameter class="javax.management.MBeanServer">
+<inject bean="JMXKernel" property="mbeanServer"/>
+</parameter>
+ <!-- Object name pattern for session managers -->
+ <!--parameter>jboss.web:type=Manager,*</parameter-->
+ </constructor>
+ </bean>
+
+
+ <!-- Returns the connection pool usage as a ratio of used to max pool size -->
+ <bean class="org.jboss.modcluster.load.metric.impl.ConnectionPoolUsageLoadMetric" mode="On Demand" name="ConnectionPoolUsageMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=ConnectionPoolUsage",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="ConnectionPoolLoadMetricSource"/>
+</parameter>
+ <!--parameter>InUseConnectionCount</parameter-->
+ <!--parameter>MaxSize</parameter-->
+ </constructor>
+ </bean>
+ <!-- Queries all JCA connection pools -->
+ <bean class="org.jboss.modcluster.load.metric.impl.ConnectionPoolLoadMetricSource" mode="On Demand" name="ConnectionPoolLoadMetricSource">
+ <constructor>
+ <parameter class="javax.management.MBeanServer">
+<inject bean="JMXKernel" property="mbeanServer"/>
+</parameter>
+ <!-- Object name pattern for connector thread pools -->
+ <!--parameter>jboss.jca:service=ManagedConnectionPool,*</parameter-->
+ </constructor>
+ </bean>
+
+ <!-- Generic load metrics/sources -->
+
+ <!-- Uses the sum of the values of the specified attribute for each
+ mbean matching the query, with respect to a defined capacity. -->
+ <bean class="org.jboss.modcluster.load.metric.impl.MBeanAttributeLoadMetric" mode="On Demand" name="MBeanAttributeLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=MBeanAttribute",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="MBeanQueryLoadMetricSource"/>
+</parameter>
+ <parameter>
+<!-- mbean attribute -->
+</parameter>
+ </constructor>
+ <property name="capacity">1</property>
+ </bean>
+ <!-- Uses the ratio of the sum of the values of the specified dividend attribute,
+ to the sum of the values of the specified divisor attribute for each mbean
+ matching the query. -->
+ <bean class="org.jboss.modcluster.load.metric.impl.MBeanAttributeRatioLoadMetric" mode="On Demand" name="MBeanAttributeRatioLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=MBeanAttributeRatio",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="MBeanQueryLoadMetricSource"/>
+</parameter>
+ <parameter>
+<!-- dividend attribute -->
+</parameter>
+ <parameter>
+<!-- divisor attribute -->
+</parameter>
+ </constructor>
+ </bean>
+ <!-- Queries for mbeans matching the specified pattern -->
+ <bean class="org.jboss.modcluster.load.metric.impl.MBeanQueryLoadMetricSource" mode="On Demand" name="MBeanQueryLoadMetricSource">
+ <constructor>
+ <parameter>
+<!-- ObjectName pattern -->
+</parameter>
+ <parameter>
+<inject bean="JMXKernel" property="mbeanServer"/>
+</parameter>
+ </constructor>
+ </bean>
+
+</deployment>
diff --git a/modules/plugins/mod-cluster/src/test/resources/xml_config/server.xml b/modules/plugins/mod-cluster/src/test/resources/xml_config/server.xml
new file mode 100644
index 0000000..51fb479
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/test/resources/xml_config/server.xml
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<Server>
+
+ <Listener advertise="true" className="org.jboss.modcluster.catalina.ModClusterListener" smax="124"/>
+
+ <!--APR library loader. Documentation at /docs/apr.html -->
+ <Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>
+ <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
+ <Listener className="org.apache.catalina.core.JasperListener"/>
+
+ <!-- Use a custom version of StandardService that allows the
+ connectors to be started independent of the normal lifecycle
+ start to allow web apps to be deployed before starting the
+ connectors.
+ -->
+ <Service name="jboss.web">
+
+ <!-- A "Connector" represents an endpoint by which requests are received
+ and responses are returned. Documentation at :
+ Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
+ Java AJP Connector: /docs/config/ajp.html
+ APR (HTTP/AJP) Connector: /docs/apr.html
+ Define a non-SSL HTTP/1.1 Connector on port 8080
+ -->
+ <Connector acceptCount="100" address="${jboss.bind.address}" connectionTimeout="20000" disableUploadTimeout="true" emptySessionPath="true" enableLookups="false" maxHttpHeaderSize="8192" maxThreads="250" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
+
+ <!-- Define a SSL HTTP/1.1 Connector on port 8443
+ This connector uses the JSSE configuration, when using APR, the
+ connector should be using the OpenSSL style configuration
+ described in the APR documentation -->
+ <!--
+ <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
+ maxThreads="150" scheme="https" secure="true"
+ clientAuth="false" sslProtocol="TLS" />
+ -->
+
+ <!-- Define an AJP 1.3 Connector on port 8009 -->
+ <Connector address="${jboss.bind.address}" emptySessionPath="true" enableLookups="false" port="8009" protocol="AJP/1.3" redirectPort="8443"/>
+
+ <Engine defaultHost="localhost" name="jboss.web">
+
+ <!-- The JAAS based authentication and authorization realm implementation
+ that is compatible with the jboss 3.2.x realm implementation.
+ - certificatePrincipal : the class name of the
+ org.jboss.security.auth.certs.CertificatePrincipal impl
+ used for mapping X509[] cert chains to a Princpal.
+ - allRolesMode : how to handle an auth-constraint with a role-name=*,
+ one of strict, authOnly, strictAuthOnly
+ + strict = Use the strict servlet spec interpretation which requires
+ that the user have one of the web-app/security-role/role-name
+ + authOnly = Allow any authenticated user
+ + strictAuthOnly = Allow any authenticated user only if there are no
+ web-app/security-roles
+ -->
+ <Realm allRolesMode="authOnly" certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping" className="org.jboss.web.tomcat.security.JBossSecurityMgrRealm"/>
+ <!-- A subclass of JBossSecurityMgrRealm that uses the authentication
+ behavior of JBossSecurityMgrRealm, but overrides the authorization
+ checks to use JACC permissions with the current java.security.Policy
+ to determine authorized access.
+ - allRolesMode : how to handle an auth-constraint with a role-name=*,
+ one of strict, authOnly, strictAuthOnly
+ + strict = Use the strict servlet spec interpretation which requires
+ that the user have one of the web-app/security-role/role-name
+ + authOnly = Allow any authenticated user
+ + strictAuthOnly = Allow any authenticated user only if there are no
+ web-app/security-roles
+ <Realm className="org.jboss.web.tomcat.security.JaccAuthorizationRealm"
+ certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping"
+ allRolesMode="authOnly"
+ />
+ -->
+
+ <Host autoDeploy="false" configClass="org.jboss.web.tomcat.security.config.JBossContextConfig" deployOnStartup="false" deployXML="false" name="localhost">
+
+ <!-- Uncomment to enable request dumper. This Valve "logs interesting
+ contents from the specified Request (before processing) and the
+ corresponding Response (after processing). It is especially useful
+ in debugging problems related to headers and cookies."
+ -->
+ <!--
+ <Valve className="org.apache.catalina.valves.RequestDumperValve" />
+ -->
+
+ <!-- Access logger -->
+ <!--
+ <Valve className="org.apache.catalina.valves.AccessLogValve"
+ prefix="localhost_access_log." suffix=".log"
+ pattern="common" directory="${jboss.server.log.dir}"
+ resolveHosts="false" />
+ -->
+
+ <!-- Uncomment to enable single sign-on across web apps
+ deployed to this host. Does not provide SSO across a cluster.
+
+ If this valve is used, do not use the JBoss ClusteredSingleSignOn
+ valve shown below.
+
+ A new configuration attribute is available beginning with
+ release 4.0.4:
+
+ cookieDomain configures the domain to which the SSO cookie
+ will be scoped (i.e. the set of hosts to
+ which the cookie will be presented). By default
+ the cookie is scoped to "/", meaning the host
+ that presented it. Set cookieDomain to a
+ wider domain (e.g. "xyz.com") to allow an SSO
+ to span more than one hostname.
+ -->
+ <!--
+ <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
+ -->
+
+ <!-- Uncomment to enable single sign-on across web apps
+ deployed to this host AND to all other hosts in the cluster.
+
+ If this valve is used, do not use the standard Tomcat SingleSignOn
+ valve shown above.
+
+ Valve uses a JBossCache instance to support SSO credential
+ caching and replication across the cluster. The JBossCache
+ instance must be configured separately. By default, the valve
+ shares a JBossCache with the service that supports HttpSession
+ replication. See the "jboss-web-cluster-service.xml" file in the
+ server/all/deploy directory for cache configuration details.
+
+ Besides the attributes supported by the standard Tomcat
+ SingleSignOn valve (see the Tomcat docs), this version also
+ supports the following attributes:
+
+ cookieDomain see above
+
+ treeCacheName JMX ObjectName of the JBossCache MBean used to
+ support credential caching and replication across
+ the cluster. If not set, the default value is
+ "jboss.cache:service=TomcatClusteringCache", the
+ standard ObjectName of the JBossCache MBean used
+ to support session replication.
+ -->
+ <!--
+ <Valve className="org.jboss.web.tomcat.service.sso.ClusteredSingleSignOn" />
+ -->
+
+ <!-- Check for unclosed connections and transaction terminated checks
+ in servlets/jsps.
+
+ Important: The dependency on the CachedConnectionManager
+ in META-INF/jboss-service.xml must be uncommented, too
+ -->
+ <Valve cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager" className="org.jboss.web.tomcat.service.jca.CachedConnectionValve" transactionManagerObjectName="jboss:service=TransactionManager"/>
+
+ </Host>
+
+ </Engine>
+
+ </Service>
+
+</Server>
commit dc131685f088d8915bf2516e25a37cf916cf07e3
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 17:50:23 2011 -0500
All the node lists are zero based index. Fixing for the incorrect indexing of lists.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
index 8cff302..c2cf3a8 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -75,9 +75,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
*/
public void setPropertyValue(String propertyName, String value) {
boolean propertyFound = false;
+ NodeList nodeList = beanNode.getChildNodes();
- for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
- Node currentNode = beanNode.getChildNodes().item(i);
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node currentNode = nodeList.item(i);
if (currentNode.getNodeName().equals("property")
&& currentNode.getAttributes().getNamedItem("name") != null
@@ -131,7 +132,7 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
private Node getBeanNodeByClass(String className) {
NodeList nodeList = this.getDocument().getElementsByTagName("bean");
- for (int i = 1; i < nodeList.getLength(); i++) {
+ for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
if (node.getAttributes().getNamedItem("class") != null
@@ -150,7 +151,7 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
private Node getBeanNodeByName(String beanName) {
NodeList nodeList = this.getDocument().getElementsByTagName("bean");
- for (int i = 1; i < nodeList.getLength(); i++) {
+ for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
if (node.getAttributes().getNamedItem("name") != null
commit d1e6d46e89fb5876446fcfe42c04cf4c48a11bce
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 17:43:08 2011 -0500
Add property persistance functionality to catalina JMX listener for mod_cluster by saving the configuration directly into the server.xml file.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java
new file mode 100644
index 0000000..1b390c5
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java
@@ -0,0 +1,93 @@
+/*
+ * 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.plugins.modcluster;
+
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+import org.rhq.core.util.exception.ThrowableUtil;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.config.JBossWebServerFile;
+
+@SuppressWarnings({ "rawtypes", "deprecation" })
+public class CatalinaServiceComponent extends MBeanResourceComponent {
+ private static final String SERVER_HOME_DIR = "serverHomeDir";
+ private static final String CONFIGURATION_FILE_RELATIVE_PATH = "/deploy/jboss-web.deployer/server.xml";
+
+ @Override
+ public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ super.updateResourceConfiguration(report);
+
+ try {
+ saveResouceConfigurationToFile(report, true);
+ } catch (Exception e) {
+ }
+ }
+
+ private void saveResouceConfigurationToFile(ConfigurationUpdateReport report, boolean ignoreReadOnly) {
+ ConfigurationDefinition configurationDefinition = this.getResourceContext().getResourceType()
+ .getResourceConfigurationDefinition();
+
+ // assume we succeed - we'll set to failure if we can't set all properties
+ report.setStatus(ConfigurationUpdateStatus.SUCCESS);
+
+ try {
+ JBossWebServerFile jbossWebServerFile = getJBossWebServerFileInstance();
+
+ for (String key : report.getConfiguration().getSimpleProperties().keySet()) {
+ PropertySimple property = report.getConfiguration().getSimple(key);
+ if (property != null) {
+ try {
+ PropertyDefinitionSimple def = configurationDefinition.getPropertyDefinitionSimple(property
+ .getName());
+ if (!(ignoreReadOnly && def.isReadOnly())) {
+ jbossWebServerFile.setPropertyValue(property.getName(), property.getStringValue());
+ }
+ } catch (Exception e) {
+ property.setErrorMessage(ThrowableUtil.getStackAsString(e));
+ report
+ .setErrorMessage("Failed setting resource configuration - see property error messages for details");
+ log.info("Failure setting MBean Resource configuration value for " + key, e);
+ }
+ }
+ }
+
+ jbossWebServerFile.saveConfigurationFile();
+ } catch (Exception e) {
+ log.debug("Unable to save mod_cluster configuration file.", e);
+ }
+ }
+
+ private JBossWebServerFile getJBossWebServerFileInstance() throws Exception {
+ ModClusterServerComponent modClusterComponent = (ModClusterServerComponent) this.resourceContext
+ .getParentResourceComponent();
+
+ PropertySimple property = modClusterComponent.getResourceContext().getPluginConfiguration()
+ .getSimple(SERVER_HOME_DIR);
+
+ if (property != null) {
+ String fileName = property.getStringValue() + CONFIGURATION_FILE_RELATIVE_PATH;
+ return new JBossWebServerFile(fileName);
+ }
+
+ return null;
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
index 354fa99..45204e1 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
@@ -23,6 +23,11 @@ import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
+import org.apache.commons.lang.NotImplementedException;
+import org.w3c.dom.Attr;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
/**
@@ -31,20 +36,52 @@ import org.xml.sax.SAXException;
*/
public class JBossWebServerFile extends AbstractConfigurationFile {
- public JBossWebServerFile(String fileName) throws ParserConfigurationException, SAXException, IOException {
- super(fileName);
- // TODO Auto-generated constructor stub
+ private static final String CATALINA_LISTENER_CLASS_NAME = "org.jboss.modcluster.catalina.ModClusterListener";
+
+ private Node listenerNode;
+
+ public JBossWebServerFile(String configurationFileName) throws ParserConfigurationException, SAXException,
+ IOException {
+ super(configurationFileName);
+
+ listenerNode = this.getListenerNode();
}
@Override
- void setPropertyValue(String propertyName, String value) {
- // TODO Auto-generated method stub
+ public void setPropertyValue(String propertyName, String value) {
+ NamedNodeMap attributeList = listenerNode.getAttributes();
+ if (attributeList.getNamedItem(propertyName) != null && value != null) {
+ Node attributeNode = attributeList.getNamedItem(propertyName);
+ attributeNode.setTextContent(value);
+ } else if (attributeList.getNamedItem(propertyName) != null && value == null) {
+ attributeList.removeNamedItem(propertyName);
+ } else if (attributeList.getNamedItem(propertyName) == null && value != null) {
+ Attr property = this.getDocument().createAttribute(propertyName);
+ property.setValue(propertyName);
+ property.setTextContent(value);
+ attributeList.setNamedItem(property);
+ }
}
@Override
- String getPropertyValue(String propertyName) {
- // TODO Auto-generated method stub
+ public String getPropertyValue(String propertyName) {
+ throw new NotImplementedException(
+ "Property values should be retrieved from the JMX interface not from the configuration file.");
+ }
+
+ private Node getListenerNode() {
+ NodeList nodeList = this.getDocument().getElementsByTagName("Listener");
+
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
+
+ if (node.getAttributes().getNamedItem("className") != null
+ && CATALINA_LISTENER_CLASS_NAME.equals(node.getAttributes().getNamedItem("className").getTextContent())) {
+ return node;
+ }
+ }
+
return null;
}
}
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 3e523f7..dafb18f 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -325,7 +325,7 @@
</service>
<!-- End - Configuration for ModClusterService -->
- <service name="Catalina Service" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="Catalina Service Listener" singleton="true">
+ <service name="Catalina Service" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="CatalinaServiceComponent" supportsManualAdd="true" description="Catalina Service Listener" singleton="true">
<plugin-configuration>
<c:simple-property name="objectName" readOnly="true" default="Catalina:type=ModClusterListener,*" />
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
index cba5672..b8fca4c 100644
--- a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
@@ -20,12 +20,13 @@ package org.rhq.plugins.modcluster.test;
import org.testng.annotations.Test;
+import org.rhq.plugins.modcluster.config.JBossWebServerFile;
import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
public class ServerConfigTest {
@Test
- public void TestConfig() {
+ public void TestModClusterConfig() {
try {
//Test simple bean configuration
@@ -57,4 +58,25 @@ public class ServerConfigTest {
}
}
+ @Test
+ public void TestJBossWebConfig() {
+
+ try {
+ //Test simple bean configuration
+ JBossWebServerFile config = new JBossWebServerFile(
+ "/home/snegrea/Downloads/jboss42/server/all/deploy/jboss-web.deployer/server.xml");
+ config.setPropertyValue("processStatusFrequency", "4");
+ config.setPropertyValue("test", "5");
+ config.setPropertyValue("test", "123");
+
+ config.setPropertyValue("test", null);
+ config.setPropertyValue("processStatusFrequency", null);
+
+ config.saveConfigurationFile();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
}
commit 616b14c59c03a04144e887c73e2c290a149c202d
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 17:35:02 2011 -0500
Moved private method at the bottom fo the file to follow standard java file structure.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
index 3eb7cbe..31530d7 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
@@ -57,18 +57,6 @@ public class LoadMetricDiscoveryComponent extends MBeanResourceDiscoveryComponen
}
/**
- * @param context
- * @param objectName
- * @return
- */
- public String getBeanConfiguredClassName(ResourceDiscoveryContext<JMXComponent> context, String objectName) {
- EmsConnection connection = context.getParentResourceComponent().getEmsConnection();
- EmsBean emsBean = loadBean(connection, objectName);
-
- return emsBean.getClassTypeName();
- }
-
- /**
* Loads the bean with the given object name.
*
* Subclasses are free to override this method in order to load the bean.
@@ -89,4 +77,16 @@ public class LoadMetricDiscoveryComponent extends MBeanResourceDiscoveryComponen
}
return bean;
}
+
+ /**
+ * @param context
+ * @param objectName
+ * @return
+ */
+ private String getBeanConfiguredClassName(ResourceDiscoveryContext<JMXComponent> context, String objectName) {
+ EmsConnection connection = context.getParentResourceComponent().getEmsConnection();
+ EmsBean emsBean = loadBean(connection, objectName);
+
+ return emsBean.getClassTypeName();
+ }
}
commit 59561513dd5e014a4ae70b0abfff9ad0ef046f65
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Aug 25 15:57:38 2011 -0400
clean up some of the timeline
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp
index 978c62e..40aeac8 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp
@@ -57,8 +57,8 @@
String icon = FunctionTagLibrary.getAlertPriorityURL(alert.getAlertDefinition().getPriority());
StringBuilder buf = new StringBuilder();
for (AlertConditionLog log : alert.getConditionLogs()) {
- buf.append("<b>Condition:</b>" + log.getCondition().getName() + "<br/>");
- buf.append("<b>Value:</b>" + log.getValue() + "</b>");
+ buf.append("<b>Condition:</b> " + log.getCondition().getName() + "<br/>");
+ buf.append("<b>Value:</b> " + log.getValue());
}
String link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Alerts/History/" + alert.getId();
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp
index c1d3df5..114baf0 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp
@@ -59,13 +59,14 @@
}
String link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Inventory/ChildHistory";
-
+ String username = entry.getSubjectName();
+ String resourceName = entry.getCreatedResourceName();
%>
{ "start" : "<%=sdf.format(entry.getCreatedTime())%>",
- "title" : "Child resource created",
+ "title" : "Child Resource Created",
"link" : "<%=link%>",
- "description" : "<b>User:</b> <%=(""+entry.getSubjectName()).replaceAll("[\"']","").trim()%><br/><b>Status:</b> <%=(""+entry.getStatus()).replaceAll("[\"']","").trim()%>",
+ "description" : "<b>Resource Name:</b> <%=(""+resourceName).replaceAll("[\"']","").trim()%><br/><b>User:</b> <%=(""+username).replaceAll("[\"']","").trim()%><br/><b>Status:</b> <%=(""+entry.getStatus())%>",
"icon" : "<%=icon%>",
"color" : "<%=(entry.getStatus() != CreateResourceStatus.FAILURE ? "#4EB84E" : "#DD5656")%>"
}
@@ -96,12 +97,16 @@
}
String link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Inventory/ChildHistory";
-
+ String username = entry.getSubjectName();
+ String description = "<b>User:</b> "+ username.replaceAll("[\"']","").trim() + "<br/><b>Status:</b> " + entry.getStatus();
+ if (entry.getResource() != null) {
+ description = "<b>Resource Name:</b> " + entry.getResource().getName().replaceAll("[\"']","").trim() + "<br/>" + description;
+ }
%>
{ "start" : "<%=sdf.format(entry.getCreatedTime())%>",
- "title" : "Child resource deleted",
+ "title" : "Child Resource Deleted",
"link" : "<%=link%>",
- "description" : "<b>User:</b> <%=(""+entry.getSubjectName()).replaceAll("[\"']","").trim()%><br/><b>Status:</b> <%=(""+entry.getStatus()).replaceAll("[\"']","").trim()%>",
+ "description" : "<%= description %>",
"icon" : "<%=icon%>",
"color" : "<%=(entry.getStatus() != DeleteResourceStatus.FAILURE ? "#4EB84E" : "#DD5656")%>"
}
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp
index bb6ced8..d14ab93 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp
@@ -33,15 +33,8 @@
boolean tooManyEvents = false;
PageList<EventComposite> list =
- eventManager.findEventComposites(subject, EntityContext.forResource(resourceId), begin, end, null,
- null, null, new PageControl(0,10000, new OrderingField("timestamp", PageOrdering.ASC)));
-
- /* TODO GH: Add alert to screen
- if (list.getTotalSize() != list.size()) {
- tooManyEvents = true;
- }*/
-
-
+ eventManager.findEventComposites(subject, EntityContext.forResource(resourceId), begin, end, null,
+ null, null, new PageControl(0,10000, new OrderingField("timestamp", PageOrdering.ASC)));
%>
<%! public String trimLength(String string, int length) {
@@ -51,16 +44,16 @@
public String eventColor(EventSeverity severity) {
switch (severity) {
case DEBUG:
- return "green";
+ return "#00FF00";
case INFO:
- return "blue";
+ return "#0000FF";
case WARN:
- return "olive";
+ return "#FFA500";
case ERROR:
- return "orange";
+ return "#FF0000";
case FATAL:
default:
- return "red";
+ return "#FF0000";
}
}
@@ -81,7 +74,7 @@
return events.get(0).getTimestamp();
}
public String getEventDetail() {
- return events.size() + " events";
+ return events.size() + " Events";
}
public EventSeverity getSeverity() {
EventSeverity highestSeverity = events.get(0).getSeverity();
@@ -157,19 +150,25 @@
String color = eventColor(event.getSeverity());
String icon = FunctionTagLibrary.getEventSeverityURL(event.getSeverity(), grouped);
- String link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Events/History/" + event.getEventId();
+ String link;
+ if (grouped) {
+ link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Events/History";
+ } else {
+ link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Events/History/" + event.getEventId();
+ }
String detail = null;
if (grouped) {
StringBuilder buf = new StringBuilder();
for (EventComposite childEvent : ((GroupedEventComposite)event).events) {
+ String childColor = eventColor(childEvent.getSeverity());
buf.append("<a href='/coregui/CoreGUI.html#Resource/" + resourceId + "/Events/History/" + childEvent.getEventId() + "'>");
- buf.append("<font size=\"-1\" color=\"" + color + "\">" + escapeBackslashes(trimLength(childEvent.getEventDetail(),80)) + "</font></a><br />");
+ buf.append("<font color=\"" + childColor + "\">" + escapeBackslashes(trimLength(childEvent.getEventDetail(),80)) + "</font></a><br />");
}
detail = buf.toString();
} else {
detail = escapeBackslashes(event.getEventDetail());
- detail = "<b>Source:</b>" + escapeBackslashes(event.getSourceLocation()) + "<br/><b>Detail:</b>" + detail;
+ detail = "<b>Source:</b> " + escapeBackslashes(event.getSourceLocation()) + "<br/><b>Detail:</b> " + detail;
}
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp
index 5e28985..49fd1cb 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp
@@ -44,17 +44,7 @@
first = false;
String icon = FunctionTagLibrary.getOperationStatusURL(operation.getStatus());
-
String link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Operations/History/" + operation.getId();
-
-// out.write(
-// " <event start=\"" + sdf.format(new Date(operation.getCreatedTime())) + "\" " +
-// "title=\"Operation: " + operation.getOperationDefinition().getDisplayName() + "\" \n" +
-// "link=\"/rhq/resource/operation/resourceOperationHistoryDetails.xhtml?id=" + resourceId + "&opId=" + operation.getId() + "\" " +
-// "icon=\"" + icon + "\" >\n" +
-// "<b>User:</b> " + operation.getSubjectName() + "<br/>" +
-// "<b>Status:</b> " + operation.getStatus() +
-// " </event>\n\n");
%>
{ "start" : "<%=sdf.format(new Date(operation.getCreatedTime()))%>",
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp
index ed75a07..17683c7 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp
@@ -58,7 +58,7 @@
%>
{ "start" : "<%=sdf.format(configUpdate.getCreatedTime())%>",
- "title" : "Plugin Configuration Change",
+ "title" : "Connection Settings Change",
"link" : "<%=link%>",
"description" : "<b>User:</b> <%=(""+configUpdate.getSubjectName()).replaceAll("[\"']","").trim()%><br/><b>Status:</b> <%=(""+configUpdate.getStatus()).replaceAll("[\"']","").trim()%>",
"icon" : "<%=icon%>",
commit 4a043396e8ef668b1daddc0f00cf7e1331552685
Merge: 0540bcd 1810577
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 13:54:43 2011 -0500
Merge branch 'mod_cluster_plugin'
commit 18105773312c888d884f71541f6ed778408aee6e
Merge: fbcf5fd 0b63dbe
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 13:42:57 2011 -0500
Merge branch 'mod_cluster_plugin' of ssh://git.fedorahosted.org/git/rhq/rhq into mod_cluster_plugin
commit fbcf5fd1fe8ef454578d00c2617bde54f353ecd7
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 00:14:01 2011 -0500
Small refactoring and code formating change to make the class easier to read and understand.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
index 6abf955..8cff302 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -75,6 +75,7 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
*/
public void setPropertyValue(String propertyName, String value) {
boolean propertyFound = false;
+
for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
Node currentNode = beanNode.getChildNodes().item(i);
@@ -107,8 +108,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @return
*/
public String getPropertyValue(String propertyName) {
- for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
- Node currentNode = beanNode.getChildNodes().item(i);
+ NodeList nodeList = beanNode.getChildNodes();
+
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node currentNode = nodeList.item(i);
if (currentNode.getNodeName().equals("property")
&& currentNode.getAttributes().getNamedItem("name") != null
@@ -126,10 +129,11 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @return
*/
private Node getBeanNodeByClass(String className) {
- NodeList result = this.getDocument().getElementsByTagName("bean");
+ NodeList nodeList = this.getDocument().getElementsByTagName("bean");
+
+ for (int i = 1; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
- for (int i = 1; i < result.getLength(); i++) {
- Node node = result.item(i);
if (node.getAttributes().getNamedItem("class") != null
&& className.equals(node.getAttributes().getNamedItem("class").getTextContent())) {
return node;
@@ -144,10 +148,11 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @return
*/
private Node getBeanNodeByName(String beanName) {
- NodeList result = this.getDocument().getElementsByTagName("bean");
+ NodeList nodeList = this.getDocument().getElementsByTagName("bean");
+
+ for (int i = 1; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
- for (int i = 1; i < result.getLength(); i++) {
- Node node = result.item(i);
if (node.getAttributes().getNamedItem("name") != null
&& beanName.equals(node.getAttributes().getNamedItem("name").getTextContent())) {
return node;
@@ -163,17 +168,17 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @return
*/
private String getBeanFromConstructorArgument(Node beanNode, String constructorArgumentClassName) {
- List<Node> tempNodeList = this.getChildNodesByName(beanNode, "constructor");
+ List<Node> nodeList = this.getChildrenNodesByName(beanNode, "constructor");
- if (tempNodeList.size() > 0) {
- Node constructorNode = tempNodeList.get(0);
+ if (nodeList.size() > 0) {
+ Node constructorNode = nodeList.get(0);
- tempNodeList = this.getChildNodesByName(constructorNode, "parameter");
+ nodeList = this.getChildrenNodesByName(constructorNode, "parameter");
- if (tempNodeList.size() > 0) {
+ if (nodeList.size() > 0) {
Node parameterNode = null;
- for (Node currentNode : tempNodeList) {
+ for (Node currentNode : nodeList) {
if (currentNode.getAttributes().getNamedItem("class") != null
&& constructorArgumentClassName.equals(currentNode.getAttributes().getNamedItem("class")
.getTextContent())) {
@@ -183,10 +188,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
}
if (parameterNode != null) {
- tempNodeList = this.getChildNodesByName(parameterNode, "inject");
+ nodeList = this.getChildrenNodesByName(parameterNode, "inject");
- if (tempNodeList.size() > 0) {
- Node injectNode = tempNodeList.get(0);
+ if (nodeList.size() > 0) {
+ Node injectNode = nodeList.get(0);
Node beanAttribute = injectNode.getAttributes().getNamedItem("bean");
if (beanAttribute != null) {
@@ -205,17 +210,17 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @param nodeName
* @return
*/
- private List<Node> getChildNodesByName(Node node, String nodeName) {
- List<Node> listOfNodes = new ArrayList<Node>();
+ private List<Node> getChildrenNodesByName(Node node, String nodeName) {
+ List<Node> nodeList = new ArrayList<Node>();
for (int i = 0; i < node.getChildNodes().getLength(); i++) {
Node currentNode = node.getChildNodes().item(i);
if (nodeName.equals(currentNode.getNodeName())) {
- listOfNodes.add(currentNode);
+ nodeList.add(currentNode);
}
}
- return listOfNodes;
+ return nodeList;
}
}
commit 0967165a89cef5268c8dcf6834b71cdefbb31032
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 00:12:49 2011 -0500
Added the proxyInfo metric back to Catalina service context since it is readly available.
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 6f46849..3e523f7 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -374,6 +374,7 @@
</operation>
<metric property="proxyConfiguration" displayName="Proxy Configuration" displayType="summary" dataType="trait" />
+ <metric property="proxyInfo" displayName="Proxy Info" displayType="summary" dataType="trait" />
<metric property="modelerType" displayName="Type of the modeled resource" displayType="summary" dataType="trait" />
<metric property="className" displayName="Fully qualified class name of the managed object" displayType="summary" dataType="trait" />
<metric property="advertise" displayName="Enable autodiscovery of httpd servers." displayType="summary" dataType="trait" />
commit 0a99815d01e6cf0d5554cc4c86bcac3b63d3bce6
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Wed Aug 24 11:18:01 2011 -0500
More updates to the naming of each plugin component to match the intent and purpose. Also updated the integration tests to test each resource type.
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModClusterPluginIntegrationTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModClusterPluginIntegrationTest.java
new file mode 100644
index 0000000..625163b
--- /dev/null
+++ b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModClusterPluginIntegrationTest.java
@@ -0,0 +1,229 @@
+/*
+ * 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.plugins.modcluster.test;
+
+import java.io.File;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.Queue;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+
+import org.rhq.core.clientapi.server.discovery.InventoryReport;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.measurement.MeasurementData;
+import org.rhq.core.domain.measurement.MeasurementDefinition;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.pc.PluginContainer;
+import org.rhq.core.pc.PluginContainerConfiguration;
+import org.rhq.core.pc.plugin.FileSystemPluginFinder;
+import org.rhq.core.pc.plugin.PluginEnvironment;
+import org.rhq.core.pc.plugin.PluginManager;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.measurement.MeasurementFacet;
+import org.rhq.core.pluginapi.operation.OperationFacet;
+import org.rhq.core.pluginapi.operation.OperationResult;
+
+/**
+ * @author Stefan Negrea
+ */
+@SuppressWarnings("rawtypes")
+@Test(groups = "modcluster-plugin")
+public class ModClusterPluginIntegrationTest {
+ private Log log = LogFactory.getLog(this.getClass());
+ private static final String PLUGIN_NAME = "mod_cluster";
+
+ @BeforeSuite
+ public void start() {
+ try {
+ File pluginDir = new File("target/testsetup/plugins");
+ PluginContainerConfiguration pcConfig = new PluginContainerConfiguration();
+ pcConfig.setPluginFinder(new FileSystemPluginFinder(pluginDir));
+ pcConfig.setPluginDirectory(pluginDir);
+
+ pcConfig.setInsideAgent(false);
+ PluginContainer.getInstance().setConfiguration(pcConfig);
+ PluginContainer.getInstance().initialize();
+ log.info("PC started.");
+ for (String plugin : PluginContainer.getInstance().getPluginManager().getMetadataManager().getPluginNames()) {
+ log.info("...Loaded plugin: " + plugin);
+ }
+ } catch (Exception e) {
+ log.info("Error initializing the context", e);
+ }
+ }
+
+ @AfterSuite
+ public void stop() {
+ PluginContainer.getInstance().shutdown();
+ }
+
+ @Test
+ public void testPluginLoad() {
+ PluginManager pluginManager = PluginContainer.getInstance().getPluginManager();
+ PluginEnvironment pluginEnvironment = pluginManager.getPlugin(PLUGIN_NAME);
+ assert (pluginEnvironment != null) : "Null environment, plugin not loaded";
+ assert (pluginEnvironment.getPluginName().equals(PLUGIN_NAME));
+ }
+
+ @Test(dependsOnMethods = "testPluginLoad")
+ public void testDiscovery() throws Exception {
+ InventoryReport report = PluginContainer.getInstance().getInventoryManager().executeServerScanImmediately();
+ assert report != null;
+ log.info("Discovery took: " + (report.getEndTime() - report.getStartTime()) + "ms");
+
+ Thread.sleep(1000);
+
+ report = PluginContainer.getInstance().getInventoryManager().executeServiceScanImmediately();
+ assert report != null;
+ log.info("Discovery took: " + (report.getEndTime() - report.getStartTime()) + "ms");
+
+ Set<Resource> resources = findResource(PluginContainer.getInstance().getInventoryManager().getPlatform());
+ log.info("Found " + resources.size() + " mod_cluster and mod_cluster_context instance(s).");
+
+ assert (resources.size() != 0) : "No mod_cluster or related instances found.";
+
+ if (resources.size() != 0) {
+ for (Object objectResource : resources.toArray()) {
+ Resource resource = (Resource) objectResource;
+ if (resource.getResourceType().getName().equals("mod_cluster")) {
+ testMainResource(resource);
+ } else if (resource.getResourceType().getName().equals("Webapp Context")) {
+ testWebappContext(resource);
+ } else if (resource.getResourceType().getName().equals("HA Service Configuration")) {
+ testLoadServiceConfiguration(resource);
+ } else if (resource.getResourceType().getName().equals("HA Service")) {
+ testServiceMeasurement(resource);
+ testServiceMethodInvocation(resource);
+ }
+ }
+ }
+ }
+
+ private void testServiceMethodInvocation(Resource resource) throws InterruptedException, Exception {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+
+ Configuration config = new Configuration();
+ config.put(new PropertySimple("p1", "1"));
+ config.put(new PropertySimple("p2", java.util.concurrent.TimeUnit.SECONDS));
+ OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("stop", config);
+ log.info("Result of operation stopContext was: " + result.getSimpleResult());
+ }
+
+ private void testLoadServiceConfiguration(Resource resource) throws Exception {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+ ((ConfigurationFacet) resourceComponent).loadResourceConfiguration();
+ }
+
+ private void testServiceMeasurement(Resource resource) throws Exception {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+
+ if (resourceComponent instanceof MeasurementFacet) {
+ for (MeasurementDefinition def : resource.getResourceType().getMetricDefinitions()) {
+ Set<MeasurementScheduleRequest> metricList = new HashSet<MeasurementScheduleRequest>();
+ metricList.add(new MeasurementScheduleRequest(1, def.getName(), 1000, true, def.getDataType(), null));
+ MeasurementReport report = new MeasurementReport();
+ ((MeasurementFacet) resourceComponent).getValues(report, metricList);
+
+ MeasurementData data = report.getTraitData().iterator().next();
+ assert data != null : "Unable to collect trait [" + def.getName() + "] on " + resource;
+ log.info("Measurement: " + def.getName() + "=" + data.getValue());
+ }
+ }
+ }
+
+ private void testMainResource(Resource resource) throws Exception {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+
+ if (resourceComponent instanceof OperationFacet) {
+ OperationResult result = null;
+
+ result = ((OperationFacet) resourceComponent).invokeOperation("reset", new Configuration());
+ log.info("Result of operation test was: " + result);
+
+ result = ((OperationFacet) resourceComponent).invokeOperation("refresh", new Configuration());
+ log.info("Result of operation test was: " + result);
+ }
+ }
+
+ private void testWebappContext(Resource resource) throws Exception {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+
+ if (resourceComponent instanceof OperationFacet) {
+ try {
+ OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("enableContext", null);
+ log.info("Result of operation " + "enableContext" + " was: " + result.getSimpleResult());
+
+ Configuration config = new Configuration();
+ config.put(new PropertySimple("timeout", "1"));
+ config.put(new PropertySimple("unit", java.util.concurrent.TimeUnit.SECONDS));
+ result = ((OperationFacet) resourceComponent).invokeOperation("stopContext", config);
+ log.info("Result of operation stopContext was: " + result.getSimpleResult());
+
+ result = ((OperationFacet) resourceComponent).invokeOperation("enableContext", null);
+ log.info("Result of operation enableContext was: " + result.getSimpleResult());
+
+ result = ((OperationFacet) resourceComponent).invokeOperation("disableContext", null);
+ log.info("Result of operation disableContext was: " + result.getSimpleResult());
+
+ } catch (Exception e) {
+ log.info("Operation failed. ", e);
+ }
+
+ }
+ }
+
+ private Set<Resource> findResource(Resource parent) {
+ Set<Resource> found = new HashSet<Resource>();
+
+ Queue<Resource> discoveryQueue = new LinkedList<Resource>();
+ discoveryQueue.add(parent);
+
+ while (!discoveryQueue.isEmpty()) {
+ Resource currentResource = discoveryQueue.poll();
+
+ log.info("Discovered resource of type: " + currentResource.getResourceType().getName());
+ if (currentResource.getResourceType().getPlugin().equals(PLUGIN_NAME)) {
+ found.add(currentResource);
+ }
+
+ if (currentResource.getChildResources() != null) {
+ for (Resource child : currentResource.getChildResources()) {
+ discoveryQueue.add(child);
+ }
+ }
+ }
+
+ return found;
+ }
+}
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
deleted file mode 100644
index f27b153..0000000
--- a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
+++ /dev/null
@@ -1,228 +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.plugins.modcluster.test;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Queue;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.testng.annotations.AfterSuite;
-import org.testng.annotations.BeforeSuite;
-import org.testng.annotations.Test;
-
-import org.rhq.core.clientapi.server.discovery.InventoryReport;
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.domain.measurement.MeasurementData;
-import org.rhq.core.domain.measurement.MeasurementDefinition;
-import org.rhq.core.domain.measurement.MeasurementReport;
-import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.pc.PluginContainer;
-import org.rhq.core.pc.PluginContainerConfiguration;
-import org.rhq.core.pc.plugin.FileSystemPluginFinder;
-import org.rhq.core.pc.plugin.PluginEnvironment;
-import org.rhq.core.pc.plugin.PluginManager;
-import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
-import org.rhq.core.pluginapi.inventory.ResourceComponent;
-import org.rhq.core.pluginapi.measurement.MeasurementFacet;
-import org.rhq.core.pluginapi.operation.OperationFacet;
-import org.rhq.core.pluginapi.operation.OperationResult;
-
-/**
- * @author Stefan Negrea
- */
-@SuppressWarnings("rawtypes")
-@Test(groups = "modcluster-plugin")
-public class ModclusterPluginTest {
- private Log log = LogFactory.getLog(this.getClass());
- private static final String PLUGIN_NAME = "mod_cluster";
-
- @BeforeSuite
- public void start() {
- try {
- File pluginDir = new File("target/testsetup/plugins");
- PluginContainerConfiguration pcConfig = new PluginContainerConfiguration();
- pcConfig.setPluginFinder(new FileSystemPluginFinder(pluginDir));
- pcConfig.setPluginDirectory(pluginDir);
-
- pcConfig.setInsideAgent(false);
- PluginContainer.getInstance().setConfiguration(pcConfig);
- PluginContainer.getInstance().initialize();
- log.info("PC started.");
- for (String plugin : PluginContainer.getInstance().getPluginManager().getMetadataManager().getPluginNames()) {
- log.info("...Loaded plugin: " + plugin);
- }
- } catch (Exception e) {
- log.info("Error initializing the context", e);
- }
- }
-
- @AfterSuite
- public void stop() {
- PluginContainer.getInstance().shutdown();
- }
-
- @Test
- public void testPluginLoad() {
- PluginManager pluginManager = PluginContainer.getInstance().getPluginManager();
- PluginEnvironment pluginEnvironment = pluginManager.getPlugin(PLUGIN_NAME);
- assert (pluginEnvironment != null) : "Null environment, plugin not loaded";
- assert (pluginEnvironment.getPluginName().equals(PLUGIN_NAME));
- }
-
- @Test(dependsOnMethods = "testPluginLoad")
- public void testDiscovery() throws Exception {
- InventoryReport report = PluginContainer.getInstance().getInventoryManager().executeServerScanImmediately();
- assert report != null;
- log.info("Discovery took: " + (report.getEndTime() - report.getStartTime()) + "ms");
-
- Thread.sleep(1000);
-
- report = PluginContainer.getInstance().getInventoryManager().executeServiceScanImmediately();
- assert report != null;
- log.info("Discovery took: " + (report.getEndTime() - report.getStartTime()) + "ms");
-
- List<String> typeNames = new ArrayList<String>() {
- private static final long serialVersionUID = 1L;
-
- {
- add(PLUGIN_NAME);
- add("Webapp Context");
- add("HA Service Configuration");
- add("HA Service");
- }
- };
-
- Set<Resource> resources = findResource(PluginContainer.getInstance().getInventoryManager().getPlatform(),
- typeNames);
- log.info("Found " + resources.size() + " mod_cluster and mod_cluster_context instance(s).");
-
- assert (resources.size() != 0) : "No mod_cluster or related instances found.";
-
- if (resources.size() != 0) {
- for (Object objectResource : resources.toArray()) {
- Resource resource = (Resource) objectResource;
- if (resource.getResourceType().getName().equals("mod_cluster")) {
- testResourceMeasurement(resource);
- } else if (resource.getResourceType().getName().equals("Webapp Context")) {
- testContextOperations(resource);
- } else if (resource.getResourceType().getName().equals("HA Service Configuration")) {
- ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
- .getResourceComponent(resource);
- ((ConfigurationFacet) resourceComponent).loadResourceConfiguration();
- } else if (resource.getResourceType().getName().equals("HA Service")) {
- ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
- .getResourceComponent(resource);
-
- Configuration config = new Configuration();
- config.put(new PropertySimple("p1", "1"));
- config.put(new PropertySimple("p2", java.util.concurrent.TimeUnit.SECONDS));
- OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("stop", config);
- log.info("Result of operation stopContext was: " + result.getSimpleResult());
- }
- }
- }
- }
-
- private void testResourceMeasurement(Resource resource) throws Exception {
- ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
- .getResourceComponent(resource);
- if (resourceComponent instanceof MeasurementFacet) {
- for (MeasurementDefinition def : resource.getResourceType().getMetricDefinitions()) {
- Set<MeasurementScheduleRequest> metricList = new HashSet<MeasurementScheduleRequest>();
- metricList.add(new MeasurementScheduleRequest(1, def.getName(), 1000, true, def.getDataType(), null));
- MeasurementReport report = new MeasurementReport();
- ((MeasurementFacet) resourceComponent).getValues(report, metricList);
-
- MeasurementData data = report.getTraitData().iterator().next();
- assert data != null : "Unable to collect trait [" + def.getName() + "] on " + resource;
- log.info("Measurement: " + def.getName() + "=" + data.getValue());
- }
- }
-
- if (resourceComponent instanceof OperationFacet) {
- OperationResult result = null;
-
- result = ((OperationFacet) resourceComponent).invokeOperation("reset", new Configuration());
- log.info("Result of operation test was: " + result);
-
- result = ((OperationFacet) resourceComponent).invokeOperation("disable", new Configuration());
- log.info("Result of operation test was: " + result.getSimpleResult());
- }
- }
-
- private void testContextOperations(Resource resource) throws Exception {
- ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
- .getResourceComponent(resource);
-
- if (resourceComponent instanceof OperationFacet) {
- try {
- OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("enableContext", null);
- log.info("Result of operation " + "enableContext" + " was: " + result.getSimpleResult());
-
- Configuration config = new Configuration();
- config.put(new PropertySimple("timeout", "1"));
- config.put(new PropertySimple("unit", java.util.concurrent.TimeUnit.SECONDS));
- result = ((OperationFacet) resourceComponent).invokeOperation("stopContext", config);
- log.info("Result of operation stopContext was: " + result.getSimpleResult());
-
- result = ((OperationFacet) resourceComponent).invokeOperation("enableContext", null);
- log.info("Result of operation enableContext was: " + result.getSimpleResult());
-
- result = ((OperationFacet) resourceComponent).invokeOperation("disableContext", null);
- log.info("Result of operation disableContext was: " + result.getSimpleResult());
-
- } catch (Exception e) {
- log.info("Operation failed. ", e);
- }
-
- }
- }
-
- private Set<Resource> findResource(Resource parent, List<String> typeNames) {
- Set<Resource> found = new HashSet<Resource>();
-
- Queue<Resource> discoveryQueue = new LinkedList<Resource>();
- discoveryQueue.add(parent);
-
- while (!discoveryQueue.isEmpty()) {
- Resource currentResource = discoveryQueue.poll();
-
- log.info("Discovered resource of type: " + currentResource.getResourceType().getName());
- if (typeNames.contains(currentResource.getResourceType().getName())) {
- found.add(currentResource);
- }
-
- if (currentResource.getChildResources() != null) {
- for (Resource child : currentResource.getChildResources()) {
- discoveryQueue.add(child);
- }
- }
- }
-
- return found;
- }
-}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
index b9ce25e..b854398 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
@@ -89,7 +89,7 @@ public class ClassNameMBeanDiscoveryComponent<T extends JMXComponent> extends MB
emsConnection.queryBeans(objectName);
bean = emsConnection.getBean(objectName);
}
+
return bean;
}
-
-}
\ No newline at end of file
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
deleted file mode 100644
index 4c8b437..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
+++ /dev/null
@@ -1,116 +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.plugins.modcluster;
-
-import java.util.concurrent.TimeUnit;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.mc4j.ems.connection.bean.EmsBean;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.measurement.AvailabilityType;
-import org.rhq.core.pluginapi.operation.OperationResult;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
-import org.rhq.plugins.modcluster.helper.JBossHelper;
-
-/**
- * Manages a mod_cluster context entity.
- *
- * @author Stefan Negrea
- */
-@SuppressWarnings({ "rawtypes", "deprecation" })
-public class ContextComponent extends MBeanResourceComponent<MBeanResourceComponent> {
-
- private static final Log log = LogFactory.getLog(ContextComponent.class);
-
- @Override
- protected EmsBean loadBean() {
- return getResourceContext().getParentResourceComponent().getEmsBean();
- }
-
- @Override
- public AvailabilityType getAvailability() {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- try {
- Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
- String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
-
- ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
-
- ProxyInfo.Context context = ProxyInfo.Context.fromString(resourceContext.getResourceKey());
-
- int indexOfCurrentContext = proxyInfo.getAvailableContexts().indexOf(context);
-
- if (indexOfCurrentContext != -1) {
- ProxyInfo.Context currentContext = proxyInfo.getAvailableContexts().get(indexOfCurrentContext);
-
- if (currentContext.isEnabled()) {
- return AvailabilityType.UP;
- }
- }
-
- return AvailabilityType.DOWN;
- } catch (Exception e) {
- log.info(e);
- return AvailabilityType.DOWN;
- } finally {
- Thread.currentThread().setContextClassLoader(cl);
- }
- }
-
- @Override
- public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
- if ("enableContext".equals(name) || "disableContext".equals(name) || "stopContext".equals(name)) {
-
- ProxyInfo.Context context = ProxyInfo.Context.fromString(resourceContext.getResourceKey());
-
- Object[] configuration = null;
- if ("stopContext".equals(name)) {
- configuration = new Object[] { context.getHost(), context.getPath(),
- parameters.getSimple("timeout").getLongValue(),
- TimeUnit.valueOf(parameters.getSimple("unit").getStringValue()) };
- } else {
- configuration = new Object[] { context.getHost(), context.getPath() };
- }
-
- if (context.getPath().equals("/")) {
- configuration[1] = "ROOT";
- }
-
- log.info(name + " - " + context.getHost() + " " + context.getPath());
-
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- try {
- Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
- Object resultObject = getEmsBean().getOperation(name).invoke(configuration);
-
- if (resultObject instanceof OperationResult) {
- return (OperationResult) resultObject;
- } else {
- return new OperationResult(String.valueOf(resultObject));
- }
- } finally {
- Thread.currentThread().setContextClassLoader(cl);
- }
- }
-
- throw new Exception("Operation " + name + " not available mod_cluster WebApp service.");
- }
-}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java
deleted file mode 100644
index 788cbce..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java
+++ /dev/null
@@ -1,104 +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.plugins.modcluster;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.mc4j.ems.connection.EmsConnection;
-import org.mc4j.ems.connection.bean.EmsBean;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
-import org.rhq.plugins.modcluster.helper.JBossHelper;
-
-/**
- * Discovers mod_cluster contexts from the proxyInfo mbean property.
- *
- * @author Stefan Negrea
- */
-@SuppressWarnings("rawtypes")
-public class ContextDiscoveryComponent implements ResourceDiscoveryComponent<MBeanResourceComponent> {
-
- private static final String JVM_ROUTE_PROPERTY = "jvmRoute";
- private static final String ENGINE_OBJECT_NAME = "engineObjectName";
-
- /* (non-Javadoc)
- * @see org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext)
- */
- public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<MBeanResourceComponent> context) {
- String jvmRoute = this.getJvmRoute(context);
-
- EmsBean configBean = context.getParentResourceComponent().getEmsBean();
- String rawProxyInfo = JBossHelper.getRawProxyInfo(configBean);
-
- ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
- Set<DiscoveredResourceDetails> entities = new HashSet<DiscoveredResourceDetails>();
-
- for (ProxyInfo.Context availableContext : proxyInfo.getAvailableContexts()) {
- if (availableContext.getJvmRoute().equals(jvmRoute)) {
- DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(),
- availableContext.createKey(), availableContext.createName(), null, "Webapp Context", null, null);
- entities.add(detail);
- }
- }
-
- return entities;
- }
-
- /**
- * Retrieves the jvm route for the node from the parent context.
- *
- * @param context the discovery context
- * @return node's jvm route
- */
- private String getJvmRoute(ResourceDiscoveryContext<MBeanResourceComponent> context) {
- Configuration pluginConfig = context.getParentResourceComponent().getResourceContext().getPluginConfiguration();
- String engineObjectName = pluginConfig.getSimple(ENGINE_OBJECT_NAME).getStringValue();
- EmsBean engineBean = this.loadBean(engineObjectName, context.getParentResourceComponent());
-
- return (String) engineBean.getAttribute(JVM_ROUTE_PROPERTY).refresh().toString();
- }
-
- /**
- * Loads the bean with the given object name.
- *
- * Subclasses are free to override this method in order to load the bean.
- *
- * @param objectName the name of the bean to load
- * @return the bean that is loaded
- */
- protected EmsBean loadBean(String objectName, MBeanResourceComponent context) {
- EmsConnection emsConnection = context.getEmsConnection();
- EmsBean bean = emsConnection.getBean(objectName);
- if (bean == null) {
- // In some cases, this resource component may have been discovered by some means other than querying its
- // parent's EMSConnection (e.g. ApplicationDiscoveryComponent uses a filesystem to discover EARs and
- // WARs that are not yet deployed). In such cases, getBean() will return null, since EMS won't have the
- // bean in its cache. To cover such cases, make an attempt to query the underlying MBeanServer for the
- // bean before giving up.
- emsConnection.queryBeans(objectName);
- bean = emsConnection.getBean(objectName);
- }
- return bean;
- }
-}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
index 7d5f0dc..0db722e 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
@@ -21,6 +21,7 @@ package org.rhq.plugins.modcluster;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.plugins.jmx.MBeanResourceComponent;
import org.rhq.plugins.modcluster.helper.JBossHelper;
+import org.rhq.plugins.modcluster.model.ProxyInfo;
/**
* @author Stefan Negrea
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ProxyInfo.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ProxyInfo.java
deleted file mode 100644
index 8614402..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ProxyInfo.java
+++ /dev/null
@@ -1,310 +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.plugins.modcluster;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Simple parser for the raw proxy information provided by mod_cluster.
- *
- * @author Stefan Negrea
- */
-public class ProxyInfo {
-
- private Map<String, Node> availableNodes = new HashMap<String, Node>();
- private Map<String, Vhost> availableVhosts = new HashMap<String, Vhost>();
- private List<Context> availableContexts = new ArrayList<ProxyInfo.Context>();
-
- public ProxyInfo(String rawProxyInfo) {
- parseNodes(rawProxyInfo);
- parseVhosts(rawProxyInfo);
- parseContexts(rawProxyInfo);
- }
-
- private void parseNodes(String rawProxyInfo) {
- Pattern nodePattern = Pattern.compile("Node:.*\n");
- Matcher nodeMatcher = nodePattern.matcher(rawProxyInfo);
- while (nodeMatcher.find()) {
- String rawNode = nodeMatcher.group();
- String[] nodePieces = rawNode.split(",");
-
- String identifier = nodePieces[0];
- identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
-
- String jvmRoute = nodePieces[1];
- jvmRoute = jvmRoute.substring(jvmRoute.indexOf(':') + 1).trim();
-
- availableNodes.put(identifier, new Node(jvmRoute, identifier));
- }
- }
-
- private void parseVhosts(String rawProxyInfo) {
- Pattern vhostPattern = Pattern.compile("Vhost:.*\n");
- Matcher vhostMatcher = vhostPattern.matcher(rawProxyInfo);
- while (vhostMatcher.find()) {
- String rawVhost = vhostMatcher.group();
- String[] vhostPieces = rawVhost.split(",");
-
- String identifier = vhostPieces[0].trim();
- identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
- identifier = identifier.substring(0, identifier.lastIndexOf(":"));
-
- String host = vhostPieces[1].trim();
- host = host.substring(host.indexOf(":") + 1).trim();
-
- availableVhosts.put(identifier, new Vhost(identifier, host));
- }
- }
-
- private void parseContexts(String rawProxyInfo) {
- Pattern contextPattern = Pattern.compile("Context:.*[\n|}]");
- Matcher contextMatcher = contextPattern.matcher(rawProxyInfo);
- while (contextMatcher.find()) {
- String rawContext = contextMatcher.group();
- String[] contextPieces = rawContext.split(",");
- String actualContext = contextPieces[1].substring(contextPieces[1].indexOf("/")).trim();
-
- String identifier = contextPieces[0];
- identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
- identifier = identifier.substring(0, identifier.lastIndexOf(":"));
-
- String nodeIdentifier = contextPieces[0];
- nodeIdentifier = nodeIdentifier.substring(nodeIdentifier.indexOf("[") + 1, nodeIdentifier.indexOf("]"));
- nodeIdentifier = nodeIdentifier.substring(0, nodeIdentifier.indexOf(":"));
- String jvmRoute = availableNodes.get(nodeIdentifier).getJvmRoute();
-
- String rawIsEnabled = contextPieces[2];
- rawIsEnabled = rawIsEnabled.substring(rawIsEnabled.indexOf(':') + 1).trim();
- boolean isEnabled = rawIsEnabled.equals("ENABLED") ? true : false;
-
- Vhost relatedVhost = availableVhosts.get(identifier);
-
- availableContexts.add(new Context(jvmRoute, relatedVhost.getHost(), actualContext, isEnabled));
- }
- }
-
- public List<Context> getAvailableContexts() {
- return Collections.unmodifiableList(availableContexts);
- }
-
- public List<Vhost> getAvailableVhosts() {
- return Collections.unmodifiableList(new ArrayList<Vhost>(availableVhosts.values()));
- }
-
- public List<Node> getAvailableNodes() {
- return Collections.unmodifiableList(new ArrayList<Node>(availableNodes.values()));
- }
-
- public static class Node {
- private String jvmRoute;
- private String nodeId;
-
- public Node(String jvmRoute, String nodeId) {
- this.jvmRoute = jvmRoute;
- this.nodeId = nodeId;
- }
-
- public String getNodeId() {
- return nodeId;
- }
-
- public String getJvmRoute() {
- return jvmRoute;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((jvmRoute == null) ? 0 : jvmRoute.hashCode());
- result = prime * result + ((nodeId == null) ? 0 : nodeId.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Node other = (Node) obj;
- if (jvmRoute == null) {
- if (other.jvmRoute != null)
- return false;
- } else if (!jvmRoute.equals(other.jvmRoute))
- return false;
- if (nodeId == null) {
- if (other.nodeId != null)
- return false;
- } else if (!nodeId.equals(other.nodeId))
- return false;
- return true;
- }
- }
-
- public static class Vhost {
- private String identifier;
- private String host;
-
- public Vhost(String identifier, String host) {
- this.identifier = identifier;
- this.host = host;
- }
-
- public String getIdentifier() {
- return identifier;
- }
-
- public String getHost() {
- return host;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((host == null) ? 0 : host.hashCode());
- result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Vhost other = (Vhost) obj;
- if (host == null) {
- if (other.host != null)
- return false;
- } else if (!host.equals(other.host))
- return false;
- if (identifier == null) {
- if (other.identifier != null)
- return false;
- } else if (!identifier.equals(other.identifier))
- return false;
- return true;
- }
- }
-
- public static class Context {
- private String path;
- private String host;
- private String jvmRoute;
- private boolean isEnabled;
-
- public Context(String jvmRoute, String host, String path) {
- this(jvmRoute, host, path, false);
- }
-
- public Context(String jvmRoute, String host, String path, boolean isEnabled) {
- this.jvmRoute = jvmRoute;
- this.host = host;
- this.path = path;
- this.isEnabled = isEnabled;
- }
-
- public String getPath() {
- return path;
- }
-
- public String getHost() {
- return host;
- }
-
- public String getJvmRoute() {
- return jvmRoute;
- }
-
- public boolean isEnabled() {
- return isEnabled;
- }
-
- public String createKey() {
- return jvmRoute + ":" + host + ":" + path;
- }
-
- public String createName() {
- return host + ":" + path;
- }
-
- @Override
- public String toString() {
- return createKey();
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((host == null) ? 0 : host.hashCode());
- result = prime * result + ((jvmRoute == null) ? 0 : jvmRoute.hashCode());
- result = prime * result + ((path == null) ? 0 : path.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Context other = (Context) obj;
- if (host == null) {
- if (other.host != null)
- return false;
- } else if (!host.equals(other.host))
- return false;
- if (jvmRoute == null) {
- if (other.jvmRoute != null)
- return false;
- } else if (!jvmRoute.equals(other.jvmRoute))
- return false;
- if (path == null) {
- if (other.path != null)
- return false;
- } else if (!path.equals(other.path))
- return false;
- return true;
- }
-
- public static Context fromString(String stringRepresentation) throws Exception {
- String parts[] = stringRepresentation.trim().split(":");
- if (parts.length < 3) {
- throw new Exception("Parsing error. Not enough information to create a context.");
- }
-
- return new Context(parts[0], parts[1], parts[2]);
- }
- }
-}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextComponent.java
new file mode 100644
index 0000000..6131578
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextComponent.java
@@ -0,0 +1,117 @@
+/*
+ * 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.plugins.modcluster;
+
+import java.util.concurrent.TimeUnit;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.mc4j.ems.connection.bean.EmsBean;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.pluginapi.operation.OperationResult;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
+import org.rhq.plugins.modcluster.model.ProxyInfo;
+
+/**
+ * Manages a mod_cluster context entity.
+ *
+ * @author Stefan Negrea
+ */
+@SuppressWarnings({ "rawtypes", "deprecation" })
+public class WebappContextComponent extends MBeanResourceComponent<MBeanResourceComponent> {
+
+ private static final Log log = LogFactory.getLog(WebappContextComponent.class);
+
+ @Override
+ protected EmsBean loadBean() {
+ return getResourceContext().getParentResourceComponent().getEmsBean();
+ }
+
+ @Override
+ public AvailabilityType getAvailability() {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
+
+ ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
+
+ ProxyInfo.Context context = ProxyInfo.Context.fromString(resourceContext.getResourceKey());
+
+ int indexOfCurrentContext = proxyInfo.getAvailableContexts().indexOf(context);
+
+ if (indexOfCurrentContext != -1) {
+ ProxyInfo.Context currentContext = proxyInfo.getAvailableContexts().get(indexOfCurrentContext);
+
+ if (currentContext.isEnabled()) {
+ return AvailabilityType.UP;
+ }
+ }
+
+ return AvailabilityType.DOWN;
+ } catch (Exception e) {
+ log.info(e);
+ return AvailabilityType.DOWN;
+ } finally {
+ Thread.currentThread().setContextClassLoader(cl);
+ }
+ }
+
+ @Override
+ public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
+ if ("enableContext".equals(name) || "disableContext".equals(name) || "stopContext".equals(name)) {
+
+ ProxyInfo.Context context = ProxyInfo.Context.fromString(resourceContext.getResourceKey());
+
+ Object[] configuration = null;
+ if ("stopContext".equals(name)) {
+ configuration = new Object[] { context.getHost(), context.getPath(),
+ parameters.getSimple("timeout").getLongValue(),
+ TimeUnit.valueOf(parameters.getSimple("unit").getStringValue()) };
+ } else {
+ configuration = new Object[] { context.getHost(), context.getPath() };
+ }
+
+ if (context.getPath().equals("/")) {
+ configuration[1] = "ROOT";
+ }
+
+ log.info(name + " - " + context.getHost() + " " + context.getPath());
+
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
+ Object resultObject = getEmsBean().getOperation(name).invoke(configuration);
+
+ if (resultObject instanceof OperationResult) {
+ return (OperationResult) resultObject;
+ } else {
+ return new OperationResult(String.valueOf(resultObject));
+ }
+ } finally {
+ Thread.currentThread().setContextClassLoader(cl);
+ }
+ }
+
+ throw new Exception("Operation " + name + " not available mod_cluster WebApp service.");
+ }
+}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextDiscoveryComponent.java
new file mode 100644
index 0000000..559e1b6
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextDiscoveryComponent.java
@@ -0,0 +1,105 @@
+/*
+ * 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.plugins.modcluster;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.mc4j.ems.connection.EmsConnection;
+import org.mc4j.ems.connection.bean.EmsBean;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
+import org.rhq.plugins.modcluster.model.ProxyInfo;
+
+/**
+ * Discovers mod_cluster contexts from the proxyInfo mbean property.
+ *
+ * @author Stefan Negrea
+ */
+@SuppressWarnings("rawtypes")
+public class WebappContextDiscoveryComponent implements ResourceDiscoveryComponent<MBeanResourceComponent> {
+
+ private static final String JVM_ROUTE_PROPERTY = "jvmRoute";
+ private static final String ENGINE_OBJECT_NAME = "engineObjectName";
+
+ /* (non-Javadoc)
+ * @see org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext)
+ */
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<MBeanResourceComponent> context) {
+ String jvmRoute = this.getJvmRoute(context);
+
+ EmsBean configBean = context.getParentResourceComponent().getEmsBean();
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(configBean);
+
+ ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
+ Set<DiscoveredResourceDetails> entities = new HashSet<DiscoveredResourceDetails>();
+
+ for (ProxyInfo.Context availableContext : proxyInfo.getAvailableContexts()) {
+ if (availableContext.getJvmRoute().equals(jvmRoute)) {
+ DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(),
+ availableContext.createKey(), availableContext.createName(), null, "Webapp Context", null, null);
+ entities.add(detail);
+ }
+ }
+
+ return entities;
+ }
+
+ /**
+ * Retrieves the jvm route for the node from the parent context.
+ *
+ * @param context the discovery context
+ * @return node's jvm route
+ */
+ private String getJvmRoute(ResourceDiscoveryContext<MBeanResourceComponent> context) {
+ Configuration pluginConfig = context.getParentResourceComponent().getResourceContext().getPluginConfiguration();
+ String engineObjectName = pluginConfig.getSimple(ENGINE_OBJECT_NAME).getStringValue();
+ EmsBean engineBean = this.loadBean(engineObjectName, context.getParentResourceComponent());
+
+ return (String) engineBean.getAttribute(JVM_ROUTE_PROPERTY).refresh().toString();
+ }
+
+ /**
+ * Loads the bean with the given object name.
+ *
+ * Subclasses are free to override this method in order to load the bean.
+ *
+ * @param objectName the name of the bean to load
+ * @return the bean that is loaded
+ */
+ protected EmsBean loadBean(String objectName, MBeanResourceComponent context) {
+ EmsConnection emsConnection = context.getEmsConnection();
+ EmsBean bean = emsConnection.getBean(objectName);
+ if (bean == null) {
+ // In some cases, this resource component may have been discovered by some means other than querying its
+ // parent's EMSConnection (e.g. ApplicationDiscoveryComponent uses a filesystem to discover EARs and
+ // WARs that are not yet deployed). In such cases, getBean() will return null, since EMS won't have the
+ // bean in its cache. To cover such cases, make an attempt to query the underlying MBeanServer for the
+ // bean before giving up.
+ emsConnection.queryBeans(objectName);
+ bean = emsConnection.getBean(objectName);
+ }
+ return bean;
+ }
+}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/model/ProxyInfo.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/model/ProxyInfo.java
new file mode 100644
index 0000000..9cedad5
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/model/ProxyInfo.java
@@ -0,0 +1,310 @@
+/*
+ * 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.plugins.modcluster.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Simple parser for the raw proxy information provided by mod_cluster.
+ *
+ * @author Stefan Negrea
+ */
+public class ProxyInfo {
+
+ private Map<String, Node> availableNodes = new HashMap<String, Node>();
+ private Map<String, Vhost> availableVhosts = new HashMap<String, Vhost>();
+ private List<Context> availableContexts = new ArrayList<ProxyInfo.Context>();
+
+ public ProxyInfo(String rawProxyInfo) {
+ parseNodes(rawProxyInfo);
+ parseVhosts(rawProxyInfo);
+ parseContexts(rawProxyInfo);
+ }
+
+ private void parseNodes(String rawProxyInfo) {
+ Pattern nodePattern = Pattern.compile("Node:.*\n");
+ Matcher nodeMatcher = nodePattern.matcher(rawProxyInfo);
+ while (nodeMatcher.find()) {
+ String rawNode = nodeMatcher.group();
+ String[] nodePieces = rawNode.split(",");
+
+ String identifier = nodePieces[0];
+ identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
+
+ String jvmRoute = nodePieces[1];
+ jvmRoute = jvmRoute.substring(jvmRoute.indexOf(':') + 1).trim();
+
+ availableNodes.put(identifier, new Node(jvmRoute, identifier));
+ }
+ }
+
+ private void parseVhosts(String rawProxyInfo) {
+ Pattern vhostPattern = Pattern.compile("Vhost:.*\n");
+ Matcher vhostMatcher = vhostPattern.matcher(rawProxyInfo);
+ while (vhostMatcher.find()) {
+ String rawVhost = vhostMatcher.group();
+ String[] vhostPieces = rawVhost.split(",");
+
+ String identifier = vhostPieces[0].trim();
+ identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
+ identifier = identifier.substring(0, identifier.lastIndexOf(":"));
+
+ String host = vhostPieces[1].trim();
+ host = host.substring(host.indexOf(":") + 1).trim();
+
+ availableVhosts.put(identifier, new Vhost(identifier, host));
+ }
+ }
+
+ private void parseContexts(String rawProxyInfo) {
+ Pattern contextPattern = Pattern.compile("Context:.*[\n|}]");
+ Matcher contextMatcher = contextPattern.matcher(rawProxyInfo);
+ while (contextMatcher.find()) {
+ String rawContext = contextMatcher.group();
+ String[] contextPieces = rawContext.split(",");
+ String actualContext = contextPieces[1].substring(contextPieces[1].indexOf("/")).trim();
+
+ String identifier = contextPieces[0];
+ identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
+ identifier = identifier.substring(0, identifier.lastIndexOf(":"));
+
+ String nodeIdentifier = contextPieces[0];
+ nodeIdentifier = nodeIdentifier.substring(nodeIdentifier.indexOf("[") + 1, nodeIdentifier.indexOf("]"));
+ nodeIdentifier = nodeIdentifier.substring(0, nodeIdentifier.indexOf(":"));
+ String jvmRoute = availableNodes.get(nodeIdentifier).getJvmRoute();
+
+ String rawIsEnabled = contextPieces[2];
+ rawIsEnabled = rawIsEnabled.substring(rawIsEnabled.indexOf(':') + 1).trim();
+ boolean isEnabled = rawIsEnabled.equals("ENABLED") ? true : false;
+
+ Vhost relatedVhost = availableVhosts.get(identifier);
+
+ availableContexts.add(new Context(jvmRoute, relatedVhost.getHost(), actualContext, isEnabled));
+ }
+ }
+
+ public List<Context> getAvailableContexts() {
+ return Collections.unmodifiableList(availableContexts);
+ }
+
+ public List<Vhost> getAvailableVhosts() {
+ return Collections.unmodifiableList(new ArrayList<Vhost>(availableVhosts.values()));
+ }
+
+ public List<Node> getAvailableNodes() {
+ return Collections.unmodifiableList(new ArrayList<Node>(availableNodes.values()));
+ }
+
+ public static class Node {
+ private String jvmRoute;
+ private String nodeId;
+
+ public Node(String jvmRoute, String nodeId) {
+ this.jvmRoute = jvmRoute;
+ this.nodeId = nodeId;
+ }
+
+ public String getNodeId() {
+ return nodeId;
+ }
+
+ public String getJvmRoute() {
+ return jvmRoute;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((jvmRoute == null) ? 0 : jvmRoute.hashCode());
+ result = prime * result + ((nodeId == null) ? 0 : nodeId.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Node other = (Node) obj;
+ if (jvmRoute == null) {
+ if (other.jvmRoute != null)
+ return false;
+ } else if (!jvmRoute.equals(other.jvmRoute))
+ return false;
+ if (nodeId == null) {
+ if (other.nodeId != null)
+ return false;
+ } else if (!nodeId.equals(other.nodeId))
+ return false;
+ return true;
+ }
+ }
+
+ public static class Vhost {
+ private String identifier;
+ private String host;
+
+ public Vhost(String identifier, String host) {
+ this.identifier = identifier;
+ this.host = host;
+ }
+
+ public String getIdentifier() {
+ return identifier;
+ }
+
+ public String getHost() {
+ return host;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((host == null) ? 0 : host.hashCode());
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Vhost other = (Vhost) obj;
+ if (host == null) {
+ if (other.host != null)
+ return false;
+ } else if (!host.equals(other.host))
+ return false;
+ if (identifier == null) {
+ if (other.identifier != null)
+ return false;
+ } else if (!identifier.equals(other.identifier))
+ return false;
+ return true;
+ }
+ }
+
+ public static class Context {
+ private String path;
+ private String host;
+ private String jvmRoute;
+ private boolean isEnabled;
+
+ public Context(String jvmRoute, String host, String path) {
+ this(jvmRoute, host, path, false);
+ }
+
+ public Context(String jvmRoute, String host, String path, boolean isEnabled) {
+ this.jvmRoute = jvmRoute;
+ this.host = host;
+ this.path = path;
+ this.isEnabled = isEnabled;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public String getHost() {
+ return host;
+ }
+
+ public String getJvmRoute() {
+ return jvmRoute;
+ }
+
+ public boolean isEnabled() {
+ return isEnabled;
+ }
+
+ public String createKey() {
+ return jvmRoute + ":" + host + ":" + path;
+ }
+
+ public String createName() {
+ return host + ":" + path;
+ }
+
+ @Override
+ public String toString() {
+ return createKey();
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((host == null) ? 0 : host.hashCode());
+ result = prime * result + ((jvmRoute == null) ? 0 : jvmRoute.hashCode());
+ result = prime * result + ((path == null) ? 0 : path.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Context other = (Context) obj;
+ if (host == null) {
+ if (other.host != null)
+ return false;
+ } else if (!host.equals(other.host))
+ return false;
+ if (jvmRoute == null) {
+ if (other.jvmRoute != null)
+ return false;
+ } else if (!jvmRoute.equals(other.jvmRoute))
+ return false;
+ if (path == null) {
+ if (other.path != null)
+ return false;
+ } else if (!path.equals(other.path))
+ return false;
+ return true;
+ }
+
+ public static Context fromString(String stringRepresentation) throws Exception {
+ String parts[] = stringRepresentation.trim().split(":");
+ if (parts.length < 3) {
+ throw new Exception("Parsing error. Not enough information to create a context.");
+ }
+
+ return new Context(parts[0], parts[1], parts[2]);
+ }
+ }
+}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 7e1a79f..6f46849 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -440,7 +440,7 @@
</resource-configuration>
</service>
- <service name="Webapp Context" discovery="ContextDiscoveryComponent" class="ContextComponent" description="Webapp Context">
+ <service name="Webapp Context" discovery="WebappContextDiscoveryComponent" class="WebappContextComponent" description="Webapp Context">
<operation name="disableContext" displayName="Disable webapp" description="Disable this webapp.">
<results>
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ProxyInfoTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ProxyInfoTest.java
index 625d8d4..ebadd86 100644
--- a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ProxyInfoTest.java
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ProxyInfoTest.java
@@ -23,7 +23,7 @@ import java.io.InputStream;
import org.testng.annotations.Test;
-import org.rhq.plugins.modcluster.ProxyInfo;
+import org.rhq.plugins.modcluster.model.ProxyInfo;
/**
* @author Stefan Negrea
commit bf99abb7942ffafbd7aad728698105f8f0fc3a63
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Aug 23 16:12:11 2011 -0500
Renaming mod_cluster components to match their explicit purpose.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
index 0a0a570..b87bfcd 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
@@ -30,14 +30,16 @@ import org.rhq.core.domain.configuration.definition.PropertyDefinition;
import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
import org.rhq.core.util.exception.ThrowableUtil;
+import org.rhq.plugins.jmx.JMXComponent;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
/**
* @author Stefan Negrea
*
*/
-@SuppressWarnings({ "deprecation" })
-public class FileConfiguredMBeanResourceComponent extends TimeUnitParamResourceComponent {
+@SuppressWarnings({ "deprecation", "rawtypes" })
+public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent<JMXComponent> {
private static final Log log = LogFactory.getLog(FileConfiguredMBeanResourceComponent.class);
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServiceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServiceComponent.java
new file mode 100644
index 0000000..d9da81c
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServiceComponent.java
@@ -0,0 +1,52 @@
+package org.rhq.plugins.modcluster;
+
+import java.util.concurrent.TimeUnit;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.pluginapi.operation.OperationResult;
+
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.
+ */
+
+/**
+ *
+ * @author Stefan Negrea
+ */
+public class ModClusterServiceComponent extends FileConfiguredMBeanResourceComponent {
+
+ @Override
+ public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
+ if (name.toLowerCase().startsWith("ping")) {
+ name = "ping";
+ }
+
+ return super.invokeOperation(name, parameters);
+ }
+
+ @Override
+ protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
+ System.out.println(typeName);
+ if (typeName.equals(TimeUnit.class.getName())) {
+ return TimeUnit.valueOf(propSimple.getStringValue());
+ }
+
+ return super.getPropertyValueAsType(propSimple, typeName);
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
deleted file mode 100644
index c67bf61..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.rhq.plugins.modcluster;
-
-import java.util.concurrent.TimeUnit;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.pluginapi.operation.OperationResult;
-
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2009 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.
- */
-
-/**
- *
- * @author Stefan Negrea
- */
-public class PolyPingMBeanResourceComponent extends FileConfiguredMBeanResourceComponent {
-
- @Override
- public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
- if (name.toLowerCase().startsWith("ping")) {
- name = "ping";
- }
-
- return super.invokeOperation(name, parameters);
- }
-
- @Override
- protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
- System.out.println(typeName);
- if (typeName.equals(TimeUnit.class.getName())) {
- return TimeUnit.valueOf(propSimple.getStringValue());
- }
-
- return super.getPropertyValueAsType(propSimple, typeName);
- }
-}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java
deleted file mode 100644
index 0296eaf..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2009 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.plugins.modcluster;
-
-import java.util.concurrent.TimeUnit;
-
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
-
-/**
- * @author Stefan Negrea
- *
- */
-@SuppressWarnings("rawtypes")
-public class TimeUnitParamResourceComponent extends MBeanResourceComponent {
-
- @Override
- protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
- System.out.println(typeName);
- if (typeName.equals(TimeUnit.class.getName())) {
- return TimeUnit.valueOf(propSimple.getStringValue());
- }
-
- return super.getPropertyValueAsType(propSimple, typeName);
- }
-}
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index ed82f7c..7e1a79f 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -27,7 +27,7 @@
<!-- Start - Configuration for HAModClusterService -->
<service name="HA Service" discovery="ClassNameMBeanDiscoveryComponent"
- class="PolyPingMBeanResourceComponent"
+ class="ModClusterServiceComponent"
supportsManualAdd="true"
description="HA Service Listener" singleton="true">
@@ -199,7 +199,7 @@
<!-- End - Configuration for HAModClusterService -->
<!-- Start - Configuration for ModClusterService -->
- <service name="Service" discovery="ClassNameMBeanDiscoveryComponent" class="PolyPingMBeanResourceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
+ <service name="Service" discovery="ClassNameMBeanDiscoveryComponent" class="ModClusterServiceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
<plugin-configuration>
<c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
commit 0218f0b41bfb7e1ae6e6ddb12565c396c7ef813d
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Aug 23 15:39:58 2011 -0500
Updates to support integration with JBoss' mod_cluster module for AS6 and EAP5.1.x
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
index b642573..f27b153 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
+++ b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
@@ -112,6 +112,7 @@ public class ModclusterPluginTest {
add(PLUGIN_NAME);
add("Webapp Context");
add("HA Service Configuration");
+ add("HA Service");
}
};
@@ -132,6 +133,15 @@ public class ModclusterPluginTest {
ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
.getResourceComponent(resource);
((ConfigurationFacet) resourceComponent).loadResourceConfiguration();
+ } else if (resource.getResourceType().getName().equals("HA Service")) {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+
+ Configuration config = new Configuration();
+ config.put(new PropertySimple("p1", "1"));
+ config.put(new PropertySimple("p2", java.util.concurrent.TimeUnit.SECONDS));
+ OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("stop", config);
+ log.info("Result of operation stopContext was: " + result.getSimpleResult());
}
}
}
diff --git a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java
index 6a60a93..8da6a2d 100644
--- a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java
+++ b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java
@@ -561,15 +561,15 @@ public class MBeanResourceComponent<T extends JMXComponent> implements Measureme
paramIndex = Integer.valueOf(propName.substring(propName.indexOf('[') + 1, propName.indexOf(']')));
if (paramIndex < 0 || paramIndex >= emsParams.size()) {
throw new IllegalStateException("Index [" + paramIndex + "] specified for parameter of operation ["
- + name + "] on MBean [" + emsBean.getBeanName() + "] is invalid. The MBean operation takes "
- + emsParams.size() + " parameters.");
+ + name + "] on MBean [" + emsBean.getBeanName() + "] is invalid. The MBean operation takes "
+ + emsParams.size() + " parameters.");
}
} else {
paramIndex = emsParamIndexesByName.get(propName);
if (paramIndex == null) {
throw new IllegalStateException("Name [" + propName + "] specified for parameter of operation ["
- + name + "] on MBean [" + emsBean.getBeanName()
- + "] is invalid. The MBean operation does not take a parameter by that name.");
+ + name + "] on MBean [" + emsBean.getBeanName()
+ + "] is invalid. The MBean operation does not take a parameter by that name.");
}
}
EmsParameter emsParam = emsParams.get(paramIndex);
@@ -611,7 +611,7 @@ public class MBeanResourceComponent<T extends JMXComponent> implements Measureme
return resultToReturn;
}
- private Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
+ protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
Object value;
if (typeName.equals(String.class.getName())) {
value = (propSimple == null) ? null : propSimple.getStringValue();
@@ -626,7 +626,8 @@ public class MBeanResourceComponent<T extends JMXComponent> implements Measureme
} else if (typeName.equals(Double.class.getName()) || typeName.equals(double.class.getName())) {
value = (propSimple == null) ? null : propSimple.getDoubleValue();
} else {
- throw new IllegalStateException("Operation parameter maps to MBean parameter with an unsupported type (" + typeName + ").");
+ throw new IllegalStateException("Operation parameter maps to MBean parameter with an unsupported type ("
+ + typeName + ").");
}
// TODO GH: Handle rest of types. (I think i have a mapper for this in mc4j
return value;
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index 35c5b28..3a6deaa 100644
--- a/modules/plugins/mod-cluster/pom.xml
+++ b/modules/plugins/mod-cluster/pom.xml
@@ -31,6 +31,11 @@
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.on</groupId>
+ <artifactId>jopr-jboss-as-plugin</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>log4j</groupId>
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
index c5343d0..4c8b437 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
@@ -90,6 +90,10 @@ public class ContextComponent extends MBeanResourceComponent<MBeanResourceCompon
configuration = new Object[] { context.getHost(), context.getPath() };
}
+ if (context.getPath().equals("/")) {
+ configuration[1] = "ROOT";
+ }
+
log.info(name + " - " + context.getHost() + " " + context.getPath());
ClassLoader cl = Thread.currentThread().getContextClassLoader();
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
index ee0369c..0a0a570 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
@@ -30,21 +30,20 @@ import org.rhq.core.domain.configuration.definition.PropertyDefinition;
import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
import org.rhq.core.util.exception.ThrowableUtil;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
/**
* @author Stefan Negrea
*
*/
-@SuppressWarnings({ "rawtypes", "deprecation" })
-public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent {
+@SuppressWarnings({ "deprecation" })
+public class FileConfiguredMBeanResourceComponent extends TimeUnitParamResourceComponent {
private static final Log log = LogFactory.getLog(FileConfiguredMBeanResourceComponent.class);
private static final String BEAN_CLASS_NAME_PROPERTY = "className";
private static final String DEPENDENCY_BEAN_CLASS_NAME_PROPERTY = "dependencyClassName";
- private static final String SERVER_HOME_DIR = "jboss.server.home.dir";
+ private static final String SERVER_HOME_DIR = "serverHomeDir";
private static final String CONFIGURATION_FILE_RELATIVE_PATH = "/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml";
/**
@@ -105,7 +104,7 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
}
private String getServerHomeDirectory() {
- ModclusterServerComponent modClusterComponent = (ModclusterServerComponent) this.resourceContext
+ ModClusterServerComponent modClusterComponent = (ModClusterServerComponent) this.resourceContext
.getParentResourceComponent();
PropertySimple property = modClusterComponent.getResourceContext().getPluginConfiguration()
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
index 496068c..3eb7cbe 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
@@ -36,9 +36,6 @@ import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
@SuppressWarnings("rawtypes")
public class LoadMetricDiscoveryComponent extends MBeanResourceDiscoveryComponent<JMXComponent> {
- /* (non-Javadoc)
- * @see org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext, boolean)
- */
@Override
public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<JMXComponent> context,
boolean skipUnknownProps) {
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterDiscoveryComponent.java
new file mode 100644
index 0000000..b9a73b5
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterDiscoveryComponent.java
@@ -0,0 +1,70 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import java.util.Set;
+
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jbossas.JBossASServerComponent;
+import org.rhq.plugins.jbossas5.ApplicationServerComponent;
+import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+@SuppressWarnings({ "rawtypes", "unchecked" })
+public class ModClusterDiscoveryComponent extends MBeanResourceDiscoveryComponent {
+
+ private final static String JBOSS_SERVER_HOME_DIR = "serverHomeDir";
+
+ @Override
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext context) {
+ Set<DiscoveredResourceDetails> tempSet = super.discoverResources(context);
+
+ for (DiscoveredResourceDetails detail : tempSet) {
+ String serverHomeDirectory = findServerHomeDirectory(context.getParentResourceComponent());
+ detail.getPluginConfiguration().put(new PropertySimple(JBOSS_SERVER_HOME_DIR, serverHomeDirectory));
+ }
+
+ return tempSet;
+ }
+
+ @SuppressWarnings("static-access")
+ public String findServerHomeDirectory(ResourceComponent parentResourceComponent) {
+ if (parentResourceComponent instanceof ApplicationServerComponent) {
+ ApplicationServerComponent parentComponent = (ApplicationServerComponent) parentResourceComponent;
+
+ return parentComponent.getResourceContext().getPluginConfiguration().getSimple("serverHomeDir")
+ .getStringValue();
+
+ } else if (parentResourceComponent instanceof JBossASServerComponent) {
+ JBossASServerComponent parentComponent = (JBossASServerComponent) parentResourceComponent;
+
+ return parentComponent.getPluginConfiguration().getSimple(parentComponent.JBOSS_HOME_DIR_CONFIG_PROP)
+ .getStringValue();
+ }
+
+ return null;
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
new file mode 100644
index 0000000..7d5f0dc
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
@@ -0,0 +1,47 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+@SuppressWarnings({ "rawtypes" })
+public class ModClusterServerComponent extends MBeanResourceComponent {
+
+ @Override
+ public AvailabilityType getAvailability() {
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
+
+ if (rawProxyInfo == null) {
+ return AvailabilityType.DOWN;
+ }
+
+ ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
+ if (proxyInfo.getAvailableNodes().size() == 0) {
+ return AvailabilityType.DOWN;
+ }
+
+ return super.getAvailability();
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
deleted file mode 100644
index 03598e9..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2009 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.plugins.modcluster;
-
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.domain.measurement.AvailabilityType;
-import org.rhq.core.pluginapi.inventory.ResourceContext;
-import org.rhq.plugins.jbossas.JBossASServerComponent;
-import org.rhq.plugins.jbossas5.ApplicationServerComponent;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
-import org.rhq.plugins.modcluster.helper.JBossHelper;
-
-/**
- * @author Stefan Negrea
- *
- */
-@SuppressWarnings({ "rawtypes" })
-public class ModclusterServerComponent extends MBeanResourceComponent {
-
- private final static String JBOSS_SERVER_HOME_DIR = "jboss.server.home.dir";
-
- @SuppressWarnings({ "unchecked", "deprecation", "static-access" })
- @Override
- public void start(ResourceContext context) {
- super.start(context);
-
- String serverHomeDirectory = null;
- if (this.resourceContext.getParentResourceComponent() instanceof ApplicationServerComponent) {
- ApplicationServerComponent parentComponent = (ApplicationServerComponent) this.resourceContext
- .getParentResourceComponent();
-
- serverHomeDirectory = parentComponent.getResourceContext().getPluginConfiguration()
- .getSimple("serverHomeDir").getStringValue();
-
- } else if (this.resourceContext.getParentResourceComponent() instanceof JBossASServerComponent) {
- JBossASServerComponent parentComponent = (JBossASServerComponent) this.resourceContext
- .getParentResourceComponent();
-
- serverHomeDirectory = parentComponent.getPluginConfiguration()
- .getSimple(parentComponent.JBOSS_HOME_DIR_CONFIG_PROP).getStringValue();
- }
-
- if (serverHomeDirectory != null) {
- PropertySimple serverHomeDirectoryProperty = null;
- serverHomeDirectoryProperty = new PropertySimple();
- serverHomeDirectoryProperty.setName(JBOSS_SERVER_HOME_DIR);
- serverHomeDirectoryProperty.setStringValue(serverHomeDirectory);
- this.resourceContext.getPluginConfiguration().put(serverHomeDirectoryProperty);
- }
- };
-
- //private final static String PROXY_INFO_PROPERTY_NAME
-
- /* (non-Javadoc)
- * @see org.rhq.plugins.jmx.MBeanResourceComponent#getAvailability()
- */
- @Override
- public AvailabilityType getAvailability() {
- String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
-
- if (rawProxyInfo == null) {
- return AvailabilityType.DOWN;
- }
-
- ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
- if (proxyInfo.getAvailableNodes().size() == 0) {
- return AvailabilityType.DOWN;
- }
-
- return super.getAvailability();
- }
-}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
index bc54267..c67bf61 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
@@ -1,6 +1,9 @@
package org.rhq.plugins.modcluster;
+import java.util.concurrent.TimeUnit;
+
import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.pluginapi.operation.OperationResult;
/*
@@ -36,4 +39,14 @@ public class PolyPingMBeanResourceComponent extends FileConfiguredMBeanResourceC
return super.invokeOperation(name, parameters);
}
+
+ @Override
+ protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
+ System.out.println(typeName);
+ if (typeName.equals(TimeUnit.class.getName())) {
+ return TimeUnit.valueOf(propSimple.getStringValue());
+ }
+
+ return super.getPropertyValueAsType(propSimple, typeName);
+ }
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java
new file mode 100644
index 0000000..0296eaf
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java
@@ -0,0 +1,42 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import java.util.concurrent.TimeUnit;
+
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+@SuppressWarnings("rawtypes")
+public class TimeUnitParamResourceComponent extends MBeanResourceComponent {
+
+ @Override
+ protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
+ System.out.println(typeName);
+ if (typeName.equals(TimeUnit.class.getName())) {
+ return TimeUnit.valueOf(propSimple.getStringValue());
+ }
+
+ return super.getPropertyValueAsType(propSimple, typeName);
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
index 6c00130..dee2f81 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
@@ -18,11 +18,18 @@
*/
package org.rhq.plugins.modcluster.config;
+import java.io.File;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
@@ -38,11 +45,13 @@ public abstract class AbstractConfigurationFile {
public AbstractConfigurationFile(String fileName) throws ParserConfigurationException, SAXException, IOException {
this.fileName = fileName;
- DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
- DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
- this.document = docBuilder.parse(this.getFileName());
+ loadConfiguratonFile();
}
+ abstract void setPropertyValue(String propertyName, String value);
+
+ abstract String getPropertyValue(String propertyName);
+
/**
* @return the fileName
*/
@@ -57,9 +66,19 @@ public abstract class AbstractConfigurationFile {
return document;
}
- abstract void setPropertyValue(String propertyName, String value);
+ public void saveConfigurationFile() throws Exception {
+ File file = new File(this.getFileName());
+ StreamResult result = new StreamResult(file);
+ Source source = new DOMSource(this.getDocument());
- abstract String getPropertyValue(String propertyName);
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+ transformer.transform(source, result);
+ }
- abstract void saveConfigurationFile() throws Exception;
+ private void loadConfiguratonFile() throws ParserConfigurationException, SAXException, IOException {
+ DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
+ this.document = docBuilder.parse(this.getFileName());
+ }
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
index 1d008ee..354fa99 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
@@ -47,11 +47,4 @@ public class JBossWebServerFile extends AbstractConfigurationFile {
// TODO Auto-generated method stub
return null;
}
-
- @Override
- void saveConfigurationFile() throws Exception {
- // TODO Auto-generated method stub
-
- }
-
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
index 45053f7..6abf955 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -19,17 +19,10 @@
package org.rhq.plugins.modcluster.config;
import java.io.IOException;
-import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Attr;
import org.w3c.dom.Node;
@@ -129,22 +122,6 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
}
/**
- * @throws TransformerException
- */
- public void saveConfigurationFile() throws TransformerException {
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "no");
-
- //initialize StreamResult with File object to save to file
- StreamResult result = new StreamResult(new StringWriter());
- DOMSource source = new DOMSource(this.getDocument());
- transformer.transform(source, result);
-
- String xmlString = result.getWriter().toString();
- System.out.println(xmlString);
- }
-
- /**
* @param className
* @return
*/
@@ -155,7 +132,6 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
Node node = result.item(i);
if (node.getAttributes().getNamedItem("class") != null
&& className.equals(node.getAttributes().getNamedItem("class").getTextContent())) {
- System.out.println(node.getAttributes().getNamedItem("class").getTextContent());
return node;
}
}
@@ -174,7 +150,6 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
Node node = result.item(i);
if (node.getAttributes().getNamedItem("name") != null
&& beanName.equals(node.getAttributes().getNamedItem("name").getTextContent())) {
- System.out.println(node.getAttributes().getNamedItem("name").getTextContent());
return node;
}
}
@@ -243,5 +218,4 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
return listOfNodes;
}
-
}
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 4f3010f..ed82f7c 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -6,7 +6,9 @@
<depends plugin="JMX" />
<service name="mod_cluster"
- discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="mod_cluster plugin" singleton="true">
+ discovery="ModClusterDiscoveryComponent"
+ class="ModClusterServerComponent"
+ supportsManualAdd="true" description="mod_cluster plugin" singleton="true">
<runs-inside>
<parent-resource-type name="JBossAS Server" plugin="JBossAS" />
@@ -17,13 +19,17 @@
<c:simple-property name="objectName" readOnly="true" default="Catalina:type=ModClusterListener,*|jboss.web:service=ModCluster" />
<c:simple-property name="engineObjectName" readOnly="true" default="jboss.web:type=Engine" />
<c:simple-property name="nameTemplate" default="mod_cluster" />
+ <c:simple-property name="serverHomeDir"/>
</plugin-configuration>
<operation name="reset" displayName="Reset the node" description="Move this application server out of an error state." />
<operation name="refresh" displayName="Refresh configuration" description="Refresh configuration for this application server." />
<!-- Start - Configuration for HAModClusterService -->
- <service name="HA Service" discovery="ClassNameMBeanDiscoveryComponent" class="PolyPingMBeanResourceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
+ <service name="HA Service" discovery="ClassNameMBeanDiscoveryComponent"
+ class="PolyPingMBeanResourceComponent"
+ supportsManualAdd="true"
+ description="HA Service Listener" singleton="true">
<plugin-configuration>
<c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
@@ -35,18 +41,18 @@
<!-- HA Operations -->
<operation name="disableDomain" displayName="Disable domain" description="Disables all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
<results>
- <c:simple-property name="result" description="The result of the operation" />
+ <c:simple-property name="operationResult" description="The result of the operation" />
</results>
</operation>
<operation name="enableDomain" displayName="Enable domain" description="Enable all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="stopDomain" displayName="Stop domain" description="Gracefully stops all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
<parameters>
- <c:simple-property required="true" name="timeout" type="string" displayName="The number of units of time for which to wait for all sessions to drain on a given node." />
- <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:simple-property required="true" name="p1" type="string" displayName="The number of units of time for which to wait for all sessions to drain on a given node." />
+ <c:simple-property required="true" name="p2" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
<c:property-options allowCustomValue="false">
<c:option value="MICROSECONDS" name="MICROSECONDS" />
<c:option value="MILLISECONDS" name="MILLISECONDS" />
@@ -58,7 +64,7 @@
</c:simple-property>
</parameters>
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
@@ -66,59 +72,60 @@
<operation name="pingHTTPD" displayName="Ping httpd" description="Ping httpd and determine whether each proxy is accessible and healthy. Returns the PING_RSP grouped by proxy address.">
<results>
- <c:simple-property name="result" description="Map of PING_RPS response, grouped by proxy.">
+ <c:simple-property name="operationResult" description="Map of PING_RPS response, grouped by proxy.">
</c:simple-property>
</results>
</operation>
<operation name="pingNodeByJVMRoute" displayName="Ping node by JVM Route"
description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Dtermines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
<parameters>
- <c:simple-property required="true" name="jvmRoute" type="string" displayName="JVM Route of node to ping." />
+ <c:simple-property required="true" name="p1" type="string" displayName="JVM Route of node to ping." />
</parameters>
<results>
- <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ <c:simple-property name="operationResult" type="string" description="Map of PING_RPS response, grouped by proxy." />
</results>
</operation>
<operation name="pingNodeByAddress" displayName="Ping node by address"
description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Determines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
<parameters>
- <c:simple-property required="true" name="scheme" type="string" displayName="Scheme (ajp, http, https)" />
- <c:simple-property required="true" name="hostname" type="string" displayName="Name or ip address of a node." />
- <c:simple-property required="true" name="port" type="string" displayName="Port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Scheme (ajp, http, https)" />
+ <c:simple-property required="true" name="p2" type="string" displayName="Name or ip address of a node." />
+ <c:simple-property required="true" name="p3" type="integer" displayName="Port" />
</parameters>
<results>
- <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ <c:simple-property name="operationResult" type="string" description="Map of PING_RPS response, grouped by proxy." />
</results>
</operation>
<operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
<parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="p2" type="integer" displayName="Proxy port" />
</parameters>
</operation>
<operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
<parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="p2" type="integer" displayName="Proxy port" />
</parameters>
</operation>
+
<operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" description="The result of the operation">
+ <c:simple-property name="operationResult" description="The result of the operation">
</c:simple-property>
</results>
</operation>
<operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" description="The result of the operation">
+ <c:simple-property name="operationResult" description="The result of the operation">
</c:simple-property>
</results>
</operation>
<operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
<parameters>
- <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout" />
- <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:simple-property required="true" name="p1" type="string" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="p2" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
<c:property-options allowCustomValue="false">
<c:option value="MICROSECONDS" name="MICROSECONDS" />
<c:option value="MILLISECONDS" name="MILLISECONDS" />
@@ -130,7 +137,7 @@
</c:simple-property>
</parameters>
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
@@ -139,7 +146,7 @@
<metric property="ProxyInfo" displayName="Proxy Info" displayType="summary" dataType="trait" />
<resource-configuration>
- <c:simple-property name="processStatusFrequency" type="integer" description="Process status frequency." />
+ <c:simple-property name="processStatusFrequency" type="integer" required="false" description="Process status frequency." />
</resource-configuration>
</service>
@@ -203,56 +210,57 @@
<operation name="pingHTTPD" displayName="Ping httpd" description="Ping httpd and determine whether each proxy is accessible and healthy. Returns the PING_RSP grouped by proxy address.">
<results>
- <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ <c:simple-property name="operationResult" type="string" description="Map of PING_RPS response, grouped by proxy." />
</results>
</operation>
<operation name="pingNodeByJVMRoute" displayName="Ping node by JVM Route"
description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Dtermines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
<parameters>
- <c:simple-property required="true" name="jvmRoute" type="string" displayName="JVM Route of node to ping." />
+ <c:simple-property required="true" name="p1" type="string" displayName="JVM Route of node to ping." />
</parameters>
<results>
- <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ <c:simple-property name="operationResult" type="string" description="Map of PING_RPS response, grouped by proxy." />
</results>
</operation>
<operation name="pingNodeByAddress" displayName="Ping node by address"
description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Determines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
<parameters>
- <c:simple-property required="true" name="scheme" type="string" displayName="Scheme (ajp, http, https)" />
- <c:simple-property required="true" name="hostname" type="string" displayName="Name or ip address of a node." />
- <c:simple-property required="true" name="port" type="string" displayName="Port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Scheme (ajp, http, https)" />
+ <c:simple-property required="true" name="p2" type="string" displayName="Name or ip address of a node." />
+ <c:simple-property required="true" name="p3" type="integer" displayName="Port" />
</parameters>
<results>
- <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ <c:simple-property name="operationResult" type="string" description="Map of PING_RPS response, grouped by proxy." />
</results>
</operation>
<operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
<parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="p2" type="integer" displayName="Proxy port" />
</parameters>
</operation>
<operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
<parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="p2" type="integer" displayName="Proxy port" />
</parameters>
</operation>
+
<operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
<parameters>
- <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout" />
- <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:simple-property required="true" name="p1" type="string" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="p2" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
<c:property-options allowCustomValue="false">
<c:option value="MICROSECONDS" name="MICROSECONDS" />
<c:option value="MILLISECONDS" name="MILLISECONDS" />
@@ -264,7 +272,7 @@
</c:simple-property>
</parameters>
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
@@ -338,12 +346,12 @@
</operation>
<operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
@@ -361,7 +369,7 @@
</c:simple-property>
</parameters>
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
@@ -396,11 +404,9 @@
<c:simple-property name="nameTemplate" default="Dynamic Load Balancer Factor" />
</plugin-configuration>
- <metric property="Metrics" displayName="Collected Metrics" displayType="summary" dataType="trait" />
-
<resource-configuration>
- <c:simple-property name="DecayFactor" type="integer" description="The number of historical load values used to determine load factor." />
- <c:simple-property name="History" type="integer" description="The exponential decay factor for historical load values." />
+ <c:simple-property name="decayFactor" type="integer" required="false" description="The number of historical load values used to determine load factor." />
+ <c:simple-property name="history" type="integer" required="false" description="The exponential decay factor for historical load values." />
</resource-configuration>
</service>
@@ -424,11 +430,13 @@
<c:simple-property name="nameTemplate" default="Load Metric" />
</plugin-configuration>
- <metric property="Load" displayName="Load" category="utilization" description="The current load of this metric as a percent of the metric's capacity." dataType="measurement" />
+ <metric property="Load" displayName="Load" category="utilization"
+ description="The current load of this metric as a percent of the metric's capacity." dataType="measurement"
+ defaultOn="true" displayType="summary"/>
<resource-configuration>
- <c:simple-property name="Weight" type="integer" description="The significance of this load metric compared to the other metrics." />
- <c:simple-property name="Capacity" type="double" description="Used to normalize the value returned by load expressed as a percentage of the capacity, such that: 0 < (load/capacity) < 1" />
+ <c:simple-property name="weight" type="integer" description="The significance of this load metric compared to the other metrics." />
+ <c:simple-property name="capacity" type="double" description="Used to normalize the value returned by load expressed as a percentage of the capacity, such that: 0 < (load/capacity) < 1" />
</resource-configuration>
</service>
@@ -436,7 +444,7 @@
<operation name="disableContext" displayName="Disable webapp" description="Disable this webapp.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation." />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation." />
</results>
</operation>
<operation name="stopContext" displayName="Stop webapp" description="Gracefully stops this webapp.">
@@ -454,12 +462,12 @@
</c:simple-property>
</parameters>
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="enableContext" displayName="Enable webapp" description="Enable this webapp.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
index c50b0e6..cba5672 100644
--- a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
@@ -28,16 +28,19 @@ public class ServerConfigTest {
public void TestConfig() {
try {
+ //Test simple bean configuration
ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
"/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
- System.out.println(config.getPropertyValue("test"));
+ config.setPropertyValue("test", null);
+ config.setPropertyValue("processStatusFrequency", null);
config.saveConfigurationFile();
+ //Test bean configuration with constructor dependency
config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
"org.jboss.modcluster.config.ha.HAModClusterConfig",
"/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
@@ -45,11 +48,8 @@ public class ServerConfigTest {
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
- System.out.println(config.getPropertyValue("test"));
-
- config.saveConfigurationFile();
-
config.setPropertyValue("test", null);
+ config.setPropertyValue("processStatusFrequency", null);
config.saveConfigurationFile();
} catch (Exception e) {
// TODO Auto-generated catch block
commit 8a35caa7f9b3d2093e7cdd495cf65f4572bca065
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Mon Aug 15 14:59:16 2011 -0500
The JBoss server home directory is now correctly retrieved from the parent resource component. Included some other minor code tweaks and refactorings.
diff --git a/modules/integration-tests/mod_cluster-plugin-test/pom.xml b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
index 77a81b2..ba94746 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/pom.xml
+++ b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
@@ -42,7 +42,13 @@
</dependencyManagement>
<dependencies>
-
+ <dependency>
+ <groupId>org.jboss.on</groupId>
+ <artifactId>jopr-jboss-as-5-plugin</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
<dependency>
<groupId>org.jboss.integration</groupId>
<artifactId>jboss-profileservice-spi</artifactId>
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
index 0a39eab..b642573 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
+++ b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
@@ -45,6 +45,7 @@ import org.rhq.core.pc.PluginContainerConfiguration;
import org.rhq.core.pc.plugin.FileSystemPluginFinder;
import org.rhq.core.pc.plugin.PluginEnvironment;
import org.rhq.core.pc.plugin.PluginManager;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
import org.rhq.core.pluginapi.inventory.ResourceComponent;
import org.rhq.core.pluginapi.measurement.MeasurementFacet;
import org.rhq.core.pluginapi.operation.OperationFacet;
@@ -109,7 +110,8 @@ public class ModclusterPluginTest {
{
add(PLUGIN_NAME);
- add(PLUGIN_NAME + " Webapp Context");
+ add("Webapp Context");
+ add("HA Service Configuration");
}
};
@@ -124,8 +126,12 @@ public class ModclusterPluginTest {
Resource resource = (Resource) objectResource;
if (resource.getResourceType().getName().equals("mod_cluster")) {
testResourceMeasurement(resource);
- } else {
+ } else if (resource.getResourceType().getName().equals("Webapp Context")) {
testContextOperations(resource);
+ } else if (resource.getResourceType().getName().equals("HA Service Configuration")) {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+ ((ConfigurationFacet) resourceComponent).loadResourceConfiguration();
}
}
}
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index fdc4f37..35c5b28 100644
--- a/modules/plugins/mod-cluster/pom.xml
+++ b/modules/plugins/mod-cluster/pom.xml
@@ -23,6 +23,14 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.on</groupId>
+ <artifactId>jopr-jboss-as-5-plugin</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
<dependency>
<groupId>log4j</groupId>
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
index 8e14f9b..c5343d0 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
@@ -20,6 +20,8 @@ package org.rhq.plugins.modcluster;
import java.util.concurrent.TimeUnit;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.mc4j.ems.connection.bean.EmsBean;
import org.rhq.core.domain.configuration.Configuration;
@@ -35,6 +37,9 @@ import org.rhq.plugins.modcluster.helper.JBossHelper;
*/
@SuppressWarnings({ "rawtypes", "deprecation" })
public class ContextComponent extends MBeanResourceComponent<MBeanResourceComponent> {
+
+ private static final Log log = LogFactory.getLog(ContextComponent.class);
+
@Override
protected EmsBean loadBean() {
return getResourceContext().getParentResourceComponent().getEmsBean();
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
index 9b511b3..ee0369c 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
@@ -19,6 +19,9 @@
package org.rhq.plugins.modcluster;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
import org.rhq.core.domain.configuration.PropertySimple;
@@ -34,11 +37,15 @@ import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
* @author Stefan Negrea
*
*/
-@SuppressWarnings("rawtypes")
+@SuppressWarnings({ "rawtypes", "deprecation" })
public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent {
+ private static final Log log = LogFactory.getLog(FileConfiguredMBeanResourceComponent.class);
+
private static final String BEAN_CLASS_NAME_PROPERTY = "className";
private static final String DEPENDENCY_BEAN_CLASS_NAME_PROPERTY = "dependencyClassName";
+ private static final String SERVER_HOME_DIR = "jboss.server.home.dir";
+ private static final String CONFIGURATION_FILE_RELATIVE_PATH = "/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml";
/**
* This default setup of configuration properties can map to mbean attributes
@@ -46,15 +53,14 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
* @return the configuration of the component
*/
@Override
- @SuppressWarnings("deprecation")
public Configuration loadResourceConfiguration() {
+
Configuration configuration = new Configuration();
ConfigurationDefinition configurationDefinition = this.resourceContext.getResourceType()
.getResourceConfigurationDefinition();
try {
- ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance(this.resourceContext
- .getPluginConfiguration());
+ ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance();
for (PropertyDefinition property : configurationDefinition.getPropertyDefinitions().values()) {
if (property instanceof PropertyDefinitionSimple) {
@@ -69,8 +75,7 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
}
}
} catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ log.debug("Unable to load mod_cluster configuration file.", e);
}
return configuration;
@@ -84,19 +89,35 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
updateResourceConfiguration(report, false);
}
- private ModClusterBeanFile getModClusterBeanFileInstance(Configuration pluginConfig) throws Exception {
+ private ModClusterBeanFile getModClusterBeanFileInstance() throws Exception {
+ Configuration pluginConfig = this.resourceContext.getPluginConfiguration();
String beanClassName = pluginConfig.getSimple(BEAN_CLASS_NAME_PROPERTY).getStringValue();
+ String fileName = this.getServerHomeDirectory() + CONFIGURATION_FILE_RELATIVE_PATH;
+
if (pluginConfig.getSimple(DEPENDENCY_BEAN_CLASS_NAME_PROPERTY) != null) {
String dependencyBeanClassName = pluginConfig.getSimple(DEPENDENCY_BEAN_CLASS_NAME_PROPERTY)
.getStringValue();
- return new ModClusterBeanFile(dependencyBeanClassName);
+ return new ModClusterBeanFile(beanClassName, dependencyBeanClassName, fileName);
+ }
+
+ return new ModClusterBeanFile(beanClassName, fileName);
+ }
+
+ private String getServerHomeDirectory() {
+ ModclusterServerComponent modClusterComponent = (ModclusterServerComponent) this.resourceContext
+ .getParentResourceComponent();
+
+ PropertySimple property = modClusterComponent.getResourceContext().getPluginConfiguration()
+ .getSimple(SERVER_HOME_DIR);
+
+ if (property != null) {
+ return property.getStringValue();
}
- return new ModClusterBeanFile(beanClassName);
+ return null;
}
- @SuppressWarnings("deprecation")
@Override
public void updateResourceConfiguration(ConfigurationUpdateReport report, boolean ignoreReadOnly) {
ConfigurationDefinition configurationDefinition = this.getResourceContext().getResourceType()
@@ -106,8 +127,7 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
report.setStatus(ConfigurationUpdateStatus.SUCCESS);
try {
- ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance(this.resourceContext
- .getPluginConfiguration());
+ ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance();
for (String key : report.getConfiguration().getSimpleProperties().keySet()) {
PropertySimple property = report.getConfiguration().getSimple(key);
@@ -127,10 +147,9 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
}
}
- modClusterBeanFile.saveConfigFile();
+ modClusterBeanFile.saveConfigurationFile();
} catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ log.debug("Unable to save mod_cluster configuration file.", e);
}
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
index fb944c8..496068c 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
@@ -30,7 +30,7 @@ import org.rhq.plugins.jmx.JMXComponent;
import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
/**
- * @author snegrea
+ * @author Stefan Negrea
*
*/
@SuppressWarnings("rawtypes")
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
index 2c964c0..03598e9 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
@@ -18,7 +18,11 @@
*/
package org.rhq.plugins.modcluster;
+import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.plugins.jbossas.JBossASServerComponent;
+import org.rhq.plugins.jbossas5.ApplicationServerComponent;
import org.rhq.plugins.jmx.MBeanResourceComponent;
import org.rhq.plugins.modcluster.helper.JBossHelper;
@@ -29,6 +33,38 @@ import org.rhq.plugins.modcluster.helper.JBossHelper;
@SuppressWarnings({ "rawtypes" })
public class ModclusterServerComponent extends MBeanResourceComponent {
+ private final static String JBOSS_SERVER_HOME_DIR = "jboss.server.home.dir";
+
+ @SuppressWarnings({ "unchecked", "deprecation", "static-access" })
+ @Override
+ public void start(ResourceContext context) {
+ super.start(context);
+
+ String serverHomeDirectory = null;
+ if (this.resourceContext.getParentResourceComponent() instanceof ApplicationServerComponent) {
+ ApplicationServerComponent parentComponent = (ApplicationServerComponent) this.resourceContext
+ .getParentResourceComponent();
+
+ serverHomeDirectory = parentComponent.getResourceContext().getPluginConfiguration()
+ .getSimple("serverHomeDir").getStringValue();
+
+ } else if (this.resourceContext.getParentResourceComponent() instanceof JBossASServerComponent) {
+ JBossASServerComponent parentComponent = (JBossASServerComponent) this.resourceContext
+ .getParentResourceComponent();
+
+ serverHomeDirectory = parentComponent.getPluginConfiguration()
+ .getSimple(parentComponent.JBOSS_HOME_DIR_CONFIG_PROP).getStringValue();
+ }
+
+ if (serverHomeDirectory != null) {
+ PropertySimple serverHomeDirectoryProperty = null;
+ serverHomeDirectoryProperty = new PropertySimple();
+ serverHomeDirectoryProperty.setName(JBOSS_SERVER_HOME_DIR);
+ serverHomeDirectoryProperty.setStringValue(serverHomeDirectory);
+ this.resourceContext.getPluginConfiguration().put(serverHomeDirectoryProperty);
+ }
+ };
+
//private final static String PROXY_INFO_PROPERTY_NAME
/* (non-Javadoc)
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
index 8f5d08b..bc54267 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
@@ -22,6 +22,10 @@ import org.rhq.core.pluginapi.operation.OperationResult;
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+/**
+ *
+ * @author Stefan Negrea
+ */
public class PolyPingMBeanResourceComponent extends FileConfiguredMBeanResourceComponent {
@Override
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
index 4fe5788..6c00130 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
@@ -32,9 +32,6 @@ import org.xml.sax.SAXException;
* @author Stefan Negrea
*/
public abstract class AbstractConfigurationFile {
-
- public static final String SERVER_HOME_DIR = "jboss.server.home.dir";
-
private String fileName;
private Document document;
@@ -60,4 +57,9 @@ public abstract class AbstractConfigurationFile {
return document;
}
+ abstract void setPropertyValue(String propertyName, String value);
+
+ abstract String getPropertyValue(String propertyName);
+
+ abstract void saveConfigurationFile() throws Exception;
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
index 602e52b..1d008ee 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
@@ -36,4 +36,22 @@ public class JBossWebServerFile extends AbstractConfigurationFile {
// TODO Auto-generated constructor stub
}
+ @Override
+ void setPropertyValue(String propertyName, String value) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ String getPropertyValue(String propertyName) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ void saveConfigurationFile() throws Exception {
+ // TODO Auto-generated method stub
+
+ }
+
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
index 0e25f26..45053f7 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -16,7 +16,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-
package org.rhq.plugins.modcluster.config;
import java.io.IOException;
@@ -38,24 +37,38 @@ import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
/**
- * @author snegrea
+ * @author Stefan Negrea
*
*/
public class ModClusterBeanFile extends AbstractConfigurationFile {
private Node beanNode;
- public ModClusterBeanFile(String className) throws ParserConfigurationException, SAXException, IOException {
- super(
- "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+ /**
+ * @param className
+ * @param configurationFile
+ * @throws ParserConfigurationException
+ * @throws SAXException
+ * @throws IOException
+ */
+ public ModClusterBeanFile(String className, String configurationFile) throws ParserConfigurationException,
+ SAXException, IOException {
+ super(configurationFile);
beanNode = this.getBeanNodeByClass(className);
}
- public ModClusterBeanFile(String className, String constructorArgumentClassName)
+ /**
+ * @param className
+ * @param constructorArgumentClassName
+ * @param configurationFile
+ * @throws ParserConfigurationException
+ * @throws SAXException
+ * @throws IOException
+ */
+ public ModClusterBeanFile(String className, String constructorArgumentClassName, String configurationFile)
throws ParserConfigurationException, SAXException, IOException {
- super(
- "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+ super(configurationFile);
Node primaryBeanNode = this.getBeanNodeByClass(className);
String dependencyName = this.getBeanFromConstructorArgument(primaryBeanNode, constructorArgumentClassName);
@@ -63,58 +76,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
beanNode = this.getBeanNodeByName(dependencyName);
}
- private String getBeanFromConstructorArgument(Node beanNode, String constructorArgumentClassName) {
- List<Node> tempNodeList = this.getChildNodesByName(beanNode, "constructor");
-
- if (tempNodeList.size() > 0) {
- Node constructorNode = tempNodeList.get(0);
-
- tempNodeList = this.getChildNodesByName(constructorNode, "parameter");
-
- if (tempNodeList.size() > 0) {
- Node parameterNode = null;
-
- for (Node currentNode : tempNodeList) {
- if (currentNode.getAttributes().getNamedItem("class") != null
- && constructorArgumentClassName.equals(currentNode.getAttributes().getNamedItem("class")
- .getTextContent())) {
- parameterNode = currentNode;
- break;
- }
- }
-
- if (parameterNode != null) {
- tempNodeList = this.getChildNodesByName(parameterNode, "inject");
-
- if (tempNodeList.size() > 0) {
- Node injectNode = tempNodeList.get(0);
- Node beanAttribute = injectNode.getAttributes().getNamedItem("bean");
-
- if (beanAttribute != null) {
- return beanAttribute.getTextContent();
- }
- }
- }
- }
- }
-
- return null;
- }
-
- private List<Node> getChildNodesByName(Node node, String nodeName) {
- List<Node> listOfNodes = new ArrayList<Node>();
-
- for (int i = 0; i < node.getChildNodes().getLength(); i++) {
- Node currentNode = node.getChildNodes().item(i);
-
- if (nodeName.equals(currentNode.getNodeName())) {
- listOfNodes.add(currentNode);
- }
- }
-
- return listOfNodes;
- }
-
+ /**
+ * @param propertyName
+ * @param value
+ */
public void setPropertyValue(String propertyName, String value) {
boolean propertyFound = false;
for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
@@ -144,6 +109,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
}
}
+ /**
+ * @param propertyName
+ * @return
+ */
public String getPropertyValue(String propertyName) {
for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
Node currentNode = beanNode.getChildNodes().item(i);
@@ -159,7 +128,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
return null;
}
- public void saveConfigFile() throws TransformerException {
+ /**
+ * @throws TransformerException
+ */
+ public void saveConfigurationFile() throws TransformerException {
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "no");
@@ -172,7 +144,11 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
System.out.println(xmlString);
}
- public Node getBeanNodeByClass(String className) {
+ /**
+ * @param className
+ * @return
+ */
+ private Node getBeanNodeByClass(String className) {
NodeList result = this.getDocument().getElementsByTagName("bean");
for (int i = 1; i < result.getLength(); i++) {
@@ -187,7 +163,11 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
return null;
}
- public Node getBeanNodeByName(String beanName) {
+ /**
+ * @param beanName
+ * @return
+ */
+ private Node getBeanNodeByName(String beanName) {
NodeList result = this.getDocument().getElementsByTagName("bean");
for (int i = 1; i < result.getLength(); i++) {
@@ -202,4 +182,66 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
return null;
}
+ /**
+ * @param beanNode
+ * @param constructorArgumentClassName
+ * @return
+ */
+ private String getBeanFromConstructorArgument(Node beanNode, String constructorArgumentClassName) {
+ List<Node> tempNodeList = this.getChildNodesByName(beanNode, "constructor");
+
+ if (tempNodeList.size() > 0) {
+ Node constructorNode = tempNodeList.get(0);
+
+ tempNodeList = this.getChildNodesByName(constructorNode, "parameter");
+
+ if (tempNodeList.size() > 0) {
+ Node parameterNode = null;
+
+ for (Node currentNode : tempNodeList) {
+ if (currentNode.getAttributes().getNamedItem("class") != null
+ && constructorArgumentClassName.equals(currentNode.getAttributes().getNamedItem("class")
+ .getTextContent())) {
+ parameterNode = currentNode;
+ break;
+ }
+ }
+
+ if (parameterNode != null) {
+ tempNodeList = this.getChildNodesByName(parameterNode, "inject");
+
+ if (tempNodeList.size() > 0) {
+ Node injectNode = tempNodeList.get(0);
+ Node beanAttribute = injectNode.getAttributes().getNamedItem("bean");
+
+ if (beanAttribute != null) {
+ return beanAttribute.getTextContent();
+ }
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @param node
+ * @param nodeName
+ * @return
+ */
+ private List<Node> getChildNodesByName(Node node, String nodeName) {
+ List<Node> listOfNodes = new ArrayList<Node>();
+
+ for (int i = 0; i < node.getChildNodes().getLength(); i++) {
+ Node currentNode = node.getChildNodes().item(i);
+
+ if (nodeName.equals(currentNode.getNodeName())) {
+ listOfNodes.add(currentNode);
+ }
+ }
+
+ return listOfNodes;
+ }
+
}
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index fe4ac7d..4f3010f 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -5,7 +5,8 @@
<depends plugin="JMX" />
- <service name="mod_cluster" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="mod_cluster plugin" singleton="true">
+ <service name="mod_cluster"
+ discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="mod_cluster plugin" singleton="true">
<runs-inside>
<parent-resource-type name="JBossAS Server" plugin="JBossAS" />
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
index 4e4aac1..c50b0e6 100644
--- a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
@@ -28,27 +28,29 @@ public class ServerConfigTest {
public void TestConfig() {
try {
- ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService");
+ ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
+ "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
System.out.println(config.getPropertyValue("test"));
- config.saveConfigFile();
+ config.saveConfigurationFile();
config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
- "org.jboss.modcluster.config.ha.HAModClusterConfig");
+ "org.jboss.modcluster.config.ha.HAModClusterConfig",
+ "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
System.out.println(config.getPropertyValue("test"));
- config.saveConfigFile();
+ config.saveConfigurationFile();
config.setPropertyValue("test", null);
- config.saveConfigFile();
+ config.saveConfigurationFile();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
commit eb9e67e2c2115a941044fe5e03782ac524d60550
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Sun Aug 14 12:06:26 2011 -0500
Enable mod_cluster support for JBoss 5&6 with simple and HA configuration listeners. Also, added metric collections and configuration save to bean file.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
new file mode 100644
index 0000000..b9ce25e
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
@@ -0,0 +1,95 @@
+/*
+ * 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.plugins.modcluster;
+
+import java.util.Set;
+
+import org.mc4j.ems.connection.EmsConnection;
+import org.mc4j.ems.connection.bean.EmsBean;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jmx.JMXComponent;
+import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
+
+/**
+ * Discovers mod_cluster contexts from the proxyInfo mbean property.
+ *
+ * @author Stefan Negrea
+ */
+@SuppressWarnings("rawtypes")
+public class ClassNameMBeanDiscoveryComponent<T extends JMXComponent> extends MBeanResourceDiscoveryComponent<T> {
+
+ private static final String CLASS_NAME = "className";
+
+ /* (non-Javadoc)
+ * @see org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext, boolean)
+ */
+ @Override
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<T> context,
+ boolean skipUnknownProps) {
+
+ Set<DiscoveredResourceDetails> results = super.discoverResources(context, skipUnknownProps);
+
+ for (DiscoveredResourceDetails discoveredResource : results) {
+ if (!isBeanConfiguredClassName(context, discoveredResource.getResourceKey())) {
+ results.remove(discoveredResource);
+ }
+ }
+
+ return results;
+ }
+
+ /**
+ * @param context
+ * @param objectName
+ * @return
+ */
+ public boolean isBeanConfiguredClassName(ResourceDiscoveryContext<T> context, String objectName) {
+ String className = context.getDefaultPluginConfiguration().getSimple(CLASS_NAME).getStringValue();
+
+ EmsConnection connection = context.getParentResourceComponent().getEmsConnection();
+ EmsBean emsBean = loadBean(connection, objectName);
+
+ return className.equals(emsBean.getClassTypeName());
+ }
+
+ /**
+ * Loads the bean with the given object name.
+ *
+ * Subclasses are free to override this method in order to load the bean.
+ *
+ * @param objectName the name of the bean to load
+ * @return the bean that is loaded
+ */
+ protected EmsBean loadBean(EmsConnection emsConnection, String objectName) {
+ EmsBean bean = emsConnection.getBean(objectName);
+ if (bean == null) {
+ // In some cases, this resource component may have been discovered by some means other than querying its
+ // parent's EMSConnection (e.g. ApplicationDiscoveryComponent uses a filesystem to discover EARs and
+ // WARs that are not yet deployed). In such cases, getBean() will return null, since EMS won't have the
+ // bean in its cache. To cover such cases, make an attempt to query the underlying MBeanServer for the
+ // bean before giving up.
+ emsConnection.queryBeans(objectName);
+ bean = emsConnection.getBean(objectName);
+ }
+ return bean;
+ }
+
+}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
index 3545fa5..8e14f9b 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
@@ -26,6 +26,7 @@ import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.pluginapi.operation.OperationResult;
import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
/**
* Manages a mod_cluster context entity.
@@ -44,7 +45,7 @@ public class ContextComponent extends MBeanResourceComponent<MBeanResourceCompon
ClassLoader cl = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
- String rawProxyInfo = (String) getEmsBean().getAttribute("proxyInfo").refresh().toString();
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
@@ -91,12 +92,16 @@ public class ContextComponent extends MBeanResourceComponent<MBeanResourceCompon
Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
Object resultObject = getEmsBean().getOperation(name).invoke(configuration);
- return new OperationResult(String.valueOf(resultObject));
+ if (resultObject instanceof OperationResult) {
+ return (OperationResult) resultObject;
+ } else {
+ return new OperationResult(String.valueOf(resultObject));
+ }
} finally {
Thread.currentThread().setContextClassLoader(cl);
}
}
- throw new Exception("Operation " + name + " not available mod_cluster_context service");
+ throw new Exception("Operation " + name + " not available mod_cluster WebApp service.");
}
}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java
index 3d03715..788cbce 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java
@@ -1,24 +1,20 @@
/*
- * Jopr Management Platform
+ * 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package org.rhq.plugins.modcluster;
@@ -33,6 +29,7 @@ import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
/**
* Discovers mod_cluster contexts from the proxyInfo mbean property.
@@ -43,7 +40,6 @@ import org.rhq.plugins.jmx.MBeanResourceComponent;
public class ContextDiscoveryComponent implements ResourceDiscoveryComponent<MBeanResourceComponent> {
private static final String JVM_ROUTE_PROPERTY = "jvmRoute";
- private static final String PROXY_INFO_PROPERTY = "proxyInfo";
private static final String ENGINE_OBJECT_NAME = "engineObjectName";
/* (non-Javadoc)
@@ -51,7 +47,9 @@ public class ContextDiscoveryComponent implements ResourceDiscoveryComponent<MBe
*/
public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<MBeanResourceComponent> context) {
String jvmRoute = this.getJvmRoute(context);
- String rawProxyInfo = this.getRawProxyInfo(context);
+
+ EmsBean configBean = context.getParentResourceComponent().getEmsBean();
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(configBean);
ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
Set<DiscoveredResourceDetails> entities = new HashSet<DiscoveredResourceDetails>();
@@ -59,8 +57,7 @@ public class ContextDiscoveryComponent implements ResourceDiscoveryComponent<MBe
for (ProxyInfo.Context availableContext : proxyInfo.getAvailableContexts()) {
if (availableContext.getJvmRoute().equals(jvmRoute)) {
DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(),
- availableContext.createKey(), availableContext.createName(), null, "mod_cluster Webapp Context",
- null, null);
+ availableContext.createKey(), availableContext.createName(), null, "Webapp Context", null, null);
entities.add(detail);
}
}
@@ -83,17 +80,6 @@ public class ContextDiscoveryComponent implements ResourceDiscoveryComponent<MBe
}
/**
- * Retrieves raw proxy configuration from the parent context.
- *
- * @param context the discovery context
- * @return raw proxy configuration
- */
- private String getRawProxyInfo(ResourceDiscoveryContext<MBeanResourceComponent> context) {
- EmsBean statsBean = context.getParentResourceComponent().getEmsBean();
- return (String) statsBean.getAttribute(PROXY_INFO_PROPERTY).refresh().toString();
- }
-
- /**
* Loads the bean with the given object name.
*
* Subclasses are free to override this method in order to load the bean.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
new file mode 100644
index 0000000..9b511b3
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
@@ -0,0 +1,137 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+import org.rhq.core.util.exception.ThrowableUtil;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+@SuppressWarnings("rawtypes")
+public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent {
+
+ private static final String BEAN_CLASS_NAME_PROPERTY = "className";
+ private static final String DEPENDENCY_BEAN_CLASS_NAME_PROPERTY = "dependencyClassName";
+
+ /**
+ * This default setup of configuration properties can map to mbean attributes
+ *
+ * @return the configuration of the component
+ */
+ @Override
+ @SuppressWarnings("deprecation")
+ public Configuration loadResourceConfiguration() {
+ Configuration configuration = new Configuration();
+ ConfigurationDefinition configurationDefinition = this.resourceContext.getResourceType()
+ .getResourceConfigurationDefinition();
+
+ try {
+ ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance(this.resourceContext
+ .getPluginConfiguration());
+
+ for (PropertyDefinition property : configurationDefinition.getPropertyDefinitions().values()) {
+ if (property instanceof PropertyDefinitionSimple) {
+ String value = modClusterBeanFile.getPropertyValue(property.getName());
+ if (value != null) {
+ configuration.put(new PropertySimple(property.getName(), value));
+ } else {
+ PropertyDefinitionSimple propertyDefinitionSimple = (PropertyDefinitionSimple) property;
+ configuration.put(new PropertySimple(property.getName(), propertyDefinitionSimple
+ .getDefaultValue()));
+ }
+ }
+ }
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ return configuration;
+ }
+
+ /**
+ * Equivalent to updateResourceConfiguration(report, false);
+ */
+ @Override
+ public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ updateResourceConfiguration(report, false);
+ }
+
+ private ModClusterBeanFile getModClusterBeanFileInstance(Configuration pluginConfig) throws Exception {
+ String beanClassName = pluginConfig.getSimple(BEAN_CLASS_NAME_PROPERTY).getStringValue();
+
+ if (pluginConfig.getSimple(DEPENDENCY_BEAN_CLASS_NAME_PROPERTY) != null) {
+ String dependencyBeanClassName = pluginConfig.getSimple(DEPENDENCY_BEAN_CLASS_NAME_PROPERTY)
+ .getStringValue();
+ return new ModClusterBeanFile(dependencyBeanClassName);
+ }
+
+ return new ModClusterBeanFile(beanClassName);
+ }
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public void updateResourceConfiguration(ConfigurationUpdateReport report, boolean ignoreReadOnly) {
+ ConfigurationDefinition configurationDefinition = this.getResourceContext().getResourceType()
+ .getResourceConfigurationDefinition();
+
+ // assume we succeed - we'll set to failure if we can't set all properties
+ report.setStatus(ConfigurationUpdateStatus.SUCCESS);
+
+ try {
+ ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance(this.resourceContext
+ .getPluginConfiguration());
+
+ for (String key : report.getConfiguration().getSimpleProperties().keySet()) {
+ PropertySimple property = report.getConfiguration().getSimple(key);
+ if (property != null) {
+ try {
+ PropertyDefinitionSimple def = configurationDefinition.getPropertyDefinitionSimple(property
+ .getName());
+ if (!(ignoreReadOnly && def.isReadOnly())) {
+ modClusterBeanFile.setPropertyValue(property.getName(), property.getStringValue());
+ }
+ } catch (Exception e) {
+ property.setErrorMessage(ThrowableUtil.getStackAsString(e));
+ report
+ .setErrorMessage("Failed setting resource configuration - see property error messages for details");
+ log.info("Failure setting MBean Resource configuration value for " + key, e);
+ }
+ }
+ }
+
+ modClusterBeanFile.saveConfigFile();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
new file mode 100644
index 0000000..fb944c8
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
@@ -0,0 +1,95 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import java.util.Set;
+
+import org.mc4j.ems.connection.EmsConnection;
+import org.mc4j.ems.connection.bean.EmsBean;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jmx.JMXComponent;
+import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
+
+/**
+ * @author snegrea
+ *
+ */
+@SuppressWarnings("rawtypes")
+public class LoadMetricDiscoveryComponent extends MBeanResourceDiscoveryComponent<JMXComponent> {
+
+ /* (non-Javadoc)
+ * @see org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext, boolean)
+ */
+ @Override
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<JMXComponent> context,
+ boolean skipUnknownProps) {
+
+ Set<DiscoveredResourceDetails> results = super.discoverResources(context, skipUnknownProps);
+
+ for (DiscoveredResourceDetails discoveredResource : results) {
+
+ String name = getBeanConfiguredClassName(context, discoveredResource.getResourceKey());
+
+ name = name.substring(name.lastIndexOf(".") + 1);
+ name = name.substring(0, name.lastIndexOf("LoadMetric"));
+
+ discoveredResource.setResourceName(name);
+ discoveredResource.setResourceDescription("Load Metric");
+ }
+
+ return results;
+ }
+
+ /**
+ * @param context
+ * @param objectName
+ * @return
+ */
+ public String getBeanConfiguredClassName(ResourceDiscoveryContext<JMXComponent> context, String objectName) {
+ EmsConnection connection = context.getParentResourceComponent().getEmsConnection();
+ EmsBean emsBean = loadBean(connection, objectName);
+
+ return emsBean.getClassTypeName();
+ }
+
+ /**
+ * Loads the bean with the given object name.
+ *
+ * Subclasses are free to override this method in order to load the bean.
+ *
+ * @param objectName the name of the bean to load
+ * @return the bean that is loaded
+ */
+ protected EmsBean loadBean(EmsConnection emsConnection, String objectName) {
+ EmsBean bean = emsConnection.getBean(objectName);
+ if (bean == null) {
+ // In some cases, this resource component may have been discovered by some means other than querying its
+ // parent's EMSConnection (e.g. ApplicationDiscoveryComponent uses a filesystem to discover EARs and
+ // WARs that are not yet deployed). In such cases, getBean() will return null, since EMS won't have the
+ // bean in its cache. To cover such cases, make an attempt to query the underlying MBeanServer for the
+ // bean before giving up.
+ emsConnection.queryBeans(objectName);
+ bean = emsConnection.getBean(objectName);
+ }
+ return bean;
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
index 70898ef..2c964c0 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
@@ -20,6 +20,7 @@ package org.rhq.plugins.modcluster;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
/**
* @author Stefan Negrea
@@ -28,15 +29,21 @@ import org.rhq.plugins.jmx.MBeanResourceComponent;
@SuppressWarnings({ "rawtypes" })
public class ModclusterServerComponent extends MBeanResourceComponent {
+ //private final static String PROXY_INFO_PROPERTY_NAME
+
/* (non-Javadoc)
* @see org.rhq.plugins.jmx.MBeanResourceComponent#getAvailability()
*/
@Override
public AvailabilityType getAvailability() {
- String rawProxyInfo = (String) getEmsBean().getAttribute("proxyInfo").refresh().toString();
- ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
+
+ if (rawProxyInfo == null) {
+ return AvailabilityType.DOWN;
+ }
- if (proxyInfo.getAvailableContexts().size() == 0) {
+ ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
+ if (proxyInfo.getAvailableNodes().size() == 0) {
return AvailabilityType.DOWN;
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
new file mode 100644
index 0000000..8f5d08b
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
@@ -0,0 +1,35 @@
+package org.rhq.plugins.modcluster;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.pluginapi.operation.OperationResult;
+
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.
+ */
+
+public class PolyPingMBeanResourceComponent extends FileConfiguredMBeanResourceComponent {
+
+ @Override
+ public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
+ if (name.toLowerCase().startsWith("ping")) {
+ name = "ping";
+ }
+
+ return super.invokeOperation(name, parameters);
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
new file mode 100644
index 0000000..4fe5788
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
@@ -0,0 +1,63 @@
+/*
+ * 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.plugins.modcluster.config;
+
+import java.io.IOException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/**
+ *
+ * @author Stefan Negrea
+ */
+public abstract class AbstractConfigurationFile {
+
+ public static final String SERVER_HOME_DIR = "jboss.server.home.dir";
+
+ private String fileName;
+ private Document document;
+
+ public AbstractConfigurationFile(String fileName) throws ParserConfigurationException, SAXException, IOException {
+ this.fileName = fileName;
+
+ DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
+ this.document = docBuilder.parse(this.getFileName());
+ }
+
+ /**
+ * @return the fileName
+ */
+ public String getFileName() {
+ return fileName;
+ }
+
+ /**
+ * @return the doc
+ */
+ public Document getDocument() {
+ return document;
+ }
+
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
new file mode 100644
index 0000000..602e52b
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
@@ -0,0 +1,39 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster.config;
+
+import java.io.IOException;
+
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.SAXException;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+public class JBossWebServerFile extends AbstractConfigurationFile {
+
+ public JBossWebServerFile(String fileName) throws ParserConfigurationException, SAXException, IOException {
+ super(fileName);
+ // TODO Auto-generated constructor stub
+ }
+
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
new file mode 100644
index 0000000..0e25f26
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -0,0 +1,205 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster.config;
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+/**
+ * @author snegrea
+ *
+ */
+public class ModClusterBeanFile extends AbstractConfigurationFile {
+
+ private Node beanNode;
+
+ public ModClusterBeanFile(String className) throws ParserConfigurationException, SAXException, IOException {
+ super(
+ "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+
+ beanNode = this.getBeanNodeByClass(className);
+ }
+
+ public ModClusterBeanFile(String className, String constructorArgumentClassName)
+ throws ParserConfigurationException, SAXException, IOException {
+ super(
+ "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+
+ Node primaryBeanNode = this.getBeanNodeByClass(className);
+ String dependencyName = this.getBeanFromConstructorArgument(primaryBeanNode, constructorArgumentClassName);
+
+ beanNode = this.getBeanNodeByName(dependencyName);
+ }
+
+ private String getBeanFromConstructorArgument(Node beanNode, String constructorArgumentClassName) {
+ List<Node> tempNodeList = this.getChildNodesByName(beanNode, "constructor");
+
+ if (tempNodeList.size() > 0) {
+ Node constructorNode = tempNodeList.get(0);
+
+ tempNodeList = this.getChildNodesByName(constructorNode, "parameter");
+
+ if (tempNodeList.size() > 0) {
+ Node parameterNode = null;
+
+ for (Node currentNode : tempNodeList) {
+ if (currentNode.getAttributes().getNamedItem("class") != null
+ && constructorArgumentClassName.equals(currentNode.getAttributes().getNamedItem("class")
+ .getTextContent())) {
+ parameterNode = currentNode;
+ break;
+ }
+ }
+
+ if (parameterNode != null) {
+ tempNodeList = this.getChildNodesByName(parameterNode, "inject");
+
+ if (tempNodeList.size() > 0) {
+ Node injectNode = tempNodeList.get(0);
+ Node beanAttribute = injectNode.getAttributes().getNamedItem("bean");
+
+ if (beanAttribute != null) {
+ return beanAttribute.getTextContent();
+ }
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private List<Node> getChildNodesByName(Node node, String nodeName) {
+ List<Node> listOfNodes = new ArrayList<Node>();
+
+ for (int i = 0; i < node.getChildNodes().getLength(); i++) {
+ Node currentNode = node.getChildNodes().item(i);
+
+ if (nodeName.equals(currentNode.getNodeName())) {
+ listOfNodes.add(currentNode);
+ }
+ }
+
+ return listOfNodes;
+ }
+
+ public void setPropertyValue(String propertyName, String value) {
+ boolean propertyFound = false;
+ for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
+ Node currentNode = beanNode.getChildNodes().item(i);
+
+ if (currentNode.getNodeName().equals("property")
+ && currentNode.getAttributes().getNamedItem("name") != null
+ && propertyName.equals(currentNode.getAttributes().getNamedItem("name").getTextContent())) {
+
+ if (value != null) {
+ currentNode.setTextContent(value);
+ } else {
+ beanNode.removeChild(currentNode);
+ }
+
+ propertyFound = true;
+ }
+ }
+
+ if (value != null && !propertyFound) {
+ Node propertyChild = this.getDocument().createElement("property");
+ Attr nameProperty = this.getDocument().createAttribute("name");
+ nameProperty.setValue(propertyName);
+ propertyChild.setTextContent(value);
+ propertyChild.getAttributes().setNamedItem(nameProperty);
+ beanNode.appendChild(propertyChild);
+ }
+ }
+
+ public String getPropertyValue(String propertyName) {
+ for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
+ Node currentNode = beanNode.getChildNodes().item(i);
+
+ if (currentNode.getNodeName().equals("property")
+ && currentNode.getAttributes().getNamedItem("name") != null
+ && propertyName.equals(currentNode.getAttributes().getNamedItem("name").getTextContent())) {
+
+ return currentNode.getTextContent();
+ }
+ }
+
+ return null;
+ }
+
+ public void saveConfigFile() throws TransformerException {
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ transformer.setOutputProperty(OutputKeys.INDENT, "no");
+
+ //initialize StreamResult with File object to save to file
+ StreamResult result = new StreamResult(new StringWriter());
+ DOMSource source = new DOMSource(this.getDocument());
+ transformer.transform(source, result);
+
+ String xmlString = result.getWriter().toString();
+ System.out.println(xmlString);
+ }
+
+ public Node getBeanNodeByClass(String className) {
+ NodeList result = this.getDocument().getElementsByTagName("bean");
+
+ for (int i = 1; i < result.getLength(); i++) {
+ Node node = result.item(i);
+ if (node.getAttributes().getNamedItem("class") != null
+ && className.equals(node.getAttributes().getNamedItem("class").getTextContent())) {
+ System.out.println(node.getAttributes().getNamedItem("class").getTextContent());
+ return node;
+ }
+ }
+
+ return null;
+ }
+
+ public Node getBeanNodeByName(String beanName) {
+ NodeList result = this.getDocument().getElementsByTagName("bean");
+
+ for (int i = 1; i < result.getLength(); i++) {
+ Node node = result.item(i);
+ if (node.getAttributes().getNamedItem("name") != null
+ && beanName.equals(node.getAttributes().getNamedItem("name").getTextContent())) {
+ System.out.println(node.getAttributes().getNamedItem("name").getTextContent());
+ return node;
+ }
+ }
+
+ return null;
+ }
+
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/helper/JBossHelper.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/helper/JBossHelper.java
new file mode 100644
index 0000000..364f3ef
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/helper/JBossHelper.java
@@ -0,0 +1,49 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster.helper;
+
+import org.mc4j.ems.connection.bean.EmsBean;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+public class JBossHelper {
+
+ public static String getRawProxyInfo(EmsBean emsBean) {
+ String rawProxyInfo = null;
+
+ //try first to get the value for JBoss EAP5.x or AS6
+ try {
+ rawProxyInfo = (String) emsBean.getAttribute("ProxyInfo").refresh().toString();
+ } catch (Exception e) {
+ }
+
+ //if not able to get the value after the first attempt try to get the value for JBoss 4.2/4.3
+ if (rawProxyInfo == null) {
+ try {
+ rawProxyInfo = (String) emsBean.getAttribute("proxyInfo").refresh().toString();
+ } catch (Exception e) {
+ }
+ }
+
+ return rawProxyInfo;
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 4846490..fe4ac7d 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -1,132 +1,466 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<plugin name="mod_cluster"
- displayName="mod_cluster"
- description="Monitoring and management of mod_cluster plugin."
- version="1.0"
- package="org.rhq.plugins.modcluster"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="urn:xmlns:rhq-plugin"
- xmlns:c="urn:xmlns:rhq-configuration">
+<plugin name="mod_cluster" displayName="mod_cluster" description="Monitoring and management of mod_cluster plugin." version="1.0" package="org.rhq.plugins.modcluster" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
<depends plugin="JMX" />
- <service name="mod_cluster"
- discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent"
- class="ModclusterServerComponent"
- supportsManualAdd="true"
- description="mod_cluster plugin"
- singleton="true">
-
+ <service name="mod_cluster" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="mod_cluster plugin" singleton="true">
+
<runs-inside>
- <parent-resource-type name="JBossAS Server" plugin="JBossAS"/>
- <parent-resource-type name="JBossAS5 Server" plugin="JBossAS5"/>
+ <parent-resource-type name="JBossAS Server" plugin="JBossAS" />
+ <parent-resource-type name="JBossAS Server" plugin="JBossAS5" />
</runs-inside>
-
+
<plugin-configuration>
- <c:simple-property name="objectName" readOnly="true" default="Catalina:type=ModClusterListener,*"/>
- <c:simple-property name="engineObjectName" readOnly="true" default="jboss.web:type=Engine"/>
- <c:simple-property name="nameTemplate" default="mod_cluster"/>
+ <c:simple-property name="objectName" readOnly="true" default="Catalina:type=ModClusterListener,*|jboss.web:service=ModCluster" />
+ <c:simple-property name="engineObjectName" readOnly="true" default="jboss.web:type=Engine" />
+ <c:simple-property name="nameTemplate" default="mod_cluster" />
</plugin-configuration>
-
- <operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
- <parameters>
- <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout"/>
- <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
- <c:property-options allowCustomValue="false">
- <c:option value="MICROSECONDS" name="MICROSECONDS"/>
- <c:option value="MILLISECONDS" name="MILLISECONDS"/>
- <c:option value="NANOSECONDS" name="NANOSECONDS"/>
- <c:option value="SECONDS" name="SECONDS"/>
- <c:option value="HOURS" name="HOURS"/>
- <c:option value="DAYS" name="DAYS"/>
- </c:property-options>
- </c:simple-property>
- </parameters>
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
- </results>
- </operation>
- <operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
- <parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address"/>
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port"/>
- </parameters>
- </operation>
- <operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
- </results>
- </operation>
+
<operation name="reset" displayName="Reset the node" description="Move this application server out of an error state." />
- <operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
- </results>
- </operation>
- <operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
- <parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address"/>
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port"/>
- </parameters>
- </operation>
<operation name="refresh" displayName="Refresh configuration" description="Refresh configuration for this application server." />
-
- <metric property="proxyConfiguration" displayName="Proxy Configuration" displayType="summary" dataType="trait" />
- <metric property="modelerType" displayName="Type of the modeled resource" displayType="summary" dataType="trait" />
- <metric property="className" displayName="Fully qualified class name of the managed object" displayType="summary" dataType="trait" />
- <metric property="advertise" displayName="Enable autodiscovery of httpd servers." displayType="summary" dataType="trait" />
-
- <resource-configuration>
- <c:simple-property name="workerTimeout" type="integer" description="Timeout to wait for an available worker (default is no wait)." />
- <c:simple-property name="stickySession" type="boolean" description="Enables sticky session for the cluster."/>
- <c:simple-property name="stickySessionRemove" type="boolean" description="Remove session when the request cannot be routed to the right node for this cluster."/>
- <c:simple-property name="smax" type="integer" description="Maximum time on seconds for idle connections above smax."/>
- <c:simple-property name="maxAttempts" type="integer" description="Maximum number of attempts to send the request to the backend server."/>
- <c:simple-property name="advertiseSecurityKey" type="string" required="false" description="Security key for discovery."/>
- <c:simple-property name="stickySessionForce" type="boolean" description="Return an error when the request cannot be routed to the right node."/>
- <c:simple-property name="balancer" type="string" required="false" description="Name of the balancer."/>
- <c:simple-property name="flushPackets" type="boolean" description="Allows controlling flusing of packets."/>
- <c:simple-property name="socketTimeout" type="integer" description="Connection timeout for communication with the proxy." />
- <c:simple-property name="advertisePort" type="integer" required="false" description="Multicast port for discovery" />
- <c:simple-property name="advertiseGroupAddress" type="string" required="false" description="Multicast address for discovery."/>
- <c:simple-property name="flushWait" type="integer" description="Time in ms to wait before flushing packets."/>
- <c:simple-property name="ping" type="integer" description="Time in s to wait for a pong answer to a ping."/>
- </resource-configuration>
-
- <service name="mod_cluster Webapp Context"
- discovery="ContextDiscoveryComponent"
- class="ContextComponent"
- description="mod_cluster webapp context">
-
- <operation name="disableContext" displayName="Disable webapp" description="Disable this webapp.">
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation."/>
- </results>
- </operation>
- <operation name="stopContext" displayName="Stop webapp" description="Gracefully stops this webapp.">
+
+ <!-- Start - Configuration for HAModClusterService -->
+ <service name="HA Service" discovery="ClassNameMBeanDiscoveryComponent" class="PolyPingMBeanResourceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
+ <c:simple-property name="nameTemplate" default="HA Service" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.ha.HAModClusterService" />
+ <c:simple-property name="proxyInfoProperty" readOnly="true" default="ProxyInfo" />
+ </plugin-configuration>
+
+ <!-- HA Operations -->
+ <operation name="disableDomain" displayName="Disable domain" description="Disables all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
+ <results>
+ <c:simple-property name="result" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="enableDomain" displayName="Enable domain" description="Enable all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="stopDomain" displayName="Stop domain" description="Gracefully stops all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
+ <parameters>
+ <c:simple-property required="true" name="timeout" type="string" displayName="The number of units of time for which to wait for all sessions to drain on a given node." />
+ <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:property-options allowCustomValue="false">
+ <c:option value="MICROSECONDS" name="MICROSECONDS" />
+ <c:option value="MILLISECONDS" name="MILLISECONDS" />
+ <c:option value="NANOSECONDS" name="NANOSECONDS" />
+ <c:option value="SECONDS" name="SECONDS" />
+ <c:option value="HOURS" name="HOURS" />
+ <c:option value="DAYS" name="DAYS" />
+ </c:property-options>
+ </c:simple-property>
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+
+ <!-- Regular Operations -->
+
+ <operation name="pingHTTPD" displayName="Ping httpd" description="Ping httpd and determine whether each proxy is accessible and healthy. Returns the PING_RSP grouped by proxy address.">
+ <results>
+ <c:simple-property name="result" description="Map of PING_RPS response, grouped by proxy.">
+ </c:simple-property>
+ </results>
+ </operation>
+ <operation name="pingNodeByJVMRoute" displayName="Ping node by JVM Route"
+ description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Dtermines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
+ <parameters>
+ <c:simple-property required="true" name="jvmRoute" type="string" displayName="JVM Route of node to ping." />
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ </results>
+ </operation>
+ <operation name="pingNodeByAddress" displayName="Ping node by address"
+ description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Determines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
+ <parameters>
+ <c:simple-property required="true" name="scheme" type="string" displayName="Scheme (ajp, http, https)" />
+ <c:simple-property required="true" name="hostname" type="string" displayName="Name or ip address of a node." />
+ <c:simple-property required="true" name="port" type="string" displayName="Port" />
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ </results>
+ </operation>
+
+ <operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" description="The result of the operation">
+ </c:simple-property>
+ </results>
+ </operation>
+ <operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" description="The result of the operation">
+ </c:simple-property>
+ </results>
+ </operation>
+ <operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
+ <parameters>
+ <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:property-options allowCustomValue="false">
+ <c:option value="MICROSECONDS" name="MICROSECONDS" />
+ <c:option value="MILLISECONDS" name="MILLISECONDS" />
+ <c:option value="NANOSECONDS" name="NANOSECONDS" />
+ <c:option value="SECONDS" name="SECONDS" />
+ <c:option value="HOURS" name="HOURS" />
+ <c:option value="DAYS" name="DAYS" />
+ </c:property-options>
+ </c:simple-property>
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+
+ <metric property="MasterNode" displayName="Master Node" displayType="summary" dataType="trait" />
+ <metric property="ProxyConfiguration" displayName="Proxy Configuration" displayType="summary" dataType="trait" />
+ <metric property="ProxyInfo" displayName="Proxy Info" displayType="summary" dataType="trait" />
+
+ <resource-configuration>
+ <c:simple-property name="processStatusFrequency" type="integer" description="Process status frequency." />
+ </resource-configuration>
+ </service>
+
+ <service name="HA Service Configuration" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true" description="HA Service Configuration" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
+ <c:simple-property name="nameTemplate" default="HA Service Configuration" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.ha.HAModClusterService" />
+ <c:simple-property name="dependencyClassName" readOnly="true" default="org.jboss.modcluster.config.ha.HAModClusterConfig" />
+ <c:simple-property name="proxyInfoProperty" readOnly="true" default="ProxyInfo" />
+ </plugin-configuration>
+
+ <resource-configuration>
+
+ <!-- HA Configuration -->
+ <c:simple-property name="masterPerLoadBalancingGroup" type="boolean" required="false" description="Enable current node to be master in the load balancing group." />
+
+ <!-- Handler Configuration -->
+ <c:simple-property name="advertise" type="boolean" required="false" default="false" description="Enable autodiscovery of httpd servers." />
+ <c:simple-property name="advertiseGroupAddress" type="string" description="Multicast address on which to listen for advertisements." />
+ <c:simple-property name="advertisePort" type="string" required="false" description="Multicast port for discovery" />
+ <c:simple-property name="advertiseInterface" type="string" required="false" description="Multicast interface for discovery" />
+ <c:simple-property name="advertiseSecurityKey" type="string" required="false" description="Security key for discovery." />
+ <c:simple-property name="proxyList" type="string" required="false" description="Comma separated list of address:port listing the httpd servers where mod_cluster is running." />
+ <c:simple-property name="proxyURL" type="string" required="false" description="URL prefix to send with commands to mod_cluster. Default is no prefix." />
+ <c:simple-property name="socketTimeout" type="integer" required="false" description="Connection timeout for communication with the proxy." />
+ <c:simple-property name="ssl" type="boolean" description="Whether to use SSL to communicate with mod_cluster. Note this has nothing to do with handling of https requests by JBoss Web" />
+ <c:simple-property name="excludedContexts" type="string" required="false" description="Comma delimited list of contexts that should *not* be auto-registered with httpd. Contexts may be qualified by host using a colon, e.g. host1:context1. If no host is defined, localhost is assumed." />
+ <c:simple-property name="autoEnableContexts" type="boolean" required="false" default="true" description="Toggle for context auto-enable during mod_cluster startup." />
+
+ <!-- Node Configuration -->
+ <c:simple-property name="loadBalancingGroup" type="string" required="false" description="Load balancing group." />
+ <c:simple-property name="flushPackets" type="boolean" required="false" description="Allows controlling flusing of packets." />
+ <c:simple-property name="flushWait" type="integer" required="false" description="Time in ms to wait before flushing packets." />
+ <c:simple-property name="ping" type="integer" required="false" description="Time in s to wait for a pong answer to a ping." />
+ <c:simple-property name="smax" type="integer" required="false" description="Maximum time on seconds for idle connections above smax." />
+ <c:simple-property name="ttl" type="integer" required="false" description="TTL" />
+ <c:simple-property name="nodeTimeout" type="integer" required="false" description="Node timeout" />
+ <c:simple-property name="balancer" type="string" required="false" description="Name of the balancer" />
+
+ <!-- Balancer Configuration -->
+ <c:simple-property name="stickySession" type="boolean" description="Enables sticky session for the node." />
+ <c:simple-property name="stickySessionRemove" type="boolean" description="Remove session when the request cannot be routed to the right node for this cluster." />
+ <c:simple-property name="stickySessionForce" type="boolean" description="Return an error when the request cannot be routed to the right node." />
+ <c:simple-property name="workerTimeout" type="integer" description="Timeout to wait for an available worker (default is no wait)." />
+ <c:simple-property name="maxAttempts" type="integer" description="Maximum number of attempts to send the request to the backend server." />
+ </resource-configuration>
+ </service>
+ <!-- End - Configuration for HAModClusterService -->
+
+ <!-- Start - Configuration for ModClusterService -->
+ <service name="Service" discovery="ClassNameMBeanDiscoveryComponent" class="PolyPingMBeanResourceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
+ <c:simple-property name="nameTemplate" default="HA Service" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.ModClusterService" />
+ <c:simple-property name="proxyInfoProperty" readOnly="true" default="ProxyInfo" />
+ </plugin-configuration>
+
+ <operation name="pingHTTPD" displayName="Ping httpd" description="Ping httpd and determine whether each proxy is accessible and healthy. Returns the PING_RSP grouped by proxy address.">
+ <results>
+ <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ </results>
+ </operation>
+ <operation name="pingNodeByJVMRoute" displayName="Ping node by JVM Route"
+ description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Dtermines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
+ <parameters>
+ <c:simple-property required="true" name="jvmRoute" type="string" displayName="JVM Route of node to ping." />
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ </results>
+ </operation>
+ <operation name="pingNodeByAddress" displayName="Ping node by address"
+ description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Determines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
+ <parameters>
+ <c:simple-property required="true" name="scheme" type="string" displayName="Scheme (ajp, http, https)" />
+ <c:simple-property required="true" name="hostname" type="string" displayName="Name or ip address of a node." />
+ <c:simple-property required="true" name="port" type="string" displayName="Port" />
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ </results>
+ </operation>
+
+ <operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
+ <parameters>
+ <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:property-options allowCustomValue="false">
+ <c:option value="MICROSECONDS" name="MICROSECONDS" />
+ <c:option value="MILLISECONDS" name="MILLISECONDS" />
+ <c:option value="NANOSECONDS" name="NANOSECONDS" />
+ <c:option value="SECONDS" name="SECONDS" />
+ <c:option value="HOURS" name="HOURS" />
+ <c:option value="DAYS" name="DAYS" />
+ </c:property-options>
+ </c:simple-property>
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+
+ <metric property="ProxyConfiguration" displayName="Proxy Configuration" displayType="summary" dataType="trait" />
+ <metric property="ProxyInfo" displayName="Proxy Info" displayType="summary" dataType="trait" />
+ </service>
+
+ <service name="Service Configuration" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true" description="HA Service Configuration" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
+ <c:simple-property name="nameTemplate" default="HA Service Configuration" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.ModClusterService" />
+ <c:simple-property name="dependencyClassName" readOnly="true" default="org.jboss.modcluster.config.ModClusterConfig" />
+ <c:simple-property name="proxyInfoProperty" readOnly="true" default="ProxyInfo" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <!-- Handler Configuration -->
+ <c:simple-property name="advertise" type="boolean" required="false" default="false" description="Enable autodiscovery of httpd servers." />
+ <c:simple-property name="advertiseGroupAddress" type="string" description="Multicast address on which to listen for advertisements." />
+ <c:simple-property name="advertisePort" type="string" required="false" description="Multicast port for discovery" />
+ <c:simple-property name="advertiseInterface" type="string" required="false" description="Multicast interface for discovery" />
+ <c:simple-property name="advertiseSecurityKey" type="string" required="false" description="Security key for discovery." />
+ <c:simple-property name="proxyList" type="string" required="false" description="Comma separated list of address:port listing the httpd servers where mod_cluster is running." />
+ <c:simple-property name="proxyURL" type="string" required="false" description="URL prefix to send with commands to mod_cluster. Default is no prefix." />
+ <c:simple-property name="socketTimeout" type="integer" required="false" description="Connection timeout for communication with the proxy." />
+ <c:simple-property name="ssl" type="boolean" description="Whether to use SSL to communicate with mod_cluster. Note this has nothing to do with handling of https requests by JBoss Web" />
+ <c:simple-property name="excludedContexts" type="string" required="false"
+ description="Comma delimited list of contexts that should *not* be auto-registered with httpd. Contexts may be qualified by host using a colon, e.g. host1:context1. If no host is defined, localhost is assumed." />
+ <c:simple-property name="autoEnableContexts" type="boolean" required="false" default="true" description="Toggle for context auto-enable during mod_cluster startup." />
+
+ <!-- Node Configuration -->
+ <c:simple-property name="loadBalancingGroup" type="string" required="false" description="Load balancing group." />
+ <c:simple-property name="flushPackets" type="boolean" required="false" description="Allows controlling flusing of packets." />
+ <c:simple-property name="flushWait" type="integer" required="false" description="Time in ms to wait before flushing packets." />
+ <c:simple-property name="ping" type="integer" required="false" description="Time in s to wait for a pong answer to a ping." />
+ <c:simple-property name="smax" type="integer" required="false" description="Maximum time on seconds for idle connections above smax." />
+ <c:simple-property name="ttl" type="integer" required="false" description="TTL" />
+ <c:simple-property name="nodeTimeout" type="integer" required="false" description="Node timeout" />
+ <c:simple-property name="balancer" type="string" required="false" description="Name of the balancer" />
+
+ <!-- Balancer Configuration -->
+ <c:simple-property name="stickySession" type="boolean" description="Enables sticky session for the node." />
+ <c:simple-property name="stickySessionRemove" type="boolean" description="Remove session when the request cannot be routed to the right node for this cluster." />
+ <c:simple-property name="stickySessionForce" type="boolean" description="Return an error when the request cannot be routed to the right node." />
+ <c:simple-property name="workerTimeout" type="integer" description="Timeout to wait for an available worker (default is no wait)." />
+ <c:simple-property name="maxAttempts" type="integer" description="Maximum number of attempts to send the request to the backend server." />
+ </resource-configuration>
+ </service>
+ <!-- End - Configuration for ModClusterService -->
+
+ <service name="Catalina Service" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="Catalina Service Listener" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="Catalina:type=ModClusterListener,*" />
+ <c:simple-property name="nameTemplate" default="mod_cluster Catalina Listener" />
+ </plugin-configuration>
+
+ <operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
+ <parameters>
+ <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:property-options allowCustomValue="false">
+ <c:option value="MICROSECONDS" name="MICROSECONDS" />
+ <c:option value="MILLISECONDS" name="MILLISECONDS" />
+ <c:option value="NANOSECONDS" name="NANOSECONDS" />
+ <c:option value="SECONDS" name="SECONDS" />
+ <c:option value="HOURS" name="HOURS" />
+ <c:option value="DAYS" name="DAYS" />
+ </c:property-options>
+ </c:simple-property>
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+
+ <metric property="proxyConfiguration" displayName="Proxy Configuration" displayType="summary" dataType="trait" />
+ <metric property="modelerType" displayName="Type of the modeled resource" displayType="summary" dataType="trait" />
+ <metric property="className" displayName="Fully qualified class name of the managed object" displayType="summary" dataType="trait" />
+ <metric property="advertise" displayName="Enable autodiscovery of httpd servers." displayType="summary" dataType="trait" />
+
+ <resource-configuration>
+ <c:simple-property name="workerTimeout" type="integer" description="Timeout to wait for an available worker (default is no wait)." />
+ <c:simple-property name="stickySession" type="boolean" description="Enables sticky session for the cluster." />
+ <c:simple-property name="stickySessionRemove" type="boolean" description="Remove session when the request cannot be routed to the right node for this cluster." />
+ <c:simple-property name="smax" type="integer" description="Maximum time on seconds for idle connections above smax." />
+ <c:simple-property name="maxAttempts" type="integer" description="Maximum number of attempts to send the request to the backend server." />
+ <c:simple-property name="advertiseSecurityKey" type="string" required="false" description="Security key for discovery." />
+ <c:simple-property name="stickySessionForce" type="boolean" description="Return an error when the request cannot be routed to the right node." />
+ <c:simple-property name="balancer" type="string" required="false" description="Name of the balancer." />
+ <c:simple-property name="flushPackets" type="boolean" description="Allows controlling flusing of packets." />
+ <c:simple-property name="socketTimeout" type="integer" description="Connection timeout for communication with the proxy." />
+ <c:simple-property name="advertisePort" type="integer" required="false" description="Multicast port for discovery" />
+ <c:simple-property name="advertiseGroupAddress" type="string" required="false" description="Multicast address for discovery." />
+ <c:simple-property name="flushWait" type="integer" description="Time in ms to wait before flushing packets." />
+ <c:simple-property name="ping" type="integer" description="Time in s to wait for a pong answer to a ping." />
+ </resource-configuration>
+ </service>
+
+ <service name="Dynamic Load Balancer Factor" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true" description="Dynamic Load balancer factor for mod_cluster" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:provider=LoadBalanceFactor,service=ModCluster,*" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProvider" />
+ <c:simple-property name="nameTemplate" default="Dynamic Load Balancer Factor" />
+ </plugin-configuration>
+
+ <metric property="Metrics" displayName="Collected Metrics" displayType="summary" dataType="trait" />
+
+ <resource-configuration>
+ <c:simple-property name="DecayFactor" type="integer" description="The number of historical load values used to determine load factor." />
+ <c:simple-property name="History" type="integer" description="The exponential decay factor for historical load values." />
+ </resource-configuration>
+ </service>
+
+ <service name="Simple Load Balancer Factor" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true" description="Simple load balancer factor for mod_cluster" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:provider=LoadBalanceFactor,service=ModCluster,*" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.load.impl.SimpleLoadBalanceFactorProvider" />
+ <c:simple-property name="nameTemplate" default="Simple Load Balancer Factor" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:simple-property name="loadBalanceFactor" type="integer" description="The load balance factor." />
+ </resource-configuration>
+ </service>
+
+ <service name="Load Metric" discovery="LoadMetricDiscoveryComponent" class="org.rhq.plugins.jmx.MBeanResourceComponent" description="Load Metric">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:provider=LoadBalanceFactor,service=ModCluster,metric=*,*" />
+ <c:simple-property name="nameTemplate" default="Load Metric" />
+ </plugin-configuration>
+
+ <metric property="Load" displayName="Load" category="utilization" description="The current load of this metric as a percent of the metric's capacity." dataType="measurement" />
+
+ <resource-configuration>
+ <c:simple-property name="Weight" type="integer" description="The significance of this load metric compared to the other metrics." />
+ <c:simple-property name="Capacity" type="double" description="Used to normalize the value returned by load expressed as a percentage of the capacity, such that: 0 < (load/capacity) < 1" />
+ </resource-configuration>
+ </service>
+
+ <service name="Webapp Context" discovery="ContextDiscoveryComponent" class="ContextComponent" description="Webapp Context">
+
+ <operation name="disableContext" displayName="Disable webapp" description="Disable this webapp.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation." />
+ </results>
+ </operation>
+ <operation name="stopContext" displayName="Stop webapp" description="Gracefully stops this webapp.">
<parameters>
- <c:simple-property required="true" name="timeout" type="integer" displayName="Session draining timeout"/>
- <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
- <c:property-options allowCustomValue="false">
- <c:option value="MICROSECONDS" name="MICROSECONDS"/>
- <c:option value="MILLISECONDS" name="MILLISECONDS"/>
- <c:option value="NANOSECONDS" name="NANOSECONDS"/>
- <c:option value="SECONDS" name="SECONDS"/>
- <c:option value="HOURS" name="HOURS"/>
- <c:option value="DAYS" name="DAYS"/>
- </c:property-options>
- </c:simple-property>
+ <c:simple-property required="true" name="timeout" type="integer" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:property-options allowCustomValue="false">
+ <c:option value="MICROSECONDS" name="MICROSECONDS" />
+ <c:option value="MILLISECONDS" name="MILLISECONDS" />
+ <c:option value="NANOSECONDS" name="NANOSECONDS" />
+ <c:option value="SECONDS" name="SECONDS" />
+ <c:option value="HOURS" name="HOURS" />
+ <c:option value="DAYS" name="DAYS" />
+ </c:property-options>
+ </c:simple-property>
</parameters>
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
- </results>
- </operation>
- <operation name="enableContext" displayName="Enable webapp" description="Enable this webapp.">
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
- </results>
- </operation>
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="enableContext" displayName="Enable webapp" description="Enable this webapp.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
</service>
</service>
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
new file mode 100644
index 0000000..4e4aac1
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
@@ -0,0 +1,58 @@
+/*
+ * 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.plugins.modcluster.test;
+
+import org.testng.annotations.Test;
+
+import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
+
+public class ServerConfigTest {
+
+ @Test
+ public void TestConfig() {
+
+ try {
+ ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService");
+ config.setPropertyValue("processStatusFrequency", "4");
+ config.setPropertyValue("test", "5");
+ config.setPropertyValue("test", "123");
+
+ System.out.println(config.getPropertyValue("test"));
+
+ config.saveConfigFile();
+
+ config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
+ "org.jboss.modcluster.config.ha.HAModClusterConfig");
+ config.setPropertyValue("processStatusFrequency", "4");
+ config.setPropertyValue("test", "5");
+ config.setPropertyValue("test", "123");
+
+ System.out.println(config.getPropertyValue("test"));
+
+ config.saveConfigFile();
+
+ config.setPropertyValue("test", null);
+ config.saveConfigFile();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+}
commit 9b57c3ef1e1bc0ee5f88968f4ee32693be048eb3
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Sun Aug 14 12:03:44 2011 -0500
With JBoss 5, the timeout is blocking the operation call for the period set. Reduce this period for these integration tests.
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
index dc98d78..0a39eab 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
+++ b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
@@ -168,7 +168,7 @@ public class ModclusterPluginTest {
log.info("Result of operation " + "enableContext" + " was: " + result.getSimpleResult());
Configuration config = new Configuration();
- config.put(new PropertySimple("timeout", "1000"));
+ config.put(new PropertySimple("timeout", "1"));
config.put(new PropertySimple("unit", java.util.concurrent.TimeUnit.SECONDS));
result = ((OperationFacet) resourceComponent).invokeOperation("stopContext", config);
log.info("Result of operation stopContext was: " + result.getSimpleResult());
commit 273a8701e0e62f907a3c92fbf9bc47aa5d02c51d
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Sun Aug 14 12:02:34 2011 -0500
Add jar dependencies for testing with JBoss 5&6.
diff --git a/modules/integration-tests/mod_cluster-plugin-test/pom.xml b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
index 0cc3f4f..77a81b2 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/pom.xml
+++ b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
@@ -17,9 +17,37 @@
<properties>
<scm.module.path>modules/integration-tests/mod_cluster-plugin-test</scm.module.path>
+ <!-- jbossas.version>6.0.0.20100429-M3</jbossas.version-->
+ <jbossas.version>6.0.0.M1</jbossas.version>
+
</properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-parent</artifactId>
+ <version>${jbossas.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-component-matrix</artifactId>
+ <version>${jbossas.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
<dependencies>
+
+ <dependency>
+ <groupId>org.jboss.integration</groupId>
+ <artifactId>jboss-profileservice-spi</artifactId>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>${rhq.groupId}</groupId>
@@ -41,6 +69,213 @@
<version>1.2.14</version>
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.naming</groupId>
+ <artifactId>jnp-client</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-aspects</artifactId>
+ <version>5.1.0.CR1</version>
+ <classifier>jboss-aspect-jdk50-client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>trove</groupId>
+ <artifactId>trove</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jboss-security-spi</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-javaee</artifactId>
+ <scope>test</scope>
+ </dependency-->
+
+ <dependency>
+ <groupId>oswego-concurrent</groupId>
+ <artifactId>concurrent</artifactId>
+ <version>1.3.4-jboss</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-server</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-mdr</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ <scope>test</scope>
+ </dependency-->
+
+ <!-- dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ <scope>test</scope>
+ </dependency-->
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-security</artifactId>
+ <version>5.1.0.CR1</version>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.integration</groupId>
+ <artifactId>jboss-transaction-spi</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-common</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-core</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-ext-api</artifactId>
+ <version>1.0.0</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-proxy-spi</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-proxy-impl</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-security</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ <scope>test</scope>
+ </dependency-->
+
+ <!-- dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jbosssx-client</artifactId>
+ <scope>test</scope>
+ </dependency-->
+
+ <dependency>
+ <groupId>org.jboss.aspects</groupId>
+ <artifactId>jboss-security-aspects</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.aop</groupId>
+ <artifactId>jboss-aop</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-reflect</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-serialization</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client-spi</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-profileservice</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-server</artifactId>
+ <classifier>jmx-invoker-adaptor-client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- dependency>
+ <groupId>jboss.messaging</groupId>
+ <artifactId>jboss-messaging-client</artifactId>
+ <scope>test</scope>
+ </dependency-->
</dependencies>
commit 324454e90750968aeaee52480f10cef156ac3178
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Wed Aug 10 18:04:02 2011 -0500
Get the integration tests to compile and run again by creating the maven module and deploying the correct resources to target folder.
diff --git a/.classpath b/.classpath
index cb9d57f..93a80cc 100644
--- a/.classpath
+++ b/.classpath
@@ -282,5 +282,6 @@
<classpathentry kind="src" path="modules/plugins/jboss-as-7/src/main/java"/>
<classpathentry kind="src" path="modules/plugins/jboss-as-7/src/test/java"/>
<classpathentry kind="src" path="modules/integration-tests/jboss-as-7-plugin-test/src/test/java"/>
+ <classpathentry kind="src" path="modules/integration-tests/mod_cluster-plugin-test/src/test/java"/>
<classpathentry kind="output" path="eclipse-classes"/>
</classpath>
diff --git a/modules/integration-tests/mod_cluster-plugin-test/pom.xml b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
new file mode 100644
index 0000000..0cc3f4f
--- /dev/null
+++ b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
@@ -0,0 +1,155 @@
+<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-plugins-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.rhq</groupId>
+ <artifactId>modcluster-plugin-test</artifactId>
+ <packaging>jar</packaging>
+
+ <name>RHQ mod_cluster Plugin Integration Test</name>
+ <description>Integration tests for mod_cluster RHQ Agent plugin</description>
+
+ <properties>
+ <scm.module.path>modules/integration-tests/mod_cluster-plugin-test</scm.module.path>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-jmx-plugin</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>modcluster-plugin</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <profiles>
+
+ <profile>
+ <id>integration-tests</id>
+ <activation>
+ <property>
+ <name>maven.test.skip</name>
+ <value>!true</value>
+ </property>
+ </activation>
+
+ <properties>
+ <rhq.rootDir>../../..</rhq.rootDir>
+ <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+ <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/rhq-downloads/rhq-plugins</rhq.deploymentDir>
+ </properties>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-test-resources</phase>
+ <configuration>
+ <tasks>
+ <echo>Setting up plugin dependencies...</echo>
+ <property name="settings.localRepository" location="${user.home}/.m2/repository" />
+ <mkdir dir="target/testsetup" />
+
+ <mkdir dir="target/testsetup/plugins" />
+ <copy toDir="target/testsetup/plugins" flatten="true">
+ <fileset dir="${settings.localRepository}/">
+ <include name="org/rhq/rhq-platform-plugin/${project.version}/rhq-platform-plugin-${project.version}.jar" />
+ <include name="org/rhq/rhq-jmx-plugin/${project.version}/rhq-jmx-plugin-${project.version}.jar" />
+ <include name="org/jboss/on/jopr-jboss-as-plugin/${project.version}/jopr-jboss-as-plugin-${project.version}.jar" />
+ <include name="org/jboss/on/jopr-jboss-as-5-plugin/${project.version}/jopr-jboss-as-5-plugin-${project.version}.jar" />
+ <include name="org/rhq/modcluster-plugin/${project.version}/modcluster-plugin-${project.version}.jar" />
+ </fileset>
+ <fileset dir="${rhq.deploymentDir}">
+ <include name="${project.artifactId}-${project.version}.jar" />
+ </fileset>
+ </copy>
+
+ <mkdir dir="target/testsetup/lib" />
+ <unzip dest="target/testsetup/lib">
+ <fileset dir="${settings.localRepository}/org/hyperic/sigar-dist/${sigar.version}" includes="*.zip" />
+ <patternset>
+ <include name="**/lib/sigar.jar" />
+ <include name="**/lib/bcel*.jar" />
+ <include name="**/lib/*.so" />
+ <include name="**/lib/*.sl" />
+ <include name="**/lib/*.dll" />
+ <include name="**/lib/*.dylib" />
+ </patternset>
+ </unzip>
+ <move todir="target/testsetup/lib" flatten="true">
+ <fileset dir="target/testsetup/lib">
+ <include name="**/lib/*" />
+ </fileset>
+ </move>
+ <delete dir="target/testsetup/lib/hyperic-sigar-${sigar.version}" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>surefire-it</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>${maven.test.skip}</skip>
+ <excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
+ <useSystemClassLoader>false</useSystemClassLoader>
+ <argLine>-Dorg.hyperic.sigar.path=${basedir}/target/testsetup/lib</argLine>
+ <systemProperties>
+ <property>
+ <name>project.artifactId</name>
+ <value>${project.artifactId}</value>
+ </property>
+ <property>
+ <name>project.version</name>
+ <value>${project.version}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
index 0f644fc..dc98d78 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
+++ b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
@@ -148,10 +148,12 @@ public class ModclusterPluginTest {
}
if (resourceComponent instanceof OperationFacet) {
- OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("reset", null);
+ OperationResult result = null;
+
+ result = ((OperationFacet) resourceComponent).invokeOperation("reset", new Configuration());
log.info("Result of operation test was: " + result);
- result = ((OperationFacet) resourceComponent).invokeOperation("disable", null);
+ result = ((OperationFacet) resourceComponent).invokeOperation("disable", new Configuration());
log.info("Result of operation test was: " + result.getSimpleResult());
}
}
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index ab52e84..fdc4f37 100644
--- a/modules/plugins/mod-cluster/pom.xml
+++ b/modules/plugins/mod-cluster/pom.xml
@@ -56,51 +56,6 @@
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
- <execution>
- <phase>process-test-resources</phase>
- <configuration>
- <tasks>
- <echo>Setting up plugin dependencies...</echo>
- <property name="settings.localRepository" location="${user.home}/.m2/repository" />
- <mkdir dir="target/testsetup" />
-
- <mkdir dir="target/testsetup/plugins" />
- <copy toDir="target/testsetup/plugins" flatten="true">
- <fileset dir="${settings.localRepository}/">
- <include name="org/rhq/rhq-platform-plugin/${project.version}/rhq-platform-plugin-${project.version}.jar" />
- <include name="org/rhq/rhq-jmx-plugin/${project.version}/rhq-jmx-plugin-${project.version}.jar" />
- <include name="org/jboss/on/jopr-jboss-as-plugin/${project.version}/jopr-jboss-as-plugin-${project.version}.jar" />
- <include name="org/jboss/on/jopr-jboss-as-5-plugin/${project.version}/jopr-jboss-as-5-plugin-${project.version}.jar" />
- </fileset>
- <fileset dir="${rhq.deploymentDir}">
- <include name="${project.artifactId}-${project.version}.jar" />
- </fileset>
- </copy>
-
- <mkdir dir="target/testsetup/lib" />
- <unzip dest="target/testsetup/lib">
- <fileset dir="${settings.localRepository}/org/hyperic/sigar-dist/${sigar.version}" includes="*.zip" />
- <patternset>
- <include name="**/lib/sigar.jar" />
- <include name="**/lib/bcel*.jar" />
- <include name="**/lib/*.so" />
- <include name="**/lib/*.sl" />
- <include name="**/lib/*.dll" />
- <include name="**/lib/*.dylib" />
- </patternset>
- </unzip>
- <move todir="target/testsetup/lib" flatten="true">
- <fileset dir="target/testsetup/lib">
- <include name="**/lib/*" />
- </fileset>
- </move>
- <delete dir="target/testsetup/lib/hyperic-sigar-${sigar.version}" />
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
<execution>
<id>deploy</id>
@@ -203,12 +158,10 @@
<build>
<plugins>
-
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
<executions>
-
<execution>
<id>deploy</id>
<phase>compile</phase>
@@ -258,14 +211,10 @@
<goal>run</goal>
</goals>
</execution>
-
</executions>
</plugin>
-
</plugins>
</build>
</profile>
-
</profiles>
-
</project>
commit 0540bcd236373f420235c9e30a6ac3ae285728b7
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Aug 25 14:31:21 2011 -0400
[BZ 695889 - Search Bar Saved Search issues]
More SearchBar/SavedSearch Work, done for now.
- simplify behavior of saved search name/update such that it requires a
return to get applied. Change onBlur to just close the edit box, thus
avoiding duplicate storage/update of the saved search.
- remove some odd time-delay stuff joe had in there, it seeme to only
confuse things and with the change to onBlur I don't think it's necessary.
- More I18N, missing properties and migration of some messaging
from server-side to client-side.
- Change look of saved search entries, different colors/fonts/indent
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/FlexSearchBar.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/FlexSearchBar.java
index 12df81d..1a99b85 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/FlexSearchBar.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/FlexSearchBar.java
@@ -90,7 +90,6 @@ public class FlexSearchBar extends AbstractSearchBar {
private SavedSearchGrid savedSearchesGrid;
private Integer currentSearchId = 0;
- private long lastNameFieldBlurTime = 0;
private SearchSubsystem searchSubsystem;
private String defaultSearchText;
@@ -384,8 +383,16 @@ public class FlexSearchBar extends AbstractSearchBar {
}
public void onBlur(BlurEvent event) {
- lastNameFieldBlurTime = System.currentTimeMillis();
- turnNameFieldIntoLabel(true);
+ // If this is a name change update (star on) then return to displaying the unchanged label.
+ // otherwise, abort the creation of the new saved search.
+ if (starImage.getUrl().endsWith(STAR_ON_URL)) {
+ patternNameField.setVisible(false);
+ patternNameLabel.setVisible(true);
+
+ } else {
+ patternNameField.setVisible(false);
+ patternNameLabel.setVisible(false);
+ }
}
}
@@ -397,20 +404,6 @@ public class FlexSearchBar extends AbstractSearchBar {
class StarImageEventHandler implements ClickHandler, MouseOverHandler, MouseOutHandler {
public void onClick(ClickEvent event) {
- long diff = System.currentTimeMillis() - lastNameFieldBlurTime;
- if (Math.abs(diff) < 750) {
- /*
- * This event propagation is annoying. If the threshold is set too low, then both
- * the name field blur event and this star image click event fire...but the blur
- * event fires first, which turns the star white. Then a click on a white star
- * triggers edit mode, re-enabling the name field. However, setting the threshold
- * too high will prevent the click event from being handled when the user naturally
- * wants to click on the star in rapid succession within the threshold time frame.
- * It is hoped that 750ms will strike a nice balance, and that most users will never
- * experienced any oddities from this trade-off.
- */
- return;
- }
// note - since hover changes off to active, we never have the star off case here
if (starImage.getUrl().endsWith(STAR_ACTIVE_URL)) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
index f0e72c3..8965900 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java
@@ -167,7 +167,8 @@ public class SavedSearchGrid extends Grid {
@Override
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Could not load saved searches", caught);
+ CoreGUI.getErrorHandler().handleError(
+ CoreGUI.getMessages().view_searchBar_savedSearch_failFind("*"), caught);
callback.onFailure(caught);
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
index a2e2d5d..ee170a1 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java
@@ -30,7 +30,6 @@ import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.FocusHandler;
import com.google.gwt.event.dom.client.HandlesAllKeyEvents;
import com.google.gwt.event.dom.client.HasAllFocusHandlers;
-import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyDownEvent;
import com.google.gwt.event.dom.client.KeyDownHandler;
import com.google.gwt.event.dom.client.KeyPressEvent;
@@ -62,6 +61,8 @@ import com.google.gwt.user.client.ui.SuggestOracle.Suggestion;
import org.rhq.core.domain.search.SearchSuggestion;
import org.rhq.core.domain.search.SearchSuggestion.Kind;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.Messages;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.search.AbstractSearchBar;
@@ -69,6 +70,8 @@ import org.rhq.enterprise.gui.coregui.client.search.AbstractSearchBar;
public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocusHandlers, HasValue<String>,
HasSelectionHandlers<Suggestion> {
+ private static final Messages MSG = CoreGUI.getMessages();
+
private final AbstractSearchBar searchBar;
private final SearchSuggestOracle oracle;
@@ -199,53 +202,33 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus
class TextBoxEvents extends HandlesAllKeyEvents implements ValueChangeHandler<String>, ClickHandler {
private boolean isInstructionalCommentSelected() {
+ if (!suggestionPopup.isAttached() || suggestionMenu.getSelectedItemIndex() < 0) {
+ return false;
+ }
+
SearchSuggestion searchSuggestion = suggestionMenu.getSearchSuggestion();
Kind kind = searchSuggestion.getKind();
return kind == Kind.InstructionalTextComment;
}
+ // We used to allow clicking and keypress to select from the suggestion list. But this
+ // could be confusing because we keep focus in the text box. A return would likely mean
+ // the user wants to submit the current pattern in the text box for search. But if the mouse
+ // was hovering over a suggest menu item, which could be accidental as the menu can be large and
+ // pops up automatically, his pattern would get replaced by a random suggestion entry and then
+ // that would get submitted. So, we now only accept clicking to select from the suggest menu
+ // and we assume a return means the user wants to submit the current text box pattern.
public void onClick(ClickEvent event) {
+
+ // if the user clicked on one of our helpful little messages then just ignore it
+ if (isInstructionalCommentSelected()) {
+ return;
+ }
+
handleSuggestions();
}
public void onKeyDown(KeyDownEvent event) {
- /*
- * Make sure that the menu is actually showing. These
- * keystrokes are only relevant when choosing a suggestion.
- */
- if (suggestionPopup.isAttached()) {
- switch (event.getNativeKeyCode()) {
- case KeyCodes.KEY_DOWN:
- suggestionMenu.moveSelectionDown();
- if (isInstructionalCommentSelected()) {
- if (suggestionMenu.getNumItems() == 1) {
- suggestionMenu.selectItem(null);
- } else {
- suggestionMenu.moveSelectionDown();
- }
- }
- event.preventDefault();
- break;
- case KeyCodes.KEY_UP:
- suggestionMenu.moveSelectionUp();
- if (isInstructionalCommentSelected()) {
- if (suggestionMenu.getNumItems() == 1) {
- suggestionMenu.selectItem(null);
- } else {
- suggestionMenu.moveSelectionUp();
- }
- }
- event.preventDefault();
- break;
- case KeyCodes.KEY_ENTER:
- if (suggestionMenu.getSelectedItemIndex() < 0) {
- suggestionPopup.hide();
- } else {
- suggestionMenu.doSelectedItemAction();
- }
- break;
- }
- }
delegateEvent(SuggestTextBox_v3.this, event);
}
@@ -402,6 +385,7 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus
setStyleName("");
}
+ @SuppressWarnings("unused")
public void doSelectedItemAction() {
// In order to perform the action of the item that is currently
// selected, the menu must be showing.
@@ -684,8 +668,8 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus
}
public void onFailure(Throwable caught) {
- SearchSuggestion errorInform = new SearchSuggestion(Kind.InstructionalTextComment, caught
- .getMessage());
+ SearchSuggestion errorInform = new SearchSuggestion(Kind.InstructionalTextComment, MSG
+ .view_searchBar_instructional_failSuggest());
adaptAndHandle(errorInform);
}
@@ -694,6 +678,10 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus
for (SearchSuggestion next : searchSuggestionResults) {
adaptedResults.add(new SearchSuggestionOracleAdapter(next));
}
+ if (adaptedResults.isEmpty()) {
+ adaptedResults.add(new SearchSuggestionOracleAdapter(new SearchSuggestion(
+ Kind.InstructionalTextComment, MSG.view_searchBar_instructional_noSuggest())));
+ }
SuggestOracle.Response response = new SuggestOracle.Response(adaptedResults);
callback.onSuggestionsReady(request, response);
}
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
index 4362b8f..beb105b 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -1623,6 +1623,9 @@ view_resource_monitor_table_min = Minimum
view_resource_title_component_errors_tooltip = Shows managed component errors. Click for details
view_resource_title_tagUpdateFailed = Failed to update resource tags
view_searchBar_defaultPattern = name your pattern
+view_searchBar_instructional_failSuggest = Failed to generate suggestions, see server log for possible errors
+view_searchBar_instructional_noSuggest = No matches, enter a different pattern
+view_searchBar_instructional_refresh = Failed to retrieve saved searches, please refresh page
view_searchBar_savedSearch_delete = Successfully deleted saved search [{0}]
view_searchBar_savedSearch_failDelete = Failed to delete saved search with name [{0}]
view_searchBar_savedSearch_failFind = Failed to find saved search with name [{0}]
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 581c8cb..5bb5a98 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
@@ -1349,6 +1349,9 @@ view_resource_monitor_table_min = Minimum
view_resource_title_component_errors_tooltip = Zeigt Fehler der gemanagten Ressource. Klicken für Details
view_resource_title_tagUpdateFailed = Fehler beim Aktualisieren der Ressourcen-Tags
view_searchBar_defaultPattern = name your pattern~
+##view_searchBar_instructional_failSuggest = Failed to generate suggestions, see server log for possible errors
+view_searchBar_instructional_noSuggest = No matches, enter a different pattern
+##view_searchBar_instructional_refresh = Failed to retrieve saved searches, please refresh page
##view_searchBar_savedSearch_delete = Successfully deleted saved search [{0}]
##view_searchBar_savedSearch_failDelete = Failed to delete saved search with name [{0}]
##view_searchBar_savedSearch_failFind = Failed to find saved search with name [{0}]
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
index 67762d3..98a20a4 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
@@ -1590,6 +1590,9 @@ view_resource_monitor_table_min = 最小
view_resource_title_component_errors_tooltip = 管理コンポーネントエラーの表示。詳細はクリックしてください
view_resource_title_tagUpdateFailed = リソースタグの更新に失敗しました
view_searchBar_defaultPattern = パターンを名前を付けてください
+##view_searchBar_instructional_failSuggest = Failed to generate suggestions, see server log for possible errors
+view_searchBar_instructional_noSuggest = No matches, enter a different pattern
+##view_searchBar_instructional_refresh = Failed to retrieve saved searches, please refresh page
##view_searchBar_savedSearch_delete = Successfully deleted saved search [{0}]
##view_searchBar_savedSearch_failDelete = Failed to delete saved search with name [{0}]
##view_searchBar_savedSearch_failFind = Failed to find saved search with name [{0}]
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
index 27312f7..48cae04 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
@@ -1728,6 +1728,9 @@ view_resource_monitor_table_min = Minimum
view_resource_title_component_errors_tooltip = Shows managed component errors. Click for details
view_resource_title_tagUpdateFailed = Failed to update resource tags
view_searchBar_defaultPattern = definir nome para o padr\u00E3o
+##view_searchBar_instructional_failSuggest = Failed to generate suggestions, see server log for possible errors
+view_searchBar_instructional_noSuggest = No matches, enter a different pattern
+##view_searchBar_instructional_refresh = Failed to retrieve saved searches, please refresh page
##view_searchBar_savedSearch_delete = Successfully deleted saved search [{0}]
##view_searchBar_savedSearch_failDelete = Failed to delete saved search with name [{0}]
##view_searchBar_savedSearch_failFind = Failed to find saved search with name [{0}]
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
index 9b9fab0..77d3749 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
@@ -1598,6 +1598,9 @@ view_resource_monitor_table_min = \u6700\u5c0f
view_resource_title_component_errors_tooltip = \u663e\u793a\u88ab\u7ba1\u7ec4\u4ef6\u9519\u8bef.\u5355\u51fb\u67e5\u770b\u8be6\u60c5
view_resource_title_tagUpdateFailed = \u66f4\u65b0\u8d44\u6e90\u6807\u7b7e\u5931\u8d25
view_searchBar_defaultPattern = \u5b9a\u4e49\u81ea\u5df1\u7684\u6837\u5f0f
+##view_searchBar_instructional_failSuggest = Failed to generate suggestions, see server log for possible errors
+view_searchBar_instructional_noSuggest = No matches, enter a different pattern
+##view_searchBar_instructional_refresh = Failed to retrieve saved searches, please refresh page
##view_searchBar_savedSearch_delete = Successfully deleted saved search [{0}]
##view_searchBar_savedSearch_failDelete = Failed to delete saved search with name [{0}]
##view_searchBar_savedSearch_failFind = Failed to find saved search with name [{0}]
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/css/search.css b/modules/enterprise/gui/coregui/src/main/webapp/css/search.css
index f4c8390..81a6967 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/css/search.css
+++ b/modules/enterprise/gui/coregui/src/main/webapp/css/search.css
@@ -153,7 +153,8 @@ div {
}
.savedSearchesPanel-top {
- font-size: 12px;
+ color: green;
+ font-size: 12px;
position: relative;
padding: 0;
margin: 0;
@@ -161,10 +162,10 @@ div {
}
.savedSearchesPanel-bottom {
- color: green;
+ font-size: 10px;
position: relative;
padding: 0;
- margin: 0;
+ margin: 3px;
bottom: 1px;
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
index 8d723d9..bfc2164 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java
@@ -387,55 +387,34 @@ public class SearchAssistManager {
public List<SearchSuggestion> getTabAwareSuggestions(String expression, int caretPos, String tab) {
List<SearchSuggestion> results = new ArrayList<SearchSuggestion>();
- if (subject == null) {
- // likely a client's misuse of the API, but gracefully return no saved searches if the user is not found
- SearchSuggestion footerMessage = new SearchSuggestion(Kind.InstructionalTextComment,
- "Error retrieving saved searches, please refresh page");
- results.add(footerMessage);
- return results;
+ if (expression == null) {
+ expression = "";
}
- try {
- if (expression == null) {
- expression = "";
- }
-
- // make sure caretPos is at a valid index prior to parsing it for suggestions
- if (caretPos > expression.length()) {
- caretPos = expression.length();
- }
+ // make sure caretPos is at a valid index prior to parsing it for suggestions
+ if (caretPos > expression.length()) {
+ caretPos = expression.length();
+ }
- List<SearchSuggestion> simple = getSimpleSuggestions(expression, caretPos, tab);
- List<SearchSuggestion> advanced = getAdvancedSuggestions(expression, caretPos, tab);
- List<SearchSuggestion> userSavedSearches = getUserSavedSearchSuggestions(expression);
- //List<SearchSuggestion> globalSavedSearches = getGlobalSavedSearchSuggestions(expression);
+ List<SearchSuggestion> simple = getSimpleSuggestions(expression, caretPos, tab);
+ List<SearchSuggestion> advanced = getAdvancedSuggestions(expression, caretPos, tab);
+ List<SearchSuggestion> userSavedSearches = getUserSavedSearchSuggestions(expression);
+ //List<SearchSuggestion> globalSavedSearches = getGlobalSavedSearchSuggestions(expression);
- results.addAll(simple);
- results.addAll(advanced);
- results.addAll(userSavedSearches);
- //results.addAll(globalSavedSearches);
+ results.addAll(simple);
+ results.addAll(advanced);
+ results.addAll(userSavedSearches);
+ //results.addAll(globalSavedSearches);
- if (results.isEmpty()) {
- SearchSuggestion footerMessage = new SearchSuggestion(Kind.InstructionalTextComment,
- "Start typing for more simple text matches");
- results.add(footerMessage);
- } else {
- Collections.sort(results);
- }
+ Collections.sort(results);
- } catch (Throwable t) {
- SearchSuggestion footerMessage = new SearchSuggestion(Kind.InstructionalTextComment,
- "Error retrieving suggestions: " + t.getMessage() + ", see server log for more details");
- results.add(footerMessage);
- LOG.info("Error retrieving suggestions", t);
- }
return results;
}
public List<SearchSuggestion> getSimpleSuggestions(String expression, int caretPos, String tab) {
SearchAssistant completor = getTabAwareSearchAssistant(tab);
- debug("getSimpleSuggestions: START");
+ LOG.debug("getSimpleSuggestions: START");
SearchTermAssistant assistant = new SearchTermAssistant(expression, caretPos);
String beforeCaret = assistant.getFragmentBeforeCaret();
@@ -451,7 +430,11 @@ public class SearchAssistManager {
*/
String parsedTerm = parsed.context;
String primarySimpleContext = completor.getPrimarySimpleContext();
- debug("getSimpleSuggestions: suggesting value completions for a simple context [" + primarySimpleContext + "]");
+
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("getSimpleSuggestions: suggesting value completions for a simple context ["
+ + primarySimpleContext + "]");
+ }
List<String> valueSuggestions = padWithQuotes(beforeCaret, completor.getValues(primarySimpleContext, null,
parsedTerm));
@@ -461,33 +444,47 @@ public class SearchAssistManager {
public List<SearchSuggestion> getAdvancedSuggestions(String expression, int caretPos, String tab) {
SearchAssistant completor = getTabAwareSearchAssistant(tab);
+ boolean isDebugEnabled = LOG.isDebugEnabled();
- debug("getAdvancedSuggestions: START");
+ LOG.debug("getAdvancedSuggestions: START");
SearchTermAssistant assistant = new SearchTermAssistant(expression, caretPos);
String[] tokens = assistant.getTerms().toArray(new String[0]);
- debug("" + tokens.length + " tokens are " + Arrays.asList(tokens));
+
+ if (isDebugEnabled) {
+ LOG.debug("" + tokens.length + " tokens are " + Arrays.asList(tokens));
+ }
if (tokens.length == 0 || caretPos == 0) {
- debug("getAdvancedSuggestions: no terms");
+ LOG.debug("getAdvancedSuggestions: no terms");
return convert(getAllContexts()); // no terms yet defined
}
String beforeCaret = assistant.getFragmentBeforeCaret();
- debug("getAdvancedSuggestions: beforeCaret is '" + beforeCaret + "'");
+
+ if (isDebugEnabled) {
+ LOG.debug("getAdvancedSuggestions: beforeCaret is '" + beforeCaret + "'");
+ }
String pad = getQuotePadding(beforeCaret);
- debug("getAdvancedSuggestions: padding is ~" + pad + "~");
+
+ if (isDebugEnabled) {
+ LOG.debug("getAdvancedSuggestions: padding is ~" + pad + "~");
+ }
if (beforeCaret.startsWith("'") || beforeCaret.startsWith("\"")) {
return Collections.emptyList();
}
ParsedContext parsed = ParsedContext.get(beforeCaret);
- debug("getAdvancedSuggestions: parsed is " + parsed);
+
+ if (isDebugEnabled) {
+ LOG.debug("getAdvancedSuggestions: parsed is " + parsed);
+ }
+
switch (parsed.state) {
case CONTEXT:
if (parsed.context.equals("")) {
- debug("getAdvancedSuggestions: empty term, suggesting all contexts");
+ LOG.debug("getAdvancedSuggestions: empty term, suggesting all contexts");
return convert(getAllContexts());
/*
if (tokens.length == 1) {
@@ -502,22 +499,22 @@ public class SearchAssistManager {
}
*/
} else if (isBooleanTerm(parsed.context)) {
- debug("getAdvancedSuggestions: beforeCaret is whole boolean operator");
+ LOG.debug("getAdvancedSuggestions: beforeCaret is whole boolean operator");
return convert(getAllContexts()); // TODO: should we tell user to type a space first?
} else {
// check if this context is complete or not
if (completor.getSimpleContexts().contains(parsed.context)) {
- debug("getAdvancedSuggestions: search term is simple context, wants operator");
+ LOG.debug("getAdvancedSuggestions: search term is simple context, wants operator");
List<String> contextComparisonOperators = getComparisonOperatorsForContext(parsed.context,
completor);
return convert(pad(parsed.context, contextComparisonOperators, ""), parsed, parsed.context);
}
if (completor.getParameterizedContexts().contains(parsed.context)) {
- debug("getAdvancedSuggestions: search term is parameterized context, wants open bracket");
+ LOG.debug("getAdvancedSuggestions: search term is parameterized context, wants open bracket");
return convert(Arrays.asList(parsed.context + "["), parsed, parsed.context);
}
- debug("getAdvancedSuggestions: search term wants context completion");
+ LOG.debug("getAdvancedSuggestions: search term wants context completion");
List<String> startsWithContexts = new ArrayList<String>();
String lowerCaseParsedContext = parsed.context.toLowerCase(); // contexts should already be lower-cased
for (String context : completor.getSimpleContexts()) {
@@ -533,20 +530,20 @@ public class SearchAssistManager {
return convert(startsWithContexts, parsed, parsed.context);
}
case PARAM:
- debug("getAdvancedSuggestions: param state");
+ LOG.debug("getAdvancedSuggestions: param state");
return convert(pad(parsed.context + "[", completor.getParameters(parsed.context, parsed.param), "]"),
parsed, parsed.param);
case OPERATOR:
- debug("getAdvancedSuggestions: operator state");
+ LOG.debug("getAdvancedSuggestions: operator state");
if (allComparisonOperators.contains(parsed.operator)) {
- debug("search term is complete operator, suggesting values instead");
+ LOG.debug("search term is complete operator, suggesting values instead");
List<String> valueSuggestions = padWithQuotes(beforeCaret, completor.getValues(parsed.context,
parsed.param, ""));
if (completor.getSimpleContexts().contains(parsed.context)) {
- debug("getAdvancedSuggestions: suggesting value completions for a simple context");
+ LOG.debug("getAdvancedSuggestions: suggesting value completions for a simple context");
return convert(pad(parsed.context + parsed.operator, valueSuggestions, ""));
} else {
- debug("getAdvancedSuggestions: suggesting value completions for a parameterized context");
+ LOG.debug("getAdvancedSuggestions: suggesting value completions for a parameterized context");
return convert(pad(parsed.context + "[" + parsed.param + "]" + parsed.operator, valueSuggestions,
""));
}
@@ -560,21 +557,21 @@ public class SearchAssistManager {
}
}
- debug("getAdvancedSuggestions: providing suggestions for comparison operators");
+ LOG.debug("getAdvancedSuggestions: providing suggestions for comparison operators");
if (completor.getSimpleContexts().contains(parsed.context)) {
return convert(pad(parsed.context, operatorSuggestions, ""));
} else {
return convert(pad(parsed.context + "[" + parsed.param + "]", operatorSuggestions, ""));
}
case VALUE:
- debug("getAdvancedSuggestions: value state");
+ LOG.debug("getAdvancedSuggestions: value state");
List<String> valueSuggestions = padWithQuotes(beforeCaret, completor.getValues(parsed.context,
parsed.param, parsed.value));
if (completor.getSimpleContexts().contains(parsed.context)) {
- debug("getAdvancedSuggestions: suggesting value completions for a simple context");
+ LOG.debug("getAdvancedSuggestions: suggesting value completions for a simple context");
return convert(pad(parsed.context + parsed.operator, valueSuggestions, ""), parsed, parsed.value);
} else {
- debug("getAdvancedSuggestions: suggesting value completions for a parameterized context");
+ LOG.debug("getAdvancedSuggestions: suggesting value completions for a parameterized context");
return convert(pad(parsed.context + "[" + parsed.param + "]" + parsed.operator, valueSuggestions, ""),
parsed, parsed.value);
}
@@ -594,6 +591,10 @@ public class SearchAssistManager {
}
public List<SearchSuggestion> getUserSavedSearchSuggestions(String expression) {
+ if (null == subject) {
+ return new ArrayList<SearchSuggestion>();
+ }
+
expression = expression.trim().toLowerCase().replaceAll("\\s+", " ");
SavedSearchCriteria criteria = new SavedSearchCriteria();
@@ -772,8 +773,4 @@ public class SearchAssistManager {
return "\"";
}
}
-
- private void debug(String message) {
- LOG.debug(message);
- }
}
commit 867eb2edccefc24d4730fdf4e0494dc1dddc94aa
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Aug 25 13:51:35 2011 -0400
add drift to timeline
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventDriftJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventDriftJSON.jsp
new file mode 100644
index 0000000..b2f42fb
--- /dev/null
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventDriftJSON.jsp
@@ -0,0 +1,59 @@
+<%@ page import="java.text.SimpleDateFormat" %>
+<%@ page import="java.util.Locale" %>
+<%@ page import="org.rhq.core.domain.auth.Subject" %>
+<%@ page import="org.rhq.core.domain.util.PageControl" %>
+<%@ page import="org.rhq.core.domain.util.PageList" %>
+<%@ page import="org.rhq.enterprise.gui.legacy.ParamConstants" %>
+<%@ page import="org.rhq.enterprise.gui.legacy.WebUser" %>
+<%@ page import="org.rhq.enterprise.gui.legacy.util.SessionUtils" %>
+<%@ page import="org.rhq.enterprise.gui.util.WebUtility" %>
+<%@ page import="org.rhq.enterprise.server.util.LookupUtil" %>
+<%@ page import="org.rhq.core.domain.resource.Resource" %>
+<%@ page import="org.rhq.enterprise.server.drift.DriftManagerLocal"%>
+<%@ page import="org.rhq.core.domain.criteria.GenericDriftChangeSetCriteria"%>
+<%@ page import="org.rhq.core.domain.drift.DriftChangeSet"%>
+
+<%
+ int resourceId = WebUtility.getOptionalIntRequestParameter(request, ParamConstants.RESOURCE_ID_PARAM, -1);
+
+ WebUser user = SessionUtils.getWebUser(request.getSession());
+ Subject subject = user.getSubject();
+
+ long end = Long.parseLong(WebUtility.getRequiredRequestParameter(request, "end"));
+ long begin = Long.parseLong(WebUtility.getRequiredRequestParameter(request, "begin"));
+
+ DriftManagerLocal driftManager = LookupUtil.getDriftManager();
+ GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
+ criteria.addFilterResourceId(resourceId);
+ criteria.addFilterCreatedAfter(begin);
+ criteria.addFilterCreatedBefore(end);
+ PageList<? extends DriftChangeSet<?>> results = driftManager.findDriftChangeSetsByCriteria(subject, criteria);
+%>
+
+{ "events": [
+
+<%
+ SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd yyyy HH:mm:ss Z", Locale.US);
+ String link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Drift/ChangeSets";
+ String icon = "/images/icons/Drift_16.png";
+ boolean first = true;
+ for (DriftChangeSet entry : results) {
+ if (!first) {
+ out.write(",\n");
+ }
+ first = false;
+%>
+
+{ "start" : "<%=sdf.format(entry.getCtime())%>",
+ "title" : "Drift Detected",
+ "link" : "<%=link%>",
+ "description" : "Drift was detected! A change set was created to document the changes.",
+ "icon" : "<%=icon%>",
+ "color" : "#3333FF"
+}
+
+<%
+ }
+%>
+
+]}
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp
index 1bbdb2f..1ac93c7 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp
@@ -236,6 +236,15 @@ function onLoad() {
});
}
+ if (document.forms['show'].drift.checked) {
+ link = "/resource/common/monitor/events/EventDriftJSON.jsp?id=" + resourceId + "&begin=" + begin + "&end=" + end;
+ Timeline.loadJSON(link, function(json, url) {
+ eventSource.loadJSON(json, url);
+ document.getElementById("event-count").innerHTML = eventSource.getCount();
+ done();
+ });
+ }
+
if (document.forms['show']['content'].checked) {
link = "/resource/common/monitor/events/EventContentJSON.jsp?id=" + resourceId + "&begin=" + begin + "&end=" + end;
Timeline.loadJSON(link, function(json, url) {
commit 4ed859a59e6cb20d417ae7bc4940169bf0194f7c
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Aug 25 13:11:51 2011 -0400
add inventory data to timeline (when resource was discovered and when it was inventoried)
clean up the content json jsp a bit
get ready for the drift timeline data (still need to create the json jsp)
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Drift_16.png b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Drift_16.png
new file mode 100644
index 0000000..a368ad4
Binary files /dev/null and b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Drift_16.png differ
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp
index 673d08e..8edeebe 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp
@@ -26,7 +26,7 @@
ContentUIManagerLocal contentManager = LookupUtil.getContentUIManager();
- PageList<InstalledPackageHistory> history = contentManager.getInstalledPackageHistoryForResource(resourceId, new PageControl(0,100, new OrderingField("iph.timestamp",PageOrdering.DESC)));
+ PageList<InstalledPackageHistory> history = contentManager.getInstalledPackageHistoryForResource(resourceId, new PageControl(0,20, new OrderingField("iph.timestamp",PageOrdering.DESC)));
%>
@@ -65,13 +65,18 @@
String link = "#Resource/" + resourceId + "/Content/Deployed";
// "/rhq/resource/content/installed_package_details.xhtml?id=" + resourceId + "¤tPackageId=" + installedPackage.getId();
+ String version = installedPackage.getPackageVersion().getDisplayVersion();
+ String username = "-Autodetected-";
+ if (installedPackage.getContentServiceRequest() != null) {
+ username = installedPackage.getContentServiceRequest().getSubjectName();
+ }
%>
{ "start" : "<%=sdf.format(new Date(installedPackage.getTimestamp()))%>",
"title" : "<% out.write(
(installedPackage.getPackageVersion().getDisplayName()==null ? null : installedPackage.getPackageVersion().getDisplayName().replaceAll("[\"']","")) + " " +
(installedPackage.getPackageVersion().getDisplayVersion() ==null ? null : installedPackage.getPackageVersion().getDisplayVersion().replaceAll("[\"']","")));%>",
"link" : "<%=link%>",
- "description" : "<b>User:</b> <% out.write((installedPackage.getContentServiceRequest() == null ? "-Detected- " : installedPackage.getContentServiceRequest().getSubjectName().replaceAll("[\"']","").trim())+"<br/> <b>Version: "+(installedPackage.getPackageVersion().getDisplayVersion() ==null ? null :installedPackage.getPackageVersion().getDisplayVersion().replaceAll("[\"']","").trim())+" </b> <br/><b>Status:</b> "+installedPackage.getStatus());%>",
+ "description" : "<b>User:</b> <% out.write(username.replaceAll("[\"']","").trim()+"<br/> <b>Version:</b> "+(version.replaceAll("[\"']","").trim())+"<br/><b>Status:</b> "+installedPackage.getStatus());%>",
"icon" : "<%=icon%>",
"color" : "<%=(installedPackage.getStatus() != InstalledPackageHistoryStatus.FAILED ? "#4EB84E" : "#DD5656")%>"
}
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventInventoryJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventInventoryJSON.jsp
new file mode 100644
index 0000000..9a3fa9c
--- /dev/null
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventInventoryJSON.jsp
@@ -0,0 +1,52 @@
+<%@ page import="java.text.SimpleDateFormat" %>
+<%@ page import="java.util.Locale" %>
+<%@ page import="org.rhq.core.domain.auth.Subject" %>
+<%@ page import="org.rhq.core.domain.util.PageControl" %>
+<%@ page import="org.rhq.core.domain.util.PageList" %>
+<%@ page import="org.rhq.enterprise.gui.legacy.ParamConstants" %>
+<%@ page import="org.rhq.enterprise.gui.legacy.WebUser" %>
+<%@ page import="org.rhq.enterprise.gui.legacy.util.SessionUtils" %>
+<%@ page import="org.rhq.enterprise.gui.util.WebUtility" %>
+<%@ page import="org.rhq.enterprise.server.resource.ResourceManagerLocal" %>
+<%@ page import="org.rhq.enterprise.server.util.LookupUtil" %>
+<%@ page import="org.rhq.core.domain.resource.Resource" %>
+
+<%
+ int resourceId = WebUtility.getOptionalIntRequestParameter(request, ParamConstants.RESOURCE_ID_PARAM, -1);
+
+ WebUser user = SessionUtils.getWebUser(request.getSession());
+ Subject subject = user.getSubject();
+
+ long end = Long.parseLong(WebUtility.getRequiredRequestParameter(request, "end"));
+ long begin = Long.parseLong(WebUtility.getRequiredRequestParameter(request, "begin"));
+
+ ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
+ Resource resource = resourceManager.getResource(subject, resourceId);
+%>
+
+{ "events": [
+
+ <%
+ SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd yyyy HH:mm:ss Z", Locale.US);
+ String link = "/coregui/CoreGUI.html#Resource/" + resourceId;
+ String iconDiscovered = "/images/icons/Inventory_grey_16.png";
+ String iconCommitted = "/images/icons/Inventory_16.png";
+ %>
+
+{ "start" : "<%=sdf.format(resource.getCtime())%>",
+ "title" : "Initial Discovery",
+ "link" : "<%=link%>",
+ "description" : "Time when the resource was initially discovered by its managing agent.",
+ "icon" : "<%=iconDiscovered%>",
+ "color" : "#A0A0A0"
+},
+
+{ "start" : "<%=sdf.format(resource.getItime())%>",
+ "title" : "Committed to Inventory",
+ "link" : "<%=link%>",
+ "description" : "Time when the resource was committed to inventory.",
+ "icon" : "<%=iconCommitted%>",
+ "color" : "#3333FF"
+}
+
+]}
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp
index 6ed2510..1bbdb2f 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp
@@ -200,6 +200,15 @@ function onLoad() {
});
}
+ if (document.forms['show'].inventory.checked) {
+ link = "/resource/common/monitor/events/EventInventoryJSON.jsp?id=" + resourceId + "&begin=" + begin + "&end=" + end;
+ Timeline.loadJSON(link, function(json, url) {
+ eventSource.loadJSON(json, url);
+ document.getElementById("event-count").innerHTML = eventSource.getCount();
+ done();
+ });
+ }
+
if (document.forms['show'].alerts.checked) {
link = "/resource/common/monitor/events/EventAlertJSON.jsp?id=" + resourceId + "&begin=" + begin + "&end=" + end;
Timeline.loadJSON(link, function(json, url) {
@@ -254,23 +263,30 @@ function onResize() {
<span id="event-count" style="display:none;"></span>
<div class="controls" id="controls"></div>
<form action="#" onsubmit="onLoad()" name="show">
+<table><tr>
+<td>
<input type="checkbox" name="inventory" checked="checked" onchange="onLoad()" id="inventoryField"/>
<label for="inventoryField"><img src="/images/icons/Inventory_grey_16.png"/> Inventory Changes</label>
-
+</td><td>
<input type="checkbox" name="alerts" checked="checked" onchange="onLoad()" id="alertsField"/>
<label for="alertsField"><img src="/images/icons/Alert_grey_16.png"/> Alerts</label>
-
+</td><td>
<input type="checkbox" name="events" checked="checked" onchange="onLoad()" id="eventsField"/>
<label for="eventsField"><img src="/images/icons/Events_grey_16.png"/> Events</label>
-
+</td><td>
<input type="checkbox" name="configurations" checked="checked" onchange="onLoad()" id="configurationsField"/>
<label for="configurationsField"><img src="/images/icons/Configure_grey_16.png"/> Configuration Changes</label>
-
+</td></tr><tr><td>
<input type="checkbox" name="operations" checked="checked" onchange="onLoad()" id="operationsField"/>
<label for="operationsField"><img src="/images/icons/Operation_grey_16.png"/> Operations</label>
-
+</td><td>
+ <input type="checkbox" name="drift" checked="checked" onchange="onLoad()" id="driftField"/>
+ <label for="driftField"><img src="/images/icons/Drift_16.png"/> Drift</label>
+</td><td>
<input type="checkbox" name="content" checked="checked" onchange="onLoad()" id="contentField"/>
<label for="contentField"><img src="/images/icons/Content_grey_16.png"/> Content Changes</label>
+</td>
+</tr></table>
</form>
-<div id="t1" style='height: 475px; border: 1px solid #aaa'></div>
+<div id="t1" style='height: 450px; border: 1px solid #aaa'></div>
</body></html>
\ No newline at end of file
commit 8c87bf63686df822bec93ad2fdf6183571392412
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Aug 25 12:20:11 2011 -0400
create/delete child history has its own inventory filter - will add more timeline markers for inventory shortly
make the timeline icons match the rest of the ui
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ImageManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ImageManager.java
index 4c1c429..5c7a385 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ImageManager.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ImageManager.java
@@ -8,6 +8,8 @@ import org.rhq.core.domain.event.EventSeverity;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.measurement.ResourceAvailability;
import org.rhq.core.domain.operation.OperationRequestStatus;
+import org.rhq.core.domain.resource.CreateResourceStatus;
+import org.rhq.core.domain.resource.DeleteResourceStatus;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.resource.ResourceType;
@@ -527,4 +529,50 @@ public class ImageManager {
public static String getConfigureIcon() {
return "subsystems/configure/Configure_16.png";
}
+
+ public static String getChildCreateIcon() {
+ return "subsystems/inventory/CreateChild_16.png";
+ }
+
+ public static String getChildCreateIcon(CreateResourceStatus createStatus) {
+ if (createStatus == null) {
+ return getChildCreateIcon();
+ } else {
+ switch (createStatus) {
+ case SUCCESS: {
+ return "subsystems/inventory/CreateChild_success_16.png";
+ }
+ case IN_PROGRESS: {
+ return getChildCreateIcon();
+ }
+ default: {
+ // all others will use the failure icon
+ return "subsystems/inventory/CreateChild_failed_16.png";
+ }
+ }
+ }
+ }
+
+ public static String getChildDeleteIcon() {
+ return "subsystems/inventory/DeleteChild_16.png";
+ }
+
+ public static String getChildDeleteIcon(DeleteResourceStatus deleteStatus) {
+ if (deleteStatus == null) {
+ return getChildDeleteIcon();
+ } else {
+ switch (deleteStatus) {
+ case SUCCESS: {
+ return "subsystems/inventory/DeleteChild_success_16.png";
+ }
+ case IN_PROGRESS: {
+ return getChildDeleteIcon();
+ }
+ default: {
+ // all others will use the failure icon
+ return "subsystems/inventory/DeleteChild_failed_16.png";
+ }
+ }
+ }
+ }
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ChildHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ChildHistoryView.java
index d5c1ec4..dc835fa 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ChildHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ChildHistoryView.java
@@ -52,6 +52,7 @@ import org.rhq.core.domain.resource.composite.ResourceComposite;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.ImageManager;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewName;
@@ -65,8 +66,8 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
public class ChildHistoryView extends Table<ChildHistoryView.DataSource> {
public static final ViewName VIEW_ID = new ViewName("ChildHistory", MSG.view_tabs_common_child_history());
- public static final String CHILD_CREATED_ICON = "[skin]/images/MultiUploadItem/icon_add_files.png";
- public static final String CHILD_DELETED_ICON = "[skin]/images/MultiUploadItem/icon_remove_files.png";
+ public static final String CHILD_CREATED_ICON = ImageManager.getChildCreateIcon();
+ public static final String CHILD_DELETED_ICON = ImageManager.getChildDeleteIcon();
private final ResourceComposite resourceComposite;
private FormItem dateRangeItem;
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/CreateChild_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/CreateChild_16.png
new file mode 100644
index 0000000..6db0919
Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/CreateChild_16.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/CreateChild_failed_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/CreateChild_failed_16.png
new file mode 100644
index 0000000..5db8573
Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/CreateChild_failed_16.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/CreateChild_success_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/CreateChild_success_16.png
new file mode 100644
index 0000000..d9eb649
Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/CreateChild_success_16.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/DeleteChild_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/DeleteChild_16.png
new file mode 100644
index 0000000..bd45928
Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/DeleteChild_16.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/DeleteChild_failed_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/DeleteChild_failed_16.png
new file mode 100644
index 0000000..33770d2
Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/DeleteChild_failed_16.png differ
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/DeleteChild_success_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/DeleteChild_success_16.png
new file mode 100644
index 0000000..9948df0
Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/DeleteChild_success_16.png differ
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_create_child.png b/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_create_child.png
index 5403358..6db0919 100644
Binary files a/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_create_child.png and b/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_create_child.png differ
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_create_child_failed.png b/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_create_child_failed.png
index 7807270..5db8573 100644
Binary files a/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_create_child_failed.png and b/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_create_child_failed.png differ
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_create_child_success.png b/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_create_child_success.png
index 2b475f1..d9eb649 100644
Binary files a/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_create_child_success.png and b/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_create_child_success.png differ
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_delete_child.png b/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_delete_child.png
index 49333cd..bd45928 100644
Binary files a/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_delete_child.png and b/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_delete_child.png differ
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_delete_child_failed.png b/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_delete_child_failed.png
index 570b905..33770d2 100644
Binary files a/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_delete_child_failed.png and b/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_delete_child_failed.png differ
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_delete_child_success.png b/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_delete_child_success.png
index 7e60281..9948df0 100644
Binary files a/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_delete_child_success.png and b/modules/enterprise/gui/portal-war/src/main/webapp/images/icn_delete_child_success.png differ
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp
index e33abdf..6ed2510 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp
@@ -191,7 +191,7 @@ function onLoad() {
});
}
- if (document.forms['show'].configurations.checked) {
+ if (document.forms['show'].inventory.checked) {
link = "/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp?id=" + resourceId + "&begin=" + begin + "&end=" + end;
Timeline.loadJSON(link, function(json, url) {
eventSource.loadJSON(json, url);
@@ -254,6 +254,9 @@ function onResize() {
<span id="event-count" style="display:none;"></span>
<div class="controls" id="controls"></div>
<form action="#" onsubmit="onLoad()" name="show">
+ <input type="checkbox" name="inventory" checked="checked" onchange="onLoad()" id="inventoryField"/>
+ <label for="inventoryField"><img src="/images/icons/Inventory_grey_16.png"/> Inventory Changes</label>
+
<input type="checkbox" name="alerts" checked="checked" onchange="onLoad()" id="alertsField"/>
<label for="alertsField"><img src="/images/icons/Alert_grey_16.png"/> Alerts</label>
commit 0b63dbefbc9f88145a8012a3677af665b41b13f7
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 00:14:01 2011 -0500
Small refactoring and code formating change to make the class easier to read and understand.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
index 6abf955..8cff302 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -75,6 +75,7 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
*/
public void setPropertyValue(String propertyName, String value) {
boolean propertyFound = false;
+
for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
Node currentNode = beanNode.getChildNodes().item(i);
@@ -107,8 +108,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @return
*/
public String getPropertyValue(String propertyName) {
- for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
- Node currentNode = beanNode.getChildNodes().item(i);
+ NodeList nodeList = beanNode.getChildNodes();
+
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node currentNode = nodeList.item(i);
if (currentNode.getNodeName().equals("property")
&& currentNode.getAttributes().getNamedItem("name") != null
@@ -126,10 +129,11 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @return
*/
private Node getBeanNodeByClass(String className) {
- NodeList result = this.getDocument().getElementsByTagName("bean");
+ NodeList nodeList = this.getDocument().getElementsByTagName("bean");
+
+ for (int i = 1; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
- for (int i = 1; i < result.getLength(); i++) {
- Node node = result.item(i);
if (node.getAttributes().getNamedItem("class") != null
&& className.equals(node.getAttributes().getNamedItem("class").getTextContent())) {
return node;
@@ -144,10 +148,11 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @return
*/
private Node getBeanNodeByName(String beanName) {
- NodeList result = this.getDocument().getElementsByTagName("bean");
+ NodeList nodeList = this.getDocument().getElementsByTagName("bean");
+
+ for (int i = 1; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
- for (int i = 1; i < result.getLength(); i++) {
- Node node = result.item(i);
if (node.getAttributes().getNamedItem("name") != null
&& beanName.equals(node.getAttributes().getNamedItem("name").getTextContent())) {
return node;
@@ -163,17 +168,17 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @return
*/
private String getBeanFromConstructorArgument(Node beanNode, String constructorArgumentClassName) {
- List<Node> tempNodeList = this.getChildNodesByName(beanNode, "constructor");
+ List<Node> nodeList = this.getChildrenNodesByName(beanNode, "constructor");
- if (tempNodeList.size() > 0) {
- Node constructorNode = tempNodeList.get(0);
+ if (nodeList.size() > 0) {
+ Node constructorNode = nodeList.get(0);
- tempNodeList = this.getChildNodesByName(constructorNode, "parameter");
+ nodeList = this.getChildrenNodesByName(constructorNode, "parameter");
- if (tempNodeList.size() > 0) {
+ if (nodeList.size() > 0) {
Node parameterNode = null;
- for (Node currentNode : tempNodeList) {
+ for (Node currentNode : nodeList) {
if (currentNode.getAttributes().getNamedItem("class") != null
&& constructorArgumentClassName.equals(currentNode.getAttributes().getNamedItem("class")
.getTextContent())) {
@@ -183,10 +188,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
}
if (parameterNode != null) {
- tempNodeList = this.getChildNodesByName(parameterNode, "inject");
+ nodeList = this.getChildrenNodesByName(parameterNode, "inject");
- if (tempNodeList.size() > 0) {
- Node injectNode = tempNodeList.get(0);
+ if (nodeList.size() > 0) {
+ Node injectNode = nodeList.get(0);
Node beanAttribute = injectNode.getAttributes().getNamedItem("bean");
if (beanAttribute != null) {
@@ -205,17 +210,17 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @param nodeName
* @return
*/
- private List<Node> getChildNodesByName(Node node, String nodeName) {
- List<Node> listOfNodes = new ArrayList<Node>();
+ private List<Node> getChildrenNodesByName(Node node, String nodeName) {
+ List<Node> nodeList = new ArrayList<Node>();
for (int i = 0; i < node.getChildNodes().getLength(); i++) {
Node currentNode = node.getChildNodes().item(i);
if (nodeName.equals(currentNode.getNodeName())) {
- listOfNodes.add(currentNode);
+ nodeList.add(currentNode);
}
}
- return listOfNodes;
+ return nodeList;
}
}
commit 7d543559bf07e87dd707fac16e0d1dc8f63b2815
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 00:12:49 2011 -0500
Added the proxyInfo metric back to Catalina service context since it is readly available.
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 6f46849..3e523f7 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -374,6 +374,7 @@
</operation>
<metric property="proxyConfiguration" displayName="Proxy Configuration" displayType="summary" dataType="trait" />
+ <metric property="proxyInfo" displayName="Proxy Info" displayType="summary" dataType="trait" />
<metric property="modelerType" displayName="Type of the modeled resource" displayType="summary" dataType="trait" />
<metric property="className" displayName="Fully qualified class name of the managed object" displayType="summary" dataType="trait" />
<metric property="advertise" displayName="Enable autodiscovery of httpd servers." displayType="summary" dataType="trait" />
commit bdc6f5e72b99f9dcffd6ab4395a6529fa32339e6
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Aug 24 22:19:16 2011 -0400
Check to see if a schedule has been removed before sending change set to server
In my previous commit I added support for deleting a drift detection
schedule and purging the change set directory. If the deletion occurs
while the schedule is still active, DriftDetector finishes its run and
the agent could still wind up sending a change set report to the server
for a configuration that has been deleted.
This commit adds a check in DriftManager.sendChangeSetToServer to make
sure that the schedule has not been deleted before sending the change
set to the server.
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java
index b162149..a3512dc 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java
@@ -150,12 +150,15 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri
@Override
public void sendChangeSetToServer(int resourceId, DriftConfiguration driftConfiguration, DriftChangeSetCategory type) {
try {
+ if (!schedulesQueue.contains(resourceId, driftConfiguration)) {
+ return;
+ }
+
File changeSetFile = changeSetMgr.findChangeSet(resourceId, driftConfiguration.getName(), type);
if (changeSetFile == null) {
- log
- .warn("changeset[resourceId: " + resourceId + ", driftConfiguration: "
- + driftConfiguration.getName()
- + "] was not found. Cancelling request to send change set to server");
+ log.warn("changeset[resourceId: " + resourceId + ", driftConfiguration: " +
+ driftConfiguration.getName() + "] was not found. Cancelling request to send change set " +
+ "to server");
return;
}
commit 676fc23804ccf42d8eb2ce236400bc08a4025f89
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Wed Aug 24 11:18:01 2011 -0500
More updates to the naming of each plugin component to match the intent and purpose. Also updated the integration tests to test each resource type.
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModClusterPluginIntegrationTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModClusterPluginIntegrationTest.java
new file mode 100644
index 0000000..625163b
--- /dev/null
+++ b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModClusterPluginIntegrationTest.java
@@ -0,0 +1,229 @@
+/*
+ * 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.plugins.modcluster.test;
+
+import java.io.File;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.Queue;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+
+import org.rhq.core.clientapi.server.discovery.InventoryReport;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.measurement.MeasurementData;
+import org.rhq.core.domain.measurement.MeasurementDefinition;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.pc.PluginContainer;
+import org.rhq.core.pc.PluginContainerConfiguration;
+import org.rhq.core.pc.plugin.FileSystemPluginFinder;
+import org.rhq.core.pc.plugin.PluginEnvironment;
+import org.rhq.core.pc.plugin.PluginManager;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.measurement.MeasurementFacet;
+import org.rhq.core.pluginapi.operation.OperationFacet;
+import org.rhq.core.pluginapi.operation.OperationResult;
+
+/**
+ * @author Stefan Negrea
+ */
+@SuppressWarnings("rawtypes")
+@Test(groups = "modcluster-plugin")
+public class ModClusterPluginIntegrationTest {
+ private Log log = LogFactory.getLog(this.getClass());
+ private static final String PLUGIN_NAME = "mod_cluster";
+
+ @BeforeSuite
+ public void start() {
+ try {
+ File pluginDir = new File("target/testsetup/plugins");
+ PluginContainerConfiguration pcConfig = new PluginContainerConfiguration();
+ pcConfig.setPluginFinder(new FileSystemPluginFinder(pluginDir));
+ pcConfig.setPluginDirectory(pluginDir);
+
+ pcConfig.setInsideAgent(false);
+ PluginContainer.getInstance().setConfiguration(pcConfig);
+ PluginContainer.getInstance().initialize();
+ log.info("PC started.");
+ for (String plugin : PluginContainer.getInstance().getPluginManager().getMetadataManager().getPluginNames()) {
+ log.info("...Loaded plugin: " + plugin);
+ }
+ } catch (Exception e) {
+ log.info("Error initializing the context", e);
+ }
+ }
+
+ @AfterSuite
+ public void stop() {
+ PluginContainer.getInstance().shutdown();
+ }
+
+ @Test
+ public void testPluginLoad() {
+ PluginManager pluginManager = PluginContainer.getInstance().getPluginManager();
+ PluginEnvironment pluginEnvironment = pluginManager.getPlugin(PLUGIN_NAME);
+ assert (pluginEnvironment != null) : "Null environment, plugin not loaded";
+ assert (pluginEnvironment.getPluginName().equals(PLUGIN_NAME));
+ }
+
+ @Test(dependsOnMethods = "testPluginLoad")
+ public void testDiscovery() throws Exception {
+ InventoryReport report = PluginContainer.getInstance().getInventoryManager().executeServerScanImmediately();
+ assert report != null;
+ log.info("Discovery took: " + (report.getEndTime() - report.getStartTime()) + "ms");
+
+ Thread.sleep(1000);
+
+ report = PluginContainer.getInstance().getInventoryManager().executeServiceScanImmediately();
+ assert report != null;
+ log.info("Discovery took: " + (report.getEndTime() - report.getStartTime()) + "ms");
+
+ Set<Resource> resources = findResource(PluginContainer.getInstance().getInventoryManager().getPlatform());
+ log.info("Found " + resources.size() + " mod_cluster and mod_cluster_context instance(s).");
+
+ assert (resources.size() != 0) : "No mod_cluster or related instances found.";
+
+ if (resources.size() != 0) {
+ for (Object objectResource : resources.toArray()) {
+ Resource resource = (Resource) objectResource;
+ if (resource.getResourceType().getName().equals("mod_cluster")) {
+ testMainResource(resource);
+ } else if (resource.getResourceType().getName().equals("Webapp Context")) {
+ testWebappContext(resource);
+ } else if (resource.getResourceType().getName().equals("HA Service Configuration")) {
+ testLoadServiceConfiguration(resource);
+ } else if (resource.getResourceType().getName().equals("HA Service")) {
+ testServiceMeasurement(resource);
+ testServiceMethodInvocation(resource);
+ }
+ }
+ }
+ }
+
+ private void testServiceMethodInvocation(Resource resource) throws InterruptedException, Exception {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+
+ Configuration config = new Configuration();
+ config.put(new PropertySimple("p1", "1"));
+ config.put(new PropertySimple("p2", java.util.concurrent.TimeUnit.SECONDS));
+ OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("stop", config);
+ log.info("Result of operation stopContext was: " + result.getSimpleResult());
+ }
+
+ private void testLoadServiceConfiguration(Resource resource) throws Exception {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+ ((ConfigurationFacet) resourceComponent).loadResourceConfiguration();
+ }
+
+ private void testServiceMeasurement(Resource resource) throws Exception {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+
+ if (resourceComponent instanceof MeasurementFacet) {
+ for (MeasurementDefinition def : resource.getResourceType().getMetricDefinitions()) {
+ Set<MeasurementScheduleRequest> metricList = new HashSet<MeasurementScheduleRequest>();
+ metricList.add(new MeasurementScheduleRequest(1, def.getName(), 1000, true, def.getDataType(), null));
+ MeasurementReport report = new MeasurementReport();
+ ((MeasurementFacet) resourceComponent).getValues(report, metricList);
+
+ MeasurementData data = report.getTraitData().iterator().next();
+ assert data != null : "Unable to collect trait [" + def.getName() + "] on " + resource;
+ log.info("Measurement: " + def.getName() + "=" + data.getValue());
+ }
+ }
+ }
+
+ private void testMainResource(Resource resource) throws Exception {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+
+ if (resourceComponent instanceof OperationFacet) {
+ OperationResult result = null;
+
+ result = ((OperationFacet) resourceComponent).invokeOperation("reset", new Configuration());
+ log.info("Result of operation test was: " + result);
+
+ result = ((OperationFacet) resourceComponent).invokeOperation("refresh", new Configuration());
+ log.info("Result of operation test was: " + result);
+ }
+ }
+
+ private void testWebappContext(Resource resource) throws Exception {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+
+ if (resourceComponent instanceof OperationFacet) {
+ try {
+ OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("enableContext", null);
+ log.info("Result of operation " + "enableContext" + " was: " + result.getSimpleResult());
+
+ Configuration config = new Configuration();
+ config.put(new PropertySimple("timeout", "1"));
+ config.put(new PropertySimple("unit", java.util.concurrent.TimeUnit.SECONDS));
+ result = ((OperationFacet) resourceComponent).invokeOperation("stopContext", config);
+ log.info("Result of operation stopContext was: " + result.getSimpleResult());
+
+ result = ((OperationFacet) resourceComponent).invokeOperation("enableContext", null);
+ log.info("Result of operation enableContext was: " + result.getSimpleResult());
+
+ result = ((OperationFacet) resourceComponent).invokeOperation("disableContext", null);
+ log.info("Result of operation disableContext was: " + result.getSimpleResult());
+
+ } catch (Exception e) {
+ log.info("Operation failed. ", e);
+ }
+
+ }
+ }
+
+ private Set<Resource> findResource(Resource parent) {
+ Set<Resource> found = new HashSet<Resource>();
+
+ Queue<Resource> discoveryQueue = new LinkedList<Resource>();
+ discoveryQueue.add(parent);
+
+ while (!discoveryQueue.isEmpty()) {
+ Resource currentResource = discoveryQueue.poll();
+
+ log.info("Discovered resource of type: " + currentResource.getResourceType().getName());
+ if (currentResource.getResourceType().getPlugin().equals(PLUGIN_NAME)) {
+ found.add(currentResource);
+ }
+
+ if (currentResource.getChildResources() != null) {
+ for (Resource child : currentResource.getChildResources()) {
+ discoveryQueue.add(child);
+ }
+ }
+ }
+
+ return found;
+ }
+}
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
deleted file mode 100644
index f27b153..0000000
--- a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
+++ /dev/null
@@ -1,228 +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.plugins.modcluster.test;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Queue;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.testng.annotations.AfterSuite;
-import org.testng.annotations.BeforeSuite;
-import org.testng.annotations.Test;
-
-import org.rhq.core.clientapi.server.discovery.InventoryReport;
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.domain.measurement.MeasurementData;
-import org.rhq.core.domain.measurement.MeasurementDefinition;
-import org.rhq.core.domain.measurement.MeasurementReport;
-import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.pc.PluginContainer;
-import org.rhq.core.pc.PluginContainerConfiguration;
-import org.rhq.core.pc.plugin.FileSystemPluginFinder;
-import org.rhq.core.pc.plugin.PluginEnvironment;
-import org.rhq.core.pc.plugin.PluginManager;
-import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
-import org.rhq.core.pluginapi.inventory.ResourceComponent;
-import org.rhq.core.pluginapi.measurement.MeasurementFacet;
-import org.rhq.core.pluginapi.operation.OperationFacet;
-import org.rhq.core.pluginapi.operation.OperationResult;
-
-/**
- * @author Stefan Negrea
- */
-@SuppressWarnings("rawtypes")
-@Test(groups = "modcluster-plugin")
-public class ModclusterPluginTest {
- private Log log = LogFactory.getLog(this.getClass());
- private static final String PLUGIN_NAME = "mod_cluster";
-
- @BeforeSuite
- public void start() {
- try {
- File pluginDir = new File("target/testsetup/plugins");
- PluginContainerConfiguration pcConfig = new PluginContainerConfiguration();
- pcConfig.setPluginFinder(new FileSystemPluginFinder(pluginDir));
- pcConfig.setPluginDirectory(pluginDir);
-
- pcConfig.setInsideAgent(false);
- PluginContainer.getInstance().setConfiguration(pcConfig);
- PluginContainer.getInstance().initialize();
- log.info("PC started.");
- for (String plugin : PluginContainer.getInstance().getPluginManager().getMetadataManager().getPluginNames()) {
- log.info("...Loaded plugin: " + plugin);
- }
- } catch (Exception e) {
- log.info("Error initializing the context", e);
- }
- }
-
- @AfterSuite
- public void stop() {
- PluginContainer.getInstance().shutdown();
- }
-
- @Test
- public void testPluginLoad() {
- PluginManager pluginManager = PluginContainer.getInstance().getPluginManager();
- PluginEnvironment pluginEnvironment = pluginManager.getPlugin(PLUGIN_NAME);
- assert (pluginEnvironment != null) : "Null environment, plugin not loaded";
- assert (pluginEnvironment.getPluginName().equals(PLUGIN_NAME));
- }
-
- @Test(dependsOnMethods = "testPluginLoad")
- public void testDiscovery() throws Exception {
- InventoryReport report = PluginContainer.getInstance().getInventoryManager().executeServerScanImmediately();
- assert report != null;
- log.info("Discovery took: " + (report.getEndTime() - report.getStartTime()) + "ms");
-
- Thread.sleep(1000);
-
- report = PluginContainer.getInstance().getInventoryManager().executeServiceScanImmediately();
- assert report != null;
- log.info("Discovery took: " + (report.getEndTime() - report.getStartTime()) + "ms");
-
- List<String> typeNames = new ArrayList<String>() {
- private static final long serialVersionUID = 1L;
-
- {
- add(PLUGIN_NAME);
- add("Webapp Context");
- add("HA Service Configuration");
- add("HA Service");
- }
- };
-
- Set<Resource> resources = findResource(PluginContainer.getInstance().getInventoryManager().getPlatform(),
- typeNames);
- log.info("Found " + resources.size() + " mod_cluster and mod_cluster_context instance(s).");
-
- assert (resources.size() != 0) : "No mod_cluster or related instances found.";
-
- if (resources.size() != 0) {
- for (Object objectResource : resources.toArray()) {
- Resource resource = (Resource) objectResource;
- if (resource.getResourceType().getName().equals("mod_cluster")) {
- testResourceMeasurement(resource);
- } else if (resource.getResourceType().getName().equals("Webapp Context")) {
- testContextOperations(resource);
- } else if (resource.getResourceType().getName().equals("HA Service Configuration")) {
- ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
- .getResourceComponent(resource);
- ((ConfigurationFacet) resourceComponent).loadResourceConfiguration();
- } else if (resource.getResourceType().getName().equals("HA Service")) {
- ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
- .getResourceComponent(resource);
-
- Configuration config = new Configuration();
- config.put(new PropertySimple("p1", "1"));
- config.put(new PropertySimple("p2", java.util.concurrent.TimeUnit.SECONDS));
- OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("stop", config);
- log.info("Result of operation stopContext was: " + result.getSimpleResult());
- }
- }
- }
- }
-
- private void testResourceMeasurement(Resource resource) throws Exception {
- ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
- .getResourceComponent(resource);
- if (resourceComponent instanceof MeasurementFacet) {
- for (MeasurementDefinition def : resource.getResourceType().getMetricDefinitions()) {
- Set<MeasurementScheduleRequest> metricList = new HashSet<MeasurementScheduleRequest>();
- metricList.add(new MeasurementScheduleRequest(1, def.getName(), 1000, true, def.getDataType(), null));
- MeasurementReport report = new MeasurementReport();
- ((MeasurementFacet) resourceComponent).getValues(report, metricList);
-
- MeasurementData data = report.getTraitData().iterator().next();
- assert data != null : "Unable to collect trait [" + def.getName() + "] on " + resource;
- log.info("Measurement: " + def.getName() + "=" + data.getValue());
- }
- }
-
- if (resourceComponent instanceof OperationFacet) {
- OperationResult result = null;
-
- result = ((OperationFacet) resourceComponent).invokeOperation("reset", new Configuration());
- log.info("Result of operation test was: " + result);
-
- result = ((OperationFacet) resourceComponent).invokeOperation("disable", new Configuration());
- log.info("Result of operation test was: " + result.getSimpleResult());
- }
- }
-
- private void testContextOperations(Resource resource) throws Exception {
- ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
- .getResourceComponent(resource);
-
- if (resourceComponent instanceof OperationFacet) {
- try {
- OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("enableContext", null);
- log.info("Result of operation " + "enableContext" + " was: " + result.getSimpleResult());
-
- Configuration config = new Configuration();
- config.put(new PropertySimple("timeout", "1"));
- config.put(new PropertySimple("unit", java.util.concurrent.TimeUnit.SECONDS));
- result = ((OperationFacet) resourceComponent).invokeOperation("stopContext", config);
- log.info("Result of operation stopContext was: " + result.getSimpleResult());
-
- result = ((OperationFacet) resourceComponent).invokeOperation("enableContext", null);
- log.info("Result of operation enableContext was: " + result.getSimpleResult());
-
- result = ((OperationFacet) resourceComponent).invokeOperation("disableContext", null);
- log.info("Result of operation disableContext was: " + result.getSimpleResult());
-
- } catch (Exception e) {
- log.info("Operation failed. ", e);
- }
-
- }
- }
-
- private Set<Resource> findResource(Resource parent, List<String> typeNames) {
- Set<Resource> found = new HashSet<Resource>();
-
- Queue<Resource> discoveryQueue = new LinkedList<Resource>();
- discoveryQueue.add(parent);
-
- while (!discoveryQueue.isEmpty()) {
- Resource currentResource = discoveryQueue.poll();
-
- log.info("Discovered resource of type: " + currentResource.getResourceType().getName());
- if (typeNames.contains(currentResource.getResourceType().getName())) {
- found.add(currentResource);
- }
-
- if (currentResource.getChildResources() != null) {
- for (Resource child : currentResource.getChildResources()) {
- discoveryQueue.add(child);
- }
- }
- }
-
- return found;
- }
-}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
index b9ce25e..b854398 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
@@ -89,7 +89,7 @@ public class ClassNameMBeanDiscoveryComponent<T extends JMXComponent> extends MB
emsConnection.queryBeans(objectName);
bean = emsConnection.getBean(objectName);
}
+
return bean;
}
-
-}
\ No newline at end of file
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
deleted file mode 100644
index 4c8b437..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
+++ /dev/null
@@ -1,116 +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.plugins.modcluster;
-
-import java.util.concurrent.TimeUnit;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.mc4j.ems.connection.bean.EmsBean;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.measurement.AvailabilityType;
-import org.rhq.core.pluginapi.operation.OperationResult;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
-import org.rhq.plugins.modcluster.helper.JBossHelper;
-
-/**
- * Manages a mod_cluster context entity.
- *
- * @author Stefan Negrea
- */
-@SuppressWarnings({ "rawtypes", "deprecation" })
-public class ContextComponent extends MBeanResourceComponent<MBeanResourceComponent> {
-
- private static final Log log = LogFactory.getLog(ContextComponent.class);
-
- @Override
- protected EmsBean loadBean() {
- return getResourceContext().getParentResourceComponent().getEmsBean();
- }
-
- @Override
- public AvailabilityType getAvailability() {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- try {
- Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
- String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
-
- ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
-
- ProxyInfo.Context context = ProxyInfo.Context.fromString(resourceContext.getResourceKey());
-
- int indexOfCurrentContext = proxyInfo.getAvailableContexts().indexOf(context);
-
- if (indexOfCurrentContext != -1) {
- ProxyInfo.Context currentContext = proxyInfo.getAvailableContexts().get(indexOfCurrentContext);
-
- if (currentContext.isEnabled()) {
- return AvailabilityType.UP;
- }
- }
-
- return AvailabilityType.DOWN;
- } catch (Exception e) {
- log.info(e);
- return AvailabilityType.DOWN;
- } finally {
- Thread.currentThread().setContextClassLoader(cl);
- }
- }
-
- @Override
- public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
- if ("enableContext".equals(name) || "disableContext".equals(name) || "stopContext".equals(name)) {
-
- ProxyInfo.Context context = ProxyInfo.Context.fromString(resourceContext.getResourceKey());
-
- Object[] configuration = null;
- if ("stopContext".equals(name)) {
- configuration = new Object[] { context.getHost(), context.getPath(),
- parameters.getSimple("timeout").getLongValue(),
- TimeUnit.valueOf(parameters.getSimple("unit").getStringValue()) };
- } else {
- configuration = new Object[] { context.getHost(), context.getPath() };
- }
-
- if (context.getPath().equals("/")) {
- configuration[1] = "ROOT";
- }
-
- log.info(name + " - " + context.getHost() + " " + context.getPath());
-
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- try {
- Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
- Object resultObject = getEmsBean().getOperation(name).invoke(configuration);
-
- if (resultObject instanceof OperationResult) {
- return (OperationResult) resultObject;
- } else {
- return new OperationResult(String.valueOf(resultObject));
- }
- } finally {
- Thread.currentThread().setContextClassLoader(cl);
- }
- }
-
- throw new Exception("Operation " + name + " not available mod_cluster WebApp service.");
- }
-}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java
deleted file mode 100644
index 788cbce..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java
+++ /dev/null
@@ -1,104 +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.plugins.modcluster;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.mc4j.ems.connection.EmsConnection;
-import org.mc4j.ems.connection.bean.EmsBean;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
-import org.rhq.plugins.modcluster.helper.JBossHelper;
-
-/**
- * Discovers mod_cluster contexts from the proxyInfo mbean property.
- *
- * @author Stefan Negrea
- */
-@SuppressWarnings("rawtypes")
-public class ContextDiscoveryComponent implements ResourceDiscoveryComponent<MBeanResourceComponent> {
-
- private static final String JVM_ROUTE_PROPERTY = "jvmRoute";
- private static final String ENGINE_OBJECT_NAME = "engineObjectName";
-
- /* (non-Javadoc)
- * @see org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext)
- */
- public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<MBeanResourceComponent> context) {
- String jvmRoute = this.getJvmRoute(context);
-
- EmsBean configBean = context.getParentResourceComponent().getEmsBean();
- String rawProxyInfo = JBossHelper.getRawProxyInfo(configBean);
-
- ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
- Set<DiscoveredResourceDetails> entities = new HashSet<DiscoveredResourceDetails>();
-
- for (ProxyInfo.Context availableContext : proxyInfo.getAvailableContexts()) {
- if (availableContext.getJvmRoute().equals(jvmRoute)) {
- DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(),
- availableContext.createKey(), availableContext.createName(), null, "Webapp Context", null, null);
- entities.add(detail);
- }
- }
-
- return entities;
- }
-
- /**
- * Retrieves the jvm route for the node from the parent context.
- *
- * @param context the discovery context
- * @return node's jvm route
- */
- private String getJvmRoute(ResourceDiscoveryContext<MBeanResourceComponent> context) {
- Configuration pluginConfig = context.getParentResourceComponent().getResourceContext().getPluginConfiguration();
- String engineObjectName = pluginConfig.getSimple(ENGINE_OBJECT_NAME).getStringValue();
- EmsBean engineBean = this.loadBean(engineObjectName, context.getParentResourceComponent());
-
- return (String) engineBean.getAttribute(JVM_ROUTE_PROPERTY).refresh().toString();
- }
-
- /**
- * Loads the bean with the given object name.
- *
- * Subclasses are free to override this method in order to load the bean.
- *
- * @param objectName the name of the bean to load
- * @return the bean that is loaded
- */
- protected EmsBean loadBean(String objectName, MBeanResourceComponent context) {
- EmsConnection emsConnection = context.getEmsConnection();
- EmsBean bean = emsConnection.getBean(objectName);
- if (bean == null) {
- // In some cases, this resource component may have been discovered by some means other than querying its
- // parent's EMSConnection (e.g. ApplicationDiscoveryComponent uses a filesystem to discover EARs and
- // WARs that are not yet deployed). In such cases, getBean() will return null, since EMS won't have the
- // bean in its cache. To cover such cases, make an attempt to query the underlying MBeanServer for the
- // bean before giving up.
- emsConnection.queryBeans(objectName);
- bean = emsConnection.getBean(objectName);
- }
- return bean;
- }
-}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
index 7d5f0dc..0db722e 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
@@ -21,6 +21,7 @@ package org.rhq.plugins.modcluster;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.plugins.jmx.MBeanResourceComponent;
import org.rhq.plugins.modcluster.helper.JBossHelper;
+import org.rhq.plugins.modcluster.model.ProxyInfo;
/**
* @author Stefan Negrea
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ProxyInfo.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ProxyInfo.java
deleted file mode 100644
index 8614402..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ProxyInfo.java
+++ /dev/null
@@ -1,310 +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.plugins.modcluster;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Simple parser for the raw proxy information provided by mod_cluster.
- *
- * @author Stefan Negrea
- */
-public class ProxyInfo {
-
- private Map<String, Node> availableNodes = new HashMap<String, Node>();
- private Map<String, Vhost> availableVhosts = new HashMap<String, Vhost>();
- private List<Context> availableContexts = new ArrayList<ProxyInfo.Context>();
-
- public ProxyInfo(String rawProxyInfo) {
- parseNodes(rawProxyInfo);
- parseVhosts(rawProxyInfo);
- parseContexts(rawProxyInfo);
- }
-
- private void parseNodes(String rawProxyInfo) {
- Pattern nodePattern = Pattern.compile("Node:.*\n");
- Matcher nodeMatcher = nodePattern.matcher(rawProxyInfo);
- while (nodeMatcher.find()) {
- String rawNode = nodeMatcher.group();
- String[] nodePieces = rawNode.split(",");
-
- String identifier = nodePieces[0];
- identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
-
- String jvmRoute = nodePieces[1];
- jvmRoute = jvmRoute.substring(jvmRoute.indexOf(':') + 1).trim();
-
- availableNodes.put(identifier, new Node(jvmRoute, identifier));
- }
- }
-
- private void parseVhosts(String rawProxyInfo) {
- Pattern vhostPattern = Pattern.compile("Vhost:.*\n");
- Matcher vhostMatcher = vhostPattern.matcher(rawProxyInfo);
- while (vhostMatcher.find()) {
- String rawVhost = vhostMatcher.group();
- String[] vhostPieces = rawVhost.split(",");
-
- String identifier = vhostPieces[0].trim();
- identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
- identifier = identifier.substring(0, identifier.lastIndexOf(":"));
-
- String host = vhostPieces[1].trim();
- host = host.substring(host.indexOf(":") + 1).trim();
-
- availableVhosts.put(identifier, new Vhost(identifier, host));
- }
- }
-
- private void parseContexts(String rawProxyInfo) {
- Pattern contextPattern = Pattern.compile("Context:.*[\n|}]");
- Matcher contextMatcher = contextPattern.matcher(rawProxyInfo);
- while (contextMatcher.find()) {
- String rawContext = contextMatcher.group();
- String[] contextPieces = rawContext.split(",");
- String actualContext = contextPieces[1].substring(contextPieces[1].indexOf("/")).trim();
-
- String identifier = contextPieces[0];
- identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
- identifier = identifier.substring(0, identifier.lastIndexOf(":"));
-
- String nodeIdentifier = contextPieces[0];
- nodeIdentifier = nodeIdentifier.substring(nodeIdentifier.indexOf("[") + 1, nodeIdentifier.indexOf("]"));
- nodeIdentifier = nodeIdentifier.substring(0, nodeIdentifier.indexOf(":"));
- String jvmRoute = availableNodes.get(nodeIdentifier).getJvmRoute();
-
- String rawIsEnabled = contextPieces[2];
- rawIsEnabled = rawIsEnabled.substring(rawIsEnabled.indexOf(':') + 1).trim();
- boolean isEnabled = rawIsEnabled.equals("ENABLED") ? true : false;
-
- Vhost relatedVhost = availableVhosts.get(identifier);
-
- availableContexts.add(new Context(jvmRoute, relatedVhost.getHost(), actualContext, isEnabled));
- }
- }
-
- public List<Context> getAvailableContexts() {
- return Collections.unmodifiableList(availableContexts);
- }
-
- public List<Vhost> getAvailableVhosts() {
- return Collections.unmodifiableList(new ArrayList<Vhost>(availableVhosts.values()));
- }
-
- public List<Node> getAvailableNodes() {
- return Collections.unmodifiableList(new ArrayList<Node>(availableNodes.values()));
- }
-
- public static class Node {
- private String jvmRoute;
- private String nodeId;
-
- public Node(String jvmRoute, String nodeId) {
- this.jvmRoute = jvmRoute;
- this.nodeId = nodeId;
- }
-
- public String getNodeId() {
- return nodeId;
- }
-
- public String getJvmRoute() {
- return jvmRoute;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((jvmRoute == null) ? 0 : jvmRoute.hashCode());
- result = prime * result + ((nodeId == null) ? 0 : nodeId.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Node other = (Node) obj;
- if (jvmRoute == null) {
- if (other.jvmRoute != null)
- return false;
- } else if (!jvmRoute.equals(other.jvmRoute))
- return false;
- if (nodeId == null) {
- if (other.nodeId != null)
- return false;
- } else if (!nodeId.equals(other.nodeId))
- return false;
- return true;
- }
- }
-
- public static class Vhost {
- private String identifier;
- private String host;
-
- public Vhost(String identifier, String host) {
- this.identifier = identifier;
- this.host = host;
- }
-
- public String getIdentifier() {
- return identifier;
- }
-
- public String getHost() {
- return host;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((host == null) ? 0 : host.hashCode());
- result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Vhost other = (Vhost) obj;
- if (host == null) {
- if (other.host != null)
- return false;
- } else if (!host.equals(other.host))
- return false;
- if (identifier == null) {
- if (other.identifier != null)
- return false;
- } else if (!identifier.equals(other.identifier))
- return false;
- return true;
- }
- }
-
- public static class Context {
- private String path;
- private String host;
- private String jvmRoute;
- private boolean isEnabled;
-
- public Context(String jvmRoute, String host, String path) {
- this(jvmRoute, host, path, false);
- }
-
- public Context(String jvmRoute, String host, String path, boolean isEnabled) {
- this.jvmRoute = jvmRoute;
- this.host = host;
- this.path = path;
- this.isEnabled = isEnabled;
- }
-
- public String getPath() {
- return path;
- }
-
- public String getHost() {
- return host;
- }
-
- public String getJvmRoute() {
- return jvmRoute;
- }
-
- public boolean isEnabled() {
- return isEnabled;
- }
-
- public String createKey() {
- return jvmRoute + ":" + host + ":" + path;
- }
-
- public String createName() {
- return host + ":" + path;
- }
-
- @Override
- public String toString() {
- return createKey();
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((host == null) ? 0 : host.hashCode());
- result = prime * result + ((jvmRoute == null) ? 0 : jvmRoute.hashCode());
- result = prime * result + ((path == null) ? 0 : path.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Context other = (Context) obj;
- if (host == null) {
- if (other.host != null)
- return false;
- } else if (!host.equals(other.host))
- return false;
- if (jvmRoute == null) {
- if (other.jvmRoute != null)
- return false;
- } else if (!jvmRoute.equals(other.jvmRoute))
- return false;
- if (path == null) {
- if (other.path != null)
- return false;
- } else if (!path.equals(other.path))
- return false;
- return true;
- }
-
- public static Context fromString(String stringRepresentation) throws Exception {
- String parts[] = stringRepresentation.trim().split(":");
- if (parts.length < 3) {
- throw new Exception("Parsing error. Not enough information to create a context.");
- }
-
- return new Context(parts[0], parts[1], parts[2]);
- }
- }
-}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextComponent.java
new file mode 100644
index 0000000..6131578
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextComponent.java
@@ -0,0 +1,117 @@
+/*
+ * 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.plugins.modcluster;
+
+import java.util.concurrent.TimeUnit;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.mc4j.ems.connection.bean.EmsBean;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.pluginapi.operation.OperationResult;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
+import org.rhq.plugins.modcluster.model.ProxyInfo;
+
+/**
+ * Manages a mod_cluster context entity.
+ *
+ * @author Stefan Negrea
+ */
+@SuppressWarnings({ "rawtypes", "deprecation" })
+public class WebappContextComponent extends MBeanResourceComponent<MBeanResourceComponent> {
+
+ private static final Log log = LogFactory.getLog(WebappContextComponent.class);
+
+ @Override
+ protected EmsBean loadBean() {
+ return getResourceContext().getParentResourceComponent().getEmsBean();
+ }
+
+ @Override
+ public AvailabilityType getAvailability() {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
+
+ ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
+
+ ProxyInfo.Context context = ProxyInfo.Context.fromString(resourceContext.getResourceKey());
+
+ int indexOfCurrentContext = proxyInfo.getAvailableContexts().indexOf(context);
+
+ if (indexOfCurrentContext != -1) {
+ ProxyInfo.Context currentContext = proxyInfo.getAvailableContexts().get(indexOfCurrentContext);
+
+ if (currentContext.isEnabled()) {
+ return AvailabilityType.UP;
+ }
+ }
+
+ return AvailabilityType.DOWN;
+ } catch (Exception e) {
+ log.info(e);
+ return AvailabilityType.DOWN;
+ } finally {
+ Thread.currentThread().setContextClassLoader(cl);
+ }
+ }
+
+ @Override
+ public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
+ if ("enableContext".equals(name) || "disableContext".equals(name) || "stopContext".equals(name)) {
+
+ ProxyInfo.Context context = ProxyInfo.Context.fromString(resourceContext.getResourceKey());
+
+ Object[] configuration = null;
+ if ("stopContext".equals(name)) {
+ configuration = new Object[] { context.getHost(), context.getPath(),
+ parameters.getSimple("timeout").getLongValue(),
+ TimeUnit.valueOf(parameters.getSimple("unit").getStringValue()) };
+ } else {
+ configuration = new Object[] { context.getHost(), context.getPath() };
+ }
+
+ if (context.getPath().equals("/")) {
+ configuration[1] = "ROOT";
+ }
+
+ log.info(name + " - " + context.getHost() + " " + context.getPath());
+
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
+ Object resultObject = getEmsBean().getOperation(name).invoke(configuration);
+
+ if (resultObject instanceof OperationResult) {
+ return (OperationResult) resultObject;
+ } else {
+ return new OperationResult(String.valueOf(resultObject));
+ }
+ } finally {
+ Thread.currentThread().setContextClassLoader(cl);
+ }
+ }
+
+ throw new Exception("Operation " + name + " not available mod_cluster WebApp service.");
+ }
+}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextDiscoveryComponent.java
new file mode 100644
index 0000000..559e1b6
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextDiscoveryComponent.java
@@ -0,0 +1,105 @@
+/*
+ * 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.plugins.modcluster;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.mc4j.ems.connection.EmsConnection;
+import org.mc4j.ems.connection.bean.EmsBean;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
+import org.rhq.plugins.modcluster.model.ProxyInfo;
+
+/**
+ * Discovers mod_cluster contexts from the proxyInfo mbean property.
+ *
+ * @author Stefan Negrea
+ */
+@SuppressWarnings("rawtypes")
+public class WebappContextDiscoveryComponent implements ResourceDiscoveryComponent<MBeanResourceComponent> {
+
+ private static final String JVM_ROUTE_PROPERTY = "jvmRoute";
+ private static final String ENGINE_OBJECT_NAME = "engineObjectName";
+
+ /* (non-Javadoc)
+ * @see org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext)
+ */
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<MBeanResourceComponent> context) {
+ String jvmRoute = this.getJvmRoute(context);
+
+ EmsBean configBean = context.getParentResourceComponent().getEmsBean();
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(configBean);
+
+ ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
+ Set<DiscoveredResourceDetails> entities = new HashSet<DiscoveredResourceDetails>();
+
+ for (ProxyInfo.Context availableContext : proxyInfo.getAvailableContexts()) {
+ if (availableContext.getJvmRoute().equals(jvmRoute)) {
+ DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(),
+ availableContext.createKey(), availableContext.createName(), null, "Webapp Context", null, null);
+ entities.add(detail);
+ }
+ }
+
+ return entities;
+ }
+
+ /**
+ * Retrieves the jvm route for the node from the parent context.
+ *
+ * @param context the discovery context
+ * @return node's jvm route
+ */
+ private String getJvmRoute(ResourceDiscoveryContext<MBeanResourceComponent> context) {
+ Configuration pluginConfig = context.getParentResourceComponent().getResourceContext().getPluginConfiguration();
+ String engineObjectName = pluginConfig.getSimple(ENGINE_OBJECT_NAME).getStringValue();
+ EmsBean engineBean = this.loadBean(engineObjectName, context.getParentResourceComponent());
+
+ return (String) engineBean.getAttribute(JVM_ROUTE_PROPERTY).refresh().toString();
+ }
+
+ /**
+ * Loads the bean with the given object name.
+ *
+ * Subclasses are free to override this method in order to load the bean.
+ *
+ * @param objectName the name of the bean to load
+ * @return the bean that is loaded
+ */
+ protected EmsBean loadBean(String objectName, MBeanResourceComponent context) {
+ EmsConnection emsConnection = context.getEmsConnection();
+ EmsBean bean = emsConnection.getBean(objectName);
+ if (bean == null) {
+ // In some cases, this resource component may have been discovered by some means other than querying its
+ // parent's EMSConnection (e.g. ApplicationDiscoveryComponent uses a filesystem to discover EARs and
+ // WARs that are not yet deployed). In such cases, getBean() will return null, since EMS won't have the
+ // bean in its cache. To cover such cases, make an attempt to query the underlying MBeanServer for the
+ // bean before giving up.
+ emsConnection.queryBeans(objectName);
+ bean = emsConnection.getBean(objectName);
+ }
+ return bean;
+ }
+}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/model/ProxyInfo.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/model/ProxyInfo.java
new file mode 100644
index 0000000..9cedad5
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/model/ProxyInfo.java
@@ -0,0 +1,310 @@
+/*
+ * 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.plugins.modcluster.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Simple parser for the raw proxy information provided by mod_cluster.
+ *
+ * @author Stefan Negrea
+ */
+public class ProxyInfo {
+
+ private Map<String, Node> availableNodes = new HashMap<String, Node>();
+ private Map<String, Vhost> availableVhosts = new HashMap<String, Vhost>();
+ private List<Context> availableContexts = new ArrayList<ProxyInfo.Context>();
+
+ public ProxyInfo(String rawProxyInfo) {
+ parseNodes(rawProxyInfo);
+ parseVhosts(rawProxyInfo);
+ parseContexts(rawProxyInfo);
+ }
+
+ private void parseNodes(String rawProxyInfo) {
+ Pattern nodePattern = Pattern.compile("Node:.*\n");
+ Matcher nodeMatcher = nodePattern.matcher(rawProxyInfo);
+ while (nodeMatcher.find()) {
+ String rawNode = nodeMatcher.group();
+ String[] nodePieces = rawNode.split(",");
+
+ String identifier = nodePieces[0];
+ identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
+
+ String jvmRoute = nodePieces[1];
+ jvmRoute = jvmRoute.substring(jvmRoute.indexOf(':') + 1).trim();
+
+ availableNodes.put(identifier, new Node(jvmRoute, identifier));
+ }
+ }
+
+ private void parseVhosts(String rawProxyInfo) {
+ Pattern vhostPattern = Pattern.compile("Vhost:.*\n");
+ Matcher vhostMatcher = vhostPattern.matcher(rawProxyInfo);
+ while (vhostMatcher.find()) {
+ String rawVhost = vhostMatcher.group();
+ String[] vhostPieces = rawVhost.split(",");
+
+ String identifier = vhostPieces[0].trim();
+ identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
+ identifier = identifier.substring(0, identifier.lastIndexOf(":"));
+
+ String host = vhostPieces[1].trim();
+ host = host.substring(host.indexOf(":") + 1).trim();
+
+ availableVhosts.put(identifier, new Vhost(identifier, host));
+ }
+ }
+
+ private void parseContexts(String rawProxyInfo) {
+ Pattern contextPattern = Pattern.compile("Context:.*[\n|}]");
+ Matcher contextMatcher = contextPattern.matcher(rawProxyInfo);
+ while (contextMatcher.find()) {
+ String rawContext = contextMatcher.group();
+ String[] contextPieces = rawContext.split(",");
+ String actualContext = contextPieces[1].substring(contextPieces[1].indexOf("/")).trim();
+
+ String identifier = contextPieces[0];
+ identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
+ identifier = identifier.substring(0, identifier.lastIndexOf(":"));
+
+ String nodeIdentifier = contextPieces[0];
+ nodeIdentifier = nodeIdentifier.substring(nodeIdentifier.indexOf("[") + 1, nodeIdentifier.indexOf("]"));
+ nodeIdentifier = nodeIdentifier.substring(0, nodeIdentifier.indexOf(":"));
+ String jvmRoute = availableNodes.get(nodeIdentifier).getJvmRoute();
+
+ String rawIsEnabled = contextPieces[2];
+ rawIsEnabled = rawIsEnabled.substring(rawIsEnabled.indexOf(':') + 1).trim();
+ boolean isEnabled = rawIsEnabled.equals("ENABLED") ? true : false;
+
+ Vhost relatedVhost = availableVhosts.get(identifier);
+
+ availableContexts.add(new Context(jvmRoute, relatedVhost.getHost(), actualContext, isEnabled));
+ }
+ }
+
+ public List<Context> getAvailableContexts() {
+ return Collections.unmodifiableList(availableContexts);
+ }
+
+ public List<Vhost> getAvailableVhosts() {
+ return Collections.unmodifiableList(new ArrayList<Vhost>(availableVhosts.values()));
+ }
+
+ public List<Node> getAvailableNodes() {
+ return Collections.unmodifiableList(new ArrayList<Node>(availableNodes.values()));
+ }
+
+ public static class Node {
+ private String jvmRoute;
+ private String nodeId;
+
+ public Node(String jvmRoute, String nodeId) {
+ this.jvmRoute = jvmRoute;
+ this.nodeId = nodeId;
+ }
+
+ public String getNodeId() {
+ return nodeId;
+ }
+
+ public String getJvmRoute() {
+ return jvmRoute;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((jvmRoute == null) ? 0 : jvmRoute.hashCode());
+ result = prime * result + ((nodeId == null) ? 0 : nodeId.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Node other = (Node) obj;
+ if (jvmRoute == null) {
+ if (other.jvmRoute != null)
+ return false;
+ } else if (!jvmRoute.equals(other.jvmRoute))
+ return false;
+ if (nodeId == null) {
+ if (other.nodeId != null)
+ return false;
+ } else if (!nodeId.equals(other.nodeId))
+ return false;
+ return true;
+ }
+ }
+
+ public static class Vhost {
+ private String identifier;
+ private String host;
+
+ public Vhost(String identifier, String host) {
+ this.identifier = identifier;
+ this.host = host;
+ }
+
+ public String getIdentifier() {
+ return identifier;
+ }
+
+ public String getHost() {
+ return host;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((host == null) ? 0 : host.hashCode());
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Vhost other = (Vhost) obj;
+ if (host == null) {
+ if (other.host != null)
+ return false;
+ } else if (!host.equals(other.host))
+ return false;
+ if (identifier == null) {
+ if (other.identifier != null)
+ return false;
+ } else if (!identifier.equals(other.identifier))
+ return false;
+ return true;
+ }
+ }
+
+ public static class Context {
+ private String path;
+ private String host;
+ private String jvmRoute;
+ private boolean isEnabled;
+
+ public Context(String jvmRoute, String host, String path) {
+ this(jvmRoute, host, path, false);
+ }
+
+ public Context(String jvmRoute, String host, String path, boolean isEnabled) {
+ this.jvmRoute = jvmRoute;
+ this.host = host;
+ this.path = path;
+ this.isEnabled = isEnabled;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public String getHost() {
+ return host;
+ }
+
+ public String getJvmRoute() {
+ return jvmRoute;
+ }
+
+ public boolean isEnabled() {
+ return isEnabled;
+ }
+
+ public String createKey() {
+ return jvmRoute + ":" + host + ":" + path;
+ }
+
+ public String createName() {
+ return host + ":" + path;
+ }
+
+ @Override
+ public String toString() {
+ return createKey();
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((host == null) ? 0 : host.hashCode());
+ result = prime * result + ((jvmRoute == null) ? 0 : jvmRoute.hashCode());
+ result = prime * result + ((path == null) ? 0 : path.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Context other = (Context) obj;
+ if (host == null) {
+ if (other.host != null)
+ return false;
+ } else if (!host.equals(other.host))
+ return false;
+ if (jvmRoute == null) {
+ if (other.jvmRoute != null)
+ return false;
+ } else if (!jvmRoute.equals(other.jvmRoute))
+ return false;
+ if (path == null) {
+ if (other.path != null)
+ return false;
+ } else if (!path.equals(other.path))
+ return false;
+ return true;
+ }
+
+ public static Context fromString(String stringRepresentation) throws Exception {
+ String parts[] = stringRepresentation.trim().split(":");
+ if (parts.length < 3) {
+ throw new Exception("Parsing error. Not enough information to create a context.");
+ }
+
+ return new Context(parts[0], parts[1], parts[2]);
+ }
+ }
+}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 7e1a79f..6f46849 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -440,7 +440,7 @@
</resource-configuration>
</service>
- <service name="Webapp Context" discovery="ContextDiscoveryComponent" class="ContextComponent" description="Webapp Context">
+ <service name="Webapp Context" discovery="WebappContextDiscoveryComponent" class="WebappContextComponent" description="Webapp Context">
<operation name="disableContext" displayName="Disable webapp" description="Disable this webapp.">
<results>
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ProxyInfoTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ProxyInfoTest.java
index 625d8d4..ebadd86 100644
--- a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ProxyInfoTest.java
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ProxyInfoTest.java
@@ -23,7 +23,7 @@ import java.io.InputStream;
import org.testng.annotations.Test;
-import org.rhq.plugins.modcluster.ProxyInfo;
+import org.rhq.plugins.modcluster.model.ProxyInfo;
/**
* @author Stefan Negrea
commit dee21cbe94b5d5befc5a087a74cc5884bea96ee4
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Aug 23 16:12:11 2011 -0500
Renaming mod_cluster components to match their explicit purpose.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
index 0a0a570..b87bfcd 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
@@ -30,14 +30,16 @@ import org.rhq.core.domain.configuration.definition.PropertyDefinition;
import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
import org.rhq.core.util.exception.ThrowableUtil;
+import org.rhq.plugins.jmx.JMXComponent;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
/**
* @author Stefan Negrea
*
*/
-@SuppressWarnings({ "deprecation" })
-public class FileConfiguredMBeanResourceComponent extends TimeUnitParamResourceComponent {
+@SuppressWarnings({ "deprecation", "rawtypes" })
+public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent<JMXComponent> {
private static final Log log = LogFactory.getLog(FileConfiguredMBeanResourceComponent.class);
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServiceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServiceComponent.java
new file mode 100644
index 0000000..d9da81c
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServiceComponent.java
@@ -0,0 +1,52 @@
+package org.rhq.plugins.modcluster;
+
+import java.util.concurrent.TimeUnit;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.pluginapi.operation.OperationResult;
+
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.
+ */
+
+/**
+ *
+ * @author Stefan Negrea
+ */
+public class ModClusterServiceComponent extends FileConfiguredMBeanResourceComponent {
+
+ @Override
+ public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
+ if (name.toLowerCase().startsWith("ping")) {
+ name = "ping";
+ }
+
+ return super.invokeOperation(name, parameters);
+ }
+
+ @Override
+ protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
+ System.out.println(typeName);
+ if (typeName.equals(TimeUnit.class.getName())) {
+ return TimeUnit.valueOf(propSimple.getStringValue());
+ }
+
+ return super.getPropertyValueAsType(propSimple, typeName);
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
deleted file mode 100644
index c67bf61..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.rhq.plugins.modcluster;
-
-import java.util.concurrent.TimeUnit;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.pluginapi.operation.OperationResult;
-
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2009 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.
- */
-
-/**
- *
- * @author Stefan Negrea
- */
-public class PolyPingMBeanResourceComponent extends FileConfiguredMBeanResourceComponent {
-
- @Override
- public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
- if (name.toLowerCase().startsWith("ping")) {
- name = "ping";
- }
-
- return super.invokeOperation(name, parameters);
- }
-
- @Override
- protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
- System.out.println(typeName);
- if (typeName.equals(TimeUnit.class.getName())) {
- return TimeUnit.valueOf(propSimple.getStringValue());
- }
-
- return super.getPropertyValueAsType(propSimple, typeName);
- }
-}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java
deleted file mode 100644
index 0296eaf..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2009 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.plugins.modcluster;
-
-import java.util.concurrent.TimeUnit;
-
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
-
-/**
- * @author Stefan Negrea
- *
- */
-@SuppressWarnings("rawtypes")
-public class TimeUnitParamResourceComponent extends MBeanResourceComponent {
-
- @Override
- protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
- System.out.println(typeName);
- if (typeName.equals(TimeUnit.class.getName())) {
- return TimeUnit.valueOf(propSimple.getStringValue());
- }
-
- return super.getPropertyValueAsType(propSimple, typeName);
- }
-}
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index ed82f7c..7e1a79f 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -27,7 +27,7 @@
<!-- Start - Configuration for HAModClusterService -->
<service name="HA Service" discovery="ClassNameMBeanDiscoveryComponent"
- class="PolyPingMBeanResourceComponent"
+ class="ModClusterServiceComponent"
supportsManualAdd="true"
description="HA Service Listener" singleton="true">
@@ -199,7 +199,7 @@
<!-- End - Configuration for HAModClusterService -->
<!-- Start - Configuration for ModClusterService -->
- <service name="Service" discovery="ClassNameMBeanDiscoveryComponent" class="PolyPingMBeanResourceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
+ <service name="Service" discovery="ClassNameMBeanDiscoveryComponent" class="ModClusterServiceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
<plugin-configuration>
<c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
commit 35d73023552f4b83976705e88f14e6fecf0eed6f
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Aug 23 15:39:58 2011 -0500
Updates to support integration with JBoss' mod_cluster module for AS6 and EAP5.1.x
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
index b642573..f27b153 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
+++ b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
@@ -112,6 +112,7 @@ public class ModclusterPluginTest {
add(PLUGIN_NAME);
add("Webapp Context");
add("HA Service Configuration");
+ add("HA Service");
}
};
@@ -132,6 +133,15 @@ public class ModclusterPluginTest {
ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
.getResourceComponent(resource);
((ConfigurationFacet) resourceComponent).loadResourceConfiguration();
+ } else if (resource.getResourceType().getName().equals("HA Service")) {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+
+ Configuration config = new Configuration();
+ config.put(new PropertySimple("p1", "1"));
+ config.put(new PropertySimple("p2", java.util.concurrent.TimeUnit.SECONDS));
+ OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("stop", config);
+ log.info("Result of operation stopContext was: " + result.getSimpleResult());
}
}
}
diff --git a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java
index 6a60a93..8da6a2d 100644
--- a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java
+++ b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java
@@ -561,15 +561,15 @@ public class MBeanResourceComponent<T extends JMXComponent> implements Measureme
paramIndex = Integer.valueOf(propName.substring(propName.indexOf('[') + 1, propName.indexOf(']')));
if (paramIndex < 0 || paramIndex >= emsParams.size()) {
throw new IllegalStateException("Index [" + paramIndex + "] specified for parameter of operation ["
- + name + "] on MBean [" + emsBean.getBeanName() + "] is invalid. The MBean operation takes "
- + emsParams.size() + " parameters.");
+ + name + "] on MBean [" + emsBean.getBeanName() + "] is invalid. The MBean operation takes "
+ + emsParams.size() + " parameters.");
}
} else {
paramIndex = emsParamIndexesByName.get(propName);
if (paramIndex == null) {
throw new IllegalStateException("Name [" + propName + "] specified for parameter of operation ["
- + name + "] on MBean [" + emsBean.getBeanName()
- + "] is invalid. The MBean operation does not take a parameter by that name.");
+ + name + "] on MBean [" + emsBean.getBeanName()
+ + "] is invalid. The MBean operation does not take a parameter by that name.");
}
}
EmsParameter emsParam = emsParams.get(paramIndex);
@@ -611,7 +611,7 @@ public class MBeanResourceComponent<T extends JMXComponent> implements Measureme
return resultToReturn;
}
- private Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
+ protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
Object value;
if (typeName.equals(String.class.getName())) {
value = (propSimple == null) ? null : propSimple.getStringValue();
@@ -626,7 +626,8 @@ public class MBeanResourceComponent<T extends JMXComponent> implements Measureme
} else if (typeName.equals(Double.class.getName()) || typeName.equals(double.class.getName())) {
value = (propSimple == null) ? null : propSimple.getDoubleValue();
} else {
- throw new IllegalStateException("Operation parameter maps to MBean parameter with an unsupported type (" + typeName + ").");
+ throw new IllegalStateException("Operation parameter maps to MBean parameter with an unsupported type ("
+ + typeName + ").");
}
// TODO GH: Handle rest of types. (I think i have a mapper for this in mc4j
return value;
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index 35c5b28..3a6deaa 100644
--- a/modules/plugins/mod-cluster/pom.xml
+++ b/modules/plugins/mod-cluster/pom.xml
@@ -31,6 +31,11 @@
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.on</groupId>
+ <artifactId>jopr-jboss-as-plugin</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>log4j</groupId>
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
index c5343d0..4c8b437 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
@@ -90,6 +90,10 @@ public class ContextComponent extends MBeanResourceComponent<MBeanResourceCompon
configuration = new Object[] { context.getHost(), context.getPath() };
}
+ if (context.getPath().equals("/")) {
+ configuration[1] = "ROOT";
+ }
+
log.info(name + " - " + context.getHost() + " " + context.getPath());
ClassLoader cl = Thread.currentThread().getContextClassLoader();
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
index ee0369c..0a0a570 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
@@ -30,21 +30,20 @@ import org.rhq.core.domain.configuration.definition.PropertyDefinition;
import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
import org.rhq.core.util.exception.ThrowableUtil;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
/**
* @author Stefan Negrea
*
*/
-@SuppressWarnings({ "rawtypes", "deprecation" })
-public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent {
+@SuppressWarnings({ "deprecation" })
+public class FileConfiguredMBeanResourceComponent extends TimeUnitParamResourceComponent {
private static final Log log = LogFactory.getLog(FileConfiguredMBeanResourceComponent.class);
private static final String BEAN_CLASS_NAME_PROPERTY = "className";
private static final String DEPENDENCY_BEAN_CLASS_NAME_PROPERTY = "dependencyClassName";
- private static final String SERVER_HOME_DIR = "jboss.server.home.dir";
+ private static final String SERVER_HOME_DIR = "serverHomeDir";
private static final String CONFIGURATION_FILE_RELATIVE_PATH = "/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml";
/**
@@ -105,7 +104,7 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
}
private String getServerHomeDirectory() {
- ModclusterServerComponent modClusterComponent = (ModclusterServerComponent) this.resourceContext
+ ModClusterServerComponent modClusterComponent = (ModClusterServerComponent) this.resourceContext
.getParentResourceComponent();
PropertySimple property = modClusterComponent.getResourceContext().getPluginConfiguration()
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
index 496068c..3eb7cbe 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
@@ -36,9 +36,6 @@ import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
@SuppressWarnings("rawtypes")
public class LoadMetricDiscoveryComponent extends MBeanResourceDiscoveryComponent<JMXComponent> {
- /* (non-Javadoc)
- * @see org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext, boolean)
- */
@Override
public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<JMXComponent> context,
boolean skipUnknownProps) {
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterDiscoveryComponent.java
new file mode 100644
index 0000000..b9a73b5
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterDiscoveryComponent.java
@@ -0,0 +1,70 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import java.util.Set;
+
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jbossas.JBossASServerComponent;
+import org.rhq.plugins.jbossas5.ApplicationServerComponent;
+import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+@SuppressWarnings({ "rawtypes", "unchecked" })
+public class ModClusterDiscoveryComponent extends MBeanResourceDiscoveryComponent {
+
+ private final static String JBOSS_SERVER_HOME_DIR = "serverHomeDir";
+
+ @Override
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext context) {
+ Set<DiscoveredResourceDetails> tempSet = super.discoverResources(context);
+
+ for (DiscoveredResourceDetails detail : tempSet) {
+ String serverHomeDirectory = findServerHomeDirectory(context.getParentResourceComponent());
+ detail.getPluginConfiguration().put(new PropertySimple(JBOSS_SERVER_HOME_DIR, serverHomeDirectory));
+ }
+
+ return tempSet;
+ }
+
+ @SuppressWarnings("static-access")
+ public String findServerHomeDirectory(ResourceComponent parentResourceComponent) {
+ if (parentResourceComponent instanceof ApplicationServerComponent) {
+ ApplicationServerComponent parentComponent = (ApplicationServerComponent) parentResourceComponent;
+
+ return parentComponent.getResourceContext().getPluginConfiguration().getSimple("serverHomeDir")
+ .getStringValue();
+
+ } else if (parentResourceComponent instanceof JBossASServerComponent) {
+ JBossASServerComponent parentComponent = (JBossASServerComponent) parentResourceComponent;
+
+ return parentComponent.getPluginConfiguration().getSimple(parentComponent.JBOSS_HOME_DIR_CONFIG_PROP)
+ .getStringValue();
+ }
+
+ return null;
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
new file mode 100644
index 0000000..7d5f0dc
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
@@ -0,0 +1,47 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+@SuppressWarnings({ "rawtypes" })
+public class ModClusterServerComponent extends MBeanResourceComponent {
+
+ @Override
+ public AvailabilityType getAvailability() {
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
+
+ if (rawProxyInfo == null) {
+ return AvailabilityType.DOWN;
+ }
+
+ ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
+ if (proxyInfo.getAvailableNodes().size() == 0) {
+ return AvailabilityType.DOWN;
+ }
+
+ return super.getAvailability();
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
deleted file mode 100644
index 03598e9..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2009 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.plugins.modcluster;
-
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.domain.measurement.AvailabilityType;
-import org.rhq.core.pluginapi.inventory.ResourceContext;
-import org.rhq.plugins.jbossas.JBossASServerComponent;
-import org.rhq.plugins.jbossas5.ApplicationServerComponent;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
-import org.rhq.plugins.modcluster.helper.JBossHelper;
-
-/**
- * @author Stefan Negrea
- *
- */
-@SuppressWarnings({ "rawtypes" })
-public class ModclusterServerComponent extends MBeanResourceComponent {
-
- private final static String JBOSS_SERVER_HOME_DIR = "jboss.server.home.dir";
-
- @SuppressWarnings({ "unchecked", "deprecation", "static-access" })
- @Override
- public void start(ResourceContext context) {
- super.start(context);
-
- String serverHomeDirectory = null;
- if (this.resourceContext.getParentResourceComponent() instanceof ApplicationServerComponent) {
- ApplicationServerComponent parentComponent = (ApplicationServerComponent) this.resourceContext
- .getParentResourceComponent();
-
- serverHomeDirectory = parentComponent.getResourceContext().getPluginConfiguration()
- .getSimple("serverHomeDir").getStringValue();
-
- } else if (this.resourceContext.getParentResourceComponent() instanceof JBossASServerComponent) {
- JBossASServerComponent parentComponent = (JBossASServerComponent) this.resourceContext
- .getParentResourceComponent();
-
- serverHomeDirectory = parentComponent.getPluginConfiguration()
- .getSimple(parentComponent.JBOSS_HOME_DIR_CONFIG_PROP).getStringValue();
- }
-
- if (serverHomeDirectory != null) {
- PropertySimple serverHomeDirectoryProperty = null;
- serverHomeDirectoryProperty = new PropertySimple();
- serverHomeDirectoryProperty.setName(JBOSS_SERVER_HOME_DIR);
- serverHomeDirectoryProperty.setStringValue(serverHomeDirectory);
- this.resourceContext.getPluginConfiguration().put(serverHomeDirectoryProperty);
- }
- };
-
- //private final static String PROXY_INFO_PROPERTY_NAME
-
- /* (non-Javadoc)
- * @see org.rhq.plugins.jmx.MBeanResourceComponent#getAvailability()
- */
- @Override
- public AvailabilityType getAvailability() {
- String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
-
- if (rawProxyInfo == null) {
- return AvailabilityType.DOWN;
- }
-
- ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
- if (proxyInfo.getAvailableNodes().size() == 0) {
- return AvailabilityType.DOWN;
- }
-
- return super.getAvailability();
- }
-}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
index bc54267..c67bf61 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
@@ -1,6 +1,9 @@
package org.rhq.plugins.modcluster;
+import java.util.concurrent.TimeUnit;
+
import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.pluginapi.operation.OperationResult;
/*
@@ -36,4 +39,14 @@ public class PolyPingMBeanResourceComponent extends FileConfiguredMBeanResourceC
return super.invokeOperation(name, parameters);
}
+
+ @Override
+ protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
+ System.out.println(typeName);
+ if (typeName.equals(TimeUnit.class.getName())) {
+ return TimeUnit.valueOf(propSimple.getStringValue());
+ }
+
+ return super.getPropertyValueAsType(propSimple, typeName);
+ }
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java
new file mode 100644
index 0000000..0296eaf
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java
@@ -0,0 +1,42 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import java.util.concurrent.TimeUnit;
+
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+@SuppressWarnings("rawtypes")
+public class TimeUnitParamResourceComponent extends MBeanResourceComponent {
+
+ @Override
+ protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
+ System.out.println(typeName);
+ if (typeName.equals(TimeUnit.class.getName())) {
+ return TimeUnit.valueOf(propSimple.getStringValue());
+ }
+
+ return super.getPropertyValueAsType(propSimple, typeName);
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
index 6c00130..dee2f81 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
@@ -18,11 +18,18 @@
*/
package org.rhq.plugins.modcluster.config;
+import java.io.File;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
@@ -38,11 +45,13 @@ public abstract class AbstractConfigurationFile {
public AbstractConfigurationFile(String fileName) throws ParserConfigurationException, SAXException, IOException {
this.fileName = fileName;
- DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
- DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
- this.document = docBuilder.parse(this.getFileName());
+ loadConfiguratonFile();
}
+ abstract void setPropertyValue(String propertyName, String value);
+
+ abstract String getPropertyValue(String propertyName);
+
/**
* @return the fileName
*/
@@ -57,9 +66,19 @@ public abstract class AbstractConfigurationFile {
return document;
}
- abstract void setPropertyValue(String propertyName, String value);
+ public void saveConfigurationFile() throws Exception {
+ File file = new File(this.getFileName());
+ StreamResult result = new StreamResult(file);
+ Source source = new DOMSource(this.getDocument());
- abstract String getPropertyValue(String propertyName);
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+ transformer.transform(source, result);
+ }
- abstract void saveConfigurationFile() throws Exception;
+ private void loadConfiguratonFile() throws ParserConfigurationException, SAXException, IOException {
+ DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
+ this.document = docBuilder.parse(this.getFileName());
+ }
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
index 1d008ee..354fa99 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
@@ -47,11 +47,4 @@ public class JBossWebServerFile extends AbstractConfigurationFile {
// TODO Auto-generated method stub
return null;
}
-
- @Override
- void saveConfigurationFile() throws Exception {
- // TODO Auto-generated method stub
-
- }
-
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
index 45053f7..6abf955 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -19,17 +19,10 @@
package org.rhq.plugins.modcluster.config;
import java.io.IOException;
-import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Attr;
import org.w3c.dom.Node;
@@ -129,22 +122,6 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
}
/**
- * @throws TransformerException
- */
- public void saveConfigurationFile() throws TransformerException {
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "no");
-
- //initialize StreamResult with File object to save to file
- StreamResult result = new StreamResult(new StringWriter());
- DOMSource source = new DOMSource(this.getDocument());
- transformer.transform(source, result);
-
- String xmlString = result.getWriter().toString();
- System.out.println(xmlString);
- }
-
- /**
* @param className
* @return
*/
@@ -155,7 +132,6 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
Node node = result.item(i);
if (node.getAttributes().getNamedItem("class") != null
&& className.equals(node.getAttributes().getNamedItem("class").getTextContent())) {
- System.out.println(node.getAttributes().getNamedItem("class").getTextContent());
return node;
}
}
@@ -174,7 +150,6 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
Node node = result.item(i);
if (node.getAttributes().getNamedItem("name") != null
&& beanName.equals(node.getAttributes().getNamedItem("name").getTextContent())) {
- System.out.println(node.getAttributes().getNamedItem("name").getTextContent());
return node;
}
}
@@ -243,5 +218,4 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
return listOfNodes;
}
-
}
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 4f3010f..ed82f7c 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -6,7 +6,9 @@
<depends plugin="JMX" />
<service name="mod_cluster"
- discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="mod_cluster plugin" singleton="true">
+ discovery="ModClusterDiscoveryComponent"
+ class="ModClusterServerComponent"
+ supportsManualAdd="true" description="mod_cluster plugin" singleton="true">
<runs-inside>
<parent-resource-type name="JBossAS Server" plugin="JBossAS" />
@@ -17,13 +19,17 @@
<c:simple-property name="objectName" readOnly="true" default="Catalina:type=ModClusterListener,*|jboss.web:service=ModCluster" />
<c:simple-property name="engineObjectName" readOnly="true" default="jboss.web:type=Engine" />
<c:simple-property name="nameTemplate" default="mod_cluster" />
+ <c:simple-property name="serverHomeDir"/>
</plugin-configuration>
<operation name="reset" displayName="Reset the node" description="Move this application server out of an error state." />
<operation name="refresh" displayName="Refresh configuration" description="Refresh configuration for this application server." />
<!-- Start - Configuration for HAModClusterService -->
- <service name="HA Service" discovery="ClassNameMBeanDiscoveryComponent" class="PolyPingMBeanResourceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
+ <service name="HA Service" discovery="ClassNameMBeanDiscoveryComponent"
+ class="PolyPingMBeanResourceComponent"
+ supportsManualAdd="true"
+ description="HA Service Listener" singleton="true">
<plugin-configuration>
<c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
@@ -35,18 +41,18 @@
<!-- HA Operations -->
<operation name="disableDomain" displayName="Disable domain" description="Disables all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
<results>
- <c:simple-property name="result" description="The result of the operation" />
+ <c:simple-property name="operationResult" description="The result of the operation" />
</results>
</operation>
<operation name="enableDomain" displayName="Enable domain" description="Enable all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="stopDomain" displayName="Stop domain" description="Gracefully stops all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
<parameters>
- <c:simple-property required="true" name="timeout" type="string" displayName="The number of units of time for which to wait for all sessions to drain on a given node." />
- <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:simple-property required="true" name="p1" type="string" displayName="The number of units of time for which to wait for all sessions to drain on a given node." />
+ <c:simple-property required="true" name="p2" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
<c:property-options allowCustomValue="false">
<c:option value="MICROSECONDS" name="MICROSECONDS" />
<c:option value="MILLISECONDS" name="MILLISECONDS" />
@@ -58,7 +64,7 @@
</c:simple-property>
</parameters>
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
@@ -66,59 +72,60 @@
<operation name="pingHTTPD" displayName="Ping httpd" description="Ping httpd and determine whether each proxy is accessible and healthy. Returns the PING_RSP grouped by proxy address.">
<results>
- <c:simple-property name="result" description="Map of PING_RPS response, grouped by proxy.">
+ <c:simple-property name="operationResult" description="Map of PING_RPS response, grouped by proxy.">
</c:simple-property>
</results>
</operation>
<operation name="pingNodeByJVMRoute" displayName="Ping node by JVM Route"
description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Dtermines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
<parameters>
- <c:simple-property required="true" name="jvmRoute" type="string" displayName="JVM Route of node to ping." />
+ <c:simple-property required="true" name="p1" type="string" displayName="JVM Route of node to ping." />
</parameters>
<results>
- <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ <c:simple-property name="operationResult" type="string" description="Map of PING_RPS response, grouped by proxy." />
</results>
</operation>
<operation name="pingNodeByAddress" displayName="Ping node by address"
description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Determines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
<parameters>
- <c:simple-property required="true" name="scheme" type="string" displayName="Scheme (ajp, http, https)" />
- <c:simple-property required="true" name="hostname" type="string" displayName="Name or ip address of a node." />
- <c:simple-property required="true" name="port" type="string" displayName="Port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Scheme (ajp, http, https)" />
+ <c:simple-property required="true" name="p2" type="string" displayName="Name or ip address of a node." />
+ <c:simple-property required="true" name="p3" type="integer" displayName="Port" />
</parameters>
<results>
- <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ <c:simple-property name="operationResult" type="string" description="Map of PING_RPS response, grouped by proxy." />
</results>
</operation>
<operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
<parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="p2" type="integer" displayName="Proxy port" />
</parameters>
</operation>
<operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
<parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="p2" type="integer" displayName="Proxy port" />
</parameters>
</operation>
+
<operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" description="The result of the operation">
+ <c:simple-property name="operationResult" description="The result of the operation">
</c:simple-property>
</results>
</operation>
<operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" description="The result of the operation">
+ <c:simple-property name="operationResult" description="The result of the operation">
</c:simple-property>
</results>
</operation>
<operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
<parameters>
- <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout" />
- <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:simple-property required="true" name="p1" type="string" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="p2" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
<c:property-options allowCustomValue="false">
<c:option value="MICROSECONDS" name="MICROSECONDS" />
<c:option value="MILLISECONDS" name="MILLISECONDS" />
@@ -130,7 +137,7 @@
</c:simple-property>
</parameters>
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
@@ -139,7 +146,7 @@
<metric property="ProxyInfo" displayName="Proxy Info" displayType="summary" dataType="trait" />
<resource-configuration>
- <c:simple-property name="processStatusFrequency" type="integer" description="Process status frequency." />
+ <c:simple-property name="processStatusFrequency" type="integer" required="false" description="Process status frequency." />
</resource-configuration>
</service>
@@ -203,56 +210,57 @@
<operation name="pingHTTPD" displayName="Ping httpd" description="Ping httpd and determine whether each proxy is accessible and healthy. Returns the PING_RSP grouped by proxy address.">
<results>
- <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ <c:simple-property name="operationResult" type="string" description="Map of PING_RPS response, grouped by proxy." />
</results>
</operation>
<operation name="pingNodeByJVMRoute" displayName="Ping node by JVM Route"
description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Dtermines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
<parameters>
- <c:simple-property required="true" name="jvmRoute" type="string" displayName="JVM Route of node to ping." />
+ <c:simple-property required="true" name="p1" type="string" displayName="JVM Route of node to ping." />
</parameters>
<results>
- <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ <c:simple-property name="operationResult" type="string" description="Map of PING_RPS response, grouped by proxy." />
</results>
</operation>
<operation name="pingNodeByAddress" displayName="Ping node by address"
description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Determines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
<parameters>
- <c:simple-property required="true" name="scheme" type="string" displayName="Scheme (ajp, http, https)" />
- <c:simple-property required="true" name="hostname" type="string" displayName="Name or ip address of a node." />
- <c:simple-property required="true" name="port" type="string" displayName="Port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Scheme (ajp, http, https)" />
+ <c:simple-property required="true" name="p2" type="string" displayName="Name or ip address of a node." />
+ <c:simple-property required="true" name="p3" type="integer" displayName="Port" />
</parameters>
<results>
- <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ <c:simple-property name="operationResult" type="string" description="Map of PING_RPS response, grouped by proxy." />
</results>
</operation>
<operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
<parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="p2" type="integer" displayName="Proxy port" />
</parameters>
</operation>
<operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
<parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="p2" type="integer" displayName="Proxy port" />
</parameters>
</operation>
+
<operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
<parameters>
- <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout" />
- <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:simple-property required="true" name="p1" type="string" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="p2" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
<c:property-options allowCustomValue="false">
<c:option value="MICROSECONDS" name="MICROSECONDS" />
<c:option value="MILLISECONDS" name="MILLISECONDS" />
@@ -264,7 +272,7 @@
</c:simple-property>
</parameters>
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
@@ -338,12 +346,12 @@
</operation>
<operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
@@ -361,7 +369,7 @@
</c:simple-property>
</parameters>
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
@@ -396,11 +404,9 @@
<c:simple-property name="nameTemplate" default="Dynamic Load Balancer Factor" />
</plugin-configuration>
- <metric property="Metrics" displayName="Collected Metrics" displayType="summary" dataType="trait" />
-
<resource-configuration>
- <c:simple-property name="DecayFactor" type="integer" description="The number of historical load values used to determine load factor." />
- <c:simple-property name="History" type="integer" description="The exponential decay factor for historical load values." />
+ <c:simple-property name="decayFactor" type="integer" required="false" description="The number of historical load values used to determine load factor." />
+ <c:simple-property name="history" type="integer" required="false" description="The exponential decay factor for historical load values." />
</resource-configuration>
</service>
@@ -424,11 +430,13 @@
<c:simple-property name="nameTemplate" default="Load Metric" />
</plugin-configuration>
- <metric property="Load" displayName="Load" category="utilization" description="The current load of this metric as a percent of the metric's capacity." dataType="measurement" />
+ <metric property="Load" displayName="Load" category="utilization"
+ description="The current load of this metric as a percent of the metric's capacity." dataType="measurement"
+ defaultOn="true" displayType="summary"/>
<resource-configuration>
- <c:simple-property name="Weight" type="integer" description="The significance of this load metric compared to the other metrics." />
- <c:simple-property name="Capacity" type="double" description="Used to normalize the value returned by load expressed as a percentage of the capacity, such that: 0 < (load/capacity) < 1" />
+ <c:simple-property name="weight" type="integer" description="The significance of this load metric compared to the other metrics." />
+ <c:simple-property name="capacity" type="double" description="Used to normalize the value returned by load expressed as a percentage of the capacity, such that: 0 < (load/capacity) < 1" />
</resource-configuration>
</service>
@@ -436,7 +444,7 @@
<operation name="disableContext" displayName="Disable webapp" description="Disable this webapp.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation." />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation." />
</results>
</operation>
<operation name="stopContext" displayName="Stop webapp" description="Gracefully stops this webapp.">
@@ -454,12 +462,12 @@
</c:simple-property>
</parameters>
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="enableContext" displayName="Enable webapp" description="Enable this webapp.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
index c50b0e6..cba5672 100644
--- a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
@@ -28,16 +28,19 @@ public class ServerConfigTest {
public void TestConfig() {
try {
+ //Test simple bean configuration
ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
"/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
- System.out.println(config.getPropertyValue("test"));
+ config.setPropertyValue("test", null);
+ config.setPropertyValue("processStatusFrequency", null);
config.saveConfigurationFile();
+ //Test bean configuration with constructor dependency
config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
"org.jboss.modcluster.config.ha.HAModClusterConfig",
"/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
@@ -45,11 +48,8 @@ public class ServerConfigTest {
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
- System.out.println(config.getPropertyValue("test"));
-
- config.saveConfigurationFile();
-
config.setPropertyValue("test", null);
+ config.setPropertyValue("processStatusFrequency", null);
config.saveConfigurationFile();
} catch (Exception e) {
// TODO Auto-generated catch block
commit 7b57da38ba1b16241e06480cf0b95a22c3508999
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Mon Aug 15 14:59:16 2011 -0500
The JBoss server home directory is now correctly retrieved from the parent resource component. Included some other minor code tweaks and refactorings.
diff --git a/modules/integration-tests/mod_cluster-plugin-test/pom.xml b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
index 77a81b2..ba94746 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/pom.xml
+++ b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
@@ -42,7 +42,13 @@
</dependencyManagement>
<dependencies>
-
+ <dependency>
+ <groupId>org.jboss.on</groupId>
+ <artifactId>jopr-jboss-as-5-plugin</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
<dependency>
<groupId>org.jboss.integration</groupId>
<artifactId>jboss-profileservice-spi</artifactId>
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
index 0a39eab..b642573 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
+++ b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
@@ -45,6 +45,7 @@ import org.rhq.core.pc.PluginContainerConfiguration;
import org.rhq.core.pc.plugin.FileSystemPluginFinder;
import org.rhq.core.pc.plugin.PluginEnvironment;
import org.rhq.core.pc.plugin.PluginManager;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
import org.rhq.core.pluginapi.inventory.ResourceComponent;
import org.rhq.core.pluginapi.measurement.MeasurementFacet;
import org.rhq.core.pluginapi.operation.OperationFacet;
@@ -109,7 +110,8 @@ public class ModclusterPluginTest {
{
add(PLUGIN_NAME);
- add(PLUGIN_NAME + " Webapp Context");
+ add("Webapp Context");
+ add("HA Service Configuration");
}
};
@@ -124,8 +126,12 @@ public class ModclusterPluginTest {
Resource resource = (Resource) objectResource;
if (resource.getResourceType().getName().equals("mod_cluster")) {
testResourceMeasurement(resource);
- } else {
+ } else if (resource.getResourceType().getName().equals("Webapp Context")) {
testContextOperations(resource);
+ } else if (resource.getResourceType().getName().equals("HA Service Configuration")) {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+ ((ConfigurationFacet) resourceComponent).loadResourceConfiguration();
}
}
}
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index fdc4f37..35c5b28 100644
--- a/modules/plugins/mod-cluster/pom.xml
+++ b/modules/plugins/mod-cluster/pom.xml
@@ -23,6 +23,14 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.on</groupId>
+ <artifactId>jopr-jboss-as-5-plugin</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
<dependency>
<groupId>log4j</groupId>
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
index 8e14f9b..c5343d0 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
@@ -20,6 +20,8 @@ package org.rhq.plugins.modcluster;
import java.util.concurrent.TimeUnit;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.mc4j.ems.connection.bean.EmsBean;
import org.rhq.core.domain.configuration.Configuration;
@@ -35,6 +37,9 @@ import org.rhq.plugins.modcluster.helper.JBossHelper;
*/
@SuppressWarnings({ "rawtypes", "deprecation" })
public class ContextComponent extends MBeanResourceComponent<MBeanResourceComponent> {
+
+ private static final Log log = LogFactory.getLog(ContextComponent.class);
+
@Override
protected EmsBean loadBean() {
return getResourceContext().getParentResourceComponent().getEmsBean();
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
index 9b511b3..ee0369c 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
@@ -19,6 +19,9 @@
package org.rhq.plugins.modcluster;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
import org.rhq.core.domain.configuration.PropertySimple;
@@ -34,11 +37,15 @@ import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
* @author Stefan Negrea
*
*/
-@SuppressWarnings("rawtypes")
+@SuppressWarnings({ "rawtypes", "deprecation" })
public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent {
+ private static final Log log = LogFactory.getLog(FileConfiguredMBeanResourceComponent.class);
+
private static final String BEAN_CLASS_NAME_PROPERTY = "className";
private static final String DEPENDENCY_BEAN_CLASS_NAME_PROPERTY = "dependencyClassName";
+ private static final String SERVER_HOME_DIR = "jboss.server.home.dir";
+ private static final String CONFIGURATION_FILE_RELATIVE_PATH = "/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml";
/**
* This default setup of configuration properties can map to mbean attributes
@@ -46,15 +53,14 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
* @return the configuration of the component
*/
@Override
- @SuppressWarnings("deprecation")
public Configuration loadResourceConfiguration() {
+
Configuration configuration = new Configuration();
ConfigurationDefinition configurationDefinition = this.resourceContext.getResourceType()
.getResourceConfigurationDefinition();
try {
- ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance(this.resourceContext
- .getPluginConfiguration());
+ ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance();
for (PropertyDefinition property : configurationDefinition.getPropertyDefinitions().values()) {
if (property instanceof PropertyDefinitionSimple) {
@@ -69,8 +75,7 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
}
}
} catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ log.debug("Unable to load mod_cluster configuration file.", e);
}
return configuration;
@@ -84,19 +89,35 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
updateResourceConfiguration(report, false);
}
- private ModClusterBeanFile getModClusterBeanFileInstance(Configuration pluginConfig) throws Exception {
+ private ModClusterBeanFile getModClusterBeanFileInstance() throws Exception {
+ Configuration pluginConfig = this.resourceContext.getPluginConfiguration();
String beanClassName = pluginConfig.getSimple(BEAN_CLASS_NAME_PROPERTY).getStringValue();
+ String fileName = this.getServerHomeDirectory() + CONFIGURATION_FILE_RELATIVE_PATH;
+
if (pluginConfig.getSimple(DEPENDENCY_BEAN_CLASS_NAME_PROPERTY) != null) {
String dependencyBeanClassName = pluginConfig.getSimple(DEPENDENCY_BEAN_CLASS_NAME_PROPERTY)
.getStringValue();
- return new ModClusterBeanFile(dependencyBeanClassName);
+ return new ModClusterBeanFile(beanClassName, dependencyBeanClassName, fileName);
+ }
+
+ return new ModClusterBeanFile(beanClassName, fileName);
+ }
+
+ private String getServerHomeDirectory() {
+ ModclusterServerComponent modClusterComponent = (ModclusterServerComponent) this.resourceContext
+ .getParentResourceComponent();
+
+ PropertySimple property = modClusterComponent.getResourceContext().getPluginConfiguration()
+ .getSimple(SERVER_HOME_DIR);
+
+ if (property != null) {
+ return property.getStringValue();
}
- return new ModClusterBeanFile(beanClassName);
+ return null;
}
- @SuppressWarnings("deprecation")
@Override
public void updateResourceConfiguration(ConfigurationUpdateReport report, boolean ignoreReadOnly) {
ConfigurationDefinition configurationDefinition = this.getResourceContext().getResourceType()
@@ -106,8 +127,7 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
report.setStatus(ConfigurationUpdateStatus.SUCCESS);
try {
- ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance(this.resourceContext
- .getPluginConfiguration());
+ ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance();
for (String key : report.getConfiguration().getSimpleProperties().keySet()) {
PropertySimple property = report.getConfiguration().getSimple(key);
@@ -127,10 +147,9 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
}
}
- modClusterBeanFile.saveConfigFile();
+ modClusterBeanFile.saveConfigurationFile();
} catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ log.debug("Unable to save mod_cluster configuration file.", e);
}
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
index fb944c8..496068c 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
@@ -30,7 +30,7 @@ import org.rhq.plugins.jmx.JMXComponent;
import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
/**
- * @author snegrea
+ * @author Stefan Negrea
*
*/
@SuppressWarnings("rawtypes")
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
index 2c964c0..03598e9 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
@@ -18,7 +18,11 @@
*/
package org.rhq.plugins.modcluster;
+import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.plugins.jbossas.JBossASServerComponent;
+import org.rhq.plugins.jbossas5.ApplicationServerComponent;
import org.rhq.plugins.jmx.MBeanResourceComponent;
import org.rhq.plugins.modcluster.helper.JBossHelper;
@@ -29,6 +33,38 @@ import org.rhq.plugins.modcluster.helper.JBossHelper;
@SuppressWarnings({ "rawtypes" })
public class ModclusterServerComponent extends MBeanResourceComponent {
+ private final static String JBOSS_SERVER_HOME_DIR = "jboss.server.home.dir";
+
+ @SuppressWarnings({ "unchecked", "deprecation", "static-access" })
+ @Override
+ public void start(ResourceContext context) {
+ super.start(context);
+
+ String serverHomeDirectory = null;
+ if (this.resourceContext.getParentResourceComponent() instanceof ApplicationServerComponent) {
+ ApplicationServerComponent parentComponent = (ApplicationServerComponent) this.resourceContext
+ .getParentResourceComponent();
+
+ serverHomeDirectory = parentComponent.getResourceContext().getPluginConfiguration()
+ .getSimple("serverHomeDir").getStringValue();
+
+ } else if (this.resourceContext.getParentResourceComponent() instanceof JBossASServerComponent) {
+ JBossASServerComponent parentComponent = (JBossASServerComponent) this.resourceContext
+ .getParentResourceComponent();
+
+ serverHomeDirectory = parentComponent.getPluginConfiguration()
+ .getSimple(parentComponent.JBOSS_HOME_DIR_CONFIG_PROP).getStringValue();
+ }
+
+ if (serverHomeDirectory != null) {
+ PropertySimple serverHomeDirectoryProperty = null;
+ serverHomeDirectoryProperty = new PropertySimple();
+ serverHomeDirectoryProperty.setName(JBOSS_SERVER_HOME_DIR);
+ serverHomeDirectoryProperty.setStringValue(serverHomeDirectory);
+ this.resourceContext.getPluginConfiguration().put(serverHomeDirectoryProperty);
+ }
+ };
+
//private final static String PROXY_INFO_PROPERTY_NAME
/* (non-Javadoc)
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
index 8f5d08b..bc54267 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
@@ -22,6 +22,10 @@ import org.rhq.core.pluginapi.operation.OperationResult;
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+/**
+ *
+ * @author Stefan Negrea
+ */
public class PolyPingMBeanResourceComponent extends FileConfiguredMBeanResourceComponent {
@Override
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
index 4fe5788..6c00130 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
@@ -32,9 +32,6 @@ import org.xml.sax.SAXException;
* @author Stefan Negrea
*/
public abstract class AbstractConfigurationFile {
-
- public static final String SERVER_HOME_DIR = "jboss.server.home.dir";
-
private String fileName;
private Document document;
@@ -60,4 +57,9 @@ public abstract class AbstractConfigurationFile {
return document;
}
+ abstract void setPropertyValue(String propertyName, String value);
+
+ abstract String getPropertyValue(String propertyName);
+
+ abstract void saveConfigurationFile() throws Exception;
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
index 602e52b..1d008ee 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
@@ -36,4 +36,22 @@ public class JBossWebServerFile extends AbstractConfigurationFile {
// TODO Auto-generated constructor stub
}
+ @Override
+ void setPropertyValue(String propertyName, String value) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ String getPropertyValue(String propertyName) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ void saveConfigurationFile() throws Exception {
+ // TODO Auto-generated method stub
+
+ }
+
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
index 0e25f26..45053f7 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -16,7 +16,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-
package org.rhq.plugins.modcluster.config;
import java.io.IOException;
@@ -38,24 +37,38 @@ import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
/**
- * @author snegrea
+ * @author Stefan Negrea
*
*/
public class ModClusterBeanFile extends AbstractConfigurationFile {
private Node beanNode;
- public ModClusterBeanFile(String className) throws ParserConfigurationException, SAXException, IOException {
- super(
- "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+ /**
+ * @param className
+ * @param configurationFile
+ * @throws ParserConfigurationException
+ * @throws SAXException
+ * @throws IOException
+ */
+ public ModClusterBeanFile(String className, String configurationFile) throws ParserConfigurationException,
+ SAXException, IOException {
+ super(configurationFile);
beanNode = this.getBeanNodeByClass(className);
}
- public ModClusterBeanFile(String className, String constructorArgumentClassName)
+ /**
+ * @param className
+ * @param constructorArgumentClassName
+ * @param configurationFile
+ * @throws ParserConfigurationException
+ * @throws SAXException
+ * @throws IOException
+ */
+ public ModClusterBeanFile(String className, String constructorArgumentClassName, String configurationFile)
throws ParserConfigurationException, SAXException, IOException {
- super(
- "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+ super(configurationFile);
Node primaryBeanNode = this.getBeanNodeByClass(className);
String dependencyName = this.getBeanFromConstructorArgument(primaryBeanNode, constructorArgumentClassName);
@@ -63,58 +76,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
beanNode = this.getBeanNodeByName(dependencyName);
}
- private String getBeanFromConstructorArgument(Node beanNode, String constructorArgumentClassName) {
- List<Node> tempNodeList = this.getChildNodesByName(beanNode, "constructor");
-
- if (tempNodeList.size() > 0) {
- Node constructorNode = tempNodeList.get(0);
-
- tempNodeList = this.getChildNodesByName(constructorNode, "parameter");
-
- if (tempNodeList.size() > 0) {
- Node parameterNode = null;
-
- for (Node currentNode : tempNodeList) {
- if (currentNode.getAttributes().getNamedItem("class") != null
- && constructorArgumentClassName.equals(currentNode.getAttributes().getNamedItem("class")
- .getTextContent())) {
- parameterNode = currentNode;
- break;
- }
- }
-
- if (parameterNode != null) {
- tempNodeList = this.getChildNodesByName(parameterNode, "inject");
-
- if (tempNodeList.size() > 0) {
- Node injectNode = tempNodeList.get(0);
- Node beanAttribute = injectNode.getAttributes().getNamedItem("bean");
-
- if (beanAttribute != null) {
- return beanAttribute.getTextContent();
- }
- }
- }
- }
- }
-
- return null;
- }
-
- private List<Node> getChildNodesByName(Node node, String nodeName) {
- List<Node> listOfNodes = new ArrayList<Node>();
-
- for (int i = 0; i < node.getChildNodes().getLength(); i++) {
- Node currentNode = node.getChildNodes().item(i);
-
- if (nodeName.equals(currentNode.getNodeName())) {
- listOfNodes.add(currentNode);
- }
- }
-
- return listOfNodes;
- }
-
+ /**
+ * @param propertyName
+ * @param value
+ */
public void setPropertyValue(String propertyName, String value) {
boolean propertyFound = false;
for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
@@ -144,6 +109,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
}
}
+ /**
+ * @param propertyName
+ * @return
+ */
public String getPropertyValue(String propertyName) {
for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
Node currentNode = beanNode.getChildNodes().item(i);
@@ -159,7 +128,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
return null;
}
- public void saveConfigFile() throws TransformerException {
+ /**
+ * @throws TransformerException
+ */
+ public void saveConfigurationFile() throws TransformerException {
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "no");
@@ -172,7 +144,11 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
System.out.println(xmlString);
}
- public Node getBeanNodeByClass(String className) {
+ /**
+ * @param className
+ * @return
+ */
+ private Node getBeanNodeByClass(String className) {
NodeList result = this.getDocument().getElementsByTagName("bean");
for (int i = 1; i < result.getLength(); i++) {
@@ -187,7 +163,11 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
return null;
}
- public Node getBeanNodeByName(String beanName) {
+ /**
+ * @param beanName
+ * @return
+ */
+ private Node getBeanNodeByName(String beanName) {
NodeList result = this.getDocument().getElementsByTagName("bean");
for (int i = 1; i < result.getLength(); i++) {
@@ -202,4 +182,66 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
return null;
}
+ /**
+ * @param beanNode
+ * @param constructorArgumentClassName
+ * @return
+ */
+ private String getBeanFromConstructorArgument(Node beanNode, String constructorArgumentClassName) {
+ List<Node> tempNodeList = this.getChildNodesByName(beanNode, "constructor");
+
+ if (tempNodeList.size() > 0) {
+ Node constructorNode = tempNodeList.get(0);
+
+ tempNodeList = this.getChildNodesByName(constructorNode, "parameter");
+
+ if (tempNodeList.size() > 0) {
+ Node parameterNode = null;
+
+ for (Node currentNode : tempNodeList) {
+ if (currentNode.getAttributes().getNamedItem("class") != null
+ && constructorArgumentClassName.equals(currentNode.getAttributes().getNamedItem("class")
+ .getTextContent())) {
+ parameterNode = currentNode;
+ break;
+ }
+ }
+
+ if (parameterNode != null) {
+ tempNodeList = this.getChildNodesByName(parameterNode, "inject");
+
+ if (tempNodeList.size() > 0) {
+ Node injectNode = tempNodeList.get(0);
+ Node beanAttribute = injectNode.getAttributes().getNamedItem("bean");
+
+ if (beanAttribute != null) {
+ return beanAttribute.getTextContent();
+ }
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @param node
+ * @param nodeName
+ * @return
+ */
+ private List<Node> getChildNodesByName(Node node, String nodeName) {
+ List<Node> listOfNodes = new ArrayList<Node>();
+
+ for (int i = 0; i < node.getChildNodes().getLength(); i++) {
+ Node currentNode = node.getChildNodes().item(i);
+
+ if (nodeName.equals(currentNode.getNodeName())) {
+ listOfNodes.add(currentNode);
+ }
+ }
+
+ return listOfNodes;
+ }
+
}
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index fe4ac7d..4f3010f 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -5,7 +5,8 @@
<depends plugin="JMX" />
- <service name="mod_cluster" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="mod_cluster plugin" singleton="true">
+ <service name="mod_cluster"
+ discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="mod_cluster plugin" singleton="true">
<runs-inside>
<parent-resource-type name="JBossAS Server" plugin="JBossAS" />
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
index 4e4aac1..c50b0e6 100644
--- a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
@@ -28,27 +28,29 @@ public class ServerConfigTest {
public void TestConfig() {
try {
- ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService");
+ ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
+ "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
System.out.println(config.getPropertyValue("test"));
- config.saveConfigFile();
+ config.saveConfigurationFile();
config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
- "org.jboss.modcluster.config.ha.HAModClusterConfig");
+ "org.jboss.modcluster.config.ha.HAModClusterConfig",
+ "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
System.out.println(config.getPropertyValue("test"));
- config.saveConfigFile();
+ config.saveConfigurationFile();
config.setPropertyValue("test", null);
- config.saveConfigFile();
+ config.saveConfigurationFile();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
commit c166ad34f0490dea2ea9c95ff6c1d2c1c8d9e0fc
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Sun Aug 14 12:06:26 2011 -0500
Enable mod_cluster support for JBoss 5&6 with simple and HA configuration listeners. Also, added metric collections and configuration save to bean file.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
new file mode 100644
index 0000000..b9ce25e
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
@@ -0,0 +1,95 @@
+/*
+ * 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.plugins.modcluster;
+
+import java.util.Set;
+
+import org.mc4j.ems.connection.EmsConnection;
+import org.mc4j.ems.connection.bean.EmsBean;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jmx.JMXComponent;
+import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
+
+/**
+ * Discovers mod_cluster contexts from the proxyInfo mbean property.
+ *
+ * @author Stefan Negrea
+ */
+@SuppressWarnings("rawtypes")
+public class ClassNameMBeanDiscoveryComponent<T extends JMXComponent> extends MBeanResourceDiscoveryComponent<T> {
+
+ private static final String CLASS_NAME = "className";
+
+ /* (non-Javadoc)
+ * @see org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext, boolean)
+ */
+ @Override
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<T> context,
+ boolean skipUnknownProps) {
+
+ Set<DiscoveredResourceDetails> results = super.discoverResources(context, skipUnknownProps);
+
+ for (DiscoveredResourceDetails discoveredResource : results) {
+ if (!isBeanConfiguredClassName(context, discoveredResource.getResourceKey())) {
+ results.remove(discoveredResource);
+ }
+ }
+
+ return results;
+ }
+
+ /**
+ * @param context
+ * @param objectName
+ * @return
+ */
+ public boolean isBeanConfiguredClassName(ResourceDiscoveryContext<T> context, String objectName) {
+ String className = context.getDefaultPluginConfiguration().getSimple(CLASS_NAME).getStringValue();
+
+ EmsConnection connection = context.getParentResourceComponent().getEmsConnection();
+ EmsBean emsBean = loadBean(connection, objectName);
+
+ return className.equals(emsBean.getClassTypeName());
+ }
+
+ /**
+ * Loads the bean with the given object name.
+ *
+ * Subclasses are free to override this method in order to load the bean.
+ *
+ * @param objectName the name of the bean to load
+ * @return the bean that is loaded
+ */
+ protected EmsBean loadBean(EmsConnection emsConnection, String objectName) {
+ EmsBean bean = emsConnection.getBean(objectName);
+ if (bean == null) {
+ // In some cases, this resource component may have been discovered by some means other than querying its
+ // parent's EMSConnection (e.g. ApplicationDiscoveryComponent uses a filesystem to discover EARs and
+ // WARs that are not yet deployed). In such cases, getBean() will return null, since EMS won't have the
+ // bean in its cache. To cover such cases, make an attempt to query the underlying MBeanServer for the
+ // bean before giving up.
+ emsConnection.queryBeans(objectName);
+ bean = emsConnection.getBean(objectName);
+ }
+ return bean;
+ }
+
+}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
index 3545fa5..8e14f9b 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
@@ -26,6 +26,7 @@ import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.pluginapi.operation.OperationResult;
import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
/**
* Manages a mod_cluster context entity.
@@ -44,7 +45,7 @@ public class ContextComponent extends MBeanResourceComponent<MBeanResourceCompon
ClassLoader cl = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
- String rawProxyInfo = (String) getEmsBean().getAttribute("proxyInfo").refresh().toString();
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
@@ -91,12 +92,16 @@ public class ContextComponent extends MBeanResourceComponent<MBeanResourceCompon
Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
Object resultObject = getEmsBean().getOperation(name).invoke(configuration);
- return new OperationResult(String.valueOf(resultObject));
+ if (resultObject instanceof OperationResult) {
+ return (OperationResult) resultObject;
+ } else {
+ return new OperationResult(String.valueOf(resultObject));
+ }
} finally {
Thread.currentThread().setContextClassLoader(cl);
}
}
- throw new Exception("Operation " + name + " not available mod_cluster_context service");
+ throw new Exception("Operation " + name + " not available mod_cluster WebApp service.");
}
}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java
index 3d03715..788cbce 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java
@@ -1,24 +1,20 @@
/*
- * Jopr Management Platform
+ * 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package org.rhq.plugins.modcluster;
@@ -33,6 +29,7 @@ import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
/**
* Discovers mod_cluster contexts from the proxyInfo mbean property.
@@ -43,7 +40,6 @@ import org.rhq.plugins.jmx.MBeanResourceComponent;
public class ContextDiscoveryComponent implements ResourceDiscoveryComponent<MBeanResourceComponent> {
private static final String JVM_ROUTE_PROPERTY = "jvmRoute";
- private static final String PROXY_INFO_PROPERTY = "proxyInfo";
private static final String ENGINE_OBJECT_NAME = "engineObjectName";
/* (non-Javadoc)
@@ -51,7 +47,9 @@ public class ContextDiscoveryComponent implements ResourceDiscoveryComponent<MBe
*/
public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<MBeanResourceComponent> context) {
String jvmRoute = this.getJvmRoute(context);
- String rawProxyInfo = this.getRawProxyInfo(context);
+
+ EmsBean configBean = context.getParentResourceComponent().getEmsBean();
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(configBean);
ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
Set<DiscoveredResourceDetails> entities = new HashSet<DiscoveredResourceDetails>();
@@ -59,8 +57,7 @@ public class ContextDiscoveryComponent implements ResourceDiscoveryComponent<MBe
for (ProxyInfo.Context availableContext : proxyInfo.getAvailableContexts()) {
if (availableContext.getJvmRoute().equals(jvmRoute)) {
DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(),
- availableContext.createKey(), availableContext.createName(), null, "mod_cluster Webapp Context",
- null, null);
+ availableContext.createKey(), availableContext.createName(), null, "Webapp Context", null, null);
entities.add(detail);
}
}
@@ -83,17 +80,6 @@ public class ContextDiscoveryComponent implements ResourceDiscoveryComponent<MBe
}
/**
- * Retrieves raw proxy configuration from the parent context.
- *
- * @param context the discovery context
- * @return raw proxy configuration
- */
- private String getRawProxyInfo(ResourceDiscoveryContext<MBeanResourceComponent> context) {
- EmsBean statsBean = context.getParentResourceComponent().getEmsBean();
- return (String) statsBean.getAttribute(PROXY_INFO_PROPERTY).refresh().toString();
- }
-
- /**
* Loads the bean with the given object name.
*
* Subclasses are free to override this method in order to load the bean.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
new file mode 100644
index 0000000..9b511b3
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
@@ -0,0 +1,137 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+import org.rhq.core.util.exception.ThrowableUtil;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+@SuppressWarnings("rawtypes")
+public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent {
+
+ private static final String BEAN_CLASS_NAME_PROPERTY = "className";
+ private static final String DEPENDENCY_BEAN_CLASS_NAME_PROPERTY = "dependencyClassName";
+
+ /**
+ * This default setup of configuration properties can map to mbean attributes
+ *
+ * @return the configuration of the component
+ */
+ @Override
+ @SuppressWarnings("deprecation")
+ public Configuration loadResourceConfiguration() {
+ Configuration configuration = new Configuration();
+ ConfigurationDefinition configurationDefinition = this.resourceContext.getResourceType()
+ .getResourceConfigurationDefinition();
+
+ try {
+ ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance(this.resourceContext
+ .getPluginConfiguration());
+
+ for (PropertyDefinition property : configurationDefinition.getPropertyDefinitions().values()) {
+ if (property instanceof PropertyDefinitionSimple) {
+ String value = modClusterBeanFile.getPropertyValue(property.getName());
+ if (value != null) {
+ configuration.put(new PropertySimple(property.getName(), value));
+ } else {
+ PropertyDefinitionSimple propertyDefinitionSimple = (PropertyDefinitionSimple) property;
+ configuration.put(new PropertySimple(property.getName(), propertyDefinitionSimple
+ .getDefaultValue()));
+ }
+ }
+ }
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ return configuration;
+ }
+
+ /**
+ * Equivalent to updateResourceConfiguration(report, false);
+ */
+ @Override
+ public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ updateResourceConfiguration(report, false);
+ }
+
+ private ModClusterBeanFile getModClusterBeanFileInstance(Configuration pluginConfig) throws Exception {
+ String beanClassName = pluginConfig.getSimple(BEAN_CLASS_NAME_PROPERTY).getStringValue();
+
+ if (pluginConfig.getSimple(DEPENDENCY_BEAN_CLASS_NAME_PROPERTY) != null) {
+ String dependencyBeanClassName = pluginConfig.getSimple(DEPENDENCY_BEAN_CLASS_NAME_PROPERTY)
+ .getStringValue();
+ return new ModClusterBeanFile(dependencyBeanClassName);
+ }
+
+ return new ModClusterBeanFile(beanClassName);
+ }
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public void updateResourceConfiguration(ConfigurationUpdateReport report, boolean ignoreReadOnly) {
+ ConfigurationDefinition configurationDefinition = this.getResourceContext().getResourceType()
+ .getResourceConfigurationDefinition();
+
+ // assume we succeed - we'll set to failure if we can't set all properties
+ report.setStatus(ConfigurationUpdateStatus.SUCCESS);
+
+ try {
+ ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance(this.resourceContext
+ .getPluginConfiguration());
+
+ for (String key : report.getConfiguration().getSimpleProperties().keySet()) {
+ PropertySimple property = report.getConfiguration().getSimple(key);
+ if (property != null) {
+ try {
+ PropertyDefinitionSimple def = configurationDefinition.getPropertyDefinitionSimple(property
+ .getName());
+ if (!(ignoreReadOnly && def.isReadOnly())) {
+ modClusterBeanFile.setPropertyValue(property.getName(), property.getStringValue());
+ }
+ } catch (Exception e) {
+ property.setErrorMessage(ThrowableUtil.getStackAsString(e));
+ report
+ .setErrorMessage("Failed setting resource configuration - see property error messages for details");
+ log.info("Failure setting MBean Resource configuration value for " + key, e);
+ }
+ }
+ }
+
+ modClusterBeanFile.saveConfigFile();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
new file mode 100644
index 0000000..fb944c8
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
@@ -0,0 +1,95 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import java.util.Set;
+
+import org.mc4j.ems.connection.EmsConnection;
+import org.mc4j.ems.connection.bean.EmsBean;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jmx.JMXComponent;
+import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
+
+/**
+ * @author snegrea
+ *
+ */
+@SuppressWarnings("rawtypes")
+public class LoadMetricDiscoveryComponent extends MBeanResourceDiscoveryComponent<JMXComponent> {
+
+ /* (non-Javadoc)
+ * @see org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext, boolean)
+ */
+ @Override
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<JMXComponent> context,
+ boolean skipUnknownProps) {
+
+ Set<DiscoveredResourceDetails> results = super.discoverResources(context, skipUnknownProps);
+
+ for (DiscoveredResourceDetails discoveredResource : results) {
+
+ String name = getBeanConfiguredClassName(context, discoveredResource.getResourceKey());
+
+ name = name.substring(name.lastIndexOf(".") + 1);
+ name = name.substring(0, name.lastIndexOf("LoadMetric"));
+
+ discoveredResource.setResourceName(name);
+ discoveredResource.setResourceDescription("Load Metric");
+ }
+
+ return results;
+ }
+
+ /**
+ * @param context
+ * @param objectName
+ * @return
+ */
+ public String getBeanConfiguredClassName(ResourceDiscoveryContext<JMXComponent> context, String objectName) {
+ EmsConnection connection = context.getParentResourceComponent().getEmsConnection();
+ EmsBean emsBean = loadBean(connection, objectName);
+
+ return emsBean.getClassTypeName();
+ }
+
+ /**
+ * Loads the bean with the given object name.
+ *
+ * Subclasses are free to override this method in order to load the bean.
+ *
+ * @param objectName the name of the bean to load
+ * @return the bean that is loaded
+ */
+ protected EmsBean loadBean(EmsConnection emsConnection, String objectName) {
+ EmsBean bean = emsConnection.getBean(objectName);
+ if (bean == null) {
+ // In some cases, this resource component may have been discovered by some means other than querying its
+ // parent's EMSConnection (e.g. ApplicationDiscoveryComponent uses a filesystem to discover EARs and
+ // WARs that are not yet deployed). In such cases, getBean() will return null, since EMS won't have the
+ // bean in its cache. To cover such cases, make an attempt to query the underlying MBeanServer for the
+ // bean before giving up.
+ emsConnection.queryBeans(objectName);
+ bean = emsConnection.getBean(objectName);
+ }
+ return bean;
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
index 70898ef..2c964c0 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
@@ -20,6 +20,7 @@ package org.rhq.plugins.modcluster;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
/**
* @author Stefan Negrea
@@ -28,15 +29,21 @@ import org.rhq.plugins.jmx.MBeanResourceComponent;
@SuppressWarnings({ "rawtypes" })
public class ModclusterServerComponent extends MBeanResourceComponent {
+ //private final static String PROXY_INFO_PROPERTY_NAME
+
/* (non-Javadoc)
* @see org.rhq.plugins.jmx.MBeanResourceComponent#getAvailability()
*/
@Override
public AvailabilityType getAvailability() {
- String rawProxyInfo = (String) getEmsBean().getAttribute("proxyInfo").refresh().toString();
- ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
+
+ if (rawProxyInfo == null) {
+ return AvailabilityType.DOWN;
+ }
- if (proxyInfo.getAvailableContexts().size() == 0) {
+ ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
+ if (proxyInfo.getAvailableNodes().size() == 0) {
return AvailabilityType.DOWN;
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
new file mode 100644
index 0000000..8f5d08b
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
@@ -0,0 +1,35 @@
+package org.rhq.plugins.modcluster;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.pluginapi.operation.OperationResult;
+
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.
+ */
+
+public class PolyPingMBeanResourceComponent extends FileConfiguredMBeanResourceComponent {
+
+ @Override
+ public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
+ if (name.toLowerCase().startsWith("ping")) {
+ name = "ping";
+ }
+
+ return super.invokeOperation(name, parameters);
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
new file mode 100644
index 0000000..4fe5788
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
@@ -0,0 +1,63 @@
+/*
+ * 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.plugins.modcluster.config;
+
+import java.io.IOException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/**
+ *
+ * @author Stefan Negrea
+ */
+public abstract class AbstractConfigurationFile {
+
+ public static final String SERVER_HOME_DIR = "jboss.server.home.dir";
+
+ private String fileName;
+ private Document document;
+
+ public AbstractConfigurationFile(String fileName) throws ParserConfigurationException, SAXException, IOException {
+ this.fileName = fileName;
+
+ DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
+ this.document = docBuilder.parse(this.getFileName());
+ }
+
+ /**
+ * @return the fileName
+ */
+ public String getFileName() {
+ return fileName;
+ }
+
+ /**
+ * @return the doc
+ */
+ public Document getDocument() {
+ return document;
+ }
+
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
new file mode 100644
index 0000000..602e52b
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
@@ -0,0 +1,39 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster.config;
+
+import java.io.IOException;
+
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.SAXException;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+public class JBossWebServerFile extends AbstractConfigurationFile {
+
+ public JBossWebServerFile(String fileName) throws ParserConfigurationException, SAXException, IOException {
+ super(fileName);
+ // TODO Auto-generated constructor stub
+ }
+
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
new file mode 100644
index 0000000..0e25f26
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -0,0 +1,205 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster.config;
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+/**
+ * @author snegrea
+ *
+ */
+public class ModClusterBeanFile extends AbstractConfigurationFile {
+
+ private Node beanNode;
+
+ public ModClusterBeanFile(String className) throws ParserConfigurationException, SAXException, IOException {
+ super(
+ "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+
+ beanNode = this.getBeanNodeByClass(className);
+ }
+
+ public ModClusterBeanFile(String className, String constructorArgumentClassName)
+ throws ParserConfigurationException, SAXException, IOException {
+ super(
+ "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+
+ Node primaryBeanNode = this.getBeanNodeByClass(className);
+ String dependencyName = this.getBeanFromConstructorArgument(primaryBeanNode, constructorArgumentClassName);
+
+ beanNode = this.getBeanNodeByName(dependencyName);
+ }
+
+ private String getBeanFromConstructorArgument(Node beanNode, String constructorArgumentClassName) {
+ List<Node> tempNodeList = this.getChildNodesByName(beanNode, "constructor");
+
+ if (tempNodeList.size() > 0) {
+ Node constructorNode = tempNodeList.get(0);
+
+ tempNodeList = this.getChildNodesByName(constructorNode, "parameter");
+
+ if (tempNodeList.size() > 0) {
+ Node parameterNode = null;
+
+ for (Node currentNode : tempNodeList) {
+ if (currentNode.getAttributes().getNamedItem("class") != null
+ && constructorArgumentClassName.equals(currentNode.getAttributes().getNamedItem("class")
+ .getTextContent())) {
+ parameterNode = currentNode;
+ break;
+ }
+ }
+
+ if (parameterNode != null) {
+ tempNodeList = this.getChildNodesByName(parameterNode, "inject");
+
+ if (tempNodeList.size() > 0) {
+ Node injectNode = tempNodeList.get(0);
+ Node beanAttribute = injectNode.getAttributes().getNamedItem("bean");
+
+ if (beanAttribute != null) {
+ return beanAttribute.getTextContent();
+ }
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private List<Node> getChildNodesByName(Node node, String nodeName) {
+ List<Node> listOfNodes = new ArrayList<Node>();
+
+ for (int i = 0; i < node.getChildNodes().getLength(); i++) {
+ Node currentNode = node.getChildNodes().item(i);
+
+ if (nodeName.equals(currentNode.getNodeName())) {
+ listOfNodes.add(currentNode);
+ }
+ }
+
+ return listOfNodes;
+ }
+
+ public void setPropertyValue(String propertyName, String value) {
+ boolean propertyFound = false;
+ for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
+ Node currentNode = beanNode.getChildNodes().item(i);
+
+ if (currentNode.getNodeName().equals("property")
+ && currentNode.getAttributes().getNamedItem("name") != null
+ && propertyName.equals(currentNode.getAttributes().getNamedItem("name").getTextContent())) {
+
+ if (value != null) {
+ currentNode.setTextContent(value);
+ } else {
+ beanNode.removeChild(currentNode);
+ }
+
+ propertyFound = true;
+ }
+ }
+
+ if (value != null && !propertyFound) {
+ Node propertyChild = this.getDocument().createElement("property");
+ Attr nameProperty = this.getDocument().createAttribute("name");
+ nameProperty.setValue(propertyName);
+ propertyChild.setTextContent(value);
+ propertyChild.getAttributes().setNamedItem(nameProperty);
+ beanNode.appendChild(propertyChild);
+ }
+ }
+
+ public String getPropertyValue(String propertyName) {
+ for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
+ Node currentNode = beanNode.getChildNodes().item(i);
+
+ if (currentNode.getNodeName().equals("property")
+ && currentNode.getAttributes().getNamedItem("name") != null
+ && propertyName.equals(currentNode.getAttributes().getNamedItem("name").getTextContent())) {
+
+ return currentNode.getTextContent();
+ }
+ }
+
+ return null;
+ }
+
+ public void saveConfigFile() throws TransformerException {
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ transformer.setOutputProperty(OutputKeys.INDENT, "no");
+
+ //initialize StreamResult with File object to save to file
+ StreamResult result = new StreamResult(new StringWriter());
+ DOMSource source = new DOMSource(this.getDocument());
+ transformer.transform(source, result);
+
+ String xmlString = result.getWriter().toString();
+ System.out.println(xmlString);
+ }
+
+ public Node getBeanNodeByClass(String className) {
+ NodeList result = this.getDocument().getElementsByTagName("bean");
+
+ for (int i = 1; i < result.getLength(); i++) {
+ Node node = result.item(i);
+ if (node.getAttributes().getNamedItem("class") != null
+ && className.equals(node.getAttributes().getNamedItem("class").getTextContent())) {
+ System.out.println(node.getAttributes().getNamedItem("class").getTextContent());
+ return node;
+ }
+ }
+
+ return null;
+ }
+
+ public Node getBeanNodeByName(String beanName) {
+ NodeList result = this.getDocument().getElementsByTagName("bean");
+
+ for (int i = 1; i < result.getLength(); i++) {
+ Node node = result.item(i);
+ if (node.getAttributes().getNamedItem("name") != null
+ && beanName.equals(node.getAttributes().getNamedItem("name").getTextContent())) {
+ System.out.println(node.getAttributes().getNamedItem("name").getTextContent());
+ return node;
+ }
+ }
+
+ return null;
+ }
+
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/helper/JBossHelper.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/helper/JBossHelper.java
new file mode 100644
index 0000000..364f3ef
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/helper/JBossHelper.java
@@ -0,0 +1,49 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster.helper;
+
+import org.mc4j.ems.connection.bean.EmsBean;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+public class JBossHelper {
+
+ public static String getRawProxyInfo(EmsBean emsBean) {
+ String rawProxyInfo = null;
+
+ //try first to get the value for JBoss EAP5.x or AS6
+ try {
+ rawProxyInfo = (String) emsBean.getAttribute("ProxyInfo").refresh().toString();
+ } catch (Exception e) {
+ }
+
+ //if not able to get the value after the first attempt try to get the value for JBoss 4.2/4.3
+ if (rawProxyInfo == null) {
+ try {
+ rawProxyInfo = (String) emsBean.getAttribute("proxyInfo").refresh().toString();
+ } catch (Exception e) {
+ }
+ }
+
+ return rawProxyInfo;
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 4846490..fe4ac7d 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -1,132 +1,466 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<plugin name="mod_cluster"
- displayName="mod_cluster"
- description="Monitoring and management of mod_cluster plugin."
- version="1.0"
- package="org.rhq.plugins.modcluster"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="urn:xmlns:rhq-plugin"
- xmlns:c="urn:xmlns:rhq-configuration">
+<plugin name="mod_cluster" displayName="mod_cluster" description="Monitoring and management of mod_cluster plugin." version="1.0" package="org.rhq.plugins.modcluster" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
<depends plugin="JMX" />
- <service name="mod_cluster"
- discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent"
- class="ModclusterServerComponent"
- supportsManualAdd="true"
- description="mod_cluster plugin"
- singleton="true">
-
+ <service name="mod_cluster" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="mod_cluster plugin" singleton="true">
+
<runs-inside>
- <parent-resource-type name="JBossAS Server" plugin="JBossAS"/>
- <parent-resource-type name="JBossAS5 Server" plugin="JBossAS5"/>
+ <parent-resource-type name="JBossAS Server" plugin="JBossAS" />
+ <parent-resource-type name="JBossAS Server" plugin="JBossAS5" />
</runs-inside>
-
+
<plugin-configuration>
- <c:simple-property name="objectName" readOnly="true" default="Catalina:type=ModClusterListener,*"/>
- <c:simple-property name="engineObjectName" readOnly="true" default="jboss.web:type=Engine"/>
- <c:simple-property name="nameTemplate" default="mod_cluster"/>
+ <c:simple-property name="objectName" readOnly="true" default="Catalina:type=ModClusterListener,*|jboss.web:service=ModCluster" />
+ <c:simple-property name="engineObjectName" readOnly="true" default="jboss.web:type=Engine" />
+ <c:simple-property name="nameTemplate" default="mod_cluster" />
</plugin-configuration>
-
- <operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
- <parameters>
- <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout"/>
- <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
- <c:property-options allowCustomValue="false">
- <c:option value="MICROSECONDS" name="MICROSECONDS"/>
- <c:option value="MILLISECONDS" name="MILLISECONDS"/>
- <c:option value="NANOSECONDS" name="NANOSECONDS"/>
- <c:option value="SECONDS" name="SECONDS"/>
- <c:option value="HOURS" name="HOURS"/>
- <c:option value="DAYS" name="DAYS"/>
- </c:property-options>
- </c:simple-property>
- </parameters>
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
- </results>
- </operation>
- <operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
- <parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address"/>
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port"/>
- </parameters>
- </operation>
- <operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
- </results>
- </operation>
+
<operation name="reset" displayName="Reset the node" description="Move this application server out of an error state." />
- <operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
- </results>
- </operation>
- <operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
- <parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address"/>
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port"/>
- </parameters>
- </operation>
<operation name="refresh" displayName="Refresh configuration" description="Refresh configuration for this application server." />
-
- <metric property="proxyConfiguration" displayName="Proxy Configuration" displayType="summary" dataType="trait" />
- <metric property="modelerType" displayName="Type of the modeled resource" displayType="summary" dataType="trait" />
- <metric property="className" displayName="Fully qualified class name of the managed object" displayType="summary" dataType="trait" />
- <metric property="advertise" displayName="Enable autodiscovery of httpd servers." displayType="summary" dataType="trait" />
-
- <resource-configuration>
- <c:simple-property name="workerTimeout" type="integer" description="Timeout to wait for an available worker (default is no wait)." />
- <c:simple-property name="stickySession" type="boolean" description="Enables sticky session for the cluster."/>
- <c:simple-property name="stickySessionRemove" type="boolean" description="Remove session when the request cannot be routed to the right node for this cluster."/>
- <c:simple-property name="smax" type="integer" description="Maximum time on seconds for idle connections above smax."/>
- <c:simple-property name="maxAttempts" type="integer" description="Maximum number of attempts to send the request to the backend server."/>
- <c:simple-property name="advertiseSecurityKey" type="string" required="false" description="Security key for discovery."/>
- <c:simple-property name="stickySessionForce" type="boolean" description="Return an error when the request cannot be routed to the right node."/>
- <c:simple-property name="balancer" type="string" required="false" description="Name of the balancer."/>
- <c:simple-property name="flushPackets" type="boolean" description="Allows controlling flusing of packets."/>
- <c:simple-property name="socketTimeout" type="integer" description="Connection timeout for communication with the proxy." />
- <c:simple-property name="advertisePort" type="integer" required="false" description="Multicast port for discovery" />
- <c:simple-property name="advertiseGroupAddress" type="string" required="false" description="Multicast address for discovery."/>
- <c:simple-property name="flushWait" type="integer" description="Time in ms to wait before flushing packets."/>
- <c:simple-property name="ping" type="integer" description="Time in s to wait for a pong answer to a ping."/>
- </resource-configuration>
-
- <service name="mod_cluster Webapp Context"
- discovery="ContextDiscoveryComponent"
- class="ContextComponent"
- description="mod_cluster webapp context">
-
- <operation name="disableContext" displayName="Disable webapp" description="Disable this webapp.">
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation."/>
- </results>
- </operation>
- <operation name="stopContext" displayName="Stop webapp" description="Gracefully stops this webapp.">
+
+ <!-- Start - Configuration for HAModClusterService -->
+ <service name="HA Service" discovery="ClassNameMBeanDiscoveryComponent" class="PolyPingMBeanResourceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
+ <c:simple-property name="nameTemplate" default="HA Service" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.ha.HAModClusterService" />
+ <c:simple-property name="proxyInfoProperty" readOnly="true" default="ProxyInfo" />
+ </plugin-configuration>
+
+ <!-- HA Operations -->
+ <operation name="disableDomain" displayName="Disable domain" description="Disables all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
+ <results>
+ <c:simple-property name="result" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="enableDomain" displayName="Enable domain" description="Enable all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="stopDomain" displayName="Stop domain" description="Gracefully stops all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
+ <parameters>
+ <c:simple-property required="true" name="timeout" type="string" displayName="The number of units of time for which to wait for all sessions to drain on a given node." />
+ <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:property-options allowCustomValue="false">
+ <c:option value="MICROSECONDS" name="MICROSECONDS" />
+ <c:option value="MILLISECONDS" name="MILLISECONDS" />
+ <c:option value="NANOSECONDS" name="NANOSECONDS" />
+ <c:option value="SECONDS" name="SECONDS" />
+ <c:option value="HOURS" name="HOURS" />
+ <c:option value="DAYS" name="DAYS" />
+ </c:property-options>
+ </c:simple-property>
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+
+ <!-- Regular Operations -->
+
+ <operation name="pingHTTPD" displayName="Ping httpd" description="Ping httpd and determine whether each proxy is accessible and healthy. Returns the PING_RSP grouped by proxy address.">
+ <results>
+ <c:simple-property name="result" description="Map of PING_RPS response, grouped by proxy.">
+ </c:simple-property>
+ </results>
+ </operation>
+ <operation name="pingNodeByJVMRoute" displayName="Ping node by JVM Route"
+ description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Dtermines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
+ <parameters>
+ <c:simple-property required="true" name="jvmRoute" type="string" displayName="JVM Route of node to ping." />
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ </results>
+ </operation>
+ <operation name="pingNodeByAddress" displayName="Ping node by address"
+ description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Determines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
+ <parameters>
+ <c:simple-property required="true" name="scheme" type="string" displayName="Scheme (ajp, http, https)" />
+ <c:simple-property required="true" name="hostname" type="string" displayName="Name or ip address of a node." />
+ <c:simple-property required="true" name="port" type="string" displayName="Port" />
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ </results>
+ </operation>
+
+ <operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" description="The result of the operation">
+ </c:simple-property>
+ </results>
+ </operation>
+ <operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" description="The result of the operation">
+ </c:simple-property>
+ </results>
+ </operation>
+ <operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
+ <parameters>
+ <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:property-options allowCustomValue="false">
+ <c:option value="MICROSECONDS" name="MICROSECONDS" />
+ <c:option value="MILLISECONDS" name="MILLISECONDS" />
+ <c:option value="NANOSECONDS" name="NANOSECONDS" />
+ <c:option value="SECONDS" name="SECONDS" />
+ <c:option value="HOURS" name="HOURS" />
+ <c:option value="DAYS" name="DAYS" />
+ </c:property-options>
+ </c:simple-property>
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+
+ <metric property="MasterNode" displayName="Master Node" displayType="summary" dataType="trait" />
+ <metric property="ProxyConfiguration" displayName="Proxy Configuration" displayType="summary" dataType="trait" />
+ <metric property="ProxyInfo" displayName="Proxy Info" displayType="summary" dataType="trait" />
+
+ <resource-configuration>
+ <c:simple-property name="processStatusFrequency" type="integer" description="Process status frequency." />
+ </resource-configuration>
+ </service>
+
+ <service name="HA Service Configuration" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true" description="HA Service Configuration" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
+ <c:simple-property name="nameTemplate" default="HA Service Configuration" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.ha.HAModClusterService" />
+ <c:simple-property name="dependencyClassName" readOnly="true" default="org.jboss.modcluster.config.ha.HAModClusterConfig" />
+ <c:simple-property name="proxyInfoProperty" readOnly="true" default="ProxyInfo" />
+ </plugin-configuration>
+
+ <resource-configuration>
+
+ <!-- HA Configuration -->
+ <c:simple-property name="masterPerLoadBalancingGroup" type="boolean" required="false" description="Enable current node to be master in the load balancing group." />
+
+ <!-- Handler Configuration -->
+ <c:simple-property name="advertise" type="boolean" required="false" default="false" description="Enable autodiscovery of httpd servers." />
+ <c:simple-property name="advertiseGroupAddress" type="string" description="Multicast address on which to listen for advertisements." />
+ <c:simple-property name="advertisePort" type="string" required="false" description="Multicast port for discovery" />
+ <c:simple-property name="advertiseInterface" type="string" required="false" description="Multicast interface for discovery" />
+ <c:simple-property name="advertiseSecurityKey" type="string" required="false" description="Security key for discovery." />
+ <c:simple-property name="proxyList" type="string" required="false" description="Comma separated list of address:port listing the httpd servers where mod_cluster is running." />
+ <c:simple-property name="proxyURL" type="string" required="false" description="URL prefix to send with commands to mod_cluster. Default is no prefix." />
+ <c:simple-property name="socketTimeout" type="integer" required="false" description="Connection timeout for communication with the proxy." />
+ <c:simple-property name="ssl" type="boolean" description="Whether to use SSL to communicate with mod_cluster. Note this has nothing to do with handling of https requests by JBoss Web" />
+ <c:simple-property name="excludedContexts" type="string" required="false" description="Comma delimited list of contexts that should *not* be auto-registered with httpd. Contexts may be qualified by host using a colon, e.g. host1:context1. If no host is defined, localhost is assumed." />
+ <c:simple-property name="autoEnableContexts" type="boolean" required="false" default="true" description="Toggle for context auto-enable during mod_cluster startup." />
+
+ <!-- Node Configuration -->
+ <c:simple-property name="loadBalancingGroup" type="string" required="false" description="Load balancing group." />
+ <c:simple-property name="flushPackets" type="boolean" required="false" description="Allows controlling flusing of packets." />
+ <c:simple-property name="flushWait" type="integer" required="false" description="Time in ms to wait before flushing packets." />
+ <c:simple-property name="ping" type="integer" required="false" description="Time in s to wait for a pong answer to a ping." />
+ <c:simple-property name="smax" type="integer" required="false" description="Maximum time on seconds for idle connections above smax." />
+ <c:simple-property name="ttl" type="integer" required="false" description="TTL" />
+ <c:simple-property name="nodeTimeout" type="integer" required="false" description="Node timeout" />
+ <c:simple-property name="balancer" type="string" required="false" description="Name of the balancer" />
+
+ <!-- Balancer Configuration -->
+ <c:simple-property name="stickySession" type="boolean" description="Enables sticky session for the node." />
+ <c:simple-property name="stickySessionRemove" type="boolean" description="Remove session when the request cannot be routed to the right node for this cluster." />
+ <c:simple-property name="stickySessionForce" type="boolean" description="Return an error when the request cannot be routed to the right node." />
+ <c:simple-property name="workerTimeout" type="integer" description="Timeout to wait for an available worker (default is no wait)." />
+ <c:simple-property name="maxAttempts" type="integer" description="Maximum number of attempts to send the request to the backend server." />
+ </resource-configuration>
+ </service>
+ <!-- End - Configuration for HAModClusterService -->
+
+ <!-- Start - Configuration for ModClusterService -->
+ <service name="Service" discovery="ClassNameMBeanDiscoveryComponent" class="PolyPingMBeanResourceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
+ <c:simple-property name="nameTemplate" default="HA Service" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.ModClusterService" />
+ <c:simple-property name="proxyInfoProperty" readOnly="true" default="ProxyInfo" />
+ </plugin-configuration>
+
+ <operation name="pingHTTPD" displayName="Ping httpd" description="Ping httpd and determine whether each proxy is accessible and healthy. Returns the PING_RSP grouped by proxy address.">
+ <results>
+ <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ </results>
+ </operation>
+ <operation name="pingNodeByJVMRoute" displayName="Ping node by JVM Route"
+ description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Dtermines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
+ <parameters>
+ <c:simple-property required="true" name="jvmRoute" type="string" displayName="JVM Route of node to ping." />
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ </results>
+ </operation>
+ <operation name="pingNodeByAddress" displayName="Ping node by address"
+ description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Determines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
+ <parameters>
+ <c:simple-property required="true" name="scheme" type="string" displayName="Scheme (ajp, http, https)" />
+ <c:simple-property required="true" name="hostname" type="string" displayName="Name or ip address of a node." />
+ <c:simple-property required="true" name="port" type="string" displayName="Port" />
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ </results>
+ </operation>
+
+ <operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
+ <parameters>
+ <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:property-options allowCustomValue="false">
+ <c:option value="MICROSECONDS" name="MICROSECONDS" />
+ <c:option value="MILLISECONDS" name="MILLISECONDS" />
+ <c:option value="NANOSECONDS" name="NANOSECONDS" />
+ <c:option value="SECONDS" name="SECONDS" />
+ <c:option value="HOURS" name="HOURS" />
+ <c:option value="DAYS" name="DAYS" />
+ </c:property-options>
+ </c:simple-property>
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+
+ <metric property="ProxyConfiguration" displayName="Proxy Configuration" displayType="summary" dataType="trait" />
+ <metric property="ProxyInfo" displayName="Proxy Info" displayType="summary" dataType="trait" />
+ </service>
+
+ <service name="Service Configuration" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true" description="HA Service Configuration" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
+ <c:simple-property name="nameTemplate" default="HA Service Configuration" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.ModClusterService" />
+ <c:simple-property name="dependencyClassName" readOnly="true" default="org.jboss.modcluster.config.ModClusterConfig" />
+ <c:simple-property name="proxyInfoProperty" readOnly="true" default="ProxyInfo" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <!-- Handler Configuration -->
+ <c:simple-property name="advertise" type="boolean" required="false" default="false" description="Enable autodiscovery of httpd servers." />
+ <c:simple-property name="advertiseGroupAddress" type="string" description="Multicast address on which to listen for advertisements." />
+ <c:simple-property name="advertisePort" type="string" required="false" description="Multicast port for discovery" />
+ <c:simple-property name="advertiseInterface" type="string" required="false" description="Multicast interface for discovery" />
+ <c:simple-property name="advertiseSecurityKey" type="string" required="false" description="Security key for discovery." />
+ <c:simple-property name="proxyList" type="string" required="false" description="Comma separated list of address:port listing the httpd servers where mod_cluster is running." />
+ <c:simple-property name="proxyURL" type="string" required="false" description="URL prefix to send with commands to mod_cluster. Default is no prefix." />
+ <c:simple-property name="socketTimeout" type="integer" required="false" description="Connection timeout for communication with the proxy." />
+ <c:simple-property name="ssl" type="boolean" description="Whether to use SSL to communicate with mod_cluster. Note this has nothing to do with handling of https requests by JBoss Web" />
+ <c:simple-property name="excludedContexts" type="string" required="false"
+ description="Comma delimited list of contexts that should *not* be auto-registered with httpd. Contexts may be qualified by host using a colon, e.g. host1:context1. If no host is defined, localhost is assumed." />
+ <c:simple-property name="autoEnableContexts" type="boolean" required="false" default="true" description="Toggle for context auto-enable during mod_cluster startup." />
+
+ <!-- Node Configuration -->
+ <c:simple-property name="loadBalancingGroup" type="string" required="false" description="Load balancing group." />
+ <c:simple-property name="flushPackets" type="boolean" required="false" description="Allows controlling flusing of packets." />
+ <c:simple-property name="flushWait" type="integer" required="false" description="Time in ms to wait before flushing packets." />
+ <c:simple-property name="ping" type="integer" required="false" description="Time in s to wait for a pong answer to a ping." />
+ <c:simple-property name="smax" type="integer" required="false" description="Maximum time on seconds for idle connections above smax." />
+ <c:simple-property name="ttl" type="integer" required="false" description="TTL" />
+ <c:simple-property name="nodeTimeout" type="integer" required="false" description="Node timeout" />
+ <c:simple-property name="balancer" type="string" required="false" description="Name of the balancer" />
+
+ <!-- Balancer Configuration -->
+ <c:simple-property name="stickySession" type="boolean" description="Enables sticky session for the node." />
+ <c:simple-property name="stickySessionRemove" type="boolean" description="Remove session when the request cannot be routed to the right node for this cluster." />
+ <c:simple-property name="stickySessionForce" type="boolean" description="Return an error when the request cannot be routed to the right node." />
+ <c:simple-property name="workerTimeout" type="integer" description="Timeout to wait for an available worker (default is no wait)." />
+ <c:simple-property name="maxAttempts" type="integer" description="Maximum number of attempts to send the request to the backend server." />
+ </resource-configuration>
+ </service>
+ <!-- End - Configuration for ModClusterService -->
+
+ <service name="Catalina Service" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="Catalina Service Listener" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="Catalina:type=ModClusterListener,*" />
+ <c:simple-property name="nameTemplate" default="mod_cluster Catalina Listener" />
+ </plugin-configuration>
+
+ <operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
+ <parameters>
+ <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:property-options allowCustomValue="false">
+ <c:option value="MICROSECONDS" name="MICROSECONDS" />
+ <c:option value="MILLISECONDS" name="MILLISECONDS" />
+ <c:option value="NANOSECONDS" name="NANOSECONDS" />
+ <c:option value="SECONDS" name="SECONDS" />
+ <c:option value="HOURS" name="HOURS" />
+ <c:option value="DAYS" name="DAYS" />
+ </c:property-options>
+ </c:simple-property>
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+
+ <metric property="proxyConfiguration" displayName="Proxy Configuration" displayType="summary" dataType="trait" />
+ <metric property="modelerType" displayName="Type of the modeled resource" displayType="summary" dataType="trait" />
+ <metric property="className" displayName="Fully qualified class name of the managed object" displayType="summary" dataType="trait" />
+ <metric property="advertise" displayName="Enable autodiscovery of httpd servers." displayType="summary" dataType="trait" />
+
+ <resource-configuration>
+ <c:simple-property name="workerTimeout" type="integer" description="Timeout to wait for an available worker (default is no wait)." />
+ <c:simple-property name="stickySession" type="boolean" description="Enables sticky session for the cluster." />
+ <c:simple-property name="stickySessionRemove" type="boolean" description="Remove session when the request cannot be routed to the right node for this cluster." />
+ <c:simple-property name="smax" type="integer" description="Maximum time on seconds for idle connections above smax." />
+ <c:simple-property name="maxAttempts" type="integer" description="Maximum number of attempts to send the request to the backend server." />
+ <c:simple-property name="advertiseSecurityKey" type="string" required="false" description="Security key for discovery." />
+ <c:simple-property name="stickySessionForce" type="boolean" description="Return an error when the request cannot be routed to the right node." />
+ <c:simple-property name="balancer" type="string" required="false" description="Name of the balancer." />
+ <c:simple-property name="flushPackets" type="boolean" description="Allows controlling flusing of packets." />
+ <c:simple-property name="socketTimeout" type="integer" description="Connection timeout for communication with the proxy." />
+ <c:simple-property name="advertisePort" type="integer" required="false" description="Multicast port for discovery" />
+ <c:simple-property name="advertiseGroupAddress" type="string" required="false" description="Multicast address for discovery." />
+ <c:simple-property name="flushWait" type="integer" description="Time in ms to wait before flushing packets." />
+ <c:simple-property name="ping" type="integer" description="Time in s to wait for a pong answer to a ping." />
+ </resource-configuration>
+ </service>
+
+ <service name="Dynamic Load Balancer Factor" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true" description="Dynamic Load balancer factor for mod_cluster" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:provider=LoadBalanceFactor,service=ModCluster,*" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProvider" />
+ <c:simple-property name="nameTemplate" default="Dynamic Load Balancer Factor" />
+ </plugin-configuration>
+
+ <metric property="Metrics" displayName="Collected Metrics" displayType="summary" dataType="trait" />
+
+ <resource-configuration>
+ <c:simple-property name="DecayFactor" type="integer" description="The number of historical load values used to determine load factor." />
+ <c:simple-property name="History" type="integer" description="The exponential decay factor for historical load values." />
+ </resource-configuration>
+ </service>
+
+ <service name="Simple Load Balancer Factor" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true" description="Simple load balancer factor for mod_cluster" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:provider=LoadBalanceFactor,service=ModCluster,*" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.load.impl.SimpleLoadBalanceFactorProvider" />
+ <c:simple-property name="nameTemplate" default="Simple Load Balancer Factor" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:simple-property name="loadBalanceFactor" type="integer" description="The load balance factor." />
+ </resource-configuration>
+ </service>
+
+ <service name="Load Metric" discovery="LoadMetricDiscoveryComponent" class="org.rhq.plugins.jmx.MBeanResourceComponent" description="Load Metric">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:provider=LoadBalanceFactor,service=ModCluster,metric=*,*" />
+ <c:simple-property name="nameTemplate" default="Load Metric" />
+ </plugin-configuration>
+
+ <metric property="Load" displayName="Load" category="utilization" description="The current load of this metric as a percent of the metric's capacity." dataType="measurement" />
+
+ <resource-configuration>
+ <c:simple-property name="Weight" type="integer" description="The significance of this load metric compared to the other metrics." />
+ <c:simple-property name="Capacity" type="double" description="Used to normalize the value returned by load expressed as a percentage of the capacity, such that: 0 < (load/capacity) < 1" />
+ </resource-configuration>
+ </service>
+
+ <service name="Webapp Context" discovery="ContextDiscoveryComponent" class="ContextComponent" description="Webapp Context">
+
+ <operation name="disableContext" displayName="Disable webapp" description="Disable this webapp.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation." />
+ </results>
+ </operation>
+ <operation name="stopContext" displayName="Stop webapp" description="Gracefully stops this webapp.">
<parameters>
- <c:simple-property required="true" name="timeout" type="integer" displayName="Session draining timeout"/>
- <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
- <c:property-options allowCustomValue="false">
- <c:option value="MICROSECONDS" name="MICROSECONDS"/>
- <c:option value="MILLISECONDS" name="MILLISECONDS"/>
- <c:option value="NANOSECONDS" name="NANOSECONDS"/>
- <c:option value="SECONDS" name="SECONDS"/>
- <c:option value="HOURS" name="HOURS"/>
- <c:option value="DAYS" name="DAYS"/>
- </c:property-options>
- </c:simple-property>
+ <c:simple-property required="true" name="timeout" type="integer" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:property-options allowCustomValue="false">
+ <c:option value="MICROSECONDS" name="MICROSECONDS" />
+ <c:option value="MILLISECONDS" name="MILLISECONDS" />
+ <c:option value="NANOSECONDS" name="NANOSECONDS" />
+ <c:option value="SECONDS" name="SECONDS" />
+ <c:option value="HOURS" name="HOURS" />
+ <c:option value="DAYS" name="DAYS" />
+ </c:property-options>
+ </c:simple-property>
</parameters>
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
- </results>
- </operation>
- <operation name="enableContext" displayName="Enable webapp" description="Enable this webapp.">
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
- </results>
- </operation>
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="enableContext" displayName="Enable webapp" description="Enable this webapp.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
</service>
</service>
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
new file mode 100644
index 0000000..4e4aac1
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
@@ -0,0 +1,58 @@
+/*
+ * 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.plugins.modcluster.test;
+
+import org.testng.annotations.Test;
+
+import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
+
+public class ServerConfigTest {
+
+ @Test
+ public void TestConfig() {
+
+ try {
+ ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService");
+ config.setPropertyValue("processStatusFrequency", "4");
+ config.setPropertyValue("test", "5");
+ config.setPropertyValue("test", "123");
+
+ System.out.println(config.getPropertyValue("test"));
+
+ config.saveConfigFile();
+
+ config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
+ "org.jboss.modcluster.config.ha.HAModClusterConfig");
+ config.setPropertyValue("processStatusFrequency", "4");
+ config.setPropertyValue("test", "5");
+ config.setPropertyValue("test", "123");
+
+ System.out.println(config.getPropertyValue("test"));
+
+ config.saveConfigFile();
+
+ config.setPropertyValue("test", null);
+ config.saveConfigFile();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+}
commit f9107f719e5fa14265be4e4f6e2ed4c4d7f8a509
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Sun Aug 14 12:03:44 2011 -0500
With JBoss 5, the timeout is blocking the operation call for the period set. Reduce this period for these integration tests.
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
index dc98d78..0a39eab 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
+++ b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
@@ -168,7 +168,7 @@ public class ModclusterPluginTest {
log.info("Result of operation " + "enableContext" + " was: " + result.getSimpleResult());
Configuration config = new Configuration();
- config.put(new PropertySimple("timeout", "1000"));
+ config.put(new PropertySimple("timeout", "1"));
config.put(new PropertySimple("unit", java.util.concurrent.TimeUnit.SECONDS));
result = ((OperationFacet) resourceComponent).invokeOperation("stopContext", config);
log.info("Result of operation stopContext was: " + result.getSimpleResult());
commit 47ccc7a36d1dbce6c2e99ef5a83ec1bfcd250988
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Sun Aug 14 12:02:34 2011 -0500
Add jar dependencies for testing with JBoss 5&6.
diff --git a/modules/integration-tests/mod_cluster-plugin-test/pom.xml b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
index 0cc3f4f..77a81b2 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/pom.xml
+++ b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
@@ -17,9 +17,37 @@
<properties>
<scm.module.path>modules/integration-tests/mod_cluster-plugin-test</scm.module.path>
+ <!-- jbossas.version>6.0.0.20100429-M3</jbossas.version-->
+ <jbossas.version>6.0.0.M1</jbossas.version>
+
</properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-parent</artifactId>
+ <version>${jbossas.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-component-matrix</artifactId>
+ <version>${jbossas.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
<dependencies>
+
+ <dependency>
+ <groupId>org.jboss.integration</groupId>
+ <artifactId>jboss-profileservice-spi</artifactId>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>${rhq.groupId}</groupId>
@@ -41,6 +69,213 @@
<version>1.2.14</version>
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.naming</groupId>
+ <artifactId>jnp-client</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-aspects</artifactId>
+ <version>5.1.0.CR1</version>
+ <classifier>jboss-aspect-jdk50-client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>trove</groupId>
+ <artifactId>trove</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jboss-security-spi</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-javaee</artifactId>
+ <scope>test</scope>
+ </dependency-->
+
+ <dependency>
+ <groupId>oswego-concurrent</groupId>
+ <artifactId>concurrent</artifactId>
+ <version>1.3.4-jboss</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-server</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-mdr</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ <scope>test</scope>
+ </dependency-->
+
+ <!-- dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ <scope>test</scope>
+ </dependency-->
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-security</artifactId>
+ <version>5.1.0.CR1</version>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.integration</groupId>
+ <artifactId>jboss-transaction-spi</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-common</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-core</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-ext-api</artifactId>
+ <version>1.0.0</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-proxy-spi</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-proxy-impl</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-security</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ <scope>test</scope>
+ </dependency-->
+
+ <!-- dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jbosssx-client</artifactId>
+ <scope>test</scope>
+ </dependency-->
+
+ <dependency>
+ <groupId>org.jboss.aspects</groupId>
+ <artifactId>jboss-security-aspects</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.aop</groupId>
+ <artifactId>jboss-aop</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-reflect</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-serialization</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client-spi</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-profileservice</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-server</artifactId>
+ <classifier>jmx-invoker-adaptor-client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- dependency>
+ <groupId>jboss.messaging</groupId>
+ <artifactId>jboss-messaging-client</artifactId>
+ <scope>test</scope>
+ </dependency-->
</dependencies>
commit 58bcfd2f5c502b59f4a362f05daa20e6a3c4ac0b
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Wed Aug 10 18:04:02 2011 -0500
Get the integration tests to compile and run again by creating the maven module and deploying the correct resources to target folder.
diff --git a/.classpath b/.classpath
index a46eaf4..e5225db 100644
--- a/.classpath
+++ b/.classpath
@@ -280,5 +280,6 @@
<classpathentry kind="src" path="modules/plugins/jboss-as-7/src/main/java"/>
<classpathentry kind="src" path="modules/plugins/jboss-as-7/src/test/java"/>
<classpathentry kind="src" path="modules/integration-tests/jboss-as-7-plugin-test/src/test/java"/>
+ <classpathentry kind="src" path="modules/integration-tests/mod_cluster-plugin-test/src/test/java"/>
<classpathentry kind="output" path="eclipse-classes"/>
</classpath>
diff --git a/modules/integration-tests/mod_cluster-plugin-test/pom.xml b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
new file mode 100644
index 0000000..0cc3f4f
--- /dev/null
+++ b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
@@ -0,0 +1,155 @@
+<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-plugins-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.rhq</groupId>
+ <artifactId>modcluster-plugin-test</artifactId>
+ <packaging>jar</packaging>
+
+ <name>RHQ mod_cluster Plugin Integration Test</name>
+ <description>Integration tests for mod_cluster RHQ Agent plugin</description>
+
+ <properties>
+ <scm.module.path>modules/integration-tests/mod_cluster-plugin-test</scm.module.path>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-jmx-plugin</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>modcluster-plugin</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <profiles>
+
+ <profile>
+ <id>integration-tests</id>
+ <activation>
+ <property>
+ <name>maven.test.skip</name>
+ <value>!true</value>
+ </property>
+ </activation>
+
+ <properties>
+ <rhq.rootDir>../../..</rhq.rootDir>
+ <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+ <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/rhq-downloads/rhq-plugins</rhq.deploymentDir>
+ </properties>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-test-resources</phase>
+ <configuration>
+ <tasks>
+ <echo>Setting up plugin dependencies...</echo>
+ <property name="settings.localRepository" location="${user.home}/.m2/repository" />
+ <mkdir dir="target/testsetup" />
+
+ <mkdir dir="target/testsetup/plugins" />
+ <copy toDir="target/testsetup/plugins" flatten="true">
+ <fileset dir="${settings.localRepository}/">
+ <include name="org/rhq/rhq-platform-plugin/${project.version}/rhq-platform-plugin-${project.version}.jar" />
+ <include name="org/rhq/rhq-jmx-plugin/${project.version}/rhq-jmx-plugin-${project.version}.jar" />
+ <include name="org/jboss/on/jopr-jboss-as-plugin/${project.version}/jopr-jboss-as-plugin-${project.version}.jar" />
+ <include name="org/jboss/on/jopr-jboss-as-5-plugin/${project.version}/jopr-jboss-as-5-plugin-${project.version}.jar" />
+ <include name="org/rhq/modcluster-plugin/${project.version}/modcluster-plugin-${project.version}.jar" />
+ </fileset>
+ <fileset dir="${rhq.deploymentDir}">
+ <include name="${project.artifactId}-${project.version}.jar" />
+ </fileset>
+ </copy>
+
+ <mkdir dir="target/testsetup/lib" />
+ <unzip dest="target/testsetup/lib">
+ <fileset dir="${settings.localRepository}/org/hyperic/sigar-dist/${sigar.version}" includes="*.zip" />
+ <patternset>
+ <include name="**/lib/sigar.jar" />
+ <include name="**/lib/bcel*.jar" />
+ <include name="**/lib/*.so" />
+ <include name="**/lib/*.sl" />
+ <include name="**/lib/*.dll" />
+ <include name="**/lib/*.dylib" />
+ </patternset>
+ </unzip>
+ <move todir="target/testsetup/lib" flatten="true">
+ <fileset dir="target/testsetup/lib">
+ <include name="**/lib/*" />
+ </fileset>
+ </move>
+ <delete dir="target/testsetup/lib/hyperic-sigar-${sigar.version}" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>surefire-it</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>${maven.test.skip}</skip>
+ <excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
+ <useSystemClassLoader>false</useSystemClassLoader>
+ <argLine>-Dorg.hyperic.sigar.path=${basedir}/target/testsetup/lib</argLine>
+ <systemProperties>
+ <property>
+ <name>project.artifactId</name>
+ <value>${project.artifactId}</value>
+ </property>
+ <property>
+ <name>project.version</name>
+ <value>${project.version}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
index 0f644fc..dc98d78 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
+++ b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
@@ -148,10 +148,12 @@ public class ModclusterPluginTest {
}
if (resourceComponent instanceof OperationFacet) {
- OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("reset", null);
+ OperationResult result = null;
+
+ result = ((OperationFacet) resourceComponent).invokeOperation("reset", new Configuration());
log.info("Result of operation test was: " + result);
- result = ((OperationFacet) resourceComponent).invokeOperation("disable", null);
+ result = ((OperationFacet) resourceComponent).invokeOperation("disable", new Configuration());
log.info("Result of operation test was: " + result.getSimpleResult());
}
}
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index ab52e84..fdc4f37 100644
--- a/modules/plugins/mod-cluster/pom.xml
+++ b/modules/plugins/mod-cluster/pom.xml
@@ -56,51 +56,6 @@
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
- <execution>
- <phase>process-test-resources</phase>
- <configuration>
- <tasks>
- <echo>Setting up plugin dependencies...</echo>
- <property name="settings.localRepository" location="${user.home}/.m2/repository" />
- <mkdir dir="target/testsetup" />
-
- <mkdir dir="target/testsetup/plugins" />
- <copy toDir="target/testsetup/plugins" flatten="true">
- <fileset dir="${settings.localRepository}/">
- <include name="org/rhq/rhq-platform-plugin/${project.version}/rhq-platform-plugin-${project.version}.jar" />
- <include name="org/rhq/rhq-jmx-plugin/${project.version}/rhq-jmx-plugin-${project.version}.jar" />
- <include name="org/jboss/on/jopr-jboss-as-plugin/${project.version}/jopr-jboss-as-plugin-${project.version}.jar" />
- <include name="org/jboss/on/jopr-jboss-as-5-plugin/${project.version}/jopr-jboss-as-5-plugin-${project.version}.jar" />
- </fileset>
- <fileset dir="${rhq.deploymentDir}">
- <include name="${project.artifactId}-${project.version}.jar" />
- </fileset>
- </copy>
-
- <mkdir dir="target/testsetup/lib" />
- <unzip dest="target/testsetup/lib">
- <fileset dir="${settings.localRepository}/org/hyperic/sigar-dist/${sigar.version}" includes="*.zip" />
- <patternset>
- <include name="**/lib/sigar.jar" />
- <include name="**/lib/bcel*.jar" />
- <include name="**/lib/*.so" />
- <include name="**/lib/*.sl" />
- <include name="**/lib/*.dll" />
- <include name="**/lib/*.dylib" />
- </patternset>
- </unzip>
- <move todir="target/testsetup/lib" flatten="true">
- <fileset dir="target/testsetup/lib">
- <include name="**/lib/*" />
- </fileset>
- </move>
- <delete dir="target/testsetup/lib/hyperic-sigar-${sigar.version}" />
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
<execution>
<id>deploy</id>
@@ -203,12 +158,10 @@
<build>
<plugins>
-
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
<executions>
-
<execution>
<id>deploy</id>
<phase>compile</phase>
@@ -258,14 +211,10 @@
<goal>run</goal>
</goals>
</execution>
-
</executions>
</plugin>
-
</plugins>
</build>
</profile>
-
</profiles>
-
</project>
12 years, 8 months
[rhq] Branch 'release_jon3.0.0' - 14 commits - modules/core modules/enterprise modules/integration-tests modules/plugins pom.xml publish_release.sh
by Simeon Pinder
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDetails.java | 126 +++
modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftConfigurationTest.java | 20
modules/core/plugin-container/pom.xml | 3
modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java | 55 +
modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/ScheduleQueueImpl.java | 21
modules/enterprise/agent/ant-run.xml | 15
modules/enterprise/agent/pom.xml | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java | 26
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java | 23
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java | 73 --
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/buttons/BackButton.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/AbstractTableSection.java | 9
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/StringIDTableSection.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java | 28
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java | 342 +++-------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DriftGWTService.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java | 15
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TestGWTService.java | 34
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java | 20
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryDataSource.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/AutodiscoveryQueueDataSource.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java | 14
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java | 15
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestRpcView.java | 52 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java | 9
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DriftGWTServiceImpl.java | 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TestGWTServiceImpl.java | 43 +
modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml | 8
modules/enterprise/remoting/cli/src/main/samples/drift.js | 153 +++-
modules/enterprise/remoting/cli/src/main/samples/util.js | 17
modules/enterprise/server/container/pom.xml | 6
modules/enterprise/server/container/src/main/scripts/rhq-container.assembly.xml | 7
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java | 69 ++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java | 10
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java | 11
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerLocal.java | 2
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBeanTest.java | 8
modules/integration-tests/apache-plugin-test/pom.xml | 4
modules/plugins/aliases/pom.xml | 2
modules/plugins/apache/pom.xml | 2
modules/plugins/augeas/pom.xml | 6
modules/plugins/cobbler/pom.xml | 2
modules/plugins/cron/pom.xml | 2
modules/plugins/grub/pom.xml | 2
modules/plugins/hosts/pom.xml | 2
modules/plugins/postfix/pom.xml | 2
modules/plugins/samba/pom.xml | 2
modules/plugins/sshd/pom.xml | 2
modules/plugins/sudoers/pom.xml | 2
pom.xml | 7
publish_release.sh | 2
53 files changed, 918 insertions(+), 404 deletions(-)
New commits:
commit 85ccbd1698c68a5a7850a32fe364973a5ef704be
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Sep 1 16:55:06 2011 -0400
[BZ 735232] Message portlet should not be displayed on default dashboard in JON
(https://bugzilla.redhat.com/show_bug.cgi?id=735232); fix layout issues in About
modal window; load ProductInfo once in CoreGUI init and cache it
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
index 2a52e4d..88801e0 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
@@ -33,6 +33,7 @@ import com.google.gwt.user.client.History;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.Window.Location;
+import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.core.KeyIdentifier;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.util.KeyCallback;
@@ -41,10 +42,12 @@ import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.layout.VLayout;
+import org.rhq.core.domain.common.ProductInfo;
import org.rhq.enterprise.gui.coregui.client.admin.AdministrationView;
import org.rhq.enterprise.gui.coregui.client.alert.AlertHistoryView;
import org.rhq.enterprise.gui.coregui.client.bundle.BundleTopView;
import org.rhq.enterprise.gui.coregui.client.dashboard.DashboardsView;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.help.HelpView;
import org.rhq.enterprise.gui.coregui.client.inventory.InventoryView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.ResourceGroupDetailView;
@@ -109,6 +112,7 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String>, Event.Na
private MenuBarView menuBarView;
private Footer footer;
private int rpcTimeout;
+ private ProductInfo productInfo;
public void onModuleLoad() {
String hostPageBaseURL = GWT.getHostPageBaseURL();
@@ -262,6 +266,28 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String>, Event.Na
return coreGUI;
}
+ public void init() {
+ if (productInfo == null) {
+ GWTServiceLookup.getSystemService().getProductInfo(new AsyncCallback<ProductInfo>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(MSG.view_aboutBox_failedToLoad(), caught);
+ buildCoreUI();
+ }
+
+ public void onSuccess(ProductInfo result) {
+ productInfo = result;
+ buildCoreUI();
+ }
+ });
+ } else {
+ buildCoreUI();
+ }
+ }
+
+ public ProductInfo getProductInfo() {
+ return productInfo;
+ }
+
public void buildCoreUI() {
// If the core gui is already built (eg. from previous login) skip the build and just refire event
if (rootCanvas == null) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java
index 56c3658..7bdcb6e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java
@@ -84,7 +84,7 @@ public class UserSessionManager {
// We want the CoreGUI session timeout to rule them all. The rhq subject session is refreshed on each SLSB
// call. But the HTTP session will die after 30 minutes. Keep it alive until logout by pinging SessionAccessServlet
- // occasionaly, as specified by this interval (which must be less than the 30 minutes).
+ // occasionally, as specified by this interval (which must be less than the 30 minutes).
// Currently: 20 minutes
private static int SESSION_ACCESS_REFRESH = 20 * 60 * 1000;
@@ -454,7 +454,7 @@ public class UserSessionManager {
scheduleWebUserUpdate(loggedInSubject);
}
- CoreGUI.get().buildCoreUI();
+ CoreGUI.get().init();
}
public void onFailure(Throwable caught) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
index 6a614bb..b476f66 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2010 Red Hat, Inc.
+ * Copyright (C) 2010-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -18,25 +18,18 @@
*/
package org.rhq.enterprise.gui.coregui.client.components;
-import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.Version;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.types.VerticalAlignment;
-import com.smartgwt.client.widgets.Button;
-import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.HTMLFlow;
-import com.smartgwt.client.widgets.IButton;
-import com.smartgwt.client.widgets.Window;
+import com.smartgwt.client.widgets.HTMLPane;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
-import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.common.ProductInfo;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.Messages;
-import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHLayout;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
@@ -52,8 +45,6 @@ public class AboutModalWindow extends LocatableWindow {
private static final Messages MSG = CoreGUI.getMessages();
- private static ProductInfo PRODUCT_INFO;
-
/**
* <pre>
* ID Format: "simpleClassname_locatorId"
@@ -78,37 +69,19 @@ public class AboutModalWindow extends LocatableWindow {
@Override
protected void onInit() {
- super.onInit();
-
- if (PRODUCT_INFO == null) {
- GWTServiceLookup.getSystemService().getProductInfo(new AsyncCallback<ProductInfo>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(MSG.view_aboutBox_failedToLoad(), caught);
- }
-
- public void onSuccess(ProductInfo result) {
- PRODUCT_INFO = result;
- setTitle(MSG.view_aboutBox_title(PRODUCT_INFO.getFullName()));
+ ProductInfo productInfo = CoreGUI.get().getProductInfo();
- finishOnInit();
- }
- });
- } else {
- finishOnInit();
- }
- }
+ setTitle(MSG.view_aboutBox_title(productInfo.getFullName()));
- private void finishOnInit() {
LocatableVLayout contentPane = new LocatableVLayout(extendLocatorId("Content"));
- contentPane.setPadding(13);
- contentPane.setMembersMargin(25);
-
- HTMLFlow htmlFlow = new HTMLFlow();
- String html = "<span class=\"DisplaySubhead\">\n" + " <a href=\"" + PRODUCT_INFO.getUrl() + "\" title=\""
- + PRODUCT_INFO.getFullName() + " " + PRODUCT_INFO.getUrl() + "\" target=\"_blank\">"
- + PRODUCT_INFO.getFullName() + "</a>\n" + "</span><br/>\n" + "<span class=\"DisplayLabel\">"
- + MSG.view_aboutBox_version() + " " + PRODUCT_INFO.getVersion() + "</span><br/>\n"
- + "<span class=\"DisplayLabel\">" + MSG.view_aboutBox_buildNumber() + " " + PRODUCT_INFO.getBuildNumber()
+ contentPane.setPadding(10);
+
+ HTMLPane htmlPane = new HTMLPane();
+ String html = "<span class=\"DisplaySubhead\">\n" + " <a href=\"" + productInfo.getUrl() + "\" title=\""
+ + productInfo.getFullName() + " " + productInfo.getUrl() + "\" target=\"_blank\">"
+ + productInfo.getFullName() + "</a>\n" + "</span><br/>\n" + "<span class=\"DisplayLabel\">"
+ + MSG.view_aboutBox_version() + " " + productInfo.getVersion() + "</span><br/>\n"
+ + "<span class=\"DisplayLabel\">" + MSG.view_aboutBox_buildNumber() + " " + productInfo.getBuildNumber()
+ "</span><p/>\n" + "<span class=\"DisplayLabel\">GWT " + MSG.common_title_version() + ": "
+ MSG.common_buildInfo_gwtVersion() + "</span><br/>\n" + "<span class=\"DisplayLabel\">SmartGWT "
+ MSG.common_title_version() + ": " + Version.getVersion() + "</span><br/>\n"
@@ -116,17 +89,19 @@ public class AboutModalWindow extends LocatableWindow {
+ " <img height=\"55\" alt=\"" + MSG.view_aboutBox_jbossByRedHat()
+ "\" src=\"/images/jboss_logo.png\">\n" + "</a></p>\n" + "<div style=\"top-margin: 10px\">"
+ MSG.view_aboutBox_allRightsReserved() + "</div>\n";
- htmlFlow.setContents(html);
- contentPane.addMember(htmlFlow);
+ htmlPane.setContents(html);
+ htmlPane.setHeight(220);
+ contentPane.addMember(htmlPane);
LocatableHLayout buttonBar = new LocatableHLayout(contentPane.extendLocatorId("ButtonBar"));
+ buttonBar.setHeight(30);
buttonBar.setAlign(Alignment.RIGHT);
LocatableIButton closeButton = new LocatableIButton(buttonBar.extendLocatorId("Close"),
MSG.common_button_close());
closeButton.setShowRollOver(true);
closeButton.setShowDown(true);
- closeButton.setWidth("60");
+ closeButton.setWidth(60);
closeButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
hide();
@@ -143,4 +118,5 @@ public class AboutModalWindow extends LocatableWindow {
// Layout class.
addItem(contentPane);
}
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
index 7d0ec7a..424b256 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2009 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -45,6 +45,7 @@ import com.smartgwt.client.widgets.tab.events.TabSelectedEvent;
import com.smartgwt.client.widgets.tab.events.TabSelectedHandler;
import org.rhq.core.domain.authz.Permission;
+import org.rhq.core.domain.common.ProductInfo;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.criteria.DashboardCriteria;
import org.rhq.core.domain.dashboard.Dashboard;
@@ -361,21 +362,32 @@ public class DashboardsView extends LocatableVLayout implements DashboardContain
dashboard.setColumnWidths("32%");
dashboard.getConfiguration().put(new PropertySimple(Dashboard.CFG_BACKGROUND, "#F1F2F3"));
+ ProductInfo productInfo = CoreGUI.get().getProductInfo();
+ boolean isRHQ = (productInfo != null) && "RHQ".equals(productInfo.getShortName());
+
// Left Column
- DashboardPortlet welcome = new DashboardPortlet(MessagePortlet.NAME, MessagePortlet.KEY, 250);
- dashboard.addPortlet(welcome, 0, 0);
+ int columnIndex = 0;
+ int rowIndex = 0;
+
+ if (isRHQ) {
+ DashboardPortlet welcome = new DashboardPortlet(MessagePortlet.NAME, MessagePortlet.KEY, 250);
+ dashboard.addPortlet(welcome, columnIndex, rowIndex++);
+ }
DashboardPortlet summary = new DashboardPortlet(InventorySummaryPortlet.NAME, InventorySummaryPortlet.KEY, 250);
- dashboard.addPortlet(summary, 0, 1);
+ dashboard.addPortlet(summary, columnIndex, rowIndex++);
DashboardPortlet news = new DashboardPortlet(MashupPortlet.NAME, MashupPortlet.KEY, 300);
news.getConfiguration().put(
new PropertySimple("address", "http://rhq-project.org/display/RHQ/RHQ+News?decorator=popup"));
- dashboard.addPortlet(news, 0, 2);
+ dashboard.addPortlet(news, columnIndex, rowIndex++);
// Right Column
+ columnIndex = 1;
+ rowIndex = 0;
+
DashboardPortlet recentAlerts = new DashboardPortlet(RecentAlertsPortlet.NAME, RecentAlertsPortlet.KEY, 250);
- dashboard.addPortlet(recentAlerts, 1, 0);
+ dashboard.addPortlet(recentAlerts, columnIndex, rowIndex++);
DashboardPortlet problemResources = new DashboardPortlet(ProblemResourcesPortlet.NAME,
ProblemResourcesPortlet.KEY, 250);
@@ -388,11 +400,11 @@ public class DashboardsView extends LocatableVLayout implements DashboardContain
.put(
new PropertySimple(ProblemResourcesPortlet.PROBLEM_RESOURCE_SHOW_HRS,
ProblemResourcesPortlet.defaultValue));
- dashboard.addPortlet(problemResources, 1, 1);
+ dashboard.addPortlet(problemResources, columnIndex, rowIndex++);
DashboardPortlet operations = new DashboardPortlet(OperationHistoryPortlet.NAME, OperationHistoryPortlet.KEY,
200);
- dashboard.addPortlet(operations, 1, 2);
+ dashboard.addPortlet(operations, columnIndex, rowIndex++);
return dashboard;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
index 22a0c13..8f4df4b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -26,7 +26,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.MissingResourceException;
-import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.Label;
@@ -41,7 +40,6 @@ import org.rhq.enterprise.gui.coregui.client.components.view.NavigationItem;
import org.rhq.enterprise.gui.coregui.client.components.view.NavigationSection;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewFactory;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewName;
-import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/**
@@ -96,20 +94,8 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
"[SKIN]/../actions/help.png", new ViewFactory() {
public Canvas createView() {
final AboutModalWindow aboutModalWindow = new AboutModalWindow(extendLocatorId("AboutModalWindow"));
- if (PRODUCT_INFO == null) {
- GWTServiceLookup.getSystemService().getProductInfo(new AsyncCallback<ProductInfo>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(MSG.view_aboutBox_failedToLoad(), caught);
- }
-
- public void onSuccess(ProductInfo result) {
- PRODUCT_INFO = result;
- aboutModalWindow.setTitle(MSG.view_aboutBox_title(PRODUCT_INFO.getFullName()));
- }
- });
- } else {
- aboutModalWindow.setTitle(MSG.view_aboutBox_title(PRODUCT_INFO.getFullName()));
- }
+ ProductInfo productInfo = CoreGUI.get().getProductInfo();
+ aboutModalWindow.setTitle(MSG.view_aboutBox_title(productInfo.getFullName()));
aboutModalWindow.show();
return aboutModalWindow;
}
commit 6f0df962341bc372463d2b2444a8626b0f472985
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Sep 1 15:55:25 2011 -0400
Fixing syntax error
diff --git a/publish_release.sh b/publish_release.sh
index 3a12b7a..2be9db9 100755
--- a/publish_release.sh
+++ b/publish_release.sh
@@ -219,7 +219,7 @@ export LANG
echo
echo "========================== Environment Variables =============================="
echo "JAVA_HOME=$JAVA_HOME"
-[ "$RELEASE_TYPE" = "enterprise" ]"
+[ "$RELEASE_TYPE" = "enterprise" ]
#[ "$RELEASE_TYPE" = "enterprise" ] && echo "JAVA5_HOME=$JAVA5_HOME"
echo "M2_HOME=$M2_HOME"
echo "MAVEN_OPTS=$MAVEN_OPTS"
commit 723ed5e890b66339daa4a20170afcea4343629dd
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Sep 1 13:30:39 2011 -0400
[BZ 608798, 608803] changes to LoginView and MenuBarView to allow RHQ logos to
be replaced with JON logos, even if the JON logo images are not the same width
and height as the RHQ logo images
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
index 5e915c6..c5b8f43 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
@@ -35,6 +35,7 @@ import com.google.gwt.http.client.URL;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.FormErrorOrientation;
+import com.smartgwt.client.types.ImageStyle;
import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.HTMLFlow;
import com.smartgwt.client.widgets.IButton;
@@ -119,9 +120,16 @@ public class LoginView extends LocatableCanvas {
form.setShowErrorText(true);
form.setErrorOrientation(FormErrorOrientation.BOTTOM);
+ // NOTE: This image will either be an RHQ logo or a JON logo.
+ Img logoImg = new Img("header/rhq_logo_28px.png");
+ // NOTE: Don't explicitly specify a width, so the width will be scaled proportionally to the height.
+ logoImg.setImageType(ImageStyle.NORMAL);
+ logoImg.setImageHeight(40);
+
CanvasItem logo = new CanvasItem();
- logo.setCanvas(new Img("header/rhq_logo_28px.png", 80, 28));
logo.setShowTitle(false);
+ logo.setHeight(logoImg.getImageHeight() + 4);
+ logo.setCanvas(logoImg);
HeaderItem header = new HeaderItem();
header.setValue(MSG.view_login_prompt());
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
index 5687c75..6a614bb 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
@@ -20,6 +20,7 @@ package org.rhq.enterprise.gui.coregui.client.components;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.Version;
+import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.Button;
@@ -99,12 +100,12 @@ public class AboutModalWindow extends LocatableWindow {
private void finishOnInit() {
LocatableVLayout contentPane = new LocatableVLayout(extendLocatorId("Content"));
- contentPane.setPadding(15);
+ contentPane.setPadding(13);
contentPane.setMembersMargin(25);
HTMLFlow htmlFlow = new HTMLFlow();
String html = "<span class=\"DisplaySubhead\">\n" + " <a href=\"" + PRODUCT_INFO.getUrl() + "\" title=\""
- + PRODUCT_INFO.getFullName() + " " + MSG.view_aboutBox_homepage() + "\" target=\"_blank\">"
+ + PRODUCT_INFO.getFullName() + " " + PRODUCT_INFO.getUrl() + "\" target=\"_blank\">"
+ PRODUCT_INFO.getFullName() + "</a>\n" + "</span><br/>\n" + "<span class=\"DisplayLabel\">"
+ MSG.view_aboutBox_version() + " " + PRODUCT_INFO.getVersion() + "</span><br/>\n"
+ "<span class=\"DisplayLabel\">" + MSG.view_aboutBox_buildNumber() + " " + PRODUCT_INFO.getBuildNumber()
@@ -119,12 +120,7 @@ public class AboutModalWindow extends LocatableWindow {
contentPane.addMember(htmlFlow);
LocatableHLayout buttonBar = new LocatableHLayout(contentPane.extendLocatorId("ButtonBar"));
- buttonBar.setAlign(VerticalAlignment.BOTTOM);
- contentPane.addMember(buttonBar);
-
- Canvas spacer = new Canvas();
- spacer.setWidth("*");
- buttonBar.addMember(spacer);
+ buttonBar.setAlign(Alignment.RIGHT);
LocatableIButton closeButton = new LocatableIButton(buttonBar.extendLocatorId("Close"),
MSG.common_button_close());
@@ -138,6 +134,11 @@ public class AboutModalWindow extends LocatableWindow {
});
buttonBar.addMember(closeButton);
+ VLayout bottom = new VLayout();
+ bottom.setAlign(VerticalAlignment.BOTTOM);
+ bottom.addMember(buttonBar);
+ contentPane.addMember(bottom);
+
// NOTE: Since this is a subclass of Window, we MUST use addItem(), rather than addMember() from the
// Layout class.
addItem(contentPane);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
index f138f6a..3bd11d2 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
@@ -22,6 +22,8 @@ import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.user.client.History;
import com.smartgwt.client.types.Alignment;
+import com.smartgwt.client.types.ImageStyle;
+import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.Img;
@@ -99,13 +101,22 @@ public class MenuBarView extends LocatableVLayout {
private Canvas getLogoSection() {
final AboutModalWindow aboutModalWindow = new AboutModalWindow(extendLocatorId("AboutModalWindow"));
- Img logo = new Img("header/rhq_logo_28px.png", 80, 28);
+ HLayout logoSection = new HLayout();
+ logoSection.setOverflow(Overflow.VISIBLE);
+
+ // NOTE: This image will either be an RHQ logo or a JON logo.
+ Img logo = new Img("header/rhq_logo_28px.png");
+ // NOTE: Don't explicitly specify a width, so the width will be scaled proportionally to the height.
+ logo.setImageType(ImageStyle.NORMAL);
+ logo.setImageHeight(28);
logo.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
aboutModalWindow.show();
}
});
- return logo;
+
+ logoSection.addMember(logo);
+ return logoSection;
}
private Canvas getLinksSection() {
commit 8b92144361a72e581ed0106c56e848bb7a0a7415
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Sep 1 12:37:01 2011 -0500
BZ684320 - Updated permissions only for the zip archives of server and agent to 744.
diff --git a/modules/enterprise/agent/ant-run.xml b/modules/enterprise/agent/ant-run.xml
index 384e283..418009d 100644
--- a/modules/enterprise/agent/ant-run.xml
+++ b/modules/enterprise/agent/ant-run.xml
@@ -211,7 +211,7 @@ Ant Script that provides ways to package the Agent.
<delete file="${basedir}/target/rhq-enterprise-agent-${project.version}.zip" />
<zip destfile="${basedir}/target/rhq-enterprise-agent-${project.version}.zip" >
<!-- The zip task does not mantain file permissions, we have to make sure they are set here -->
- <zipfileset dir="${basedir}/target">
+ <zipfileset dir="${basedir}/target" filemode="744" dirmode="744">
<include name="rhq-agent/**"/>
<exclude name="rhq-agent/bin/*.sh"/>
<exclude name="rhq-agent/lib/*.so"/>
@@ -220,7 +220,7 @@ Ant Script that provides ways to package the Agent.
<exclude name="rhq-agent/lib/*.dylib"/>
<exclude name="rhq-agent/lib/augeas/**" />
</zipfileset>
- <zipfileset dir="${basedir}/target" filemode="755">
+ <zipfileset dir="${basedir}/target" filemode="755" dirmode="744">
<include name="rhq-agent/bin/*.sh"/>
<include name="rhq-agent/lib/*.so"/>
<include name="rhq-agent/lib/*.sl"/>
diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml
index d27c157..42cc43c 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -8,7 +8,7 @@
<version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
-
+
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-container</artifactId>
<packaging>pom</packaging>
@@ -250,6 +250,10 @@
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
+ <archiverConfig>
+ <!-- permissions for archiver configuration are in decimal (not octal) -->
+ <defaultDirectoryMode>484</defaultDirectoryMode>
+ </archiverConfig>
<descriptors>
<descriptor>src/main/scripts/rhq-container.assembly.xml</descriptor>
</descriptors>
diff --git a/modules/enterprise/server/container/src/main/scripts/rhq-container.assembly.xml b/modules/enterprise/server/container/src/main/scripts/rhq-container.assembly.xml
index a6dbf98..816ab0d 100644
--- a/modules/enterprise/server/container/src/main/scripts/rhq-container.assembly.xml
+++ b/modules/enterprise/server/container/src/main/scripts/rhq-container.assembly.xml
@@ -20,8 +20,10 @@
<exclude>**/*.sl</exclude>
<exclude>**/*.dylib</exclude>
</excludes>
+ <fileMode>0744</fileMode>
+ <directoryMode>0744</directoryMode>
</fileSet>
- <fileSet>
+ <fileSet>
<directory>${project.build.outputDirectory}</directory>
<outputDirectory>/</outputDirectory>
<includes>
@@ -30,7 +32,8 @@
<include>**/*.sl</include>
<include>**/*.dylib</include>
</includes>
- <fileMode>0755</fileMode>
+ <fileMode>0744</fileMode>
+ <directoryMode>0744</directoryMode>
</fileSet>
</fileSets>
</assembly>
\ No newline at end of file
commit 153c9845c2ac28079b9629b4cc445d7eccca8901
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Sep 1 10:11:40 2011 -0400
[BZ 734879 - Drift display issue ... Change Sets-->Context Menu--->Details]
Even if the table view is not visible, it may not be hidden. Instead, it
may be the case that its parent (the encompassing Table/HLayout) may not
be visible. This is unusual because typically we switch between the table
and detail view while under the subtab, but if we navigate to the detail
view from another subtab (for example, the drift tree context
menu) the Table may not be visible and the table view may not be hidden.
To make a long story short, ensure the table view is hidden when
displaying the details view.
- Also, convert History,newItem occurrences in BackButton and
StringIdTableSection to CoreGUI.gotToView. We should not be using
History.newItem in most places because it bypasses some view processing
we do in goToView prior to calling History.newItem. I see more
occurrences of this but will hold off changing until after the pending
release.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/buttons/BackButton.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/buttons/BackButton.java
index 7054d2e..aaa6688 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/buttons/BackButton.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/buttons/BackButton.java
@@ -22,10 +22,10 @@
*/
package org.rhq.enterprise.gui.coregui.client.components.buttons;
-import com.google.gwt.user.client.History;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableStretchImgButton;
/**
@@ -43,7 +43,7 @@ public class BackButton extends LocatableStretchImgButton {
setTitle("<b>" + title + "</b>");
addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
- History.newItem((anchor.startsWith("#")) ? anchor.substring(1) : anchor);
+ CoreGUI.goToView(anchor);
}
});
setAutoFit(true);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/AbstractTableSection.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/AbstractTableSection.java
index 8c4ee37..2ccfb53 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/AbstractTableSection.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/AbstractTableSection.java
@@ -329,6 +329,7 @@ public abstract class AbstractTableSection<DS extends RPCDataSource, ID> extends
// If the Table has not yet been initialized then ignore
if (contents != null) {
+ // If the table view is visible then gracefully switch to the details view.
if (contents.isVisible()) {
contents.animateHide(AnimationEffect.WIPE, new AnimationCallback() {
@Override
@@ -337,6 +338,14 @@ public abstract class AbstractTableSection<DS extends RPCDataSource, ID> extends
}
});
} else {
+ // Even if the table view is not visible, it may not be hidden. Instead, it may be the
+ // case that its parent (the encompassing Table/HLayout) may not be visible. This is unusual
+ // because typically we switch between the table and detail view while under the subtab, but
+ // if we navigate to the detail view from another subtab (for example, the drift tree context
+ // menu) the Table may not be visible and the table view may not be hidden. To make a long
+ // story short, ensure the table view is hidden when displaying the details view.
+ contents.hide();
+
/*
* if the programmer chooses to go directly from the detailView in create-mode to the
* detailsView in edit-mode, the content canvas will already be hidden, which means the
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/StringIDTableSection.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/StringIDTableSection.java
index 1c5a333..1235751 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/StringIDTableSection.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/StringIDTableSection.java
@@ -19,7 +19,6 @@
package org.rhq.enterprise.gui.coregui.client.components.table;
-import com.google.gwt.user.client.History;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.data.SortSpecifier;
import com.smartgwt.client.widgets.Canvas;
@@ -38,6 +37,7 @@ import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
*
* @author John Mazzitelli
*/
+@SuppressWarnings("unchecked")
public abstract class StringIDTableSection<DS extends RPCDataSource> extends AbstractTableSection<DS, String> {
public StringIDTableSection(String locatorId, String tableTitle, boolean autoFetchData) {
@@ -93,7 +93,7 @@ public abstract class StringIDTableSection<DS extends RPCDataSource> extends Abs
@Override
public void showDetails(String id) {
if (id != null && id.length() > 0) {
- History.newItem(getBasePath() + "/" + convertIDToCurrentViewPath(id));
+ CoreGUI.goToView(getBasePath() + "/" + convertIDToCurrentViewPath(id));
} else {
String msg = MSG.view_tableSection_error_badId(this.getClass().toString(), (id == null) ? "null" : id
.toString());
commit b6125949237abceab2abd2fcee70f339f12c4fa6
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Aug 31 22:33:19 2011 -0400
[BZ 734881] Need to check for empty content because oracle blobs don't handle it
When a file is empty we still persist a row for it in rhq_drift_file.
The blob is set to null. This works fine on postgresql, but results in
the NPE reported in BZ 734881. To work around this, we now check the
size which is also stored in the rhq_drift_file table, and if the size
is zero, DriftManagerBean.getDriftFileContent just returns an empty
stream instead of opening an input stream on the blob.
This required one additional change. We previously were not storing the
size in rhq_drift_file. I have updated
JPADriftServerBean.persistDriftFileData to save the size now as well.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
index daa7a68..16e0d73 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
@@ -211,12 +211,13 @@ public class JPADriftServerBean implements JPADriftServerLocal {
@Override
@TransactionAttribute(REQUIRES_NEW)
- public void persistDriftFileData(JPADriftFile driftFile, InputStream data) throws Exception {
+ public void persistDriftFileData(JPADriftFile driftFile, InputStream data, long numBytes) throws Exception {
JPADriftFileBits df = entityManager.find(JPADriftFileBits.class, driftFile.getHashId());
if (null == df) {
throw new IllegalArgumentException("JPADriftFile not found [" + driftFile.getHashId() + "]");
}
+ df.setDataSize(numBytes);
df.setData(Hibernate.createBlob(new BufferedInputStream(data)));
df.setStatus(LOADED);
}
@@ -377,7 +378,7 @@ public class JPADriftServerBean implements JPADriftServerLocal {
for (File file : dir.listFiles()) {
JPADriftFile driftFile = new JPADriftFile(file.getName());
try {
- JPADriftServer.persistDriftFileData(driftFile, new FileInputStream(file));
+ JPADriftServer.persistDriftFileData(driftFile, new FileInputStream(file), file.length());
} catch (Exception e) {
LogFactory.getLog(getClass()).info("Skipping bad drift file", e);
}
@@ -400,6 +401,9 @@ public class JPADriftServerBean implements JPADriftServerLocal {
try {
JPADriftFileBits content = (JPADriftFileBits) entityManager.createNamedQuery(
JPADriftFileBits.QUERY_FIND_BY_ID).setParameter("hashId", hash).getSingleResult();
+ if (content.getDataSize() == null || content.getDataSize() < 1) {
+ return "";
+ }
byte[] bytes = StreamUtil.slurp(content.getBlob().getBinaryStream());
return new String(bytes);
} catch (SQLException e) {
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerLocal.java
index 7142ead..9da1a5b 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerLocal.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerLocal.java
@@ -85,7 +85,7 @@ public interface JPADriftServerLocal {
* @param data
* @throws Exception
*/
- void persistDriftFileData(JPADriftFile driftFile, InputStream data) throws Exception;
+ void persistDriftFileData(JPADriftFile driftFile, InputStream data, long numBytes) throws Exception;
/**
* This method stores the provided change-set file for the resource. The version will be incremented based
commit 59387081b9bf66be0970958473d8cc52debae774
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Aug 31 17:33:18 2011 -0400
[BZ 734610] remove validator on username field that was disallowing usernames
less than 6 characters long (https://bugzilla.redhat.com/show_bug.cgi?id=734610)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
index b0d418f..5e915c6 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -55,7 +55,6 @@ import com.smartgwt.client.widgets.form.fields.SubmitItem;
import com.smartgwt.client.widgets.form.fields.TextItem;
import com.smartgwt.client.widgets.form.fields.events.KeyPressEvent;
import com.smartgwt.client.widgets.form.fields.events.KeyPressHandler;
-import com.smartgwt.client.widgets.form.validator.LengthRangeValidator;
import com.smartgwt.client.widgets.form.validator.RegExpValidator;
import com.smartgwt.client.widgets.layout.HStack;
@@ -495,16 +494,6 @@ public class LoginView extends LocatableCanvas {
for (FormItem item : form.getFields()) {
String name = item.getName();
if ((name != null) && (!name.isEmpty())) {
- if (name.equals(USERNAME)) {
- LengthRangeValidator validator = new LengthRangeValidator();
- validator.setMin(6);
- item.setValidators(validator);
- }
- if (name.equals(FIRST)) {
- LengthRangeValidator validator = new LengthRangeValidator();
- validator.setMin(1);
- item.setValidators(validator);
- }
if (name.equals(EMAIL)) {
RegExpValidator emailValidator = new RegExpValidator();
emailValidator.setErrorMessage(MSG.view_login_invalidEmail());
commit f4fdec760496263f02cba9e1e713f124e597a83b
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Aug 31 17:18:11 2011 -0400
[BZ 722548] add new #Test/Rpc view that can be used to invoke a new sleep() RPC
method that sleeps for a specified number of seconds; increase default RPC
timeout from 10s to 30s; use custom timeouts for autodiscovery queue,
config history list, group schedules list views, which may exceed even the new
default timeout (https://bugzilla.redhat.com/show_bug.cgi?id=722548)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
index 8f5dbc1..c516592 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -58,6 +58,10 @@ public class GWTServiceLookup {
return secure(ConfigurationGWTServiceAsync.Util.getInstance());
}
+ public static ConfigurationGWTServiceAsync getConfigurationService(int timeout) {
+ return secure(ConfigurationGWTServiceAsync.Util.getInstance(), timeout);
+ }
+
public static DriftGWTServiceAsync getDriftService() {
return secure(DriftGWTServiceAsync.Util.getInstance());
}
@@ -190,6 +194,10 @@ public class GWTServiceLookup {
return secure(AgentGWTServiceAsync.Util.getInstance());
}
+ public static TestGWTServiceAsync getTestService() {
+ return secure(TestGWTServiceAsync.Util.getInstance());
+ }
+
@SuppressWarnings("unchecked")
private static <T> T secure(Object sdt) {
return (T) secure(sdt, -1);
@@ -208,7 +216,8 @@ public class GWTServiceLookup {
public static class SessionRpcRequestBuilder extends RpcRequestBuilder {
private static int DEBUG_TIMEOUT_FUDGE_FACTOR = 30000;
- private static int DEFAULT_RPC_TIMEOUT = 10000;
+ private static int DEFAULT_RPC_TIMEOUT = 30000;
+
private int timeout;
public SessionRpcRequestBuilder(int timeout) {
@@ -221,7 +230,7 @@ public class GWTServiceLookup {
this.timeout = (timeout <= 0) ? DEFAULT_RPC_TIMEOUT : timeout;
}
- if (CoreGUI.isDebugMode()) {
+ if (CoreGUI.isDebugMode() && (this.timeout != 0)) {
// debug mode is slow, so give requests more time to complete otherwise you'll get
// weird exceptions whose messages are extremely unhelpful in finding root cause
this.timeout += DEBUG_TIMEOUT_FUDGE_FACTOR;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TestGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TestGWTService.java
new file mode 100644
index 0000000..168edfa
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TestGWTService.java
@@ -0,0 +1,34 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 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.enterprise.gui.coregui.client.gwt;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+
+/**
+ * @author Ian Springer
+ */
+public interface TestGWTService extends RemoteService {
+
+ void sleep(int seconds) throws RuntimeException;
+
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java
index 1f4d491..c21484d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2010 Red Hat, Inc.
+ * Copyright (C) 2010-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -43,7 +43,10 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message;
* @author Ian Springer
*/
public class SchedulesDataSource extends AbstractMeasurementScheduleCompositeDataSource {
- private MeasurementDataGWTServiceAsync measurementService = GWTServiceLookup.getMeasurementDataService();
+
+ // Specify 60s timeout to compensate for schedule updates taking a long time for large groups.
+ // TODO (ips, 08/31/11): Remove this once updating of group schedules has been optimized.
+ private MeasurementDataGWTServiceAsync measurementService = GWTServiceLookup.getMeasurementDataService(60 * 1000);
private int resourceGroupId;
public SchedulesDataSource(int resourceGroupId) {
@@ -157,4 +160,5 @@ public class SchedulesDataSource extends AbstractMeasurementScheduleCompositeDat
}
});
}
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryDataSource.java
index b92fb94..9991f9c 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryDataSource.java
@@ -78,7 +78,9 @@ public abstract class AbstractConfigurationHistoryDataSource<T extends AbstractR
public static final String RESOURCE_ID = "resourceId";
}
- private ConfigurationGWTServiceAsync configurationService = GWTServiceLookup.getConfigurationService();
+ // Specify 60s timeout to compensate for Configurations being fetched for all of the config updates.
+ // TODO (ips, 08/31/11): Remove this once fetching of Configurations has been disabled.
+ private ConfigurationGWTServiceAsync configurationService = GWTServiceLookup.getConfigurationService(60 * 1000);
protected ConfigurationGWTServiceAsync getConfigurationService() {
return this.configurationService;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/AutodiscoveryQueueDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/AutodiscoveryQueueDataSource.java
index 6769b9c..cccc08a 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/AutodiscoveryQueueDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/AutodiscoveryQueueDataSource.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -65,7 +65,11 @@ public class AutodiscoveryQueueDataSource extends DataSource {
private int unlimited = -1;
private int maximumPlatformsToDisplay = -1;
- private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService(1000000);
+
+ // Specify 60s timeout to compensate for slow loading of this view due to lack of paging of results.
+ // TODO (ips, 08/31/11): Remove this once paging has been implemented.
+ private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService(60 * 1000);
+
private PermissionsLoader permissionsLoader = new PermissionsLoader();
private TreeGrid dataContainerReference = null;
private static final Permission MANAGE_INVENTORY = Permission.MANAGE_INVENTORY;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java
index 4daa3c6..9b0cfe3 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java
@@ -79,7 +79,14 @@ public class ResourceAutodiscoveryView extends LocatableVLayout implements Refre
// This allows the selection handler to ignore selection changes initiated by us, as opposed to by the user.
private boolean selectionChangedHandlerDisabled;
- private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService(1000000);
+ private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService();
+
+ // Specify 3m timeout to compensate for import taking a long time for a large number of Resources.
+ // TODO (ips, 08/31/11): Remove this once import has been refactored to be partially asynchronous, i.e. where the
+ // call to importResources() flips all the Resources to a new COMMITTING inventory status
+ // and then kicks off a background job to do the actual work of committing (syncing to
+ // Agents, etc.).
+ private ResourceGWTServiceAsync importResourceService = GWTServiceLookup.getResourceService(3 * 60 * 1000);
public ResourceAutodiscoveryView(String locatorId) {
super(locatorId);
@@ -317,11 +324,14 @@ public class ResourceAutodiscoveryView extends LocatableVLayout implements Refre
importButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
disableButtons(selectAllButton, deselectAllButton, importButton, ignoreButton, unignoreButton);
+ // TODO (ips): Make the below message sticky, but add a new ClearSticky Message option that the
+ // below callback methods can use to clear it once the importResources() call has
+ // completed.
CoreGUI.getMessageCenter().notify(
new Message(MSG.view_autoDiscoveryQ_importInProgress(), Message.Severity.Info, EnumSet
.of(Message.Option.Transient)));
- resourceService.importResources(getSelectedIds(), new AsyncCallback<Void>() {
+ importResourceService.importResources(getSelectedIds(), new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError(MSG.view_autoDiscoveryQ_importFailure(), caught);
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestRpcView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestRpcView.java
new file mode 100644
index 0000000..b3c333f
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestRpcView.java
@@ -0,0 +1,52 @@
+package org.rhq.enterprise.gui.coregui.client.test;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.ButtonItem;
+import com.smartgwt.client.widgets.form.fields.FormItem;
+import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
+import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.gwt.TestGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
+
+/**
+ * @author Ian Springer
+ */
+public class TestRpcView extends LocatableVLayout {
+
+ public TestRpcView(String locatorId) {
+ super(locatorId);
+ setMargin(10);
+
+ DynamicForm form = new DynamicForm();
+ form.setWidth(400);
+
+ final FormItem item = new FormItem("seconds");
+ item.setTitle("Seconds to sleep");
+ item.setRequired(true);
+
+ ButtonItem button = new ButtonItem("execute", "Execute");
+ button.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent event) {
+ TestGWTServiceAsync testService = GWTServiceLookup.getTestService();
+ final int seconds = Integer.valueOf((String)item.getValue());
+ testService.sleep(seconds, new AsyncCallback<Void>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("sleep(" + seconds + ") RPC call failed.", caught);
+ }
+
+ public void onSuccess(Void result) {
+ CoreGUI.getMessageCenter().notify(new Message("sleep(" + seconds + ") RPC completed."));
+ }
+ });
+ }
+ });
+ form.setItems(item, button);
+
+ addMember(form);
+ }
+
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java
index 58a6cd6..a9e131b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java
@@ -79,6 +79,7 @@ public class TestTopView extends AbstractSectionedLeftNavigationView {
private static final ViewName MISC_SECTION_VIEW_ID = new ViewName("Misc");
private static final ViewName PAGE_PLURALIZATION_TEST = new ViewName("PluralizationTest");
private static final ViewName PAGE_ASYNC = new ViewName("Async");
+ private static final ViewName PAGE_RPC = new ViewName("Rpc");
public TestTopView() {
// This is a top level view, so our locator id can simply be our view id.
@@ -235,7 +236,13 @@ public class TestTopView extends AbstractSectionedLeftNavigationView {
}
});
- return new NavigationSection(MISC_SECTION_VIEW_ID, pluralizationItem, asyncItem);
+ NavigationItem rpcItem = new NavigationItem(PAGE_RPC, null, new ViewFactory() {
+ public Canvas createView() {
+ return new TestRpcView(extendLocatorId(PAGE_RPC.getName()));
+ }
+ });
+
+ return new NavigationSection(MISC_SECTION_VIEW_ID, pluralizationItem, asyncItem, rpcItem);
}
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TestGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TestGWTServiceImpl.java
new file mode 100644
index 0000000..8f9a518
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TestGWTServiceImpl.java
@@ -0,0 +1,43 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 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.enterprise.gui.coregui.server.gwt;
+
+import org.rhq.enterprise.gui.coregui.client.gwt.TestGWTService;
+
+/**
+ * @author Ian Springer
+ */
+public class TestGWTServiceImpl extends AbstractGWTServiceImpl implements TestGWTService {
+
+ private static final long serialVersionUID = 1L;
+
+ public void sleep(int seconds) throws RuntimeException {
+ try {
+ Thread.sleep(seconds * 1000);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw getExceptionToThrowToClient(e);
+ }
+ }
+
+}
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
index c4943ed..ebc12f5 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
+++ b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
@@ -161,6 +161,10 @@
<servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI DriftGWTService</servlet-name>
<servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.DriftGWTServiceImpl</servlet-class>
</servlet>
+ <servlet>
+ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI TestGWTService</servlet-name>
+ <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.TestGWTServiceImpl</servlet-class>
+ </servlet>
<servlet-mapping>
@@ -311,6 +315,10 @@
<servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI DriftGWTService</servlet-name>
<url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/DriftGWTService</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI TestGWTService</servlet-name>
+ <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/TestGWTService</url-pattern>
+ </servlet-mapping>
<welcome-file-list>
commit 3bcea7dc24cf65119b17b2f19a95e21777980082
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Aug 31 14:25:07 2011 -0400
[BZ 734814] Adding docs
diff --git a/modules/enterprise/remoting/cli/src/main/samples/drift.js b/modules/enterprise/remoting/cli/src/main/samples/drift.js
index 5a1e6e0a..ff7c31a 100644
--- a/modules/enterprise/remoting/cli/src/main/samples/drift.js
+++ b/modules/enterprise/remoting/cli/src/main/samples/drift.js
@@ -1,10 +1,64 @@
-// This script has a dependency on rhq/etc/cl-scripts/util.js. The following
-// command needs to be run in order to load the functions in util.js:
-//
-// exec -f /path/to/rhq/etc/cli-scripts/util.js
-//
-// Then the same exec command can be run to load functions in this script.
+/**
+ * file: drift.js
+ *
+ * description: This script contains functions that illustrate and highlight
+ * drift monitoring functionality. Some of the functionality demonstrated in
+ * this script is currently available only via RHQ's remote client (and CLI)
+ * at the time of this writing. This script has a dependency on util.js. To
+ * load this script's functions into your CLI session execute the following
+ * from the CLI shell,
+ *
+ * $ login <username> <password>
+ * $ exec -f samples/util.js
+ * $ exec -f samples/drift.js
+ *
+ * Note that you must login before you can load the scripts. Also please note
+ * that if a function is not documented, then it is not intended for public
+ * use. It is used only as an internal helper function.
+ *
+ * author: jsanda(a)redhat.com
+ */
+/**
+ * description: Generates a snapshot of changes sets belonging to a particular
+ * drift configuration of a specific resource. By default all change sets are
+ * included in the snapshot. An optional third argument can be specified to
+ * limit or control the number of change sets included in the snapshot.
+ *
+ * Note that a snapshot is an accumulation or aggregation of change sets that
+ * provides a view of a resource, or more precisely, all files being monitored
+ * for drift, at a particular version or point in time.
+ *
+ * arguments:
+ * rid: A resource id, expected to be an integer
+ *
+ * cname: The drift configuration name as a string
+ *
+ * filters: (optional) A map or JS object that limits the number of
+ * change sets included in the snapshot
+ *
+ * return: A org.rhq.core.domamin.drift.DriftSnapshot object
+ *
+ * usage:
+ * // generates a snapshot that includes all change sets belonging to the
+ * // mydrift drift configuration.
+ * createSnapshot(123, 'mydrift')
+ *
+ * // generates a snapshot starting a change set version 3 and including
+ * // everything more recent than it.
+ * createSnapshot(123, 'mydrift', {"startVersion": 3})
+ *
+ * // generates a snapshot that includes change sets 3 through 5 inclusive.
+ * createSnapshot(123, 'mydrift', {"startVersion": 3, "endVersion": 5})
+ *
+ * // generates a snaphot that includes everything after the specified
+ * // timestamp. Note that the timestamp should be specified in milliseconds.
+ * createSnapshot(123, 'mydrift', {"createdAfter": 1314811734365})
+ *
+ * // generates a snapshot that includes all change sets that were created
+ * // between the two timestamps.
+ * createSnapshot(123, 'mydrift', {"createdAfter": 1314811734365, "createdBefore": 9994811734365})
+ */
function createSnapshot(rid, cname) {
var config = findDriftConfig(rid, function(c) { return cname.equals(c.name) });
@@ -35,6 +89,39 @@ function findDriftConfig(rid, filter) {
});
}
+/**
+ * description: Generates a diff report that is printed to the console. By
+ * default this function generates a snapshot diff. The function expects two
+ * arguments which should be DriftSnapshot objects. A diff between those two
+ * snapshots is generated and printed to the console. A path can be specified
+ * as an optional third argument. If a path is a specified as a third argument,
+ * then a file diff will be performed using the file that matches the path in
+ * each change set. The format will be a unified diff.
+ *
+ * Note that the snapshots can be from the same or from different resources;
+ * however, if they are from different resources, it is assumed that the
+ * resources are of the same type.
+ *
+ * arguments:
+ * s1: A DriftSnapshot object
+ *
+ * s2: A DriftSnapshot object
+ *
+ * path: (optional) A string that specifies a path that exists in both s1 and
+ * s2.
+ *
+ * return: This function does not return a useful value. It may be an empty
+ * string or it could be null. Instead of returns its results, the function
+ * prints them to the CLI console. As such, this function is intended for
+ * use from the interactive CLI shell.
+ *
+ * usage:
+ * // Generates a snapshot diff report
+ * diff(s1, s2)
+ *
+ * // Generates a file diff report in the unified format
+ * diff(s1, s2, 'jboss_home/bin/run.conf')
+ */
function diff(s1, s2) {
var theDiff = s1.diff(s2);
@@ -73,12 +160,40 @@ function diff(s1, s2) {
report('elements not in right', theDiff.elementsNotInRight);
}
+/**
+ * description: Generates and returns the drift history for a file being
+ * monitored for drift. This function takes three arguments. The first two, the
+ * resource id drift configuration name, uniquely identify the drift
+ * configuration. The third argument specifies a path that is set up for
+ * monitoring by the drift configuration.
+ *
+ * arguments:
+ * rid: A resource id
+ *
+ * configName: A drift configuration name
+ *
+ * path: A path that is set up for drift monitoring by the drift
+ * configuration that is identified by the first two arguments. The path
+ * should be specified as relative to the base directory from which
+ * monitoring is done.
+ *
+ * return: A History object, which is a native JS object. This object contains
+ * a few methods for working with the file history:
+ *
+ * list: prints a short summary of all versions of the file
+ * view: returns the contents of a particular version of the file
+ * compare: compares two versions of the file and prints a unified diff
+ *
+ * usage:
+ * $ history = fetchHistory(123, 'mydrift', 'bin/run.conf')
+ * $ history.list() // prints a summary of all versions of 'bin/run.conf'
+ * $ history.view(1) // returns the full contents of version 1 of the file
+ * $ history.compare(1, 2) // generates and prints a unified diff of versions 1 and 2
+ */
function fetchHistory(rid, configName, path) {
function History() {
var entries = [];
- this.echo = function(msg) {println(msg);}
-
function findDrift(version) {
return find(entries, function(drift) {
return drift.changeSet.version == version
@@ -139,26 +254,4 @@ function fetchHistory(rid, configName, path) {
}
return new History();
-
-/*
- var criteria = GenericDriftCriteria();
- criteria.addFilterResourceIds([rid]);
- criteria.fetchChangeSet(true);
- criteria.addFilterPath(path);
-
- var drifts = DriftManager.findDriftsByCriteria(criteria);
- var history = [];
- foreach(drifts, function(drift) {
- if (drift.changeSet.driftConfiguration.name == configName &&
- drift.path == path) {
- history.push(drift);
- }
- });
-
- history.sort(function(d1, d2) {
- return d1.changeSet.version <= d2.changeSet.version
- });
-
- return history;
-*/
}
diff --git a/modules/enterprise/remoting/cli/src/main/samples/util.js b/modules/enterprise/remoting/cli/src/main/samples/util.js
index e0bb219..0369fe8 100644
--- a/modules/enterprise/remoting/cli/src/main/samples/util.js
+++ b/modules/enterprise/remoting/cli/src/main/samples/util.js
@@ -1,4 +1,21 @@
/**
+ * file: util.js
+ *
+ * description: This script contains functions that provide core, low-level
+ * functionality such as iterating over a collection or searching a collection.
+ * This has no other script or library dependencies. To load the functions into
+ * your CLI session execute the following from the CLI shell,
+ *
+ * $ login <username> <password>
+ * $ exec -f samples/util.js
+ *
+ * Note that you must login before you can load the script.
+ *
+ * author: jsanda(a)redhat.com
+ */
+
+
+/**
* If obj is a JS array or a java.util.Collection, each element is passed to
* the callback function. If obj is a java.util.Map, each map entry is passed
* to the callback function as a key/value pair. If obj is none of the
commit 5d4fbbefb4f9ee8767e3fb8e18c87a95bdd80d79
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Aug 31 12:49:03 2011 -0400
[BZ 734842] Adding more detailed logging around drift detection
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java
index 4bffe9e..d2956d3 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java
@@ -243,8 +243,8 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri
@Override
public void detectDrift(int resourceId, DriftConfiguration driftConfiguration) {
- if (log.isDebugEnabled()) {
- log.debug("Received request to schedule drift detection immediately for [resourceId: " + resourceId
+ if (log.isInfoEnabled()) {
+ log.info("Received request to schedule drift detection immediately for [resourceId: " + resourceId
+ ", driftConfigurationId: " + driftConfiguration.getId() + ", driftConfigurationName: "
+ driftConfiguration.getName() + "]");
}
@@ -258,16 +258,41 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri
}
log.debug("Resetting " + schedule + " for immediate detection.");
schedule.resetSchedule();
- schedulesQueue.addSchedule(schedule);
+ boolean queueUpdated = schedulesQueue.addSchedule(schedule);
+
+ if (queueUpdated) {
+ if (log.isDebugEnabled()) {
+ log.debug(schedule + " has been added to " + schedulesQueue + " for immediate detection.");
+ }
+ } else {
+ log.warn("Failed to add " + schedule + " to " + schedulesQueue + " for immediate detection.");
+ }
}
@Override
public void scheduleDriftDetection(int resourceId, DriftConfiguration driftConfiguration) {
- schedulesQueue.addSchedule(new DriftDetectionSchedule(resourceId, driftConfiguration));
+ DriftDetectionSchedule schedule = new DriftDetectionSchedule(resourceId, driftConfiguration);
+ if (log.isInfoEnabled()) {
+ log.info("Scheduling drift detection for " + schedule);
+ }
+ boolean added = schedulesQueue.addSchedule(schedule);
+
+ if (added) {
+ if (log.isDebugEnabled()) {
+ log.debug(schedule + " has been added to " + schedulesQueue);
+ } else {
+ log.warn("Failed to add " + schedule + " to " + schedulesQueue);
+ }
+ }
}
@Override
public boolean requestDriftFiles(int resourceId, Headers headers, List<? extends DriftFile> driftFiles) {
+ if (log.isInfoEnabled()) {
+ log.info("Server is requesting files for [resourceId: " + resourceId + ", driftConfigurationId: " +
+ headers.getDriftCofigurationId() + ", driftConfigurationName: " + headers.getDriftConfigurationName() +
+ "]");
+ }
DriftFilesSender sender = new DriftFilesSender();
sender.setResourceId(resourceId);
sender.setDriftClient(this);
@@ -282,8 +307,8 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri
@Override
public void unscheduleDriftDetection(final int resourceId, final DriftConfiguration driftConfiguration) {
- log.debug("Received request to unschedule drift detection for [resourceId:" + resourceId +
- ", driftConfigurationId:" + driftConfiguration.getId() + ", driftConfigurationName: " +
+ log.info("Received request to unschedule drift detection for [resourceId:" + resourceId +
+ ", driftConfigurationId: " + driftConfiguration.getId() + ", driftConfigurationName: " +
driftConfiguration.getName() + "].");
DriftDetectionSchedule schedule = schedulesQueue.removeAndExecute(resourceId, driftConfiguration,
@@ -298,15 +323,29 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri
}
});
- log.debug("Removed " + schedule + " from the schedule queue.");
+ if (log.isDebugEnabled()) {
+ log.debug("Removed " + schedule + " from the queue " + schedulesQueue);
+ }
}
@Override
public void updateDriftDetection(int resourceId, DriftConfiguration driftConfiguration) {
+ log.info("Received request to update schedule for [resourceId: " + resourceId + ", driftConfigurationId: " +
+ driftConfiguration.getId() + ", driftConfigurationName: " + driftConfiguration.getName() + "]");
DriftDetectionSchedule updatedSchedule = schedulesQueue.update(resourceId, driftConfiguration);
if (updatedSchedule == null) {
updatedSchedule = new DriftDetectionSchedule(resourceId, driftConfiguration);
- schedulesQueue.addSchedule(updatedSchedule);
+ if (log.isInfoEnabled()) {
+ log.info("Adding " + updatedSchedule + " to " + schedulesQueue);
+ }
+ boolean added = schedulesQueue.addSchedule(updatedSchedule);
+ if (added) {
+ if (log.isDebugEnabled()) {
+ log.debug(updatedSchedule + " has been added to " + schedulesQueue);
+ }
+ } else {
+ log.warn("Failed to add " + updatedSchedule + " to " + schedulesQueue);
+ }
}
InventoryManager inventoryMgr = PluginContainer.getInstance().getInventoryManager();
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/ScheduleQueueImpl.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/ScheduleQueueImpl.java
index f944299..003868d 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/ScheduleQueueImpl.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/ScheduleQueueImpl.java
@@ -166,4 +166,25 @@ public class ScheduleQueueImpl implements ScheduleQueue {
lock.writeLock().unlock();
}
}
+
+ @Override
+ public String toString() {
+ try {
+ lock.readLock().lock();
+ if (queue.isEmpty()) {
+ return "ScheduleQueue[]";
+ }
+ StringBuilder buffer = new StringBuilder("ScheduleQueue[");
+ for (DriftDetectionSchedule schedule : queue) {
+ buffer.append(schedule).append(", ");
+ }
+ int end = buffer.length();
+ buffer.delete(end - 2, end);
+ buffer.append("]");
+
+ return buffer.toString();
+ } finally {
+ lock.readLock().unlock();
+ }
+ }
}
commit e7acb51347c550e38c5a35d6a5fbba61e5908110
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Wed Aug 31 18:03:07 2011 +0200
BZ 707669 - Forgot to check in the plugin-container pom that actually fetches the augeas-native as its dependency.
diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml
index 1d12869..5e8397b 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -104,7 +104,8 @@
<dependency>
<groupId>net.augeas</groupId>
<artifactId>augeas-native</artifactId>
- <version>0.7.1.1</version>
+ <version>${augeas.version}</version>
+ <classifier>${augeas.classifier}</classifier>
<type>zip</type>
</dependency>
commit 405c128a92bd65d24dad5ae40b26e2b6bfc12a84
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Wed Aug 31 17:27:43 2011 +0200
BZ 707669 - The bundled native augeas libraries have been bumped to version 0.9.0.
diff --git a/modules/enterprise/agent/ant-run.xml b/modules/enterprise/agent/ant-run.xml
index 20617c5..384e283 100644
--- a/modules/enterprise/agent/ant-run.xml
+++ b/modules/enterprise/agent/ant-run.xml
@@ -12,8 +12,11 @@ Ant Script that provides ways to package the Agent.
<property name="settings.localRepository" location="${user.home}/.m2/repository"/>
<property name="project.version" value="2.0.0-SNAPSHOT"/>
<property name="sigar.version" value="1.6.5.132"/>
- <property name="augeas.version" value="0.7.1.1"/>
- <property name="augeas.zip.version" value="0.7.1"/>
+ <property name="augeas.version" value="0.9.0"/>
+ <property name="augeas.classifier" value="el5"/>
+ <property name="augeas.zip.location" value="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}/"/>
+ <property name="augeas.zip.mask" value="*-${augeas.classifier}.zip"/>
+ <property name="augeas.zip.version" value="0.9.0"/>
<property name="getopt.version" value="1.0.13"/>
<property name="jaxb-api.version" value="2.1"/>
<property name="jaxb-impl.version" value="2.1"/>
@@ -79,8 +82,8 @@ Ant Script that provides ways to package the Agent.
<include name="org/hyperic/sigar-dist/${sigar.version}/sigar-dist-${sigar.version}.zip" />
</fileset>
- <fileset dir="${settings.localRepository}" id="augeas.native.fileset">
- <include name="net/augeas/augeas-native/${augeas.version}/augeas-native-${augeas.version}.zip" />
+ <fileset dir="${augeas.zip.location}" id="augeas.native.fileset">
+ <include name="${augeas.zip.mask}" />
</fileset>
<fileset dir="${settings.localRepository}" id="plugins.fileset">
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index 17690d3..199a996 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -188,6 +188,9 @@ Build-Number=${buildNumber}
<property name="jaxb-impl.version" value="${jaxb-impl.version}" />
<property name="jline.version" value="${jline.version}" />
<property name="augeas.version" value="${augeas.version}" />
+ <property name="augeas.classifier" value="${augeas.classifier}"/>
+ <property name="augeas.zip.location" value="${augeas.zip.location}"/>
+ <property name="augeas.zip.mask" value="${augeas.zip.mask}"/>
<property name="augeas.zip.version" value="${augeas.zip.version}" />
</ant>
</tasks>
diff --git a/modules/integration-tests/apache-plugin-test/pom.xml b/modules/integration-tests/apache-plugin-test/pom.xml
index bba3c06..206a7a7 100644
--- a/modules/integration-tests/apache-plugin-test/pom.xml
+++ b/modules/integration-tests/apache-plugin-test/pom.xml
@@ -198,8 +198,8 @@
<unzip dest="target/itest/lib">
<fileset
- dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}"
- includes="*.zip" />
+ dir="${augeas.zip.location}"
+ includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index 959fa3c..d983b6a 100644
--- a/modules/plugins/aliases/pom.xml
+++ b/modules/plugins/aliases/pom.xml
@@ -114,7 +114,7 @@
<delete dir="target/itest/lib/hyperic-sigar-${sigar.zip.version}" />
<unzip dest="target/itest/lib">
- <fileset dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}" includes="*.zip" />
+ <fileset dir="${augeas.zip.location}" includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index 0694d78..e68547f 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -178,7 +178,7 @@
<delete dir="target/itest/lib/hyperic-sigar-${sigar.zip.version}" />
<unzip dest="target/itest/lib">
- <fileset dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}" includes="*.zip" />
+ <fileset dir="${augeas.zip.location}" includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index 66d35d1..ff7d21f 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -18,7 +18,7 @@
<description>An abstract plugin for configuring resources via Augeas</description>
<properties>
- <augeas.version>0.0.2</augeas.version>
+ <augeas-bindings.version>0.0.2</augeas-bindings.version>
</properties>
<dependencies>
@@ -50,7 +50,7 @@
<dependency>
<groupId>net.augeas</groupId>
<artifactId>augeas</artifactId>
- <version>${augeas.version}</version>
+ <version>${augeas-bindings.version}</version>
</dependency>
<dependency>
@@ -84,7 +84,7 @@
<artifactItem>
<groupId>net.augeas</groupId>
<artifactId>augeas</artifactId>
- <version>${augeas.version}</version>
+ <version>${augeas-bindings.version}</version>
</artifactItem>
</artifactItems>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index 9a45599..78156f3 100644
--- a/modules/plugins/cobbler/pom.xml
+++ b/modules/plugins/cobbler/pom.xml
@@ -120,7 +120,7 @@
<delete dir="target/itest/lib/hyperic-sigar-${sigar.zip.version}" />
<unzip dest="target/itest/lib">
- <fileset dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}" includes="*.zip" />
+ <fileset dir="${augeas.zip.location}" includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index e42d480..5f2c454 100644
--- a/modules/plugins/cron/pom.xml
+++ b/modules/plugins/cron/pom.xml
@@ -108,7 +108,7 @@
<delete dir="target/itest/lib/hyperic-sigar-${sigar.zip.version}" />
<unzip dest="target/itest/lib">
- <fileset dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}" includes="*.zip" />
+ <fileset dir="${augeas.zip.location}" includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index 93b5dd3..d197727 100644
--- a/modules/plugins/grub/pom.xml
+++ b/modules/plugins/grub/pom.xml
@@ -105,7 +105,7 @@
<delete dir="target/itest/lib/hyperic-sigar-${sigar.zip.version}" />
<unzip dest="target/itest/lib">
- <fileset dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}" includes="*.zip" />
+ <fileset dir="${augeas.zip.location}" includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 31af33b..0c7ec29 100644
--- a/modules/plugins/hosts/pom.xml
+++ b/modules/plugins/hosts/pom.xml
@@ -115,7 +115,7 @@
<delete dir="target/itest/lib/hyperic-sigar-${sigar.zip.version}" />
<unzip dest="target/itest/lib">
- <fileset dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}" includes="*.zip" />
+ <fileset dir="${augeas.zip.location}" includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index 5ef7252..2a0eb28 100644
--- a/modules/plugins/postfix/pom.xml
+++ b/modules/plugins/postfix/pom.xml
@@ -113,7 +113,7 @@
<delete dir="target/itest/lib/hyperic-sigar-${sigar.zip.version}" />
<unzip dest="target/itest/lib">
- <fileset dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}" includes="*.zip" />
+ <fileset dir="${augeas.zip.location}" includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 84fc9b7..90337ed 100644
--- a/modules/plugins/samba/pom.xml
+++ b/modules/plugins/samba/pom.xml
@@ -113,7 +113,7 @@
<delete dir="target/itest/lib/hyperic-sigar-${sigar.zip.version}" />
<unzip dest="target/itest/lib">
- <fileset dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}" includes="*.zip" />
+ <fileset dir="${augeas.zip.location}" includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index 83da74a..3a1df45 100644
--- a/modules/plugins/sshd/pom.xml
+++ b/modules/plugins/sshd/pom.xml
@@ -105,7 +105,7 @@
<delete dir="target/itest/lib/hyperic-sigar-${sigar.zip.version}" />
<unzip dest="target/itest/lib">
- <fileset dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}" includes="*.zip" />
+ <fileset dir="${augeas.zip.location}" includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 1b69180..9429831 100644
--- a/modules/plugins/sudoers/pom.xml
+++ b/modules/plugins/sudoers/pom.xml
@@ -103,7 +103,7 @@
<delete dir="target/itest/lib/hyperic-sigar-${sigar.zip.version}" />
<unzip dest="target/itest/lib">
- <fileset dir="${settings.localRepository}/net/augeas/augeas-native/${augeas.version}" includes="*.zip" />
+ <fileset dir="${augeas.zip.location}" includes="${augeas.zip.mask}" />
<patternset>
<include name="**/lib*/*.so" />
<include name="**/lib*/*.so.*" />
diff --git a/pom.xml b/pom.xml
index c57a43b..ab342f5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -99,8 +99,11 @@
<commons-codec.version>1.4</commons-codec.version>
<testng.version>5.13.1</testng.version>
<cobertura.version>1.9.4.1</cobertura.version>
- <augeas.version>0.7.1.1</augeas.version>
- <augeas.zip.version>0.7.1</augeas.zip.version>
+ <augeas.version>0.9.0</augeas.version>
+ <augeas.classifier>el5</augeas.classifier>
+ <augeas.zip.version>0.9.0</augeas.zip.version>
+ <augeas.zip.location>${settings.localRepository}/net/augeas/augeas-native/${augeas.version}</augeas.zip.location>
+ <augeas.zip.mask>*-${augeas.classifier}.zip</augeas.zip.mask>
<ant.contrib.version>1.0b3</ant.contrib.version>
<rhq.db.admin.username>rhqadmin</rhq.db.admin.username>
commit 044113ead28a4449d07651e9f402eddac928c646
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Aug 30 21:42:31 2011 -0400
fixing test failures
diff --git a/modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftConfigurationTest.java b/modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftConfigurationTest.java
index 1cf29d6..b59dd01 100644
--- a/modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftConfigurationTest.java
+++ b/modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftConfigurationTest.java
@@ -1,12 +1,5 @@
package org.rhq.core.domain.drift;
-import static java.util.Arrays.asList;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.PROP_BASEDIR;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.PROP_BASEDIR_VALUECONTEXT;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.PROP_BASEDIR_VALUENAME;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
-import static org.testng.Assert.assertEquals;
-
import java.util.List;
import org.testng.annotations.Test;
@@ -18,6 +11,13 @@ import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.drift.DriftConfigurationComparator.CompareMode;
import org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext;
+import static java.util.Arrays.asList;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.PROP_BASEDIR;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.PROP_BASEDIR_VALUECONTEXT;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.PROP_BASEDIR_VALUENAME;
+import static org.testng.Assert.assertEquals;
+
public class DriftConfigurationTest {
@Test
public void getCompareIgnoreIncludesExcludes() {
@@ -28,7 +28,7 @@ public class DriftConfigurationTest {
// make sure our comparator can deal with all the nulls that are in empty configs
assert comparator.compare(dc1, dc2) == 0 : dc1 + " should equal " + dc2;
- dc1.setEnabled(true);
+ dc1.setEnabled(false);
assert comparator.compare(dc1, dc2) != 0 : dc1 + " should not equal " + dc2;
assert comparator.compare(dc2, dc1) != 0 : dc2 + " should not equal " + dc1;
dc1.setInterval(1000L);
@@ -38,14 +38,14 @@ public class DriftConfigurationTest {
assert comparator.compare(dc1, dc2) != 0 : dc1 + " should not equal " + dc2;
assert comparator.compare(dc2, dc1) != 0 : dc2 + " should not equal " + dc1;
- dc2.setEnabled(true);
+ dc2.setEnabled(false);
dc2.setInterval(1000L);
dc2.setName("the-name");
assert comparator.compare(dc1, dc2) == 0 : dc1 + " should equal " + dc2;
dc1.setEnabled(!dc2.isEnabled());
- assert comparator.compare(dc1, dc2) < 0 : dc1 + " should have different enabled than " + dc2;
+ assert comparator.compare(dc1, dc2) > 0 : dc1 + " should have different enabled than " + dc2;
dc1.setEnabled(dc2.isEnabled()); // put them back to the same value
dc1.setInterval(dc2.getInterval() + 2222L);
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBeanTest.java
index 511df03..ca9ee2a 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBeanTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBeanTest.java
@@ -168,7 +168,7 @@ public class ResourceMetadataManagerBeanTest extends MetadataBeanTest {
for (ConfigurationTemplate drift : drifts) {
if (drift.getName().equals("drift-pc")) {
driftConfig = new DriftConfiguration(drift.getConfiguration());
- assertFalse(driftConfig.isEnabled());
+ assertTrue(driftConfig.isEnabled());
assertEquals(BaseDirValueContext.pluginConfiguration, driftConfig.getBasedir().getValueContext());
assertEquals("connectionPropertyX", driftConfig.getBasedir().getValueName());
assertEquals(123456L, driftConfig.getInterval());
@@ -185,7 +185,7 @@ public class ResourceMetadataManagerBeanTest extends MetadataBeanTest {
assertEquals("", filter.getPattern());
} else if (drift.getName().equals("drift-fs")) {
driftConfig = new DriftConfiguration(drift.getConfiguration());
- assertFalse(driftConfig.isEnabled());
+ assertTrue(driftConfig.isEnabled());
assertEquals(BaseDirValueContext.fileSystem, driftConfig.getBasedir().getValueContext());
assertEquals("/", driftConfig.getBasedir().getValueName());
assertEquals(DriftConfigurationDefinition.DEFAULT_INTERVAL, driftConfig.getInterval());
@@ -290,7 +290,7 @@ public class ResourceMetadataManagerBeanTest extends MetadataBeanTest {
for (ConfigurationTemplate drift : drifts) {
if (drift.getName().equals("drift-rc")) {
driftConfig = new DriftConfiguration(drift.getConfiguration());
- assertFalse(driftConfig.isEnabled());
+ assertTrue(driftConfig.isEnabled());
assertEquals(BaseDirValueContext.resourceConfiguration, driftConfig.getBasedir().getValueContext());
assertEquals("resourceConfig1", driftConfig.getBasedir().getValueName());
assertEquals(DriftConfigurationDefinition.DEFAULT_INTERVAL, driftConfig.getInterval());
@@ -298,7 +298,7 @@ public class ResourceMetadataManagerBeanTest extends MetadataBeanTest {
assertEquals(0, driftConfig.getExcludes().size());
} else if (drift.getName().equals("drift-mt")) {
driftConfig = new DriftConfiguration(drift.getConfiguration());
- assertFalse(driftConfig.isEnabled());
+ assertTrue(driftConfig.isEnabled());
assertEquals(BaseDirValueContext.measurementTrait, driftConfig.getBasedir().getValueContext());
assertEquals("trait1", driftConfig.getBasedir().getValueName());
assertEquals(DriftConfigurationDefinition.DEFAULT_INTERVAL, driftConfig.getInterval());
commit 4b12e68d2d7648ed08921f482bb02e3525a3cf81
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Aug 30 21:03:24 2011 -0400
[BZ 734194] Check that content is loaded in db on drift details view
The drift details view page displays links for viewing the current and
previous version of a file as well as a diff between those versions.
The initial implementation failed to take into account that the file
content referenced by the drift may not be in the database. The page
previously attempted to generate a diff report on load instead of on
demand. This of course resulted in an exception getting thrown.
With this commit, links for viewing file content and for viewing a diff
are shown when the file content is available. If the file content is not
available, a message is instead displayed that says the content is not
available.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDetails.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDetails.java
new file mode 100644
index 0000000..283f53f
--- /dev/null
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDetails.java
@@ -0,0 +1,126 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 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.core.domain.drift;
+
+import java.io.Serializable;
+
+/**
+ * Encapsulates information and details about drift that can be used in the UI. This class
+ * the Drift object, the change set to which the drift belongs, and the change set in which
+ * the file with drift was last referenced. This class also store statuses of the current
+ * and previous versions of the file to indicate whether or not the content is in the
+ * database. Lastly, it has a flag to indicate whether or not the file is a binary file.
+ */
+public class DriftDetails implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private Drift drift;
+
+ private DriftChangeSet previousChangeSet;
+
+ private DriftFileStatus newFileStatus;
+
+ private DriftFileStatus oldFileStatus;
+
+ private boolean isBinary;
+
+ /** @return The drift object */
+ public Drift getDrift() {
+ return drift;
+ }
+
+ /** @param drift The Drift object to which the details belong */
+ public void setDrift(Drift drift) {
+ this.drift = drift;
+ }
+
+ /** @return The change set to which the drift is part of */
+ public DriftChangeSet getChangeSet() {
+ return drift.getChangeSet();
+ }
+
+ /**
+ * Returns the previous change set for which there was an occurrence of drift on the
+ * file referenced by the Drift object. This can be null if there was no previous
+ * drift.
+ *
+ * @return The previous change set for which there was drift on the file referenced by
+ * the Drift object or null if there is not previous drift on the file.
+ */
+ public DriftChangeSet getPreviousChangeSet() {
+ return previousChangeSet;
+ }
+
+ /**
+ * @param changeSet The previous change set in which drift occurred on the file
+ * referenced by the Drift object.
+ */
+ public void setPreviousChangeSet(DriftChangeSet changeSet) {
+ previousChangeSet = changeSet;
+ }
+
+ /**
+ * @return The status of the file as reported in the current change set. Indicates
+ * whether or not the file has been loaded into the database. Can be null if the type
+ * of drift is a {@link DriftCategory#FILE_REMOVED deletion}.
+ */
+ public DriftFileStatus getNewFileStatus() {
+ return newFileStatus;
+ }
+
+ /**
+ * @param status The status of the file reported in the change set.
+ */
+ public void setNewFileStatus(DriftFileStatus status) {
+ newFileStatus = status;
+ }
+
+ /**
+ * @return The status of the file as reported in the previous change set. Indicates
+ * whether or not the file has been loaded into the database. Can be null if the type
+ * of drift is a {@link DriftCategory#FILE_ADDED addition}.
+ */
+ public DriftFileStatus getOldFileStatus() {
+ return oldFileStatus;
+ }
+
+ /**
+ * @param status The status of the file as reported in the last change set in which the
+ * file was referenced.
+ */
+ public void setOldFileStatus(DriftFileStatus status) {
+ oldFileStatus = status;
+ }
+
+ /**
+ * @return true if the file is a binary file.
+ */
+ public boolean isBinaryFile() {
+ return isBinary;
+ }
+
+ /**
+ * @param binaryFile True if the file is a binary type, false otherwise.
+ */
+ public void setBinaryFile(boolean binaryFile) {
+ isBinary = binaryFile;
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java
index 31c888d..1c0b54e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java
@@ -36,24 +36,20 @@ import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
import com.smartgwt.client.widgets.layout.VLayout;
-import org.rhq.core.domain.criteria.GenericDriftChangeSetCriteria;
-import org.rhq.core.domain.criteria.GenericDriftCriteria;
import org.rhq.core.domain.drift.Drift;
-import org.rhq.core.domain.drift.DriftChangeSet;
+import org.rhq.core.domain.drift.DriftDetails;
+import org.rhq.core.domain.drift.DriftFileStatus;
import org.rhq.core.domain.drift.FileDiffReport;
-import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.PopupWindow;
import org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter;
import org.rhq.enterprise.gui.coregui.client.gwt.DriftGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
-import static org.rhq.core.domain.drift.DriftCategory.FILE_CHANGED;
+import static org.rhq.core.domain.drift.DriftFileStatus.LOADED;
import static org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter.DATE_TIME_FORMAT_FULL;
/**
@@ -75,165 +71,30 @@ public class DriftDetailsView extends LocatableVLayout {
show(this.driftId);
}
- private void show(String driftId) {
+ private void show(final String driftId) {
final DriftGWTServiceAsync driftService = GWTServiceLookup.getDriftService();
-
- GenericDriftCriteria criteria = new GenericDriftCriteria();
- criteria.addFilterId(driftId);
- criteria.fetchChangeSet(true);
- driftService.findDriftsByCriteria(criteria,
- new AsyncCallback<PageList<? extends Drift>>() {
- @Override
- public void onSuccess(PageList<? extends Drift> result) {
- if (result.getTotalSize() != 1) {
- CoreGUI.getMessageCenter().notify(
- new Message("Got [" + result.getTotalSize()
- + "] results. Should have been 1. The details shown here might not be correct.",
- Severity.Warning));
- }
- final Drift drift = result.get(0);
- if (drift.getCategory() == FILE_CHANGED) {
- GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
- criteria.addFilterResourceId(drift.getChangeSet().getResourceId());
- criteria.addFilterDriftConfigurationId(drift.getChangeSet().getDriftConfigurationId());
- criteria.addFilterVersion(Integer.toString(drift.getChangeSet().getVersion() - 1));
-
- driftService.findDriftChangeSetsByCriteria(criteria,
- new AsyncCallback<PageList<? extends DriftChangeSet>>() {
- @Override
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to load change set", caught);
- }
-
- @Override
- public void onSuccess(PageList<? extends DriftChangeSet> changeSets) {
- show(drift, changeSets.get(0));
- }
- });
- } else {
- show(drift, null);
- }
- }
-
- @Override
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(MSG.view_drift_failure_load(), caught);
- }
- });
- }
-
- private void show(final Drift drift, final DriftChangeSet previousVersion) {
- for (Canvas child : getMembers()) {
- removeMember(child);
- child.destroy();
- }
-
- // the change set to which the drift belongs
-
- DynamicForm changeSetForm = new LocatableDynamicForm(extendLocatorId("changeSetForm"));
- changeSetForm.setIsGroup(true);
- changeSetForm.setGroupTitle(MSG.view_drift_table_changeSet());
- changeSetForm.setWrapItemTitles(false);
-
- StaticTextItem changeSetId = new StaticTextItem("changeSetId", MSG.common_title_id());
- changeSetId.setValue(drift.getChangeSet().getId());
- StaticTextItem changeSetCategory = new StaticTextItem("changeSetCategory", MSG.common_title_category());
- changeSetCategory.setValue(drift.getChangeSet().getCategory().name());
- StaticTextItem changeSetVersion = new StaticTextItem("changeSetVersion", MSG.common_title_version());
- changeSetVersion.setValue(drift.getChangeSet().getVersion());
- changeSetForm.setItems(changeSetId, changeSetCategory, changeSetVersion);
-
- addMember(changeSetForm);
-
- GWTServiceLookup.getDriftService().isBinaryFile(drift, new AsyncCallback<Boolean>() {
+ driftService.getDriftDetails(driftId, new AsyncCallback<DriftDetails>() {
@Override
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to look up file type", caught);
+ CoreGUI.getErrorHandler().handleError("Failed to load drift details for drift id: " + driftId, caught);
}
@Override
- public void onSuccess(Boolean isBinary) {
- if (isBinary) {
- addMember(createDriftFormForBinaryFile(drift, previousVersion));
- } else {
- addMember(createDriftFormForTextFile(drift, previousVersion));
- }
+ public void onSuccess(final DriftDetails details) {
+ show(details);
}
});
- }
-
- private DynamicForm createDriftFormForBinaryFile(Drift drift, DriftChangeSet previousVersion) {
- DynamicForm driftForm = new LocatableDynamicForm(extendLocatorId("form"));
- driftForm.setIsGroup(true);
- driftForm.setGroupTitle(MSG.view_drift());
- driftForm.setWrapItemTitles(false);
- driftForm.setNumCols(4);
-
- SpacerItem spacer = new SpacerItem();
-
- StaticTextItem id = new StaticTextItem("id", MSG.common_title_id());
- id.setValue(drift.getId());
-
- StaticTextItem path = new StaticTextItem("path", MSG.common_title_path());
- path.setValue(drift.getPath());
- StaticTextItem timestamp = new StaticTextItem("timestamp", MSG.common_title_timestamp());
- timestamp.setValue(TimestampCellFormatter.format(drift.getCtime(), DATE_TIME_FORMAT_FULL));
-
- StaticTextItem category = new StaticTextItem("category", MSG.common_title_category());
-
- LinkedHashMap<String, String> catIconsMap = new LinkedHashMap<String, String>(3);
- catIconsMap.put(DriftDataSource.CATEGORY_ICON_ADD, DriftDataSource.CATEGORY_ICON_ADD);
- catIconsMap.put(DriftDataSource.CATEGORY_ICON_CHANGE, DriftDataSource.CATEGORY_ICON_CHANGE);
- catIconsMap.put(DriftDataSource.CATEGORY_ICON_REMOVE, DriftDataSource.CATEGORY_ICON_REMOVE);
- LinkedHashMap<String, String> catValueMap = new LinkedHashMap<String, String>(3);
- catValueMap.put(DriftDataSource.CATEGORY_ICON_ADD, MSG.view_drift_category_fileAdded());
- catValueMap.put(DriftDataSource.CATEGORY_ICON_CHANGE, MSG.view_drift_category_fileChanged());
- catValueMap.put(DriftDataSource.CATEGORY_ICON_REMOVE, MSG.view_drift_category_fileRemoved());
- category.setValueMap(catValueMap);
- category.setValueIcons(catIconsMap);
- category.setShowIcons(true);
-
- StaticTextItem oldFile = new StaticTextItem("oldFile", MSG.view_drift_table_oldFile());
- FormItem oldFileLink = null;
-
- StaticTextItem newFile = new StaticTextItem("newFile", MSG.view_drift_table_newFile());
- FormItem newFileLink = null;
+ }
- switch (drift.getCategory()) {
- case FILE_ADDED:
- category.setValue(DriftDataSource.CATEGORY_ICON_ADD);
- oldFile.setValue(MSG.common_label_none());
- oldFileLink = spacer;
- newFile.setValue(drift.getNewDriftFile().getHashId());
- newFileLink = spacer;
- break;
-
- case FILE_CHANGED:
- category.setValue(DriftDataSource.CATEGORY_ICON_CHANGE);
- oldFile.setValue(drift.getOldDriftFile().getHashId());
- oldFileLink = createViewFileLink(drift.getOldDriftFile().getHashId(), drift.getPath(),
- previousVersion.getVersion());
- newFile.setValue(drift.getNewDriftFile().getHashId());
- newFileLink = spacer;
- break;
-
- case FILE_REMOVED:
- category.setValue(DriftDataSource.CATEGORY_ICON_REMOVE);
- oldFile.setValue(drift.getOldDriftFile().getHashId());
- oldFileLink = spacer;
- newFile.setValue(MSG.common_label_none());
- newFileLink = spacer;
- break;
+ private void show(DriftDetails driftDetails) {
+ for (Canvas child : getMembers()) {
+ removeMember(child);
+ child.destroy();
}
- driftForm.setItems(id, spacer, path, spacer, category, spacer, timestamp, spacer, oldFile, oldFileLink,
- newFile, newFileLink);
-
- return driftForm;
- }
+ addMember(createChangeSetForm(driftDetails.getDrift()));
- private DynamicForm createDriftFormForTextFile(Drift drift, DriftChangeSet previousVersion) {
DynamicForm driftForm = new LocatableDynamicForm(extendLocatorId("form"));
driftForm.setIsGroup(true);
driftForm.setGroupTitle(MSG.view_drift());
@@ -243,13 +104,13 @@ public class DriftDetailsView extends LocatableVLayout {
SpacerItem spacer = new SpacerItem();
StaticTextItem id = new StaticTextItem("id", MSG.common_title_id());
- id.setValue(drift.getId());
+ id.setValue(driftDetails.getDrift().getId());
StaticTextItem path = new StaticTextItem("path", MSG.common_title_path());
- path.setValue(drift.getPath());
+ path.setValue(driftDetails.getDrift().getPath());
StaticTextItem timestamp = new StaticTextItem("timestamp", MSG.common_title_timestamp());
- timestamp.setValue(TimestampCellFormatter.format(drift.getCtime(), DATE_TIME_FORMAT_FULL));
+ timestamp.setValue(TimestampCellFormatter.format(driftDetails.getDrift().getCtime(), DATE_TIME_FORMAT_FULL));
StaticTextItem category = new StaticTextItem("category", MSG.common_title_category());
@@ -271,55 +132,102 @@ public class DriftDetailsView extends LocatableVLayout {
StaticTextItem newFile = new StaticTextItem("newFile", MSG.view_drift_table_newFile());
FormItem newFileLink = null;
- switch (drift.getCategory()) {
- case FILE_ADDED:
- category.setValue(DriftDataSource.CATEGORY_ICON_ADD);
- oldFile.setValue(MSG.common_label_none());
- oldFileLink = spacer;
- newFile.setValue(drift.getNewDriftFile().getHashId());
- newFileLink = createViewFileLink(drift.getNewDriftFile().getHashId(), drift.getPath(),
- drift.getChangeSet().getVersion());
- break;
-
- case FILE_CHANGED:
- category.setValue(DriftDataSource.CATEGORY_ICON_CHANGE);
- oldFile.setValue(drift.getOldDriftFile().getHashId());
- oldFileLink = createViewFileLink(drift.getOldDriftFile().getHashId(), drift.getPath(),
- previousVersion.getVersion());
- newFile.setValue(drift.getNewDriftFile().getHashId());
- newFileLink = createViewFileLink(drift.getNewDriftFile().getHashId(), drift.getPath(),
- drift.getChangeSet().getVersion());
- break;
-
- case FILE_REMOVED:
- category.setValue(DriftDataSource.CATEGORY_ICON_REMOVE);
- oldFile.setValue(drift.getOldDriftFile().getHashId());
- oldFileLink = createViewFileLink(drift.getOldDriftFile().getHashId(), drift.getPath(),
- drift.getChangeSet().getVersion());
- newFile.setValue(MSG.common_label_none());
- newFileLink = spacer;
- break;
+ if (driftDetails.isBinaryFile()) {
+ switch (driftDetails.getDrift().getCategory()) {
+ case FILE_ADDED:
+ category.setValue(DriftDataSource.CATEGORY_ICON_ADD);
+ oldFile.setValue(MSG.common_label_none());
+ oldFileLink = spacer;
+ newFile.setValue(driftDetails.getDrift().getNewDriftFile().getHashId());
+ newFileLink = spacer;
+ break;
+ case FILE_CHANGED:
+ category.setValue(DriftDataSource.CATEGORY_ICON_CHANGE);
+ oldFile.setValue(driftDetails.getDrift().getOldDriftFile().getHashId());
+ oldFileLink = createViewFileLink(driftDetails.getDrift().getOldDriftFile().getHashId(),
+ driftDetails.getDrift().getPath(), driftDetails.getPreviousChangeSet().getVersion());
+ newFile.setValue(driftDetails.getDrift().getNewDriftFile().getHashId());
+ newFileLink = spacer;
+ break;
+ case FILE_REMOVED:
+ category.setValue(DriftDataSource.CATEGORY_ICON_REMOVE);
+ oldFile.setValue(driftDetails.getDrift().getOldDriftFile().getHashId());
+ oldFileLink = spacer;
+ newFile.setValue(MSG.common_label_none());
+ newFileLink = spacer;
+ break;
+ }
+ driftForm.setItems(id, spacer, path, spacer, category, spacer, timestamp, spacer, oldFile, oldFileLink,
+ newFile, newFileLink);
+ } else {
+ FormItem viewDiffLink = spacer;
+ switch (driftDetails.getDrift().getCategory()) {
+ case FILE_ADDED:
+ category.setValue(DriftDataSource.CATEGORY_ICON_ADD);
+ oldFile.setValue(MSG.common_label_none());
+ oldFileLink = spacer;
+ newFile.setValue(driftDetails.getDrift().getNewDriftFile().getHashId());
+ newFileLink = createViewFileLink(driftDetails.getDrift().getNewDriftFile().getHashId(),
+ driftDetails.getDrift().getPath(), driftDetails.getChangeSet().getVersion(),
+ driftDetails.getNewFileStatus());
+ break;
+ case FILE_CHANGED:
+ category.setValue(DriftDataSource.CATEGORY_ICON_CHANGE);
+ oldFile.setValue(driftDetails.getDrift().getOldDriftFile().getHashId());
+ oldFileLink = createViewFileLink(driftDetails.getDrift().getOldDriftFile().getHashId(),
+ driftDetails.getDrift().getPath(), driftDetails.getPreviousChangeSet().getVersion(),
+ driftDetails.getOldFileStatus());
+ newFile.setValue(driftDetails.getDrift().getNewDriftFile().getHashId());
+ newFileLink = createViewFileLink(driftDetails.getDrift().getNewDriftFile().getHashId(),
+ driftDetails.getDrift().getPath(), driftDetails.getChangeSet().getVersion(),
+ driftDetails.getNewFileStatus());
+ if (driftDetails.getNewFileStatus() == LOADED && driftDetails.getOldFileStatus() == LOADED) {
+ viewDiffLink = createViewDiffLink(driftDetails.getDrift(),
+ driftDetails.getPreviousChangeSet().getVersion());
+ }
+ break;
+ case FILE_REMOVED:
+ category.setValue(DriftDataSource.CATEGORY_ICON_REMOVE);
+ oldFile.setValue(driftDetails.getDrift().getOldDriftFile().getHashId());
+ oldFileLink = createViewFileLink(driftDetails.getDrift().getOldDriftFile().getHashId(),
+ driftDetails.getDrift().getPath(), driftDetails.getChangeSet().getVersion(),
+ driftDetails.getOldFileStatus());
+ newFile.setValue(MSG.common_label_none());
+ newFileLink = spacer;
+ break;
+ }
+ driftForm.setItems(id, spacer, path, spacer, category, spacer, timestamp, spacer, oldFile, oldFileLink,
+ newFile, newFileLink, spacer, spacer, spacer, viewDiffLink);
}
+ addMember(driftForm);
+ }
- if (drift.getCategory() == FILE_CHANGED) {
- StaticTextItem numberOfChanges = new StaticTextItem("numberOfChanges", "Number of Changes");
- numberOfChanges.setValue("Loading...");
+ private DynamicForm createChangeSetForm(Drift drift) {
+ DynamicForm changeSetForm = new LocatableDynamicForm(extendLocatorId("changeSetForm"));
+ changeSetForm.setIsGroup(true);
+ changeSetForm.setGroupTitle(MSG.view_drift_table_changeSet());
+ changeSetForm.setWrapItemTitles(false);
- LinkItem viewDiffLink = new LinkItem("viewDiff");
- viewDiffLink.setLinkTitle("(view diff)");
- viewDiffLink.setShowTitle(false);
- viewDiffLink.setDisabled(true);
+ StaticTextItem changeSetId = new StaticTextItem("changeSetId", MSG.common_title_id());
+ changeSetId.setValue(drift.getChangeSet().getId());
+ StaticTextItem changeSetCategory = new StaticTextItem("changeSetCategory", MSG.common_title_category());
+ changeSetCategory.setValue(drift.getChangeSet().getCategory().name());
+ StaticTextItem changeSetVersion = new StaticTextItem("changeSetVersion", MSG.common_title_version());
+ changeSetVersion.setValue(drift.getChangeSet().getVersion());
+ changeSetForm.setItems(changeSetId, changeSetCategory, changeSetVersion);
- driftForm.setItems(id, spacer, path, spacer, category, spacer, timestamp, spacer, oldFile, oldFileLink,
- newFile, newFileLink, numberOfChanges, viewDiffLink);
+ return changeSetForm;
+ }
- generateDiff(drift, previousVersion.getVersion(), numberOfChanges, viewDiffLink);
- } else {
- driftForm.setItems(id, spacer, path, spacer, category, spacer, timestamp, spacer, oldFile, oldFileLink,
- newFile, newFileLink);
+ private FormItem createViewFileLink(String hash, String path, int version, DriftFileStatus status) {
+ if (status == LOADED) {
+ return createViewFileLink(hash, path, version);
}
+ StaticTextItem item = new StaticTextItem(hash + "_fileLink");
+ item.setShowTitle(false);
+ item.setValue("(file not ready for viewing)");
- return driftForm;
+ return item;
}
private LinkItem createViewFileLink(final String hash, final String path, final int version) {
@@ -333,7 +241,11 @@ public class DriftDetailsView extends LocatableVLayout {
GWTServiceLookup.getDriftService().getDriftFileBits(hash, new AsyncCallback<String>() {
@Override
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to load file", caught);
+ try {
+ throw caught;
+ } catch (Throwable r) {
+ CoreGUI.getErrorHandler().handleError("Failed to load file", r);
+ }
}
@Override
@@ -397,31 +309,32 @@ public class DriftDetailsView extends LocatableVLayout {
return window;
}
- private void generateDiff(final Drift drift, final int oldVersion, final StaticTextItem changes,
- final LinkItem viewDiff) {
- GWTServiceLookup.getDriftService().generateUnifiedDiff(drift, new AsyncCallback<FileDiffReport>() {
- @Override
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Failed to load change report", caught);
- }
+ private LinkItem createViewDiffLink(final Drift drift, final int oldVersion) {
+ LinkItem viewDiffLink = new LinkItem("viewDiff");
+ viewDiffLink.setLinkTitle("(view diff)");
+ viewDiffLink.setShowTitle(false);
+ viewDiffLink.addClickHandler(new ClickHandler() {
@Override
- public void onSuccess(final FileDiffReport diffReport) {
- changes.setValue(diffReport.getNumberOfChanges());
- viewDiff.setDisabled(false);
- viewDiff.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ GWTServiceLookup.getDriftService().generateUnifiedDiff(drift, new AsyncCallback<FileDiffReport>() {
@Override
- public void onClick(ClickEvent clickEvent) {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Failed to generate diff", caught);
+ }
+
+ @Override
+ public void onSuccess(FileDiffReport diffReport) {
int newVersion = drift.getChangeSet().getVersion();
String diffContents = toHtml(diffReport.getDiff(), oldVersion, newVersion);
-
- //LocatableWindow window = createFileViewer(diffReport.getDiff());
- LocatableWindow window = createDiffViewer(diffContents, drift.getPath(), oldVersion, newVersion);
+ LocatableWindow window = createDiffViewer(diffContents, drift.getPath(), oldVersion,
+ newVersion);
window.show();
}
});
}
});
+ return viewDiffLink;
}
private String toHtml(List<String> deltas, int oldVersion, int newVersion) {
@@ -441,7 +354,6 @@ public class DriftDetailsView extends LocatableVLayout {
diff.append(line).append("<br/>");
}
}
-
return diff.toString();
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DriftGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DriftGWTService.java
index 9b96231..d4faced 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DriftGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DriftGWTService.java
@@ -29,6 +29,7 @@ import org.rhq.core.domain.drift.Drift;
import org.rhq.core.domain.drift.DriftChangeSet;
import org.rhq.core.domain.drift.DriftComposite;
import org.rhq.core.domain.drift.DriftConfiguration;
+import org.rhq.core.domain.drift.DriftDetails;
import org.rhq.core.domain.drift.DriftSnapshot;
import org.rhq.core.domain.drift.FileDiffReport;
import org.rhq.core.domain.util.PageList;
@@ -115,4 +116,6 @@ public interface DriftGWTService extends RemoteService {
boolean isBinaryFile(Drift drift) throws RuntimeException;
+ DriftDetails getDriftDetails(String driftId) throws RuntimeException;
+
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DriftGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DriftGWTServiceImpl.java
index e8531be..55f9f7e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DriftGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DriftGWTServiceImpl.java
@@ -27,6 +27,7 @@ import org.rhq.core.domain.drift.Drift;
import org.rhq.core.domain.drift.DriftChangeSet;
import org.rhq.core.domain.drift.DriftComposite;
import org.rhq.core.domain.drift.DriftConfiguration;
+import org.rhq.core.domain.drift.DriftDetails;
import org.rhq.core.domain.drift.DriftSnapshot;
import org.rhq.core.domain.drift.FileDiffReport;
import org.rhq.core.domain.util.PageList;
@@ -160,6 +161,16 @@ public class DriftGWTServiceImpl extends AbstractGWTServiceImpl implements Drift
}
@Override
+ public DriftDetails getDriftDetails(String driftId) throws RuntimeException {
+ try {
+ DriftDetails details = driftManager.getDriftDetails(getSessionSubject(), driftId);
+ return SerialUtility.prepare(details, "DriftService.getDriftDetails");
+ } catch (Throwable t) {
+ throw getExceptionToThrowToClient(t);
+ }
+ }
+
+ @Override
public boolean isBinaryFile(Drift drift) throws RuntimeException {
try {
return driftManager.isBinaryFile(drift);
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
index b1a7415..898a4c2 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
@@ -47,6 +47,8 @@ import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.criteria.DriftChangeSetCriteria;
import org.rhq.core.domain.criteria.DriftConfigurationCriteria;
import org.rhq.core.domain.criteria.DriftCriteria;
+import org.rhq.core.domain.criteria.GenericDriftChangeSetCriteria;
+import org.rhq.core.domain.criteria.GenericDriftCriteria;
import org.rhq.core.domain.drift.Drift;
import org.rhq.core.domain.drift.DriftChangeSet;
import org.rhq.core.domain.drift.DriftComposite;
@@ -54,6 +56,7 @@ import org.rhq.core.domain.drift.DriftConfiguration;
import org.rhq.core.domain.drift.DriftConfigurationComparator;
import org.rhq.core.domain.drift.DriftConfigurationComparator.CompareMode;
import org.rhq.core.domain.drift.DriftConfigurationDefinition;
+import org.rhq.core.domain.drift.DriftDetails;
import org.rhq.core.domain.drift.DriftFile;
import org.rhq.core.domain.drift.DriftSnapshot;
import org.rhq.core.domain.drift.FileDiffReport;
@@ -115,6 +118,7 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
binaryFileTypes.add("jpg");
binaryFileTypes.add("png");
binaryFileTypes.add("jpeg");
+ binaryFileTypes.add("gif");
binaryFileTypes.add("pdf");
binaryFileTypes.add("swf");
binaryFileTypes.add("bpm");
@@ -389,12 +393,14 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
@Override
@TransactionAttribute(NOT_SUPPORTED)
public String getDriftFileBits(String hash) {
+ log.debug("Retrieving drift file content for " + hash);
DriftServerPluginFacet driftServerPlugin = getServerPlugin();
return driftServerPlugin.getDriftFileBits(hash);
}
@Override
public FileDiffReport generateUnifiedDiff(Drift drift) {
+ log.debug("Generating diff for " + drift);
String oldContent = getDriftFileBits(drift.getOldDriftFile().getHashId());
List<String> oldList = asList(oldContent.split("\\n"));
String newContent = getDriftFileBits(drift.getNewDriftFile().getHashId());
@@ -495,6 +501,69 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
return binaryFileTypes.contains(path.substring(index + 1, path.length()));
}
+ @Override
+ @TransactionAttribute(NOT_SUPPORTED)
+ public DriftDetails getDriftDetails(Subject subject, String driftId) {
+ log.debug("Loading drift details for drift id: " + driftId);
+
+ GenericDriftCriteria criteria = new GenericDriftCriteria();
+ criteria.addFilterId(driftId);
+ criteria.fetchChangeSet(true);
+
+ DriftDetails driftDetails = new DriftDetails();
+ DriftServerPluginFacet driftServerPlugin = getServerPlugin();
+
+ DriftFile newFile = null;
+ DriftFile oldFile = null;
+
+ PageList<? extends Drift<?, ?>> results = driftServerPlugin.findDriftsByCriteria(subject, criteria);
+ if (results.size() == 0) {
+ log.warn("Unable to get the drift details for drift id " + driftId + ". No drift object found with that id.");
+ return null;
+ }
+
+ Drift drift = results.get(0);
+ driftDetails.setDrift(drift);
+ try {
+ switch (drift.getCategory()) {
+ case FILE_ADDED:
+ newFile = driftServerPlugin.getDriftFile(subject, drift.getNewDriftFile().getHashId());
+ driftDetails.setNewFileStatus(newFile.getStatus());
+ break;
+ case FILE_CHANGED:
+ newFile = driftServerPlugin.getDriftFile(subject, drift.getNewDriftFile().getHashId());
+ oldFile = driftServerPlugin.getDriftFile(subject, drift.getOldDriftFile().getHashId());
+
+ driftDetails.setNewFileStatus(newFile.getStatus());
+ driftDetails.setOldFileStatus(oldFile.getStatus());
+
+ driftDetails.setPreviousChangeSet(loadPreviousChangeSet(subject, drift));
+ break;
+ case FILE_REMOVED:
+ oldFile = driftServerPlugin.getDriftFile(subject, drift.getOldDriftFile().getHashId());
+ driftDetails.setOldFileStatus(oldFile.getStatus());
+ break;
+ }
+ } catch (Exception e) {
+ log.error("An error occurred while loading the drift details for drift id " + driftId + ": " +
+ e.getMessage());
+ throw new RuntimeException("An error occurred while loading th drift details for drift id " + driftId, e);
+ }
+ driftDetails.setBinaryFile(isBinaryFile(drift));
+ return driftDetails;
+ }
+
+ private DriftChangeSet loadPreviousChangeSet(Subject subject, Drift drift) {
+ GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
+ criteria.addFilterResourceId(drift.getChangeSet().getResourceId());
+ criteria.addFilterDriftConfigurationId(drift.getChangeSet().getDriftConfigurationId());
+ criteria.addFilterVersion(Integer.toString(drift.getChangeSet().getVersion() - 1));
+
+ PageList<? extends DriftChangeSet<?>> results = findDriftChangeSetsByCriteria(subject, criteria);
+ // TODO handle empty results
+ return results.get(0);
+ }
+
private DriftServerPluginFacet getServerPlugin() {
MasterServerPluginContainer masterPC = LookupUtil.getServerPluginService().getMasterPluginContainer();
if (masterPC == null) {
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java
index 663b626..5d9838f 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java
@@ -28,6 +28,7 @@ import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.criteria.DriftConfigurationCriteria;
import org.rhq.core.domain.drift.Drift;
import org.rhq.core.domain.drift.DriftConfiguration;
+import org.rhq.core.domain.drift.DriftDetails;
import org.rhq.core.domain.drift.FileDiffReport;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.server.plugin.pc.drift.DriftServerPluginFacet;
@@ -130,5 +131,14 @@ public interface DriftManagerLocal extends DriftServerPluginFacet, DriftManagerR
*/
FileDiffReport generateUnifiedDiff(Drift drift);
+ /**
+ * Returns an object that encapsulates the information needed for viewing drift details
+ *
+ * @param subject
+ * @param driftId
+ * @return
+ */
+ DriftDetails getDriftDetails(Subject subject, String driftId);
+
boolean isBinaryFile(Drift drift);
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
index c3a34bf..daa7a68 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
@@ -77,6 +77,7 @@ import org.rhq.enterprise.server.util.CriteriaQueryGenerator;
import org.rhq.enterprise.server.util.CriteriaQueryRunner;
import static javax.ejb.TransactionAttributeType.REQUIRES_NEW;
+import static org.rhq.core.domain.drift.DriftFileStatus.LOADED;
/**
* The SLSB method implementation needed to support the JPA (RHQ Default) Drift Server Plugin.
@@ -217,7 +218,7 @@ public class JPADriftServerBean implements JPADriftServerLocal {
throw new IllegalArgumentException("JPADriftFile not found [" + driftFile.getHashId() + "]");
}
df.setData(Hibernate.createBlob(new BufferedInputStream(data)));
- df.setStatus(DriftFileStatus.LOADED);
+ df.setStatus(LOADED);
}
@Override
12 years, 8 months
[rhq] Branch 'drift' - modules/enterprise
by mazz
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java | 21 +++++++++-
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 3 +
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties | 3 +
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties | 3 +
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties | 3 +
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties | 3 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/DriftCacheElement.java | 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/drift/DriftChangeSetSummary.java | 17 ++++++++
8 files changed, 53 insertions(+), 2 deletions(-)
New commits:
commit fbc77d447c2e27923a8eac3c275121cb3ecd0598
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Sep 1 18:00:30 2011 -0400
[BZ 735230] provide better messages in ui
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 c25855c..72a6966 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
@@ -188,7 +188,26 @@ public class AlertFormatUtility {
break;
}
case DRIFT: {
- str.append(MSG.view_alert_common_tab_conditions_type_drift());
+ String configNameRegex = condition.getName();
+ String pathNameRegex = condition.getOption();
+ if (configNameRegex == null || configNameRegex.length() == 0) {
+ if (pathNameRegex == null || pathNameRegex.length() == 0) {
+ // neither a config name regex nor path regex was specified
+ str.append(MSG.view_alert_common_tab_conditions_type_drift());
+ } else {
+ // a path name regex was specified, but not a config name regex
+ str.append(MSG.view_alert_common_tab_conditions_type_drift_onlypaths(pathNameRegex));
+ }
+ } else {
+ if (pathNameRegex == null || pathNameRegex.length() == 0) {
+ // a config name regex was specified, but not a path name regex
+ str.append(MSG.view_alert_common_tab_conditions_type_drift_onlyconfig(configNameRegex));
+ } else {
+ // both a config name regex and a path regex was specified
+ str.append(MSG.view_alert_common_tab_conditions_type_drift_configpaths(pathNameRegex,
+ configNameRegex));
+ }
+ }
break;
}
default: {
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
index 8b978c8..494d691 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -613,6 +613,9 @@ view_alert_common_tab_conditions_type_availability = Availability Change
view_alert_common_tab_conditions_type_availability_down = Went down
view_alert_common_tab_conditions_type_availability_up = Came up
view_alert_common_tab_conditions_type_drift = Drift Detection
+view_alert_common_tab_conditions_type_drift_configpaths = Drift Detection for files that match "{0}" and for drift configuration [{1}]
+view_alert_common_tab_conditions_type_drift_onlyconfig = Drift Detection for drift configuration [{0}]
+view_alert_common_tab_conditions_type_drift_onlypaths = Drift Detection for files that match "{0}"
view_alert_common_tab_conditions_type_event = Event Detection
view_alert_common_tab_conditions_type_event_matching = with event source matching
view_alert_common_tab_conditions_type_metric_baseline = Metric Value Baseline
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 1e1b853..2e546b6 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
@@ -490,6 +490,9 @@ view_alert_common_tab_conditions_type_availability = Änderung der Verfügbarkei
view_alert_common_tab_conditions_type_availability_down = Wurde unverfügbar
view_alert_common_tab_conditions_type_availability_up = Wurde wieder verfügbar
##view_alert_common_tab_conditions_type_drift = Drift Detection
+##view_alert_common_tab_conditions_type_drift_configpaths = Drift Detection for files that match "{0}" and for drift configuration [{1}]
+##view_alert_common_tab_conditions_type_drift_onlyconfig = Drift Detection for drift configuration [{0}]
+##view_alert_common_tab_conditions_type_drift_onlypaths = Drift Detection for files that match "{0}"
##view_alert_common_tab_conditions_type_event = Event Detection
view_alert_common_tab_conditions_type_event_matching = with event source matching~
view_alert_common_tab_conditions_type_metric_baseline = Metrik überschreitet Referenzband
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
index 150c06a..74f8fbd 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
@@ -608,6 +608,9 @@ view_alert_common_tab_conditions_type_availability = アベイラビリティの
view_alert_common_tab_conditions_type_availability_down = 下降
view_alert_common_tab_conditions_type_availability_up = 上昇
##view_alert_common_tab_conditions_type_drift = Drift Detection
+##view_alert_common_tab_conditions_type_drift_configpaths = Drift Detection for files that match "{0}" and for drift configuration [{1}]
+##view_alert_common_tab_conditions_type_drift_onlyconfig = Drift Detection for drift configuration [{0}]
+##view_alert_common_tab_conditions_type_drift_onlypaths = Drift Detection for files that match "{0}"
view_alert_common_tab_conditions_type_event = イベントの検出
view_alert_common_tab_conditions_type_event_matching = イベントソースが一致
view_alert_common_tab_conditions_type_metric_baseline = メトリック値のベースライン
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
index 53c9dfd..3dc1b04 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
@@ -624,6 +624,9 @@ view_alert_common_tab_conditions_type_availability = Mudan\u00E7a na Disponibili
view_alert_common_tab_conditions_type_availability_down = Indispon\u00EDvel
view_alert_common_tab_conditions_type_availability_up = Dispon\u00EDvel
##view_alert_common_tab_conditions_type_drift = Drift Detection
+##view_alert_common_tab_conditions_type_drift_configpaths = Drift Detection for files that match "{0}" and for drift configuration [{1}]
+##view_alert_common_tab_conditions_type_drift_onlyconfig = Drift Detection for drift configuration [{0}]
+##view_alert_common_tab_conditions_type_drift_onlypaths = Drift Detection for files that match "{0}"
view_alert_common_tab_conditions_type_event = Detec\u00E7\u00E3o de Envento
view_alert_common_tab_conditions_type_event_matching = combinando com o evento de origem
view_alert_common_tab_conditions_type_metric_baseline = Valor da m\u00E9trica excede a linha de base (baseline)
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
index 428b402..086bb1b 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
@@ -607,6 +607,9 @@ view_alert_common_tab_conditions_type_availability = \u53ef\u7528\u6027\u6539\u5
view_alert_common_tab_conditions_type_availability_down = Went down
view_alert_common_tab_conditions_type_availability_up = Came up
##view_alert_common_tab_conditions_type_drift = Drift Detection
+##view_alert_common_tab_conditions_type_drift_configpaths = Drift Detection for files that match "{0}" and for drift configuration [{1}]
+##view_alert_common_tab_conditions_type_drift_onlyconfig = Drift Detection for drift configuration [{0}]
+##view_alert_common_tab_conditions_type_drift_onlypaths = Drift Detection for files that match "{0}"
view_alert_common_tab_conditions_type_event = \u4e8b\u4ef6\u68c0\u6d4b
view_alert_common_tab_conditions_type_event_matching = with event source matching
view_alert_common_tab_conditions_type_metric_baseline = \u6307\u6807\u57fa\u51c6
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/DriftCacheElement.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/DriftCacheElement.java
index d7c68cf..7527fdc 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/DriftCacheElement.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/DriftCacheElement.java
@@ -25,7 +25,7 @@ import org.rhq.enterprise.server.plugin.pc.drift.DriftChangeSetSummary;
public class DriftCacheElement extends AbstractCacheElement<Object> {
- public static final Object UNUSED_CONDITION_VALUE = "unused";
+ public static final Object UNUSED_CONDITION_VALUE = "Drift Detected";
private final Pattern driftConfigNameRegex;
private final Pattern driftPathNameRegex;
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/drift/DriftChangeSetSummary.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/drift/DriftChangeSetSummary.java
index 8148690..535faf9 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/drift/DriftChangeSetSummary.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/drift/DriftChangeSetSummary.java
@@ -20,6 +20,7 @@
package org.rhq.enterprise.server.plugin.pc.drift;
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
import org.rhq.core.domain.drift.DriftChangeSetCategory;
@@ -40,6 +41,22 @@ public class DriftChangeSetSummary {
private String driftConfigurationName;
private List<String> driftPathnames;
+ /**
+ * Because this summary object is used within the alert subsystem, this toString is used to display
+ * a message in the alert description if/when alerts are fired.
+ */
+ @Override
+ public String toString() {
+ if (category == DriftChangeSetCategory.COVERAGE) {
+ return "[" + new Date(createdTime) + "] Initial drift coverage includes ["
+ + obtainDriftPathnamesList().size() + "] files using drift configuration [" + driftConfigurationName
+ + "]";
+ } else {
+ return "[" + new Date(createdTime) + "] Drift detected in [" + obtainDriftPathnamesList().size()
+ + "] files using drift configuration [" + driftConfigurationName + "]";
+ }
+ }
+
public long getCreatedTime() {
return createdTime;
}
12 years, 8 months
[rhq] Branch 'drift' - modules/core modules/enterprise
by mazz
modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertCondition.java | 7 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NewConditionEditor.java | 32 ++++-
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 4
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties | 4
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties | 4
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties | 4
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties | 4
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/AbstractConditionCache.java | 25 ++-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/AgentConditionCache.java | 27 +++-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/GlobalConditionCache.java | 6
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/DriftCacheElement.java | 64 +++++++++-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/MeasurementNumericCacheElement.java | 1
12 files changed, 151 insertions(+), 31 deletions(-)
New commits:
commit 62d5a9dcdd60d217b25e491c30501e6345d91e52
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Sep 1 16:46:50 2011 -0400
[BZ 735230] initial attempt at alerting on drift for certain drift configs and certain pathnames of files
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertCondition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertCondition.java
index 00a409b..bebcbe0 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertCondition.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertCondition.java
@@ -412,7 +412,10 @@ public class AlertCondition implements Serializable {
* CONTROL: the name of the operation (not its display name)
* EVENT: the level of event to compare with (DEBUG, INFO, WARN, ERROR, FATAL)
* RESOURCE_CONFIG: n/a (null)
- * DRIFT: n/a (null)
+ * DRIFT: the name of the drift config that triggered the drift detection. This is actually a
+ * regex that allows the user to match more than one drift config if they so choose.
+ * (this value may be null, in which case it doesn't matter which drift configs were the ones
+ * in which the drift was detected)
*
* @return additional information about the condition
*/
@@ -469,7 +472,7 @@ public class AlertCondition implements Serializable {
* CONTROL: the {@link OperationRequestStatus} name (SUCCESS, FAILURE, etc).
* EVENT: the regular expression of the message to match (which may be empty string if not specified)
* RESOURCE_CONFIG: n/a
- * DRIFT: n/a (TODO driftalert - regular expression to match files whose content drifted (may be empty string if not specified)
+ * DRIFT: a regular expression to match files whose content drifted (may be empty string or null if not specified)
*
* @return additional information about the condition
*/
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NewConditionEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NewConditionEditor.java
index 8b9986f..f3e872d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NewConditionEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NewConditionEditor.java
@@ -90,6 +90,8 @@ public class NewConditionEditor extends LocatableDynamicForm {
private static final String OPERATION_RESULTS_ITEMNAME = "operationResults";
private static final String EVENT_SEVERITY_ITEMNAME = "eventSeverity";
private static final String EVENT_REGEX_ITEMNAME = "eventRegex";
+ private static final String DRIFT_CONFIGNAME_REGEX_ITEMNAME = "driftConfigNameRegex";
+ private static final String DRIFT_PATHNAME_REGEX_ITEMNAME = "driftPathNameRegex";
private SelectItem conditionTypeSelectItem;
private HashSet<AlertCondition> conditions; // the new condition we create goes into this set
@@ -294,7 +296,7 @@ public class NewConditionEditor extends LocatableDynamicForm {
case THRESHOLD: {
if (!calltimeCategory) {
MeasurementDefinition measDef = getMeasurementDefinition(getValueAsString(THRESHOLD_METRIC_ITEMNAME));
- newCondition.setName(measDef.getDisplayName()); // TODO should not use display name
+ newCondition.setName(measDef.getDisplayName());
newCondition.setThreshold(Double.valueOf(getValueAsString(THRESHOLD_ABSVALUE_ITEMNAME)));
newCondition.setComparator(getValueAsString(THRESHOLD_COMPARATOR_ITEMNAME));
newCondition.setOption(null);
@@ -312,7 +314,7 @@ public class NewConditionEditor extends LocatableDynamicForm {
case BASELINE: {
MeasurementDefinition measDef = getMeasurementDefinition(getValueAsString(BASELINE_METRIC_ITEMNAME));
- newCondition.setName(measDef.getDisplayName()); // TODO should not use display name
+ newCondition.setName(measDef.getDisplayName());
newCondition.setThreshold(Double.valueOf(getValueAsString(BASELINE_PERCENTAGE_ITEMNAME)) / 100.0);
newCondition.setComparator(getValueAsString(BASELINE_COMPARATOR_ITEMNAME));
newCondition.setOption(getValueAsString(BASELINE_SELECTION_ITEMNAME));
@@ -323,7 +325,7 @@ public class NewConditionEditor extends LocatableDynamicForm {
case CHANGE: {
if (!calltimeCategory) {
MeasurementDefinition measDef = getMeasurementDefinition(getValueAsString(CHANGE_METRIC_ITEMNAME));
- newCondition.setName(measDef.getDisplayName()); // TODO should not use display name
+ newCondition.setName(measDef.getDisplayName());
newCondition.setComparator(null);
newCondition.setThreshold(null);
newCondition.setOption(null);
@@ -342,7 +344,7 @@ public class NewConditionEditor extends LocatableDynamicForm {
case TRAIT: {
MeasurementDefinition measDef = getMeasurementDefinition(getValueAsString(TRAIT_METRIC_ITEMNAME));
- newCondition.setName(measDef.getDisplayName()); // TODO should not use display name
+ newCondition.setName(measDef.getDisplayName());
newCondition.setComparator(null);
newCondition.setThreshold(null);
newCondition.setOption(null);
@@ -378,10 +380,10 @@ public class NewConditionEditor extends LocatableDynamicForm {
}
case DRIFT: {
- newCondition.setName(null);
+ newCondition.setName(getValueAsString(DRIFT_CONFIGNAME_REGEX_ITEMNAME));
newCondition.setComparator(null);
newCondition.setThreshold(null);
- newCondition.setOption(null); // TODO driftalert - be able to regex for only certain files that drifted
+ newCondition.setOption(getValueAsString(DRIFT_PATHNAME_REGEX_ITEMNAME));
newCondition.setMeasurementDefinition(null);
break;
}
@@ -730,6 +732,24 @@ public class NewConditionEditor extends LocatableDynamicForm {
StaticTextItem helpItem = buildHelpTextItem("driftHelp", helpStr, ifFunc);
formItems.add(helpItem);
+ TextItem driftConfigNameRegex = new TextItem(DRIFT_CONFIGNAME_REGEX_ITEMNAME, MSG
+ .view_alert_definition_condition_editor_drift_configname_regex());
+ driftConfigNameRegex.setRequired(false);
+ driftConfigNameRegex.setTooltip(MSG.view_alert_definition_condition_editor_drift_configname_regex_tooltip());
+ driftConfigNameRegex.setHoverWidth(200);
+ driftConfigNameRegex.setWrapTitle(false);
+ driftConfigNameRegex.setShowIfCondition(ifFunc);
+ formItems.add(driftConfigNameRegex);
+
+ TextItem driftPathNameRegex = new TextItem(DRIFT_PATHNAME_REGEX_ITEMNAME, MSG
+ .view_alert_definition_condition_editor_drift_pathname_regex());
+ driftPathNameRegex.setRequired(false);
+ driftPathNameRegex.setTooltip(MSG.view_alert_definition_condition_editor_drift_pathname_regex_tooltip());
+ driftPathNameRegex.setHoverWidth(200);
+ driftPathNameRegex.setWrapTitle(false);
+ driftPathNameRegex.setShowIfCondition(ifFunc);
+ formItems.add(driftPathNameRegex);
+
return formItems;
}
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
index 2c62f90..8b978c8 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -667,6 +667,10 @@ view_alert_definition_condition_editor_common_avg = Average
view_alert_definition_condition_editor_common_max = Maximum
view_alert_definition_condition_editor_common_min = Minimum
view_alert_definition_condition_editor_delete_confirm = Delete the selected alert condition(s)?
+view_alert_definition_condition_editor_drift_configname_regex = Drift Configuration Name
+view_alert_definition_condition_editor_drift_configname_regex_tooltip = If specified, this is the drift configuration name that was responsible for the drift that was detected. This can optionally be a regular expression if you wish to match multiple drift configuration names.
+view_alert_definition_condition_editor_drift_pathname_regex = Pathname Regular Expression
+view_alert_definition_condition_editor_drift_pathname_regex_tooltip = If specified, this is a regular expression that must match the pathnames of those files that drifted.
view_alert_definition_condition_editor_drift_tooltip = This condition is triggered when drift has been detected.
view_alert_definition_condition_editor_event_regex = Regular Expression
view_alert_definition_condition_editor_event_regex_tooltip = If specified, this is a regular expression that must match a collected event message in order to trigger the condition.
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 54c4599..1e1b853 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
@@ -544,6 +544,10 @@ view_alert_definition_condition_editor_common_avg = Durchschnitt
view_alert_definition_condition_editor_common_max = Maximum
view_alert_definition_condition_editor_common_min = Minimum
view_alert_definition_condition_editor_delete_confirm = Die ausgewählte(n) Alarm-Bedingung(en) löschen?
+##view_alert_definition_condition_editor_drift_configname_regex = Drift Configuration Name
+##view_alert_definition_condition_editor_drift_configname_regex_tooltip = If specified, this is the drift configuration name that was responsible for the drift that was detected. This can optionally be a regular expression if you wish to match multiple drift configuration names.
+##view_alert_definition_condition_editor_drift_pathname_regex = Pathname Regular Expression
+##view_alert_definition_condition_editor_drift_pathname_regex_tooltip = If specified, this is a regular expression that must match the pathnames of those files that drifted.
##view_alert_definition_condition_editor_drift_tooltip = This condition is triggered when drift has been detected.
view_alert_definition_condition_editor_event_regex = Regulärer Ausdruck
view_alert_definition_condition_editor_event_regex_tooltip = If specified, this is a regular expression that must match a collected event message in order to trigger the condition.~
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
index bafd11f..150c06a 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
@@ -662,6 +662,10 @@ view_alert_definition_condition_editor_common_avg = 平均
view_alert_definition_condition_editor_common_max = 最大
view_alert_definition_condition_editor_common_min = 最小
view_alert_definition_condition_editor_delete_confirm = 選択されたアラート定義を削除しますか?
+##view_alert_definition_condition_editor_drift_configname_regex = Drift Configuration Name
+##view_alert_definition_condition_editor_drift_configname_regex_tooltip = If specified, this is the drift configuration name that was responsible for the drift that was detected. This can optionally be a regular expression if you wish to match multiple drift configuration names.
+##view_alert_definition_condition_editor_drift_pathname_regex = Pathname Regular Expression
+##view_alert_definition_condition_editor_drift_pathname_regex_tooltip = If specified, this is a regular expression that must match the pathnames of those files that drifted.
##view_alert_definition_condition_editor_drift_tooltip = This condition is triggered when drift has been detected.
view_alert_definition_condition_editor_event_regex = 正規表現
view_alert_definition_condition_editor_event_regex_tooltip = もし指定されたなら、これは正規表現であり、この条件を引き起こすために収集されたイベントメッセージに一致しなければなりません。
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
index 2722b0d..53c9dfd 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
@@ -680,6 +680,10 @@ view_alert_definition_condition_editor_common_avg = M\u00E9dio
view_alert_definition_condition_editor_common_max = M\u00E1ximo
view_alert_definition_condition_editor_common_min = M\u00EDnimo
view_alert_definition_condition_editor_delete_confirm = Delete the selected alert condition(s)?
+##view_alert_definition_condition_editor_drift_configname_regex = Drift Configuration Name
+##view_alert_definition_condition_editor_drift_configname_regex_tooltip = If specified, this is the drift configuration name that was responsible for the drift that was detected. This can optionally be a regular expression if you wish to match multiple drift configuration names.
+##view_alert_definition_condition_editor_drift_pathname_regex = Pathname Regular Expression
+##view_alert_definition_condition_editor_drift_pathname_regex_tooltip = If specified, this is a regular expression that must match the pathnames of those files that drifted.
##view_alert_definition_condition_editor_drift_tooltip = This condition is triggered when drift has been detected.
view_alert_definition_condition_editor_event_regex = Express\u00E3o Regular
view_alert_definition_condition_editor_event_regex_tooltip = Se definida, a condi\u00E7\u00E3o somente ser\u00E1 disparada caso o evento satisfa\u00E7a a express\u00E3o.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
index f73be85..428b402 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
@@ -661,6 +661,10 @@ view_alert_definition_condition_editor_common_avg = \u5e73\u5747
view_alert_definition_condition_editor_common_max = \u6700\u5927
view_alert_definition_condition_editor_common_min = \u6700\u5c0f
view_alert_definition_condition_editor_delete_confirm = \u5220\u9664\u9009\u5b9a\u7684\u8b66\u62a5\u6761\u4ef6?
+##view_alert_definition_condition_editor_drift_configname_regex = Drift Configuration Name
+##view_alert_definition_condition_editor_drift_configname_regex_tooltip = If specified, this is the drift configuration name that was responsible for the drift that was detected. This can optionally be a regular expression if you wish to match multiple drift configuration names.
+##view_alert_definition_condition_editor_drift_pathname_regex = Pathname Regular Expression
+##view_alert_definition_condition_editor_drift_pathname_regex_tooltip = If specified, this is a regular expression that must match the pathnames of those files that drifted.
##view_alert_definition_condition_editor_drift_tooltip = This condition is triggered when drift has been detected.
view_alert_definition_condition_editor_event_regex = \u6b63\u5219\u8868\u8fbe\u5f0f
view_alert_definition_condition_editor_event_regex_tooltip = If specified, this is a regular expression that must match a collected event message in order to trigger the condition.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/AbstractConditionCache.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/AbstractConditionCache.java
index 9f8726a..9199701 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/AbstractConditionCache.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/AbstractConditionCache.java
@@ -66,8 +66,8 @@ abstract class AbstractConditionCache {
*/
cacheElement.setActive(true); // no harm to always set active (though, technically, STATELESS operators don't need it)
cachedConditionProducer.sendActivateAlertConditionMessage(
- cacheElement.getAlertConditionTriggerId(), timestamp,
- cacheElement.convertValueToString(providedValue), extraParams);
+ cacheElement.getAlertConditionTriggerId(), timestamp, cacheElement
+ .convertValueToString(providedValue), extraParams);
stats.matched++;
} catch (Exception e) {
@@ -120,14 +120,21 @@ abstract class AbstractConditionCache {
cache.put(key, cacheElements);
}
- if (log.isTraceEnabled()) {
- log.trace("Inserted '" + mapName + "' element: " + "key=" + key + ", " + "value=" + cacheElement);
- }
+ boolean success;
+
+ if (cacheElement != null) {
+ if (log.isTraceEnabled()) {
+ log.trace("Inserting '" + mapName + "' element: " + "key=" + key + ", " + "value=" + cacheElement);
+ }
- // and finally update stats and return whether it was success
- boolean success = cacheElements.add(cacheElement);
- if (success) {
- stats.created++;
+ // and finally update stats and return whether it was success
+ success = (cacheElement != null) ? cacheElements.add(cacheElement) : false;
+ if (success) {
+ stats.created++;
+ }
+ } else {
+ success = false;
+ log.warn("Cannot insert null cache element in '" + mapName + "' element: " + "key=" + key);
}
return success;
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/AgentConditionCache.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/AgentConditionCache.java
index ac19d37..21409e5 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/AgentConditionCache.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/AgentConditionCache.java
@@ -73,11 +73,11 @@ import org.rhq.enterprise.server.util.LookupUtil;
*/
class AgentConditionCache extends AbstractConditionCache {
- private Map<Integer, List<NumericDoubleCacheElement>> measurementDataCache;
- private Map<Integer, List<MeasurementTraitCacheElement>> measurementTraitCache;
- private Map<Integer, List<CallTimeDataCacheElement>> callTimeCache;
- private Map<Integer, List<EventCacheElement>> eventsCache;
- private Map<Integer, List<DriftCacheElement>> driftCache;
+ private Map<Integer, List<NumericDoubleCacheElement>> measurementDataCache; // key: schedule ID
+ private Map<Integer, List<MeasurementTraitCacheElement>> measurementTraitCache; // key: schedule ID
+ private Map<Integer, List<CallTimeDataCacheElement>> callTimeCache; // key: schedule ID
+ private Map<Integer, List<EventCacheElement>> eventsCache; // key: resource ID
+ private Map<Integer, List<DriftCacheElement>> driftCache; // key: resource ID
private AlertConditionManagerLocal alertConditionManager;
private MeasurementDataManagerLocal measurementDataManager;
@@ -314,7 +314,19 @@ class AgentConditionCache extends AbstractConditionCache {
addTo("eventsCache", eventsCache, eventComposite.getResourceId(), cacheElement, alertConditionId, stats);
} else if (alertConditionCategory == AlertConditionCategory.DRIFT) {
AlertConditionDriftCategoryComposite driftComposite = (AlertConditionDriftCategoryComposite) composite;
- DriftCacheElement cacheElement = new DriftCacheElement(alertConditionOperator, alertConditionId);
+
+ String driftConfigNameRegexStr = driftComposite.getCondition().getName();
+ String driftPathNameRegexStr = driftComposite.getCondition().getOption();
+
+ DriftCacheElement cacheElement = null;
+ try {
+ cacheElement = new DriftCacheElement(alertConditionOperator, driftConfigNameRegexStr,
+ driftPathNameRegexStr, alertConditionId);
+ } catch (InvalidCacheElementException icee) {
+ log.info("Failed to create DriftCacheElement: id=" + alertConditionId + ", operator="
+ + alertConditionOperator + ", driftConfigNameRegex=" + driftConfigNameRegexStr
+ + ", driftPathNameRegex=" + driftPathNameRegexStr);
+ }
addTo("driftCache", driftCache, driftComposite.getResourceId(), cacheElement, alertConditionId, stats);
}
}
@@ -477,7 +489,8 @@ class AgentConditionCache extends AbstractConditionCache {
int resourceId = driftChangeSetSummary.getResourceId();
List<DriftCacheElement> cacheElements = lookupDriftCacheElements(resourceId);
- processCacheElements(cacheElements, (Object) "", driftChangeSetSummary.getCreatedTime(), stats);
+ processCacheElements(cacheElements, DriftCacheElement.UNUSED_CONDITION_VALUE, driftChangeSetSummary
+ .getCreatedTime(), stats, driftChangeSetSummary);
AlertConditionCacheMonitor.getMBean().incrementDriftCacheElementMatches(stats.matched);
AlertConditionCacheMonitor.getMBean().incrementDriftProcessingTime(stats.getAge());
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/GlobalConditionCache.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/GlobalConditionCache.java
index dc4166f..5f9ecdb 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/GlobalConditionCache.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/GlobalConditionCache.java
@@ -57,9 +57,9 @@ import org.rhq.enterprise.server.util.LookupUtil;
*/
class GlobalConditionCache extends AbstractConditionCache {
- private Map<Integer, Map<Integer, List<ResourceOperationCacheElement>>> resourceOperationCache;
- private Map<Integer, List<AvailabilityCacheElement>> availabilityCache;
- private Map<Integer, List<ResourceConfigurationCacheElement>> resourceConfigurationCache;
+ private Map<Integer, Map<Integer, List<ResourceOperationCacheElement>>> resourceOperationCache; // key: resource ID, inner key: operation def ID
+ private Map<Integer, List<AvailabilityCacheElement>> availabilityCache; // key: resource ID
+ private Map<Integer, List<ResourceConfigurationCacheElement>> resourceConfigurationCache; // key: resource ID
private AlertConditionManagerLocal alertConditionManager;
private SubjectManagerLocal subjectManager;
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/DriftCacheElement.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/DriftCacheElement.java
index d11ab51..d7c68cf 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/DriftCacheElement.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/DriftCacheElement.java
@@ -18,16 +18,74 @@
*/
package org.rhq.enterprise.server.alert.engine.model;
+import java.util.regex.Pattern;
+
+import org.rhq.core.domain.drift.DriftChangeSetCategory;
+import org.rhq.enterprise.server.plugin.pc.drift.DriftChangeSetSummary;
+
public class DriftCacheElement extends AbstractCacheElement<Object> {
- public DriftCacheElement(AlertConditionOperator operator, int conditionTriggerId) {
- super(operator, "", conditionTriggerId);
+ public static final Object UNUSED_CONDITION_VALUE = "unused";
+ private final Pattern driftConfigNameRegex;
+ private final Pattern driftPathNameRegex;
+
+ public DriftCacheElement(AlertConditionOperator operator, String driftConfigNameRegexStr,
+ String driftPathNameRegexStr, int conditionTriggerId) {
+ // our drift processing is special in that we do not have an alert condition value that
+ // we need check to determine if our cache element matches a particular value. But we need
+ // to give something, so just give static string since its small and we don't create more
+ // objects than we need. This means super.alertConditionValue will not be used.
+ super(operator, UNUSED_CONDITION_VALUE, conditionTriggerId);
+
+ try {
+ if (driftConfigNameRegexStr != null && driftConfigNameRegexStr.length() > 0) {
+ this.driftConfigNameRegex = Pattern.compile(driftConfigNameRegexStr);
+ } else {
+ this.driftConfigNameRegex = null;
+ }
+
+ if (driftPathNameRegexStr != null && driftPathNameRegexStr.length() > 0) {
+ this.driftPathNameRegex = Pattern.compile(driftPathNameRegexStr);
+ } else {
+ this.driftPathNameRegex = null;
+ }
+ } catch (Exception e) {
+ throw new InvalidCacheElementException("Failed to compile regex for drift condition", e);
+ }
}
@Override
public boolean matches(Object providedValue, Object... extraParams) {
+
if (alertConditionOperator == AlertConditionOperator.CHANGES) {
- return true; // any drift report we get implies the content has changed
+ DriftChangeSetSummary summary = (DriftChangeSetSummary) extraParams[0];
+
+ if (summary.getCategory() == DriftChangeSetCategory.COVERAGE) {
+ return false; // we never alert on coverage reports, we only alert when files have drifted from previous known states
+ }
+
+ if (driftConfigNameRegex != null) {
+ if (!driftConfigNameRegex.matcher(summary.getDriftConfigurationName()).matches()) {
+ return false; // drift config name did not match, our condition is false so don't alert
+ }
+ }
+
+ boolean pathNameMatches;
+ if (driftPathNameRegex != null) {
+ pathNameMatches = false; // assume we don't match anything
+ for (String pathname : summary.getDriftPathnames()) {
+ if (driftPathNameRegex.matcher(pathname).matches()) {
+ // at least one file that drifted matches our regex
+ pathNameMatches = true;
+ break;
+ }
+ }
+ } else {
+ pathNameMatches = true; // no regex, so we always match no matter what files drifted
+ }
+
+ return pathNameMatches;
+
} else {
throw new UnsupportedAlertConditionOperatorException(getClass().getSimpleName() + " does not support "
+ alertConditionOperator);
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/MeasurementNumericCacheElement.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/MeasurementNumericCacheElement.java
index 29c00cd..0b66ba8 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/MeasurementNumericCacheElement.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/MeasurementNumericCacheElement.java
@@ -30,7 +30,6 @@ public class MeasurementNumericCacheElement extends NumericDoubleCacheElement {
public MeasurementNumericCacheElement(AlertConditionOperator operator, Double value, int conditionTriggerId) {
super(operator, value, conditionTriggerId);
- // TODO Auto-generated constructor stub
}
}
12 years, 8 months
[rhq] modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java | 26 ++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java | 60 +++-------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java | 28 +++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java | 20 ---
5 files changed, 69 insertions(+), 69 deletions(-)
New commits:
commit 85ccbd1698c68a5a7850a32fe364973a5ef704be
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Sep 1 16:55:06 2011 -0400
[BZ 735232] Message portlet should not be displayed on default dashboard in JON
(https://bugzilla.redhat.com/show_bug.cgi?id=735232); fix layout issues in About
modal window; load ProductInfo once in CoreGUI init and cache it
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
index 2a52e4d..88801e0 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
@@ -33,6 +33,7 @@ import com.google.gwt.user.client.History;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.Window.Location;
+import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.core.KeyIdentifier;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.util.KeyCallback;
@@ -41,10 +42,12 @@ import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.layout.VLayout;
+import org.rhq.core.domain.common.ProductInfo;
import org.rhq.enterprise.gui.coregui.client.admin.AdministrationView;
import org.rhq.enterprise.gui.coregui.client.alert.AlertHistoryView;
import org.rhq.enterprise.gui.coregui.client.bundle.BundleTopView;
import org.rhq.enterprise.gui.coregui.client.dashboard.DashboardsView;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.help.HelpView;
import org.rhq.enterprise.gui.coregui.client.inventory.InventoryView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.ResourceGroupDetailView;
@@ -109,6 +112,7 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String>, Event.Na
private MenuBarView menuBarView;
private Footer footer;
private int rpcTimeout;
+ private ProductInfo productInfo;
public void onModuleLoad() {
String hostPageBaseURL = GWT.getHostPageBaseURL();
@@ -262,6 +266,28 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String>, Event.Na
return coreGUI;
}
+ public void init() {
+ if (productInfo == null) {
+ GWTServiceLookup.getSystemService().getProductInfo(new AsyncCallback<ProductInfo>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(MSG.view_aboutBox_failedToLoad(), caught);
+ buildCoreUI();
+ }
+
+ public void onSuccess(ProductInfo result) {
+ productInfo = result;
+ buildCoreUI();
+ }
+ });
+ } else {
+ buildCoreUI();
+ }
+ }
+
+ public ProductInfo getProductInfo() {
+ return productInfo;
+ }
+
public void buildCoreUI() {
// If the core gui is already built (eg. from previous login) skip the build and just refire event
if (rootCanvas == null) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java
index 56c3658..7bdcb6e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java
@@ -84,7 +84,7 @@ public class UserSessionManager {
// We want the CoreGUI session timeout to rule them all. The rhq subject session is refreshed on each SLSB
// call. But the HTTP session will die after 30 minutes. Keep it alive until logout by pinging SessionAccessServlet
- // occasionaly, as specified by this interval (which must be less than the 30 minutes).
+ // occasionally, as specified by this interval (which must be less than the 30 minutes).
// Currently: 20 minutes
private static int SESSION_ACCESS_REFRESH = 20 * 60 * 1000;
@@ -454,7 +454,7 @@ public class UserSessionManager {
scheduleWebUserUpdate(loggedInSubject);
}
- CoreGUI.get().buildCoreUI();
+ CoreGUI.get().init();
}
public void onFailure(Throwable caught) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
index 6a614bb..b476f66 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2010 Red Hat, Inc.
+ * Copyright (C) 2010-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -18,25 +18,18 @@
*/
package org.rhq.enterprise.gui.coregui.client.components;
-import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.Version;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.types.VerticalAlignment;
-import com.smartgwt.client.widgets.Button;
-import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.HTMLFlow;
-import com.smartgwt.client.widgets.IButton;
-import com.smartgwt.client.widgets.Window;
+import com.smartgwt.client.widgets.HTMLPane;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
-import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.common.ProductInfo;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.Messages;
-import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHLayout;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
@@ -52,8 +45,6 @@ public class AboutModalWindow extends LocatableWindow {
private static final Messages MSG = CoreGUI.getMessages();
- private static ProductInfo PRODUCT_INFO;
-
/**
* <pre>
* ID Format: "simpleClassname_locatorId"
@@ -78,37 +69,19 @@ public class AboutModalWindow extends LocatableWindow {
@Override
protected void onInit() {
- super.onInit();
-
- if (PRODUCT_INFO == null) {
- GWTServiceLookup.getSystemService().getProductInfo(new AsyncCallback<ProductInfo>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(MSG.view_aboutBox_failedToLoad(), caught);
- }
-
- public void onSuccess(ProductInfo result) {
- PRODUCT_INFO = result;
- setTitle(MSG.view_aboutBox_title(PRODUCT_INFO.getFullName()));
+ ProductInfo productInfo = CoreGUI.get().getProductInfo();
- finishOnInit();
- }
- });
- } else {
- finishOnInit();
- }
- }
+ setTitle(MSG.view_aboutBox_title(productInfo.getFullName()));
- private void finishOnInit() {
LocatableVLayout contentPane = new LocatableVLayout(extendLocatorId("Content"));
- contentPane.setPadding(13);
- contentPane.setMembersMargin(25);
-
- HTMLFlow htmlFlow = new HTMLFlow();
- String html = "<span class=\"DisplaySubhead\">\n" + " <a href=\"" + PRODUCT_INFO.getUrl() + "\" title=\""
- + PRODUCT_INFO.getFullName() + " " + PRODUCT_INFO.getUrl() + "\" target=\"_blank\">"
- + PRODUCT_INFO.getFullName() + "</a>\n" + "</span><br/>\n" + "<span class=\"DisplayLabel\">"
- + MSG.view_aboutBox_version() + " " + PRODUCT_INFO.getVersion() + "</span><br/>\n"
- + "<span class=\"DisplayLabel\">" + MSG.view_aboutBox_buildNumber() + " " + PRODUCT_INFO.getBuildNumber()
+ contentPane.setPadding(10);
+
+ HTMLPane htmlPane = new HTMLPane();
+ String html = "<span class=\"DisplaySubhead\">\n" + " <a href=\"" + productInfo.getUrl() + "\" title=\""
+ + productInfo.getFullName() + " " + productInfo.getUrl() + "\" target=\"_blank\">"
+ + productInfo.getFullName() + "</a>\n" + "</span><br/>\n" + "<span class=\"DisplayLabel\">"
+ + MSG.view_aboutBox_version() + " " + productInfo.getVersion() + "</span><br/>\n"
+ + "<span class=\"DisplayLabel\">" + MSG.view_aboutBox_buildNumber() + " " + productInfo.getBuildNumber()
+ "</span><p/>\n" + "<span class=\"DisplayLabel\">GWT " + MSG.common_title_version() + ": "
+ MSG.common_buildInfo_gwtVersion() + "</span><br/>\n" + "<span class=\"DisplayLabel\">SmartGWT "
+ MSG.common_title_version() + ": " + Version.getVersion() + "</span><br/>\n"
@@ -116,17 +89,19 @@ public class AboutModalWindow extends LocatableWindow {
+ " <img height=\"55\" alt=\"" + MSG.view_aboutBox_jbossByRedHat()
+ "\" src=\"/images/jboss_logo.png\">\n" + "</a></p>\n" + "<div style=\"top-margin: 10px\">"
+ MSG.view_aboutBox_allRightsReserved() + "</div>\n";
- htmlFlow.setContents(html);
- contentPane.addMember(htmlFlow);
+ htmlPane.setContents(html);
+ htmlPane.setHeight(220);
+ contentPane.addMember(htmlPane);
LocatableHLayout buttonBar = new LocatableHLayout(contentPane.extendLocatorId("ButtonBar"));
+ buttonBar.setHeight(30);
buttonBar.setAlign(Alignment.RIGHT);
LocatableIButton closeButton = new LocatableIButton(buttonBar.extendLocatorId("Close"),
MSG.common_button_close());
closeButton.setShowRollOver(true);
closeButton.setShowDown(true);
- closeButton.setWidth("60");
+ closeButton.setWidth(60);
closeButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
hide();
@@ -143,4 +118,5 @@ public class AboutModalWindow extends LocatableWindow {
// Layout class.
addItem(contentPane);
}
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
index 7d0ec7a..424b256 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2009 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -45,6 +45,7 @@ import com.smartgwt.client.widgets.tab.events.TabSelectedEvent;
import com.smartgwt.client.widgets.tab.events.TabSelectedHandler;
import org.rhq.core.domain.authz.Permission;
+import org.rhq.core.domain.common.ProductInfo;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.criteria.DashboardCriteria;
import org.rhq.core.domain.dashboard.Dashboard;
@@ -361,21 +362,32 @@ public class DashboardsView extends LocatableVLayout implements DashboardContain
dashboard.setColumnWidths("32%");
dashboard.getConfiguration().put(new PropertySimple(Dashboard.CFG_BACKGROUND, "#F1F2F3"));
+ ProductInfo productInfo = CoreGUI.get().getProductInfo();
+ boolean isRHQ = (productInfo != null) && "RHQ".equals(productInfo.getShortName());
+
// Left Column
- DashboardPortlet welcome = new DashboardPortlet(MessagePortlet.NAME, MessagePortlet.KEY, 250);
- dashboard.addPortlet(welcome, 0, 0);
+ int columnIndex = 0;
+ int rowIndex = 0;
+
+ if (isRHQ) {
+ DashboardPortlet welcome = new DashboardPortlet(MessagePortlet.NAME, MessagePortlet.KEY, 250);
+ dashboard.addPortlet(welcome, columnIndex, rowIndex++);
+ }
DashboardPortlet summary = new DashboardPortlet(InventorySummaryPortlet.NAME, InventorySummaryPortlet.KEY, 250);
- dashboard.addPortlet(summary, 0, 1);
+ dashboard.addPortlet(summary, columnIndex, rowIndex++);
DashboardPortlet news = new DashboardPortlet(MashupPortlet.NAME, MashupPortlet.KEY, 300);
news.getConfiguration().put(
new PropertySimple("address", "http://rhq-project.org/display/RHQ/RHQ+News?decorator=popup"));
- dashboard.addPortlet(news, 0, 2);
+ dashboard.addPortlet(news, columnIndex, rowIndex++);
// Right Column
+ columnIndex = 1;
+ rowIndex = 0;
+
DashboardPortlet recentAlerts = new DashboardPortlet(RecentAlertsPortlet.NAME, RecentAlertsPortlet.KEY, 250);
- dashboard.addPortlet(recentAlerts, 1, 0);
+ dashboard.addPortlet(recentAlerts, columnIndex, rowIndex++);
DashboardPortlet problemResources = new DashboardPortlet(ProblemResourcesPortlet.NAME,
ProblemResourcesPortlet.KEY, 250);
@@ -388,11 +400,11 @@ public class DashboardsView extends LocatableVLayout implements DashboardContain
.put(
new PropertySimple(ProblemResourcesPortlet.PROBLEM_RESOURCE_SHOW_HRS,
ProblemResourcesPortlet.defaultValue));
- dashboard.addPortlet(problemResources, 1, 1);
+ dashboard.addPortlet(problemResources, columnIndex, rowIndex++);
DashboardPortlet operations = new DashboardPortlet(OperationHistoryPortlet.NAME, OperationHistoryPortlet.KEY,
200);
- dashboard.addPortlet(operations, 1, 2);
+ dashboard.addPortlet(operations, columnIndex, rowIndex++);
return dashboard;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
index 22a0c13..8f4df4b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -26,7 +26,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.MissingResourceException;
-import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.Label;
@@ -41,7 +40,6 @@ import org.rhq.enterprise.gui.coregui.client.components.view.NavigationItem;
import org.rhq.enterprise.gui.coregui.client.components.view.NavigationSection;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewFactory;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewName;
-import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/**
@@ -96,20 +94,8 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
"[SKIN]/../actions/help.png", new ViewFactory() {
public Canvas createView() {
final AboutModalWindow aboutModalWindow = new AboutModalWindow(extendLocatorId("AboutModalWindow"));
- if (PRODUCT_INFO == null) {
- GWTServiceLookup.getSystemService().getProductInfo(new AsyncCallback<ProductInfo>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(MSG.view_aboutBox_failedToLoad(), caught);
- }
-
- public void onSuccess(ProductInfo result) {
- PRODUCT_INFO = result;
- aboutModalWindow.setTitle(MSG.view_aboutBox_title(PRODUCT_INFO.getFullName()));
- }
- });
- } else {
- aboutModalWindow.setTitle(MSG.view_aboutBox_title(PRODUCT_INFO.getFullName()));
- }
+ ProductInfo productInfo = CoreGUI.get().getProductInfo();
+ aboutModalWindow.setTitle(MSG.view_aboutBox_title(productInfo.getFullName()));
aboutModalWindow.show();
return aboutModalWindow;
}
12 years, 8 months
[rhq] Branch 'release-4.1.0' - modules/common modules/core modules/enterprise modules/helpers modules/plugins modules/pom.xml modules/test-utils pom.xml
by John Sanda
modules/common/ant-bundle/pom.xml | 2 +-
modules/common/drift/pom.xml | 2 +-
modules/common/filetemplate-bundle/pom.xml | 2 +-
modules/common/jboss-as/pom.xml | 2 +-
modules/common/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/pom.xml | 2 +-
modules/core/plugin-validator/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
modules/core/util/pom.xml | 2 +-
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/base-perspective-jar/pom.xml | 2 +-
modules/enterprise/gui/base-perspective-war/pom.xml | 2 +-
modules/enterprise/gui/content_http-war/pom.xml | 2 +-
modules/enterprise/gui/coregui/pom.xml | 2 +-
modules/enterprise/gui/installer-war/pom.xml | 2 +-
modules/enterprise/gui/pom.xml | 2 +-
modules/enterprise/gui/portal-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/remoting/webservices/pom.xml | 2 +-
modules/enterprise/server/client-api/pom.xml | 4 ++--
modules/enterprise/server/container-lib/pom.xml | 2 +-
modules/enterprise/server/container/pom.xml | 2 +-
modules/enterprise/server/ear/pom.xml | 2 +-
modules/enterprise/server/jar/pom.xml | 2 +-
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/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/groovy-script/pom.xml | 4 ++--
modules/enterprise/server/plugins/jboss-software/pom.xml | 2 +-
modules/enterprise/server/plugins/packagetype-cli/pom.xml | 4 ++--
modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml | 2 +-
modules/enterprise/server/plugins/perspectives/core/pom.xml | 2 +-
modules/enterprise/server/plugins/pom.xml | 2 +-
modules/enterprise/server/plugins/rhnhosted/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/safe-invoker/pom.xml | 2 +-
modules/enterprise/server/sars/agent-sar/pom.xml | 2 +-
modules/enterprise/server/sars/pom.xml | 2 +-
modules/enterprise/server/xml-schemas/pom.xml | 2 +-
modules/helpers/bundleGen/pom.xml | 4 ++--
modules/helpers/perftest-support/pom.xml | 4 ++--
modules/helpers/pom.xml | 2 +-
modules/helpers/rtfilter/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/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/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/samba/pom.xml | 2 +-
modules/plugins/script/pom.xml | 2 +-
modules/plugins/script2/pom.xml | 2 +-
modules/plugins/snmptrapd/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 +-
119 files changed, 137 insertions(+), 137 deletions(-)
New commits:
commit b2a99b53777c9a853f042ac497f809b152373209
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Sep 1 16:56:35 2011 -0400
[maven-release-plugin] prepare for next development iteration
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index cc093dc..1eb86ef 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/drift/pom.xml b/modules/common/drift/pom.xml
index a0b0fe5..73ab33a 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml
index ec13aba..352de33 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index 5e803b5..184c5ad 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index dc9d201..bd88fa0 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index efb8ea9..9f5f66a 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index b00af21..5a8b356 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index df55970..aa20853 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-dbutils</artifactId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index f4a1644..42d28e1 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index ef9b5a2..bb4dc2c 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index defd464..7d83f3d 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index ab47c9f..fc78701 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml
index 6071e4f..5e8397b 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml
index 14572cd..f2953a6 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 85e1b5c..62a73be 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index 105c762..dfa5bb8 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index 1606f00..42673c4 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml
index 0265632..8b7ffe8 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/binding/pom.xml b/modules/enterprise/binding/pom.xml
index 24fb704..d96cf83 100644
--- a/modules/enterprise/binding/pom.xml
+++ b/modules/enterprise/binding/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-enterprise-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-script-bindings</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 91d1113..f424704 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml
index 3bf686e..cebd439 100644
--- a/modules/enterprise/gui/base-perspective-jar/pom.xml
+++ b/modules/enterprise/gui/base-perspective-jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml
index 3583575..b66da2c 100644
--- a/modules/enterprise/gui/base-perspective-war/pom.xml
+++ b/modules/enterprise/gui/base-perspective-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 166500b..db7d757 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml
index 43751b9..de77f3f 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml
index 2dfd803..900d476 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index 2615b14..8e8cf66 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 7c07c4c..4e2ac9f 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index 28d87f6..01fb7f6 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml
index 91a2a2a..24fbb60 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 a389fa4..1a1c88c 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 c65a209..3fe07b7 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index d0fc35d..f4b1866 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml
index 5c4b9f3..dee43bc 100644
--- a/modules/enterprise/remoting/webservices/pom.xml
+++ b/modules/enterprise/remoting/webservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 78116e0..c57eaba 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-server-client-api</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</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/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml
index bff3f77..1aebae1 100644
--- a/modules/enterprise/server/container-lib/pom.xml
+++ b/modules/enterprise/server/container-lib/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml
index 812e4a2..d27c157 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml
index a90f82e..8cdaf8b 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml
index 1afd286..d2f2bc5 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 6a9abdd..b380393 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>alert-cli</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 c2c4c37..e1e1890 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.server</groupId>
<artifactId>alert-email</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 76d4be0..1b609e1 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-irc</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 4f81b24..1a27831 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-log4j</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 48bf813..ab68d6b 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-microblog</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 0ef3ee7..0adccaf 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-mobicents</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 174f7a1..2c9bcfa 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-operations</artifactId>
<packaging>jar</packaging>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 b8639bc..06bab65 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-roles</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 480b216..3763c54 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-snmp</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 3780d6a..bb595b5 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-subject</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Subject Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index 252a47d..c4e59b2 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 5157789..381f64c 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>rhq-serverplugin-cobbler</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 5e2a23b..403ef41 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 f71ba0b..9c9d3b6 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 a58f862..ad1c570 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/groovy-script/pom.xml b/modules/enterprise/server/plugins/groovy-script/pom.xml
index 5f07165..0d2bf4b 100644
--- a/modules/enterprise/server/plugins/groovy-script/pom.xml
+++ b/modules/enterprise/server/plugins/groovy-script/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>groovy-script-server-plugin</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Groovy Script Plugin</name>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml
index bb8bca5..dacaec2 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 d9ecf3c..9a51242 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>packagetype-cli</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server CLI Package Type Plugin</name>
diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
index a158617..f73ecb8 100644
--- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml
index a8dd29f..c2d5c7e 100644
--- a/modules/enterprise/server/plugins/perspectives/core/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml
index 7b5f68f..3fa05d3 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml
index 623b911..04df0b8 100644
--- a/modules/enterprise/server/plugins/rhnhosted/pom.xml
+++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml
index b4a7e6e..79ccf2b 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 3bf9a23..9e221a0 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 8020ab3..ce8468c 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml
index 9cc9503..05cb339 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml
index 991618b..00344d4 100644
--- a/modules/enterprise/server/sars/agent-sar/pom.xml
+++ b/modules/enterprise/server/sars/agent-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml
index 33b2552..2377858 100644
--- a/modules/enterprise/server/sars/pom.xml
+++ b/modules/enterprise/server/sars/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 967e367..90c0da6 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/bundleGen/pom.xml b/modules/helpers/bundleGen/pom.xml
index 56788dc..9e80f1f 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.helpers</groupId>
<artifactId>bundleGen</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<build>
<plugins>
diff --git a/modules/helpers/perftest-support/pom.xml b/modules/helpers/perftest-support/pom.xml
index b64a93b..e488bb0 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>perftest-support</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 e01b64a..0c73fd3 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index 3a82c2b..417a3df 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index e15151b..d983b6a 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index 87c8023..ff8c753 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index 0f0bf36..e68547f 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index a7d6928..ff7d21f 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/byteman/pom.xml b/modules/plugins/byteman/pom.xml
index 55db9e7..46bcb55 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index 8a6a965..78156f3 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index 02ae96e..5f2c454 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index 5a6973b..6c1812b 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml
index d53b74d..c1e0a3d 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index 43a2a5d..d197727 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hadoop/pom.xml b/modules/plugins/hadoop/pom.xml
index dd99e27..840e619 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index 7d33e56..e482d30 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 6e1739f..0c7ec29 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index 537d523..b097071 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-hudson-plugin</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>RHQ Hudson Plugin</name>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index 3de5266..2cdc32a 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/irc/pom.xml b/modules/plugins/irc/pom.xml
index 8e3b26e..edf12ea 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 8aab8d5..6ec0096 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 ccede24..ca63c5e 100644
--- a/modules/plugins/jboss-as-7/pom.xml
+++ b/modules/plugins/jboss-as-7/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index 03c26e2..57c8bb3 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 07fd383..1a3a1df 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index 2746b2e..ae06793 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index a4fa475..1daf86d 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/kickstart/pom.xml b/modules/plugins/kickstart/pom.xml
index db2abe4..dc87ed7 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index ef80c44..3a6deaa 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index 49d7072..d8ebb5d 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index ed2fe57..f1675e4 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index 8b2b38a..8a3b3c0 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pattern-generator/pom.xml b/modules/plugins/pattern-generator/pom.xml
index 75281e6..6b0791d 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index 15e299b..63dd974 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index 456d886..99f36d0 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index a6637f1..f32159e 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index f72540b..2a0eb28 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index 94545df..365f6c4 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index 6a7f19f..60471c2 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index 1b9ade1..e88b97f 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 8202103..90337ed 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index c9b2423..d31afb9 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script2/pom.xml b/modules/plugins/script2/pom.xml
index 1dd219f..2cf689c 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index be1e9bc..05ed401 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index d37e38d..3a1df45 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index f372d88..9429831 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index b5f6dbe..f6dfebd 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index 1507ac7..50ff9b6 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</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 f2e6e6c..6565a7b 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/virt/pom.xml b/modules/plugins/virt/pom.xml
index b6e7f72..8700a19 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index 8a3c8c3..2b45c62 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index fd77c86..5c6e85c 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.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<artifactId>test-utils</artifactId>
diff --git a/pom.xml b/pom.xml
index 87fc764..ab342f5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0</version>
+ <version>4.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RHQ</name>
12 years, 8 months
[rhq] Changes to 'refs/tags/RHQ_4_1_0'
by John Sanda
Tag 'RHQ_4_1_0' created by John Sanda <jsanda(a)redhat.com> at 2011-09-01 20:56 +0000
[maven-release-plugin] copy for tag RHQ_4_1_0
Changes since RHQ_3_0_0-BETA1:
Ian Springer (4):
[BZ 676761] add better error handling when user enters an invalid search expression on the Inventory>Children subtab (https://bugzilla.redhat.com/show_bug.cgi?id=676761)
add support for dev profile to perftest plugin's pom
[BZ 722548] add new #Test/Rpc view that can be used to invoke a new sleep() RPC
[BZ 734610] remove validator on username field that was disallowing usernames
Jay Shaughnessy (7):
[BZ 695889 - Search Bar Saved Search issues]
[BZ 733144 - links to non-default subtabs don't work]
[BZ 734034 - Saved search name should be removed from search bar after user deletes it]
[BZ 734092 - 'Discovery Queue' portlet refresh is not working on dashboard]
[BZ 34054 - Throws 'Globally uncaught exception' while adding 'Platform Utilization' on dashboard]
[BZ 733613 - Add button got disabled, if user cancel the drift creation]
[BZ 734879 - Drift display issue ... Change Sets-->Context Menu--->Details]
John Mazzitelli (5):
create/delete child history has its own inventory filter - will add more timeline markers for inventory shortly
add inventory data to timeline (when resource was discovered and when it was inventoried)
add drift to timeline
clean up some of the timeline
we have create-child and delete-child icons - use those rather than re-use the inventory icons
John Sanda (14):
Check to see if a schedule has been removed before sending change set to server
Updating clean up code in DriftManager to not delete files until streams are closed
[BZ 732078] Adding support for detecting "viewable" files
Enable drift configurations by default
Package sample/demo scripts with CLI
[BZ 734194] Check that content is loaded in db on drift details view
fixing test failures
[BZ 734842] Adding more detailed logging around drift detection
[BZ 734814] Adding docs
[BZ 734881] Need to check for empty content because oracle blobs don't handle it
[maven-release-plugin] prepare release RHQ_4_1_0
[maven-release-plugin] prepare for next development iteration
Fixing syntax error
[maven-release-plugin] prepare release RHQ_4_1_0
Lukas Krejci (2):
BZ 707669 - The bundled native augeas libraries have been bumped to version 0.9.0.
BZ 707669 - Forgot to check in the plugin-container pom that actually fetches the augeas-native as its dependency.
Simeon Pinder (12):
[maven-release-plugin] prepare for next development iteration
disabling mongodb server side plugin for a)cause problematic brew
Merge branch 'release_jon3.0.0-test-build' of ssh://git.fedorahosted.org/git/rhq/rhq into release_jon3.0.0-test-build
[maven-release-plugin] prepare release RHQ_4_1_1-BETA1
[maven-release-plugin] prepare for next development iteration
Revert "[maven-release-plugin] prepare for next development iteration"
Disabling 'plugindoc' plugin which generated DocBook and Confluence docs off the plugin.xmls. Causing brew dependency issues and doesn't appear to be used.
-applying missing brew patches to master. Somehow these got lost in translation.
Merge branch 'jon3_test-build' into track_master4
removing JAVA5 backwards compatiblity support. Only commenting out logic as similar logic needed for JDK6 vs JDK7 in the near future.
also removing JAVA5 logic from publish_release. Same reason as earlier commit.
reverting back to SNAPSHOT version.
Stefan Negrea (34):
Get the integration tests to compile and run again by creating the maven module and deploying the correct resources to target folder.
Add jar dependencies for testing with JBoss 5&6.
With JBoss 5, the timeout is blocking the operation call for the period set. Reduce this period for these integration tests.
Enable mod_cluster support for JBoss 5&6 with simple and HA configuration listeners. Also, added metric collections and configuration save to bean file.
The JBoss server home directory is now correctly retrieved from the parent resource component. Included some other minor code tweaks and refactorings.
Updates to support integration with JBoss' mod_cluster module for AS6 and EAP5.1.x
Renaming mod_cluster components to match their explicit purpose.
More updates to the naming of each plugin component to match the intent and purpose. Also updated the integration tests to test each resource type.
Added the proxyInfo metric back to Catalina service context since it is readly available.
Small refactoring and code formating change to make the class easier to read and understand.
Get the integration tests to compile and run again by creating the maven module and deploying the correct resources to target folder.
Add jar dependencies for testing with JBoss 5&6.
With JBoss 5, the timeout is blocking the operation call for the period set. Reduce this period for these integration tests.
Enable mod_cluster support for JBoss 5&6 with simple and HA configuration listeners. Also, added metric collections and configuration save to bean file.
The JBoss server home directory is now correctly retrieved from the parent resource component. Included some other minor code tweaks and refactorings.
Updates to support integration with JBoss' mod_cluster module for AS6 and EAP5.1.x
Renaming mod_cluster components to match their explicit purpose.
More updates to the naming of each plugin component to match the intent and purpose. Also updated the integration tests to test each resource type.
Added the proxyInfo metric back to Catalina service context since it is readly available.
Small refactoring and code formating change to make the class easier to read and understand.
Merge branch 'mod_cluster_plugin' of ssh://git.fedorahosted.org/git/rhq/rhq into mod_cluster_plugin
Merge branch 'mod_cluster_plugin'
Moved private method at the bottom fo the file to follow standard java file structure.
Add property persistance functionality to catalina JMX listener for mod_cluster by saving the configuration directly into the server.xml file.
All the node lists are zero based index. Fixing for the incorrect indexing of lists.
Refactoring configuration file classes to accept files in the constructor to allow testing. Also, added basic configuration files for testing.
Merge branch 'mod_cluster_plugin'
BZ728621 - The correct procedure to update mod_cluster properties for JBoss 42 is:
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
BZ729051 - Extended the default MBean resource component implementation to support TimeUnit arguments.
BZ727963 - Updated the code to declare the logger locally before using it. The logger declared at parent level was issuing usage warnings on the agent container.
BZ733775 - Update the plugin configuration file to have correct descriptions for each service available. Also added a new class to verify the availability of a className mbean resource.
Add proxy information metric to make the mod_cluster component dyna group friendly for complex queries (eg. group based on httpd proxy).
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
---
.classpath | 1
etc/cli-scripts/drift.js | 164 --
etc/cli-scripts/measurement_utils.js | 134 --
etc/cli-scripts/util.js | 95 -
modules/common/ant-bundle/pom.xml | 2
modules/common/drift/pom.xml | 2
modules/common/filetemplate-bundle/pom.xml | 2
modules/common/jboss-as/pom.xml | 2
modules/common/pom.xml | 2
modules/core/client-api/pom.xml | 2
modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/DriftMetadataParser.java | 3
modules/core/client-api/src/test/java/org/rhq/core/clientapi/agent/metadata/test/PluginMetadataParserTest.java | 3
modules/core/comm-api/pom.xml | 2
modules/core/dbutils/pom.xml | 2
modules/core/domain/pom.xml | 2
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java | 2
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDetails.java | 126 ++
modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftConfigurationTest.java | 20
modules/core/gui/pom.xml | 2
modules/core/native-system/pom.xml | 2
modules/core/plugin-api/pom.xml | 2
modules/core/plugin-container/pom.xml | 5
modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftInputStream.java | 93 +
modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java | 144 +-
modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/ScheduleQueueImpl.java | 21
modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DriftManagerTest.java | 133 ++
modules/core/plugin-validator/pom.xml | 2
modules/core/plugindoc/pom.xml | 38
modules/core/pom.xml | 5
modules/core/util/pom.xml | 2
modules/enterprise/agent/ant-run.xml | 11
modules/enterprise/agent/pom.xml | 40
modules/enterprise/agentupdate/pom.xml | 2
modules/enterprise/binding/pom.xml | 4
modules/enterprise/comm/pom.xml | 2
modules/enterprise/gui/base-perspective-jar/pom.xml | 2
modules/enterprise/gui/base-perspective-war/pom.xml | 2
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/ImageManager.java | 48
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java | 13
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java | 9
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/buttons/BackButton.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/AbstractTableSection.java | 9
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/StringIDTableSection.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java | 25
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/queue/AutodiscoveryPortlet.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformMetricDataSource.java | 17
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java | 80 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/AbstractRecentDriftsPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/AbstractOperationHistoryPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftConfigurationView.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java | 259 ++--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DriftGWTService.java | 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java | 15
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TestGWTService.java | 34
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/AbstractTwoLevelTabSetView.java | 22
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeDataSource.java | 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ChildHistoryView.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryDataSource.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/AutodiscoveryQueueDataSource.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java | 14
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/FlexSearchBar.java | 31
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java | 68 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestRpcView.java | 52
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java | 9
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DriftGWTServiceImpl.java | 22
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TestGWTServiceImpl.java | 43
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties | 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties | 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties | 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties | 3
modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml | 8
modules/enterprise/gui/coregui/src/main/webapp/css/search.css | 7
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/CreateChild_16.png |binary
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/CreateChild_failed_16.png |binary
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/CreateChild_success_16.png |binary
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/DeleteChild_16.png |binary
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/DeleteChild_failed_16.png |binary
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/inventory/DeleteChild_success_16.png |binary
modules/enterprise/gui/installer-war/pom.xml | 2
modules/enterprise/gui/pom.xml | 2
modules/enterprise/gui/portal-war/pom.xml | 2
modules/enterprise/gui/portal-war/src/main/webapp/images/icn_create_child.png |binary
modules/enterprise/gui/portal-war/src/main/webapp/images/icn_create_child_failed.png |binary
modules/enterprise/gui/portal-war/src/main/webapp/images/icn_create_child_success.png |binary
modules/enterprise/gui/portal-war/src/main/webapp/images/icn_delete_child.png |binary
modules/enterprise/gui/portal-war/src/main/webapp/images/icn_delete_child_failed.png |binary
modules/enterprise/gui/portal-war/src/main/webapp/images/icn_delete_child_success.png |binary
modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Drift_16.png |binary
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp | 4
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp | 9
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp | 17
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventDriftJSON.jsp | 59 +
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp | 35
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventInventoryJSON.jsp | 52
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp | 10
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp | 2
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp | 40
modules/enterprise/pom.xml | 2
modules/enterprise/remoting/cli/pom.xml | 2
modules/enterprise/remoting/cli/src/main/samples/README.txt | 24
modules/enterprise/remoting/cli/src/main/samples/drift.js | 257 ++++
modules/enterprise/remoting/cli/src/main/samples/measurement_utils.js | 134 ++
modules/enterprise/remoting/cli/src/main/samples/util.js | 112 +
modules/enterprise/remoting/cli/src/main/scripts/rhq-client.build.xml | 11
modules/enterprise/remoting/client-api/pom.xml | 2
modules/enterprise/remoting/client-deps/pom.xml | 2
modules/enterprise/remoting/pom.xml | 2
modules/enterprise/remoting/webservices/pom.xml | 2
modules/enterprise/server/client-api/pom.xml | 4
modules/enterprise/server/container-lib/pom.xml | 2
modules/enterprise/server/container/pom.xml | 2
modules/enterprise/server/ear/pom.xml | 2
modules/enterprise/server/jar/pom.xml | 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java | 124 ++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java | 12
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java | 11
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerLocal.java | 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java | 121 +-
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBeanTest.java | 8
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/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-mongodb/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/groovy-script/pom.xml | 4
modules/enterprise/server/plugins/jboss-software/pom.xml | 2
modules/enterprise/server/plugins/packagetype-cli/pom.xml | 4
modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml | 2
modules/enterprise/server/plugins/perspectives/core/pom.xml | 2
modules/enterprise/server/plugins/pom.xml | 8
modules/enterprise/server/plugins/rhnhosted/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/safe-invoker/pom.xml | 2
modules/enterprise/server/sars/agent-sar/pom.xml | 2
modules/enterprise/server/sars/pom.xml | 2
modules/enterprise/server/xml-schemas/pom.xml | 2
modules/helpers/bundleGen/pom.xml | 4
modules/helpers/perftest-support/pom.xml | 4
modules/helpers/pom.xml | 2
modules/helpers/rtfilter/pom.xml | 2
modules/integration-tests/apache-plugin-test/pom.xml | 4
modules/integration-tests/mod_cluster-plugin-test/pom.xml | 396 ++++++
modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModClusterPluginIntegrationTest.java | 229 +++
modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java | 210 ---
modules/plugins/aliases/pom.xml | 4
modules/plugins/ant-bundle/pom.xml | 2
modules/plugins/apache/pom.xml | 4
modules/plugins/augeas/pom.xml | 8
modules/plugins/byteman/pom.xml | 2
modules/plugins/cobbler/pom.xml | 4
modules/plugins/cron/pom.xml | 4
modules/plugins/database/pom.xml | 2
modules/plugins/filetemplate-bundle/pom.xml | 2
modules/plugins/grub/pom.xml | 4
modules/plugins/hadoop/pom.xml | 2
modules/plugins/hibernate/pom.xml | 2
modules/plugins/hosts/pom.xml | 4
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/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java | 13
modules/plugins/kickstart/pom.xml | 2
modules/plugins/mod-cluster/pom.xml | 66 -
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java | 121 ++
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanComponent.java | 64 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java | 109 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java | 102 -
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java | 118 --
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java | 155 ++
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java | 92 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterDiscoveryComponent.java | 85 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java | 70 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServiceComponent.java | 51
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java | 45
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ProxyInfo.java | 310 -----
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextComponent.java | 117 ++
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextDiscoveryComponent.java | 105 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java | 81 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java | 92 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java | 253 ++++
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/helper/JBossHelper.java | 49
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/model/ProxyInfo.java | 310 +++++
modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml | 581 ++++++++--
modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ProxyInfoTest.java | 2
modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java | 91 +
modules/plugins/mod-cluster/src/test/resources/xml_config/mod_cluster-jboss-beans.xml | 337 +++++
modules/plugins/mod-cluster/src/test/resources/xml_config/server.xml | 157 ++
modules/plugins/mysql/pom.xml | 2
modules/plugins/netservices/pom.xml | 2
modules/plugins/oracle/pom.xml | 2
modules/plugins/pattern-generator/pom.xml | 2
modules/plugins/perftest/pom.xml | 78 +
modules/plugins/platform/pom.xml | 2
modules/plugins/pom.xml | 2
modules/plugins/postfix/pom.xml | 4
modules/plugins/postgres/pom.xml | 2
modules/plugins/rhq-agent/pom.xml | 2
modules/plugins/rhq-server/pom.xml | 2
modules/plugins/samba/pom.xml | 4
modules/plugins/script/pom.xml | 2
modules/plugins/script2/pom.xml | 2
modules/plugins/snmptrapd/pom.xml | 2
modules/plugins/sshd/pom.xml | 4
modules/plugins/sudoers/pom.xml | 4
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 | 10
publish_release.sh | 61 -
release.sh | 61 -
245 files changed, 5846 insertions(+), 2047 deletions(-)
---
12 years, 8 months
[rhq] Branch 'release-4.1.0' - modules/common modules/core modules/enterprise modules/helpers modules/plugins modules/pom.xml modules/test-utils pom.xml
by John Sanda
modules/common/ant-bundle/pom.xml | 2 +-
modules/common/drift/pom.xml | 2 +-
modules/common/filetemplate-bundle/pom.xml | 2 +-
modules/common/jboss-as/pom.xml | 2 +-
modules/common/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/pom.xml | 2 +-
modules/core/plugin-validator/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
modules/core/util/pom.xml | 2 +-
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/base-perspective-jar/pom.xml | 2 +-
modules/enterprise/gui/base-perspective-war/pom.xml | 2 +-
modules/enterprise/gui/content_http-war/pom.xml | 2 +-
modules/enterprise/gui/coregui/pom.xml | 2 +-
modules/enterprise/gui/installer-war/pom.xml | 2 +-
modules/enterprise/gui/pom.xml | 2 +-
modules/enterprise/gui/portal-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/remoting/webservices/pom.xml | 2 +-
modules/enterprise/server/client-api/pom.xml | 4 ++--
modules/enterprise/server/container-lib/pom.xml | 2 +-
modules/enterprise/server/container/pom.xml | 2 +-
modules/enterprise/server/ear/pom.xml | 2 +-
modules/enterprise/server/jar/pom.xml | 2 +-
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/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/groovy-script/pom.xml | 4 ++--
modules/enterprise/server/plugins/jboss-software/pom.xml | 2 +-
modules/enterprise/server/plugins/packagetype-cli/pom.xml | 4 ++--
modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml | 2 +-
modules/enterprise/server/plugins/perspectives/core/pom.xml | 2 +-
modules/enterprise/server/plugins/pom.xml | 2 +-
modules/enterprise/server/plugins/rhnhosted/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/safe-invoker/pom.xml | 2 +-
modules/enterprise/server/sars/agent-sar/pom.xml | 2 +-
modules/enterprise/server/sars/pom.xml | 2 +-
modules/enterprise/server/xml-schemas/pom.xml | 2 +-
modules/helpers/bundleGen/pom.xml | 4 ++--
modules/helpers/perftest-support/pom.xml | 4 ++--
modules/helpers/pom.xml | 2 +-
modules/helpers/rtfilter/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/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/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/samba/pom.xml | 2 +-
modules/plugins/script/pom.xml | 2 +-
modules/plugins/script2/pom.xml | 2 +-
modules/plugins/snmptrapd/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 +-
119 files changed, 137 insertions(+), 137 deletions(-)
New commits:
commit f01c483e610959ff383f9774d8138826288e5f50
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Sep 1 16:56:23 2011 -0400
[maven-release-plugin] prepare release RHQ_4_1_0
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index 1eb86ef..cc093dc 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/drift/pom.xml b/modules/common/drift/pom.xml
index 73ab33a..a0b0fe5 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml
index 352de33..ec13aba 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index 184c5ad..5e803b5 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index bd88fa0..dc9d201 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index 9f5f66a..efb8ea9 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index 5a8b356..b00af21 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index aa20853..df55970 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-dbutils</artifactId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index 42d28e1..f4a1644 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index bb4dc2c..ef9b5a2 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index 7d83f3d..defd464 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index fc78701..ab47c9f 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml
index 5e8397b..6071e4f 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml
index f2953a6..14572cd 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 62a73be..85e1b5c 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index dfa5bb8..105c762 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index 42673c4..1606f00 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml
index 8b7ffe8..0265632 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/binding/pom.xml b/modules/enterprise/binding/pom.xml
index d96cf83..24fb704 100644
--- a/modules/enterprise/binding/pom.xml
+++ b/modules/enterprise/binding/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-enterprise-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-script-bindings</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 f424704..91d1113 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml
index cebd439..3bf686e 100644
--- a/modules/enterprise/gui/base-perspective-jar/pom.xml
+++ b/modules/enterprise/gui/base-perspective-jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml
index b66da2c..3583575 100644
--- a/modules/enterprise/gui/base-perspective-war/pom.xml
+++ b/modules/enterprise/gui/base-perspective-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 db7d757..166500b 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml
index de77f3f..43751b9 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml
index 900d476..2dfd803 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index 8e8cf66..2615b14 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 4e2ac9f..7c07c4c 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index 01fb7f6..28d87f6 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml
index 24fbb60..91a2a2a 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 1a1c88c..a389fa4 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 3fe07b7..c65a209 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index f4b1866..d0fc35d 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml
index dee43bc..5c4b9f3 100644
--- a/modules/enterprise/remoting/webservices/pom.xml
+++ b/modules/enterprise/remoting/webservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 c57eaba..78116e0 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-server-client-api</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</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/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml
index 1aebae1..bff3f77 100644
--- a/modules/enterprise/server/container-lib/pom.xml
+++ b/modules/enterprise/server/container-lib/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml
index d27c157..812e4a2 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml
index 8cdaf8b..a90f82e 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml
index d2f2bc5..1afd286 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 b380393..6a9abdd 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>alert-cli</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 e1e1890..c2c4c37 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.server</groupId>
<artifactId>alert-email</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 1b609e1..76d4be0 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-irc</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 1a27831..4f81b24 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-log4j</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 ab68d6b..48bf813 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-microblog</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 0adccaf..0ef3ee7 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-mobicents</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 2c9bcfa..174f7a1 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-operations</artifactId>
<packaging>jar</packaging>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 06bab65..b8639bc 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-roles</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 3763c54..480b216 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-snmp</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 bb595b5..3780d6a 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-subject</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<name>RHQ Enterprise Server Subject Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index c4e59b2..252a47d 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 381f64c..5157789 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>rhq-serverplugin-cobbler</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 403ef41..5e2a23b 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 9c9d3b6..f71ba0b 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 ad1c570..a58f862 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/groovy-script/pom.xml b/modules/enterprise/server/plugins/groovy-script/pom.xml
index 0d2bf4b..5f07165 100644
--- a/modules/enterprise/server/plugins/groovy-script/pom.xml
+++ b/modules/enterprise/server/plugins/groovy-script/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>groovy-script-server-plugin</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<name>RHQ Enterprise Server Groovy Script Plugin</name>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml
index dacaec2..bb8bca5 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 9a51242..d9ecf3c 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>packagetype-cli</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<name>RHQ Enterprise Server CLI Package Type Plugin</name>
diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
index f73ecb8..a158617 100644
--- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml
index c2d5c7e..a8dd29f 100644
--- a/modules/enterprise/server/plugins/perspectives/core/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml
index 3fa05d3..7b5f68f 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml
index 04df0b8..623b911 100644
--- a/modules/enterprise/server/plugins/rhnhosted/pom.xml
+++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml
index 79ccf2b..b4a7e6e 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 9e221a0..3bf9a23 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 ce8468c..8020ab3 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml
index 05cb339..9cc9503 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml
index 00344d4..991618b 100644
--- a/modules/enterprise/server/sars/agent-sar/pom.xml
+++ b/modules/enterprise/server/sars/agent-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml
index 2377858..33b2552 100644
--- a/modules/enterprise/server/sars/pom.xml
+++ b/modules/enterprise/server/sars/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 90c0da6..967e367 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/bundleGen/pom.xml b/modules/helpers/bundleGen/pom.xml
index 9e80f1f..56788dc 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.helpers</groupId>
<artifactId>bundleGen</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<build>
<plugins>
diff --git a/modules/helpers/perftest-support/pom.xml b/modules/helpers/perftest-support/pom.xml
index e488bb0..b64a93b 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>perftest-support</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 0c73fd3..e01b64a 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index 417a3df..3a82c2b 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index d983b6a..e15151b 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index ff8c753..87c8023 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index e68547f..0f0bf36 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index ff7d21f..a7d6928 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/byteman/pom.xml b/modules/plugins/byteman/pom.xml
index 46bcb55..55db9e7 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index 78156f3..8a6a965 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index 5f2c454..02ae96e 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index 6c1812b..5a6973b 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml
index c1e0a3d..d53b74d 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index d197727..43a2a5d 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hadoop/pom.xml b/modules/plugins/hadoop/pom.xml
index 840e619..dd99e27 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index e482d30..7d33e56 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 0c7ec29..6e1739f 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index b097071..537d523 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-hudson-plugin</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<packaging>jar</packaging>
<name>RHQ Hudson Plugin</name>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index 2cdc32a..3de5266 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/irc/pom.xml b/modules/plugins/irc/pom.xml
index edf12ea..8e3b26e 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 6ec0096..8aab8d5 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 ca63c5e..ccede24 100644
--- a/modules/plugins/jboss-as-7/pom.xml
+++ b/modules/plugins/jboss-as-7/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index 57c8bb3..03c26e2 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 1a3a1df..07fd383 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index ae06793..2746b2e 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index 1daf86d..a4fa475 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/kickstart/pom.xml b/modules/plugins/kickstart/pom.xml
index dc87ed7..db2abe4 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index 3a6deaa..ef80c44 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index d8ebb5d..49d7072 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index f1675e4..ed2fe57 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index 8a3b3c0..8b2b38a 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pattern-generator/pom.xml b/modules/plugins/pattern-generator/pom.xml
index 6b0791d..75281e6 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index 63dd974..15e299b 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index 99f36d0..456d886 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index f32159e..a6637f1 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index 2a0eb28..f72540b 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index 365f6c4..94545df 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index 60471c2..6a7f19f 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index e88b97f..1b9ade1 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 90337ed..8202103 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index d31afb9..c9b2423 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script2/pom.xml b/modules/plugins/script2/pom.xml
index 2cf689c..1dd219f 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index 05ed401..be1e9bc 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index 3a1df45..d37e38d 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 9429831..f372d88 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index f6dfebd..b5f6dbe 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index 50ff9b6..1507ac7 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</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 6565a7b..f2e6e6c 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/virt/pom.xml b/modules/plugins/virt/pom.xml
index 8700a19..b6e7f72 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index 2b45c62..8a3c8c3 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index 5c6e85c..fd77c86 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.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
</parent>
<artifactId>test-utils</artifactId>
diff --git a/pom.xml b/pom.xml
index ab342f5..87fc764 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0</version>
<packaging>pom</packaging>
<name>RHQ</name>
12 years, 8 months
[rhq] publish_release.sh
by John Sanda
publish_release.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 6f0df962341bc372463d2b2444a8626b0f472985
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Sep 1 15:55:25 2011 -0400
Fixing syntax error
diff --git a/publish_release.sh b/publish_release.sh
index 3a12b7a..2be9db9 100755
--- a/publish_release.sh
+++ b/publish_release.sh
@@ -219,7 +219,7 @@ export LANG
echo
echo "========================== Environment Variables =============================="
echo "JAVA_HOME=$JAVA_HOME"
-[ "$RELEASE_TYPE" = "enterprise" ]"
+[ "$RELEASE_TYPE" = "enterprise" ]
#[ "$RELEASE_TYPE" = "enterprise" ] && echo "JAVA5_HOME=$JAVA5_HOME"
echo "M2_HOME=$M2_HOME"
echo "MAVEN_OPTS=$MAVEN_OPTS"
12 years, 8 months