.classpath
| 4
.gitignore
| 2
.mailmap
| 1
etc/rhq-ircBot/pom.xml
| 15
etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBot.java
| 270
etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java
| 375 +
etc/rhq-ircBot/src/main/resources/org/rhq/etc/ircbot/cacerts.jks
|binary
etc/rhq-ircBot/src/main/resources/org/rhq/etc/ircbot/rhq-ircbot.properties
| 2
etc/samples/embedded-ext-plugin/pom.xml
| 72
etc/samples/embedded-ext-plugin/src/main/java/org/rhq/sample/embeddedextplugin/EmbeddedExtensionDiscoveryComponent.java
| 58
etc/samples/embedded-ext-plugin/src/main/resources/META-INF/rhq-plugin.xml
| 21
etc/samples/skeleton-plugin/pom.xml
| 99
etc/samples/skeleton-plugin/src/main/java/org/rhq/sample/skeletonplugin/SamplePluginChildDiscoveryComponent.java
| 47
etc/samples/skeleton-plugin/src/main/java/org/rhq/sample/skeletonplugin/SamplePluginChildServiceComponent.java
| 61
etc/samples/skeleton-plugin/src/main/resources/META-INF/rhq-plugin.xml
| 20
etc/samples/skinny-platform/pom.xml
| 60
etc/samples/skinny-platform/src/main/java/org/rhq/plugins/skinnyplatform/PlatformComponent.java
| 39
etc/samples/skinny-platform/src/main/java/org/rhq/plugins/skinnyplatform/PlatformDiscoveryComponent.java
| 67
etc/samples/skinny-platform/src/main/resources/META-INF/rhq-plugin.xml
| 18
modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
| 50
modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/LoggingJBossASClient.java
| 4
modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/SecurityDomainJBossASClient.java
| 140
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java
| 78
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/JPADriftChangeSetCriteria.java
| 9
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/JPADriftCriteria.java
| 9
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementDataTraitCriteria.java
| 12
modules/core/domain/src/main/java/org/rhq/core/domain/util/JoinFetchReportingQueryTranslator.java
| 113
modules/core/domain/src/main/java/org/rhq/core/domain/util/JoinFetchReportingQueryTranslatorFactory.java
| 27
modules/core/domain/src/main/java/org/rhq/core/domain/util/PageControl.java
| 40
modules/core/domain/src/main/java/org/rhq/core/domain/util/UnlimitedPageControl.java
| 5
modules/core/domain/src/main/resources/META-INF/persistence.xml
| 8
modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentData.java
| 92
modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerCanonicalPathTest.java
| 275
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationConstants.java
| 2
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationUpgrade.java
| 63
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
| 40
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentUpdateDownload.java
| 32
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentUpdateVersion.java
| 33
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/SecureConnector.java
| 212
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
| 6
modules/enterprise/agent/src/main/resources/agent-configuration.xml
| 15
modules/enterprise/binding/src/main/java/org/rhq/bindings/script/BaseRhqSchemeScriptSourceProvider.java
| 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
| 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java
| 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/AlertDefinitionTemplateTypeView.java
| 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/DriftDefinitionTemplateTypeView.java
| 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/IgnoreResourceTypesView.java
| 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/MetricTemplateTypeView.java
| 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/ResourceTypeTreeNodeBuilder.java
| 153
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionEditor.java
| 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsEditor.java
| 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/EditAlertDefinitionForm.java
| 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java
| 9
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
| 42
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/buttons/BackButton.java
| 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/GroupConfigurationEditor.java
| 72
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/DurationItem.java
| 31
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/measurement/AbstractMeasurementRangeEditor.java
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
| 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
| 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
| 32
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/groups/graph/ResourceGroupD3GraphPortlet.java
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/groups/graph/ResourceGroupGraphPortlet.java
| 214
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/ResourceD3GraphPortlet.java
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/ResourceGraphPortlet.java
| 203
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java
| 31
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionEditView.java
| 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionTemplateEditView.java
| 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertDefinitionGWTService.java
| 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractD3GraphListView.java
| 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMetricGraphView.java
| 358 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
| 383 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/MetricNvd3BarChartGraph.java
| 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphIE8Impl.java
| 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphImpl.java
| 34
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/D3GroupGraphListView.java
| 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupContextMenu.java
| 340 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
| 39
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationEditView.java
| 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/GroupPluginConfigurationEditView.java
| 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/ResourceGroupMetricGraphView.java
| 137
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupMultiLineGraphListView.java
| 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
| 35
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
| 44
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ResourceConfigurationEditView.java
| 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/inventory/PluginConfigurationEditView.java
| 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/D3GraphListView.java
| 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java
| 146
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/LiveGraphView.java
| 303 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/MetricD3GraphView.java
| 34
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/ResourceMetricGraphView.java
| 159
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityBarView.java
| 137
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityD3Graph.java
| 23
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MeasurementTableView.java
| 49
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java
| 16
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/configuration/TestConfigurationView.java
| 13
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/configuration/TestGroupConfigurationView.java
| 13
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertDefinitionGWTServiceImpl.java
| 18
modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/RHQDomain.gwt.xml
| 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/domain/util/JoinFetchReportingQueryTranslator.java
| 9
modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/domain/util/JoinFetchReportingQueryTranslatorFactory.java
| 7
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
| 14
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
| 5
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
| 5
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
| 89
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
| 5
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties
| 5
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
| 5
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
| 5
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
| 5
modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
| 18
modules/enterprise/gui/coregui/src/main/webapp/css/charts.css
| 7
modules/enterprise/gui/coregui/src/main/webapp/css/nv.d3.css
| 128
modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Disabled_end.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Disabled_start.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Disabled_stretch.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/js/nv.d3.js
| 2855
++++++++--
modules/enterprise/gui/coregui/src/main/webapp/js/rhq.js
| 32
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
| 15
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AuthenticationFilter.java
| 15
modules/enterprise/gui/rest-examples-war/src/main/webapp/WEB-INF/jboss-web.xml
| 2
modules/enterprise/gui/rest-examples-war/src/main/webapp/WEB-INF/web.xml
| 4
modules/enterprise/gui/rest-war/src/main/webapp/WEB-INF/jboss-web.xml
| 2
modules/enterprise/gui/rest-war/src/main/webapp/WEB-INF/web.xml
| 4
modules/enterprise/remoting/cli/src/main/samples/deploy-to-and-restart-JBAS.js
| 2
modules/enterprise/scripting/api/src/main/java/org/rhq/scripting/ScriptSourceProvider.java
| 16
modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-server.sh
| 3
modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-server-wrapper.conf
| 9
modules/enterprise/server/appserver/src/main/dev-resources/bin/rhq-autoinstall.sh
| 2
modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-server-wrapper.inc
| 6
modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
| 31
modules/enterprise/server/client-api/src/main/java/org/rhq/enterprise/client/RhqDownloadsScriptSourceProvider.java
| 66
modules/enterprise/server/client-api/src/test/java/org/rhq/enterprise/client/test/RhqDownloadsScriptSourceProviderTest.java
| 4
modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/Installer.java
| 30
modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerService.java
| 17
modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
| 86
modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java
| 323 -
modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/client/security/test/ScriptingAPIServerTest.java
| 4
modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/auth/test/SubjectManagerBeanTest.java
| 33
modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
| 4
modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/measurement/test/MeasurementScheduleManagerTest.java
| 9
modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/StrippedDownStartupBean.java
| 5
modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/TestAgentClient.java
| 18
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/agentclient/AgentClient.java
| 18
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/agentclient/impl/AgentClientImpl.java
| 18
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java
| 27
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerLocal.java
| 23
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerBean.java
| 54
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java
| 27
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java
| 52
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentServiceMBean.java
| 8
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
| 30
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBeanPreparation.java
| 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupLocal.java
| 39
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/DelegatingLoginModule.java
| 209
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/JDBCLoginModule.java
| 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/JDBCPrincipalCheckLoginModule.java
| 1
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/LdapLoginModule.java
| 12
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java
| 8
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
| 231
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java
| 124
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerBean.java
| 41
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/BadArgumentException.java
| 5
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/CustomExceptionMapper.java
| 26
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/EventHandlerBean.java
| 75
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/GroupHandlerBean.java
| 20
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
| 210
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ParameterMissingException.java
| 3
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ReportsHandlerBean.java
| 20
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
| 102
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/RootHandlerBean.java
| 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/SetCallerInterceptor.java
| 7
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/StatusHandlerBean.java
| 4
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/UserHandlerBean.java
| 57
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/AlertDefinitionRest.java
| 24
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/Link.java
| 16
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/PagingCollection.java
| 97
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/ResourceWithType.java
| 30
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/helper/ConfigurationHelper.java
| 432 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
| 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQuery.java
| 15
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
| 120
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryRunner.java
| 21
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
| 6
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationHelperTest.java
| 756 ++
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/util/CriteriaQueryTest.java
| 22
modules/enterprise/server/plugins/alert-snmp/pom.xml
| 32
modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfo.java
| 59
modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSender.java
| 32
modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpTrapSender.java
| 38
modules/enterprise/server/plugins/alert-snmp/src/main/resources/META-INF/rhq-serverplugin.xml
| 36
modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfoTest.java
| 106
modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSenderTest.java
| 378 +
modules/enterprise/server/plugins/alert-snmp/src/test/resources/log4j.xml
| 32
modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/safeinvoker/HibernateDetachUtility.java
| 4
modules/integration-tests/jndi-access/jndi-access-test/pom.xml
| 47
modules/integration-tests/jndi-access/jndi-access-test/src/test/resources/arquillian.xml
| 2
modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AbstractBase.java
| 9
modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java
| 106
modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ContentTest.java
| 94
modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/EventTest.java
| 129
modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/GroupTest.java
| 44
modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/OperationsTest.java
| 188
modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
| 269
modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/RootURITest.java
| 2
modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/UserTest.java
| 4
modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/d/AlertDefinition.java
| 21
modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/d/Resource.java
| 9
modules/plugins/ant-bundle/src/test/java/org/rhq/plugins/ant/AntBundlePluginComponentTest.java
| 186
modules/plugins/ant-bundle/src/test/resources/test-bundle-dotdot.xml
| 19
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
| 50
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JBossInstanceInfo.java
| 2
modules/plugins/jboss-as-7/pom.xml
| 12
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
| 13
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
| 25
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
| 86
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JBossProductType.java
| 39
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASComponent.java
| 43
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/StandaloneASComponent.java
| 10
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/helper/HostConfiguration.java
| 8
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/helper/ServerPluginConfiguration.java
| 19
modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
| 50
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractJBossAS7PluginTest.java
| 33
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractServerComponentTest.java
| 14
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/DomainServerComponentTest.java
| 17
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/ManagedServerTest.java
| 19
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java
| 74
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/InterruptibleOperationsTest.java
| 239
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/StandaloneServerComponentTest.java
| 24
modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/helper/JBossInstanceInfo.java
| 2
pom.xml
| 7
233 files changed, 10757 insertions(+), 4522 deletions(-)
New commits:
commit 45c43c4848b6672ccf9ffc7784ba671c6b840ae4
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Thu May 30 04:32:46 2013 -0400
Moving pom versions back to 4.7.0.JON for ALPHA build.
diff --git a/code-coverage/pom.xml b/code-coverage/pom.xml
index dbb487d..4aae357 100644
--- a/code-coverage/pom.xml
+++ b/code-coverage/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<artifactId>rhq-code-coverage</artifactId>
diff --git a/modules/cli-tests/pom.xml b/modules/cli-tests/pom.xml
index efe6d1f..434edad 100644
--- a/modules/cli-tests/pom.xml
+++ b/modules/cli-tests/pom.xml
@@ -8,7 +8,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index 138e9ca..86baa5a 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/drift/pom.xml b/modules/common/drift/pom.xml
index 5afdead..0faef44 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<artifactId>rhq-common-drift</artifactId>
diff --git a/modules/common/filetemplate-bundle/pom.xml
b/modules/common/filetemplate-bundle/pom.xml
index 0beb20b..5949978 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<artifactId>rhq-filetemplate-bundle-common</artifactId>
diff --git a/modules/common/jboss-as-dmr-client/pom.xml
b/modules/common/jboss-as-dmr-client/pom.xml
index b8c1682..cbb58f3 100644
--- a/modules/common/jboss-as-dmr-client/pom.xml
+++ b/modules/common/jboss-as-dmr-client/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<artifactId>rhq-jboss-as-dmr-client</artifactId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index 6dac77b..7ce384f 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<artifactId>rhq-jboss-as-common</artifactId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index 088e268..da1d138 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/arquillian-integration/archive/pom.xml
b/modules/core/arquillian-integration/archive/pom.xml
index fe5f377..f4b2afa 100644
--- a/modules/core/arquillian-integration/archive/pom.xml
+++ b/modules/core/arquillian-integration/archive/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-arquillian-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<!-- Model Version -->
diff --git a/modules/core/arquillian-integration/container/pom.xml
b/modules/core/arquillian-integration/container/pom.xml
index 258d050..33e48b1 100644
--- a/modules/core/arquillian-integration/container/pom.xml
+++ b/modules/core/arquillian-integration/container/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-arquillian-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<!-- Model Version -->
diff --git a/modules/core/arquillian-integration/pom.xml
b/modules/core/arquillian-integration/pom.xml
index 67b02a8..66df7dd 100644
--- a/modules/core/arquillian-integration/pom.xml
+++ b/modules/core/arquillian-integration/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/arquillian-integration/suite-extension/pom.xml
b/modules/core/arquillian-integration/suite-extension/pom.xml
index 231ab67..bbe0954 100644
--- a/modules/core/arquillian-integration/suite-extension/pom.xml
+++ b/modules/core/arquillian-integration/suite-extension/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-arquillian-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<!-- Model Version -->
diff --git a/modules/core/arquillian-integration/test-agent-plugin/pom.xml
b/modules/core/arquillian-integration/test-agent-plugin/pom.xml
index 4ed7bca..b560968 100644
--- a/modules/core/arquillian-integration/test-agent-plugin/pom.xml
+++ b/modules/core/arquillian-integration/test-agent-plugin/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-arquillian-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index 7adcd3b..c5184a1 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index 1fb2161..62028e4 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index cc040f8..b30f82e 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index 776459d..8c36237 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<artifactId>rhq-core-domain</artifactId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index dc21aad..52e1956 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index 46fe305..86a3e7e 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index 8060a89..adf5bd4 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container-itest/pom.xml
b/modules/core/plugin-container-itest/pom.xml
index 9c801de..2ed4c26 100644
--- a/modules/core/plugin-container-itest/pom.xml
+++ b/modules/core/plugin-container-itest/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<artifactId>rhq-core-plugin-container-itest</artifactId>
diff --git a/modules/core/plugin-container/pom.xml
b/modules/core/plugin-container/pom.xml
index 3c070a9..e03ac78 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<artifactId>rhq-core-plugin-container</artifactId>
diff --git a/modules/core/plugin-test-api/pom.xml b/modules/core/plugin-test-api/pom.xml
index 18fa318..97ed3ab 100644
--- a/modules/core/plugin-test-api/pom.xml
+++ b/modules/core/plugin-test-api/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<artifactId>rhq-core-plugin-test-api</artifactId>
diff --git a/modules/core/plugin-test-util/pom.xml
b/modules/core/plugin-test-util/pom.xml
index 0374729..b2c1184 100644
--- a/modules/core/plugin-test-util/pom.xml
+++ b/modules/core/plugin-test-util/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-validator/pom.xml
b/modules/core/plugin-validator/pom.xml
index 99c875d..0820f4b 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml
index 426d298..ecdde93 100644
--- a/modules/core/plugindoc/pom.xml
+++ b/modules/core/plugindoc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index c41a8f4..9765a55 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index cdc3b9b..2bd8b52 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<artifactId>rhq-core-util</artifactId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index 2d7093d..c832b41 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/agentupdate/pom.xml
b/modules/enterprise/agentupdate/pom.xml
index 67ed9a8..329f7fb 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/binding/pom.xml b/modules/enterprise/binding/pom.xml
index d5b7643..91ab077 100644
--- a/modules/enterprise/binding/pom.xml
+++ b/modules/enterprise/binding/pom.xml
@@ -3,10 +3,10 @@
<parent>
<artifactId>rhq-enterprise-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<artifactId>rhq-script-bindings</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 8148262..9ade65f 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 a140a9c..539cff8 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml
b/modules/enterprise/gui/coregui/pom.xml
index cb7dd3a..3dea516 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index 018a802..57c01e8 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -8,7 +8,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 d2998cc..8b742ff 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/remoting-war/pom.xml
b/modules/enterprise/gui/remoting-war/pom.xml
index 638bccd..0dae4ac 100644
--- a/modules/enterprise/gui/remoting-war/pom.xml
+++ b/modules/enterprise/gui/remoting-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/rest-examples-war/pom.xml
b/modules/enterprise/gui/rest-examples-war/pom.xml
index c9aa075..0cd7bf7 100644
--- a/modules/enterprise/gui/rest-examples-war/pom.xml
+++ b/modules/enterprise/gui/rest-examples-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/rest-war/pom.xml
b/modules/enterprise/gui/rest-war/pom.xml
index 33e330e..10a7cd8 100644
--- a/modules/enterprise/gui/rest-war/pom.xml
+++ b/modules/enterprise/gui/rest-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index 3fad441..0e5c315 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/cli/pom.xml
b/modules/enterprise/remoting/cli/pom.xml
index dec19d0..40ed02c 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 cba50db..49e0186 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 6db40f2..a087cb1 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index 7bf574e..bbd87da 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/scripting/api/pom.xml
b/modules/enterprise/scripting/api/pom.xml
index 268af3a..b584947 100644
--- a/modules/enterprise/scripting/api/pom.xml
+++ b/modules/enterprise/scripting/api/pom.xml
@@ -3,10 +3,10 @@
<parent>
<artifactId>rhq-scripting-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<artifactId>rhq-scripting-api</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<name>RHQ Scripting API</name>
<description>Provides API for adding scripting support to RHQ using different
javax.scripting - based interpreters</description>
diff --git a/modules/enterprise/scripting/javascript/pom.xml
b/modules/enterprise/scripting/javascript/pom.xml
index acc09aa..c376943 100644
--- a/modules/enterprise/scripting/javascript/pom.xml
+++ b/modules/enterprise/scripting/javascript/pom.xml
@@ -4,10 +4,10 @@
<parent>
<artifactId>rhq-scripting-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<artifactId>rhq-scripting-javascript</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<name>RHQ Javascript support</name>
<description>Provides RHQ scripting in Javascript using
Rhino</description>
diff --git a/modules/enterprise/scripting/pom.xml b/modules/enterprise/scripting/pom.xml
index a58f1ca..4c47992 100644
--- a/modules/enterprise/scripting/pom.xml
+++ b/modules/enterprise/scripting/pom.xml
@@ -3,12 +3,12 @@
<parent>
<artifactId>rhq-enterprise-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<artifactId>rhq-scripting-parent</artifactId>
<packaging>pom</packaging>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<name>RHQ Scripting Parent Module</name>
<modules>
diff --git a/modules/enterprise/scripting/python/pom.xml
b/modules/enterprise/scripting/python/pom.xml
index dc69d9e..385978a 100644
--- a/modules/enterprise/scripting/python/pom.xml
+++ b/modules/enterprise/scripting/python/pom.xml
@@ -3,10 +3,10 @@
<parent>
<artifactId>rhq-scripting-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<artifactId>rhq-scripting-python</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<name>RHQ Python support</name>
<description>Provides RHQ scripting in Python using Jython</description>
diff --git a/modules/enterprise/server/appserver/pom.xml
b/modules/enterprise/server/appserver/pom.xml
index f186d70..d6e97a0 100644
--- a/modules/enterprise/server/appserver/pom.xml
+++ b/modules/enterprise/server/appserver/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 3e69ded..560de86 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-server-client-api</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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/ear/pom.xml
b/modules/enterprise/server/ear/pom.xml
index 867ebe1..dd10dec 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/installer/pom.xml
b/modules/enterprise/server/installer/pom.xml
index 23d8e94..9ee8e93 100644
--- a/modules/enterprise/server/installer/pom.xml
+++ b/modules/enterprise/server/installer/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/itests-2/pom.xml
b/modules/enterprise/server/itests-2/pom.xml
index 5e4e076..460342b 100644
--- a/modules/enterprise/server/itests-2/pom.xml
+++ b/modules/enterprise/server/itests-2/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/jar/pom.xml
b/modules/enterprise/server/jar/pom.xml
index 84e34c4..c0a0bae 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 ea9bd42..1bd8378 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>alert-cli</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 a2102a3..5252acc 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.server</groupId>
<artifactId>alert-email</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 bd5f656..ee5adda 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-irc</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 934cb7e..8c7670d 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-log4j</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 28d1d56..80d32e7 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-microblog</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 4338526..6438e21 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-mobicents</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 21ec5f7..b2ecdbe 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-operations</artifactId>
<packaging>jar</packaging>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 a6c054a..cb37a34 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-roles</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 f84398b..12ac31b 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-snmp</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 d4d2564..3e43ea6 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-subject</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 648b451..7784473 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 6f56e82..5c79143 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>rhq-serverplugin-cobbler</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 21bb689..dde366f 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 7111543..6429931 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 6ab0964..b36fcbb 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml
b/modules/enterprise/server/plugins/jboss-software/pom.xml
index 32ffc76..6285905 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 2a75e07..de6f9c4 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>packagetype-cli</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<name>RHQ Enterprise Server CLI Package Type Plugin</name>
diff --git a/modules/enterprise/server/plugins/pom.xml
b/modules/enterprise/server/plugins/pom.xml
index dc862db..7e75407 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/url/pom.xml
b/modules/enterprise/server/plugins/url/pom.xml
index bb1740d..19bc8b1 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 06da613..32d9a39 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 6f8ac10..c97e216 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/pom.xml b/modules/enterprise/server/pom.xml
index 9c60e30..48fd5ea 100644
--- a/modules/enterprise/server/pom.xml
+++ b/modules/enterprise/server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml
b/modules/enterprise/server/safe-invoker/pom.xml
index b2b741e..ab869f2 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/sars/pom.xml
b/modules/enterprise/server/sars/pom.xml
index d4f7715..fc69668 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/sars/services-sar/pom.xml
b/modules/enterprise/server/sars/services-sar/pom.xml
index 014420b..6377787 100644
--- a/modules/enterprise/server/sars/services-sar/pom.xml
+++ b/modules/enterprise/server/sars/services-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/startup-subsystem/pom.xml
b/modules/enterprise/server/startup-subsystem/pom.xml
index 7152fc3..286398c 100644
--- a/modules/enterprise/server/startup-subsystem/pom.xml
+++ b/modules/enterprise/server/startup-subsystem/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 00e558b..2f0d910 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/bundleGen/pom.xml b/modules/helpers/bundleGen/pom.xml
index f2f2455..e63e38e 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.helpers</groupId>
<artifactId>bundleGen</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<build>
<plugins>
diff --git a/modules/helpers/jeeGen/pom.xml b/modules/helpers/jeeGen/pom.xml
index 6f36514..a7ed4cc 100644
--- a/modules/helpers/jeeGen/pom.xml
+++ b/modules/helpers/jeeGen/pom.xml
@@ -9,7 +9,7 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/perftest-support/pom.xml
b/modules/helpers/perftest-support/pom.xml
index 8772058..84d6d04 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>perftest-support</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 ecebf6c..a853c5e 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/rest-docs-generator/pom.xml
b/modules/helpers/rest-docs-generator/pom.xml
index c5a4a41..2ef0b85 100644
--- a/modules/helpers/rest-docs-generator/pom.xml
+++ b/modules/helpers/rest-docs-generator/pom.xml
@@ -24,7 +24,7 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/helpers/rtfilter-subsystem/pom.xml
b/modules/helpers/rtfilter-subsystem/pom.xml
index baf0801..0567602 100644
--- a/modules/helpers/rtfilter-subsystem/pom.xml
+++ b/modules/helpers/rtfilter-subsystem/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index bf4ca3d..24f015d 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/integration-tests/apache-plugin-test/pom.xml
b/modules/integration-tests/apache-plugin-test/pom.xml
index a9d7296..ca3d81f 100644
--- a/modules/integration-tests/apache-plugin-test/pom.xml
+++ b/modules/integration-tests/apache-plugin-test/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-integration-tests</artifactId>
<groupId>org.rhq</groupId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
b/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
index 48808ac..0b0c363 100644
--- a/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
+++ b/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>jndi-access-test-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<artifactId>jndi-access-test</artifactId>
diff --git a/modules/integration-tests/jndi-access/pom.xml
b/modules/integration-tests/jndi-access/pom.xml
index 6ded494..5e1f84c 100644
--- a/modules/integration-tests/jndi-access/pom.xml
+++ b/modules/integration-tests/jndi-access/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-integration-tests</artifactId>
<groupId>org.rhq</groupId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/integration-tests/jndi-access/remote-server/pom.xml
b/modules/integration-tests/jndi-access/remote-server/pom.xml
index d11992a..777f236 100644
--- a/modules/integration-tests/jndi-access/remote-server/pom.xml
+++ b/modules/integration-tests/jndi-access/remote-server/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>jndi-access-test-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<artifactId>jndi-access-remote-server</artifactId>
diff --git a/modules/integration-tests/pom.xml b/modules/integration-tests/pom.xml
index 7e5f521..ac50627 100644
--- a/modules/integration-tests/pom.xml
+++ b/modules/integration-tests/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/integration-tests/rest-api/pom.xml
b/modules/integration-tests/rest-api/pom.xml
index bca2fe4..8debbc4 100644
--- a/modules/integration-tests/rest-api/pom.xml
+++ b/modules/integration-tests/rest-api/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-integration-tests</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index 2809e95..d74b6cc 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index 75a98a4..780b6e3 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index 380f6e6..cead04e 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index ada89b3..d68d451 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/byteman/pom.xml b/modules/plugins/byteman/pom.xml
index 37ffe0e..2e80e03 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cassandra/pom.xml b/modules/plugins/cassandra/pom.xml
index a17a3d8..79f789b 100644
--- a/modules/plugins/cassandra/pom.xml
+++ b/modules/plugins/cassandra/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index 9424397..f37463b 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index 3aa5463..cd8f563 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index 03349f8..2292a6f 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml
b/modules/plugins/filetemplate-bundle/pom.xml
index 8a5f0e6..7da6b89 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index a1c3353..8a77511 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hadoop/pom.xml b/modules/plugins/hadoop/pom.xml
index d8325e4..1618ff0 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index adee980..d2dc58a 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index f587112..0a159b5 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index d1f3e43..b31fd66 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-hudson-plugin</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<packaging>jar</packaging>
<name>RHQ Hudson Plugin</name>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index 93a915f..34e2f82 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/irc/pom.xml b/modules/plugins/irc/pom.xml
index b043e7b..daaa104 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 f2e6f8a..7dc2147 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 d85e7e3..397026c 100644
--- a/modules/plugins/jboss-as-7/pom.xml
+++ b/modules/plugins/jboss-as-7/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index b792d26..155912f 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 837852d..896a15d 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index 3828a6a..6976d9b 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index 864f675..5ac7010 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/kickstart/pom.xml b/modules/plugins/kickstart/pom.xml
index 094f451..1dee28d 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index 54b9f53..e8fe102 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index 572851e..22d5822 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index 6b663ff..3b6bd23 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/noop/pom.xml b/modules/plugins/noop/pom.xml
index 68af26a..f479b37 100644
--- a/modules/plugins/noop/pom.xml
+++ b/modules/plugins/noop/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index ed93d10..a55e980 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pattern-generator/pom.xml
b/modules/plugins/pattern-generator/pom.xml
index 5653d69..4811181 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index f852e8a..8d330c6 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index e28148c..48bd3e1 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index 0e27179..8b95b87 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index 12ae83c..45c5ae5 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index 26d37b3..b2f56ff 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index 6bf549f..0805240 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index 968a154..5b0231a 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 20e41c4..8eb6a1b 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index d31500b..9cf27a2 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script2/pom.xml b/modules/plugins/script2/pom.xml
index 36ab8be..8eb8486 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index 74d740b..cca0dfb 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index e0a216e..e99a393 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 3891b84..6ccc01b 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index eb97008..2848dbb 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index 45c2544..928ab6c 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</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 63eb6ae..f590ca2 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/virt/pom.xml b/modules/plugins/virt/pom.xml
index de510c5..17d502f 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index 8f4cf31..0e18cc9 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index c343deb..3407cad 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.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
</parent>
<artifactId>test-utils</artifactId>
diff --git a/pom.xml b/pom.xml
index b46ee9e..314c512 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.8.0-SNAPSHOT</version>
+ <version>4.7.0.JON</version>
<packaging>pom</packaging>
<name>RHQ</name>
commit 914ec1e15b09a712f18ce46e4c3124e1a8baa6d4
Merge: 3368ace 2eef3b4
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Thu May 30 04:31:15 2013 -0400
Merge branch 'master' into nightly/rhq.jon
Conflicts:
modules/plugins/jboss-as-7/pom.xml
commit 3368acebc21e2a43a981379774d319781daabffa
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Thu May 30 04:27:37 2013 -0400
Temporarily move the pom version to minimize auto commit issues.
diff --git a/code-coverage/pom.xml b/code-coverage/pom.xml
index 4aae357..dbb487d 100644
--- a/code-coverage/pom.xml
+++ b/code-coverage/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-code-coverage</artifactId>
diff --git a/modules/cli-tests/pom.xml b/modules/cli-tests/pom.xml
index 434edad..efe6d1f 100644
--- a/modules/cli-tests/pom.xml
+++ b/modules/cli-tests/pom.xml
@@ -8,7 +8,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index 86baa5a..138e9ca 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/drift/pom.xml b/modules/common/drift/pom.xml
index 0faef44..5afdead 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-common-drift</artifactId>
diff --git a/modules/common/filetemplate-bundle/pom.xml
b/modules/common/filetemplate-bundle/pom.xml
index 5949978..0beb20b 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-filetemplate-bundle-common</artifactId>
diff --git a/modules/common/jboss-as-dmr-client/pom.xml
b/modules/common/jboss-as-dmr-client/pom.xml
index cbb58f3..b8c1682 100644
--- a/modules/common/jboss-as-dmr-client/pom.xml
+++ b/modules/common/jboss-as-dmr-client/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-jboss-as-dmr-client</artifactId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index 7ce384f..6dac77b 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-jboss-as-common</artifactId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index da1d138..088e268 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/arquillian-integration/archive/pom.xml
b/modules/core/arquillian-integration/archive/pom.xml
index f4b2afa..fe5f377 100644
--- a/modules/core/arquillian-integration/archive/pom.xml
+++ b/modules/core/arquillian-integration/archive/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-arquillian-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<!-- Model Version -->
diff --git a/modules/core/arquillian-integration/container/pom.xml
b/modules/core/arquillian-integration/container/pom.xml
index 33e48b1..258d050 100644
--- a/modules/core/arquillian-integration/container/pom.xml
+++ b/modules/core/arquillian-integration/container/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-arquillian-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<!-- Model Version -->
diff --git a/modules/core/arquillian-integration/pom.xml
b/modules/core/arquillian-integration/pom.xml
index 66df7dd..67b02a8 100644
--- a/modules/core/arquillian-integration/pom.xml
+++ b/modules/core/arquillian-integration/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/arquillian-integration/suite-extension/pom.xml
b/modules/core/arquillian-integration/suite-extension/pom.xml
index bbe0954..231ab67 100644
--- a/modules/core/arquillian-integration/suite-extension/pom.xml
+++ b/modules/core/arquillian-integration/suite-extension/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-arquillian-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<!-- Model Version -->
diff --git a/modules/core/arquillian-integration/test-agent-plugin/pom.xml
b/modules/core/arquillian-integration/test-agent-plugin/pom.xml
index b560968..4ed7bca 100644
--- a/modules/core/arquillian-integration/test-agent-plugin/pom.xml
+++ b/modules/core/arquillian-integration/test-agent-plugin/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-arquillian-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index c5184a1..7adcd3b 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 62028e4..1fb2161 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index b30f82e..cc040f8 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index 8c36237..776459d 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-domain</artifactId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index 52e1956..dc21aad 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.7.0.JON</version>
+ <version>4.8.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 86a3e7e..46fe305 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.7.0.JON</version>
+ <version>4.8.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 adf5bd4..8060a89 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container-itest/pom.xml
b/modules/core/plugin-container-itest/pom.xml
index 2ed4c26..9c801de 100644
--- a/modules/core/plugin-container-itest/pom.xml
+++ b/modules/core/plugin-container-itest/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-plugin-container-itest</artifactId>
diff --git a/modules/core/plugin-container/pom.xml
b/modules/core/plugin-container/pom.xml
index e03ac78..3c070a9 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-plugin-container</artifactId>
diff --git a/modules/core/plugin-test-api/pom.xml b/modules/core/plugin-test-api/pom.xml
index 97ed3ab..18fa318 100644
--- a/modules/core/plugin-test-api/pom.xml
+++ b/modules/core/plugin-test-api/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-plugin-test-api</artifactId>
diff --git a/modules/core/plugin-test-util/pom.xml
b/modules/core/plugin-test-util/pom.xml
index b2c1184..0374729 100644
--- a/modules/core/plugin-test-util/pom.xml
+++ b/modules/core/plugin-test-util/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 0820f4b..99c875d 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml
index ecdde93..426d298 100644
--- a/modules/core/plugindoc/pom.xml
+++ b/modules/core/plugindoc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 9765a55..c41a8f4 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index 2bd8b52..cdc3b9b 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-util</artifactId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index c832b41..2d7093d 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/agentupdate/pom.xml
b/modules/enterprise/agentupdate/pom.xml
index 329f7fb..67ed9a8 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/binding/pom.xml b/modules/enterprise/binding/pom.xml
index 91ab077..d5b7643 100644
--- a/modules/enterprise/binding/pom.xml
+++ b/modules/enterprise/binding/pom.xml
@@ -3,10 +3,10 @@
<parent>
<artifactId>rhq-enterprise-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-script-bindings</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 9ade65f..8148262 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.7.0.JON</version>
+ <version>4.8.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 539cff8..a140a9c 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.7.0.JON</version>
+ <version>4.8.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 3dea516..cb7dd3a 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index 57c01e8..018a802 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -8,7 +8,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 8b742ff..d2998cc 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/remoting-war/pom.xml
b/modules/enterprise/gui/remoting-war/pom.xml
index 0dae4ac..638bccd 100644
--- a/modules/enterprise/gui/remoting-war/pom.xml
+++ b/modules/enterprise/gui/remoting-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/rest-examples-war/pom.xml
b/modules/enterprise/gui/rest-examples-war/pom.xml
index 0cd7bf7..c9aa075 100644
--- a/modules/enterprise/gui/rest-examples-war/pom.xml
+++ b/modules/enterprise/gui/rest-examples-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/rest-war/pom.xml
b/modules/enterprise/gui/rest-war/pom.xml
index 10a7cd8..33e330e 100644
--- a/modules/enterprise/gui/rest-war/pom.xml
+++ b/modules/enterprise/gui/rest-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index 0e5c315..3fad441 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.7.0.JON</version>
+ <version>4.8.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 40ed02c..dec19d0 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.7.0.JON</version>
+ <version>4.8.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 49e0186..cba50db 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.7.0.JON</version>
+ <version>4.8.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 a087cb1..6db40f2 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index bbd87da..7bf574e 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/scripting/api/pom.xml
b/modules/enterprise/scripting/api/pom.xml
index b584947..268af3a 100644
--- a/modules/enterprise/scripting/api/pom.xml
+++ b/modules/enterprise/scripting/api/pom.xml
@@ -3,10 +3,10 @@
<parent>
<artifactId>rhq-scripting-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-scripting-api</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<name>RHQ Scripting API</name>
<description>Provides API for adding scripting support to RHQ using different
javax.scripting - based interpreters</description>
diff --git a/modules/enterprise/scripting/javascript/pom.xml
b/modules/enterprise/scripting/javascript/pom.xml
index c376943..acc09aa 100644
--- a/modules/enterprise/scripting/javascript/pom.xml
+++ b/modules/enterprise/scripting/javascript/pom.xml
@@ -4,10 +4,10 @@
<parent>
<artifactId>rhq-scripting-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-scripting-javascript</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<name>RHQ Javascript support</name>
<description>Provides RHQ scripting in Javascript using
Rhino</description>
diff --git a/modules/enterprise/scripting/pom.xml b/modules/enterprise/scripting/pom.xml
index 4c47992..a58f1ca 100644
--- a/modules/enterprise/scripting/pom.xml
+++ b/modules/enterprise/scripting/pom.xml
@@ -3,12 +3,12 @@
<parent>
<artifactId>rhq-enterprise-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-scripting-parent</artifactId>
<packaging>pom</packaging>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<name>RHQ Scripting Parent Module</name>
<modules>
diff --git a/modules/enterprise/scripting/python/pom.xml
b/modules/enterprise/scripting/python/pom.xml
index 385978a..dc69d9e 100644
--- a/modules/enterprise/scripting/python/pom.xml
+++ b/modules/enterprise/scripting/python/pom.xml
@@ -3,10 +3,10 @@
<parent>
<artifactId>rhq-scripting-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-scripting-python</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<name>RHQ Python support</name>
<description>Provides RHQ scripting in Python using Jython</description>
diff --git a/modules/enterprise/server/appserver/pom.xml
b/modules/enterprise/server/appserver/pom.xml
index d6e97a0..f186d70 100644
--- a/modules/enterprise/server/appserver/pom.xml
+++ b/modules/enterprise/server/appserver/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 560de86..3e69ded 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-server-client-api</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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/ear/pom.xml
b/modules/enterprise/server/ear/pom.xml
index dd10dec..867ebe1 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/installer/pom.xml
b/modules/enterprise/server/installer/pom.xml
index 9ee8e93..23d8e94 100644
--- a/modules/enterprise/server/installer/pom.xml
+++ b/modules/enterprise/server/installer/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/itests-2/pom.xml
b/modules/enterprise/server/itests-2/pom.xml
index 460342b..5e4e076 100644
--- a/modules/enterprise/server/itests-2/pom.xml
+++ b/modules/enterprise/server/itests-2/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 c0a0bae..84e34c4 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 1bd8378..ea9bd42 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>alert-cli</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 5252acc..a2102a3 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.server</groupId>
<artifactId>alert-email</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 ee5adda..bd5f656 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-irc</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 8c7670d..934cb7e 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-log4j</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 80d32e7..28d1d56 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-microblog</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 6438e21..4338526 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-mobicents</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 b2ecdbe..21ec5f7 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-operations</artifactId>
<packaging>jar</packaging>
- <version>4.7.0.JON</version>
+ <version>4.8.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 cb37a34..a6c054a 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-roles</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 87a66cc..b933e91 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-snmp</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 3e43ea6..d4d2564 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-subject</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 7784473..648b451 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.7.0.JON</version>
+ <version>4.8.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 5c79143..6f56e82 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>rhq-serverplugin-cobbler</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 dde366f..21bb689 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.7.0.JON</version>
+ <version>4.8.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 6429931..7111543 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.7.0.JON</version>
+ <version>4.8.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 b36fcbb..6ab0964 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml
b/modules/enterprise/server/plugins/jboss-software/pom.xml
index 6285905..32ffc76 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.7.0.JON</version>
+ <version>4.8.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 de6f9c4..2a75e07 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>packagetype-cli</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<name>RHQ Enterprise Server CLI Package Type Plugin</name>
diff --git a/modules/enterprise/server/plugins/pom.xml
b/modules/enterprise/server/plugins/pom.xml
index 7e75407..dc862db 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/url/pom.xml
b/modules/enterprise/server/plugins/url/pom.xml
index 19bc8b1..bb1740d 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.7.0.JON</version>
+ <version>4.8.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 32d9a39..06da613 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.7.0.JON</version>
+ <version>4.8.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 c97e216..6f8ac10 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/pom.xml b/modules/enterprise/server/pom.xml
index 48fd5ea..9c60e30 100644
--- a/modules/enterprise/server/pom.xml
+++ b/modules/enterprise/server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml
b/modules/enterprise/server/safe-invoker/pom.xml
index ab869f2..b2b741e 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/sars/pom.xml
b/modules/enterprise/server/sars/pom.xml
index fc69668..d4f7715 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/sars/services-sar/pom.xml
b/modules/enterprise/server/sars/services-sar/pom.xml
index 6377787..014420b 100644
--- a/modules/enterprise/server/sars/services-sar/pom.xml
+++ b/modules/enterprise/server/sars/services-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/startup-subsystem/pom.xml
b/modules/enterprise/server/startup-subsystem/pom.xml
index 286398c..7152fc3 100644
--- a/modules/enterprise/server/startup-subsystem/pom.xml
+++ b/modules/enterprise/server/startup-subsystem/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 2f0d910..00e558b 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/bundleGen/pom.xml b/modules/helpers/bundleGen/pom.xml
index e63e38e..f2f2455 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.helpers</groupId>
<artifactId>bundleGen</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<build>
<plugins>
diff --git a/modules/helpers/jeeGen/pom.xml b/modules/helpers/jeeGen/pom.xml
index a7ed4cc..6f36514 100644
--- a/modules/helpers/jeeGen/pom.xml
+++ b/modules/helpers/jeeGen/pom.xml
@@ -9,7 +9,7 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/perftest-support/pom.xml
b/modules/helpers/perftest-support/pom.xml
index 84d6d04..8772058 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>perftest-support</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 a853c5e..ecebf6c 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/rest-docs-generator/pom.xml
b/modules/helpers/rest-docs-generator/pom.xml
index 2ef0b85..c5a4a41 100644
--- a/modules/helpers/rest-docs-generator/pom.xml
+++ b/modules/helpers/rest-docs-generator/pom.xml
@@ -24,7 +24,7 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/helpers/rtfilter-subsystem/pom.xml
b/modules/helpers/rtfilter-subsystem/pom.xml
index 0567602..baf0801 100644
--- a/modules/helpers/rtfilter-subsystem/pom.xml
+++ b/modules/helpers/rtfilter-subsystem/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index 24f015d..bf4ca3d 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/integration-tests/apache-plugin-test/pom.xml
b/modules/integration-tests/apache-plugin-test/pom.xml
index ca3d81f..a9d7296 100644
--- a/modules/integration-tests/apache-plugin-test/pom.xml
+++ b/modules/integration-tests/apache-plugin-test/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-integration-tests</artifactId>
<groupId>org.rhq</groupId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
b/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
index 59becbb..7ae77d3 100644
--- a/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
+++ b/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>jndi-access-test-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>jndi-access-test</artifactId>
diff --git a/modules/integration-tests/jndi-access/pom.xml
b/modules/integration-tests/jndi-access/pom.xml
index 5e1f84c..6ded494 100644
--- a/modules/integration-tests/jndi-access/pom.xml
+++ b/modules/integration-tests/jndi-access/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-integration-tests</artifactId>
<groupId>org.rhq</groupId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/integration-tests/jndi-access/remote-server/pom.xml
b/modules/integration-tests/jndi-access/remote-server/pom.xml
index 777f236..d11992a 100644
--- a/modules/integration-tests/jndi-access/remote-server/pom.xml
+++ b/modules/integration-tests/jndi-access/remote-server/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>jndi-access-test-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>jndi-access-remote-server</artifactId>
diff --git a/modules/integration-tests/pom.xml b/modules/integration-tests/pom.xml
index ac50627..7e5f521 100644
--- a/modules/integration-tests/pom.xml
+++ b/modules/integration-tests/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/integration-tests/rest-api/pom.xml
b/modules/integration-tests/rest-api/pom.xml
index 8debbc4..bca2fe4 100644
--- a/modules/integration-tests/rest-api/pom.xml
+++ b/modules/integration-tests/rest-api/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-integration-tests</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index d74b6cc..2809e95 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.7.0.JON</version>
+ <version>4.8.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 780b6e3..75a98a4 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index cead04e..380f6e6 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index d68d451..ada89b3 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/byteman/pom.xml b/modules/plugins/byteman/pom.xml
index 2e80e03..37ffe0e 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cassandra/pom.xml b/modules/plugins/cassandra/pom.xml
index 79f789b..a17a3d8 100644
--- a/modules/plugins/cassandra/pom.xml
+++ b/modules/plugins/cassandra/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index f37463b..9424397 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index cd8f563..3aa5463 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index 2292a6f..03349f8 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.7.0.JON</version>
+ <version>4.8.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 7da6b89..8a5f0e6 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index 8a77511..a1c3353 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hadoop/pom.xml b/modules/plugins/hadoop/pom.xml
index 1618ff0..d8325e4 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index d2dc58a..adee980 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 0a159b5..f587112 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index b31fd66..d1f3e43 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-hudson-plugin</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 34e2f82..93a915f 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/irc/pom.xml b/modules/plugins/irc/pom.xml
index daaa104..b043e7b 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.7.0.JON</version>
+ <version>4.8.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 7dc2147..f2e6f8a 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.7.0.JON</version>
+ <version>4.8.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 75e7b74..0b36f29 100644
--- a/modules/plugins/jboss-as-7/pom.xml
+++ b/modules/plugins/jboss-as-7/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.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 155912f..b792d26 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.7.0.JON</version>
+ <version>4.8.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 896a15d..837852d 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.7.0.JON</version>
+ <version>4.8.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 6976d9b..3828a6a 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index 5ac7010..864f675 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/kickstart/pom.xml b/modules/plugins/kickstart/pom.xml
index 1dee28d..094f451 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.7.0.JON</version>
+ <version>4.8.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 e8fe102..54b9f53 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index 22d5822..572851e 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index 3b6bd23..6b663ff 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/noop/pom.xml b/modules/plugins/noop/pom.xml
index f479b37..68af26a 100644
--- a/modules/plugins/noop/pom.xml
+++ b/modules/plugins/noop/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index a55e980..ed93d10 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.7.0.JON</version>
+ <version>4.8.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 4811181..5653d69 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index 8d330c6..f852e8a 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index 48bd3e1..e28148c 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index 8b95b87..0e27179 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index 45c5ae5..12ae83c 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index b2f56ff..26d37b3 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.7.0.JON</version>
+ <version>4.8.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 0805240..6bf549f 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.7.0.JON</version>
+ <version>4.8.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 5b0231a..968a154 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 8eb6a1b..20e41c4 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index 9cf27a2..d31500b 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script2/pom.xml b/modules/plugins/script2/pom.xml
index 8eb8486..36ab8be 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index cca0dfb..74d740b 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index e99a393..e0a216e 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 6ccc01b..3891b84 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index 2848dbb..eb97008 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index 928ab6c..45c2544 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.7.0.JON</version>
+ <version>4.8.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 f590ca2..63eb6ae 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/virt/pom.xml b/modules/plugins/virt/pom.xml
index 17d502f..de510c5 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index 0e18cc9..8f4cf31 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index 3407cad..c343deb 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.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>test-utils</artifactId>
diff --git a/pom.xml b/pom.xml
index 9b29fab..a5588bb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0.JON</version>
+ <version>4.8.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RHQ</name>
commit 2eef3b4fcd05fc1b248ab3c95fbc115e3758079d
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Wed May 29 13:48:05 2013 +0200
[BZ 967542] - UI shows confusing units when editing Availability Duration alert
condition type
Now if user iserts e.g. 90 mins and reopens the dialog, it won't display
1.5 hours anymore, but 90 mins as expected.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/DurationItem.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/DurationItem.java
index 104b84c..6c41897 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/DurationItem.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/DurationItem.java
@@ -38,6 +38,7 @@ import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
import com.smartgwt.client.widgets.form.validator.IntegerRangeValidator;
import org.rhq.core.domain.measurement.MeasurementUnits;
+import org.rhq.core.domain.measurement.composite.MeasurementNumericValueAndUnits;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.Messages;
import org.rhq.enterprise.gui.coregui.client.util.FormUtility;
@@ -238,26 +239,17 @@ public class DurationItem extends CanvasItem {
this.form.setValue(FIELD_VALUE, formattedOutput);
setValue(formattedOutput);
} else {
- String valueWithUnits = MeasurementConverterClient.format((double)
longValue,
- MeasurementUnits.MILLISECONDS, true);
- String[] chunks = valueWithUnits.split(" ");
- String value = chunks[0];
- if (value.endsWith(".0")) {
- value = value.substring(0, value.indexOf(".0"));
+ MeasurementNumericValueAndUnits valueWithUnits;
+ if (longValue % HOUR_IN_MILLIS == 0) {
+ valueWithUnits = MeasurementConverterClient.fit((double) longValue,
MeasurementUnits.MILLISECONDS,
+ MeasurementUnits.HOURS, MeasurementUnits.HOURS);
+ } else {
+ valueWithUnits = MeasurementConverterClient.fit((double) longValue,
MeasurementUnits.MILLISECONDS,
+ MeasurementUnits.MINUTES, MeasurementUnits.MINUTES);
}
- this.form.setValue(FIELD_VALUE, value);
- String units = chunks[1];
SelectItem unitsItem = (SelectItem) this.form.getItem(FIELD_UNITS);
- if
(MeasurementConverterClient.getMeasurementUnitAbbreviation(MeasurementUnits.SECONDS).equals(units))
{
- unitsItem.setValue(TimeUnit.SECONDS.name().toLowerCase());
- } else if
(MeasurementConverterClient.getMeasurementUnitAbbreviation(MeasurementUnits.MINUTES)
- .equals(units)) {
- unitsItem.setValue(TimeUnit.MINUTES.name().toLowerCase());
- } else if
(MeasurementConverterClient.getMeasurementUnitAbbreviation(MeasurementUnits.HOURS).equals(units))
{
- unitsItem.setValue(TimeUnit.HOURS.name().toLowerCase());
- } else if
(MeasurementConverterClient.getMeasurementUnitAbbreviation(MeasurementUnits.DAYS).equals(units))
{
- unitsItem.setValue(TimeUnit.DAYS.name().toLowerCase());
- }
+ this.form.setValue(FIELD_VALUE, valueWithUnits.getValue().intValue());
+ unitsItem.setValue(valueWithUnits.getUnits().name().toLowerCase());
}
}
commit 2e3f2b2e2f8db3894fea0777508e79e4bf3817cd
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue May 28 14:32:14 2013 -0400
BZ 967990 the installer now turns off the admin console
diff --git
a/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
b/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
index 8cef6e1..eaf6f66 100644
---
a/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
+++
b/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
@@ -40,12 +40,33 @@ public class CoreJBossASClient extends JBossASClient {
public static final String SCANNER = "scanner";
public static final String EXTENSION = "extension";
public static final String MODULE = "module";
+ public static final String CORE_SERVICE_MGMT = "management";
+ public static final String MGMT_INTERFACE = "management-interface";
+ public static final String MGMT_INTERFACE_HTTP = "http-interface";
public CoreJBossASClient(ModelControllerClient client) {
super(client);
}
/**
+ * Allows the caller to turn on or off complete access for the app server's admin
console.
+ *
+ * @param enableFlag true if the admin console enabled and visible; false if you want
to prohibit all access to the admin console
+ * @throws Exception
+ */
+ public void setEnableAdminConsole(boolean enableFlag) throws Exception {
+ //
/core-service=management/management-interface=http-interface/:write-attribute(name=console-enabled,value=false)
+ final Address address = Address.root()
+ .add(CORE_SERVICE, CORE_SERVICE_MGMT, MGMT_INTERFACE, MGMT_INTERFACE_HTTP);
+ final ModelNode req = createWriteAttributeRequest("console-enabled",
Boolean.toString(enableFlag), address);
+ final ModelNode response = execute(req);
+ if (!isSuccess(response)) {
+ throw new FailureException(response);
+ }
+ return;
+ }
+
+ /**
* Given a string with possible ${x} expressions in it, this will resolve that
expression
* using system property values that are set within the AS JVM itself. If the string
* to resolve has no expressions, or has no expressions that are resolveable, the
expression
diff --git
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
index 0b9c078..bb42d4a 100644
---
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
+++
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
@@ -1034,6 +1034,9 @@ public class InstallerServiceImpl implements InstallerService {
// we don't want to the JBossAS welcome screen; turn it off
new WebJBossASClient(mcc).setEnableWelcomeRoot(false);
+ // we don't want users to access the admin console
+ new CoreJBossASClient(mcc).setEnableAdminConsole(false);
+
} catch (Exception e) {
log("deployServices failed", e);
throw new Exception("Failed to deploy services: " +
ThrowableUtil.getAllMessages(e));
commit 57333dd7c4a683fe39bfcf68ea706cbfa6feded9
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Tue May 28 18:40:38 2013 +0200
[BZ 967542] - UI shows confusing units when editing Availability Duration alert
condition type
I improved the DurationItem component to use internally the SelectItem
instead of ComboBoxItem. When using ComboBoxItem, it was possible to
write to the combobox and this is something that shouldn't happen in
this component because the unit types should be fixed. The DurationItem
is also used from the operation tab view, but no reggression was
introduced by this commit in this view.
Modifying also the DurationItem.setAndFormatValue() to populate the time correctly
when
!isReadOnly.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionEditor.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionEditor.java
index 8fe6d4b..0a2627c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionEditor.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionEditor.java
@@ -65,7 +65,6 @@ import
org.rhq.enterprise.gui.coregui.client.components.form.DurationItem;
import org.rhq.enterprise.gui.coregui.client.components.form.NumberWithUnitsValidator;
import org.rhq.enterprise.gui.coregui.client.components.form.SortedSelectItem;
import org.rhq.enterprise.gui.coregui.client.components.form.TimeUnit;
-import org.rhq.enterprise.gui.coregui.client.components.form.UnitType;
import org.rhq.enterprise.gui.coregui.client.util.enhanced.EnhancedVLayout;
import org.rhq.enterprise.gui.coregui.client.util.measurement.MeasurementParser;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
@@ -959,7 +958,7 @@ public class ConditionEditor extends EnhancedVLayout {
durationValue.setTooltip(MSG.view_alert_definition_condition_editor_availabilityDuration_tooltip_duration());
durationValue.setHoverWidth(200);
if (editMode) {
- durationValue.setValue(Integer.parseInt(existingCondition.getOption()),
UnitType.TIME);
+
durationValue.setAndFormatValue(Integer.parseInt(existingCondition.getOption()) * 1000L);
}
durationValue.setShowIfCondition(ifFunc);
formItems.add(durationValue);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
index 25742f5..e24d1b4 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
@@ -211,6 +211,8 @@ public class SingleAlertDefinitionView extends EnhancedVLayout {
public void execute(Boolean value) {
if (value) {
save();
+ } else {
+ unregisterHandler();
}
}
});
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/DurationItem.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/DurationItem.java
index 633188a..104b84c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/DurationItem.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/DurationItem.java
@@ -29,17 +29,19 @@ import java.util.TreeSet;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.CanvasItem;
-import com.smartgwt.client.widgets.form.fields.ComboBoxItem;
import com.smartgwt.client.widgets.form.fields.FormItem;
import com.smartgwt.client.widgets.form.fields.IntegerItem;
+import com.smartgwt.client.widgets.form.fields.SelectItem;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import com.smartgwt.client.widgets.form.fields.events.ChangedEvent;
import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
import com.smartgwt.client.widgets.form.validator.IntegerRangeValidator;
+import org.rhq.core.domain.measurement.MeasurementUnits;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.Messages;
import org.rhq.enterprise.gui.coregui.client.util.FormUtility;
+import org.rhq.enterprise.gui.coregui.client.util.MeasurementConverterClient;
import org.rhq.enterprise.gui.coregui.client.util.TypeConversionUtility;
/**
@@ -142,7 +144,7 @@ public class DurationItem extends CanvasItem {
}
});
- ComboBoxItem unitsItem = new ComboBoxItem(FIELD_UNITS);
+ SelectItem unitsItem = new SelectItem(FIELD_UNITS);
unitsItem.setShowTitle(false);
LinkedHashMap<String, String> valueMap = new LinkedHashMap<String,
String>();
@@ -230,10 +232,33 @@ public class DurationItem extends CanvasItem {
if (longValue < 0) {
throw new IllegalArgumentException("negative time period " +
longValue);
}
- String formattedOutput = formatMilliseconds(longValue);
- this.unitType = UnitType.TIME;
- this.form.setValue(FIELD_VALUE, formattedOutput);
- setValue(formattedOutput);
+ if (isReadOnly) {
+ String formattedOutput = formatMilliseconds(longValue);
+ this.unitType = UnitType.TIME;
+ this.form.setValue(FIELD_VALUE, formattedOutput);
+ setValue(formattedOutput);
+ } else {
+ String valueWithUnits = MeasurementConverterClient.format((double)
longValue,
+ MeasurementUnits.MILLISECONDS, true);
+ String[] chunks = valueWithUnits.split(" ");
+ String value = chunks[0];
+ if (value.endsWith(".0")) {
+ value = value.substring(0, value.indexOf(".0"));
+ }
+ this.form.setValue(FIELD_VALUE, value);
+ String units = chunks[1];
+ SelectItem unitsItem = (SelectItem) this.form.getItem(FIELD_UNITS);
+ if
(MeasurementConverterClient.getMeasurementUnitAbbreviation(MeasurementUnits.SECONDS).equals(units))
{
+ unitsItem.setValue(TimeUnit.SECONDS.name().toLowerCase());
+ } else if
(MeasurementConverterClient.getMeasurementUnitAbbreviation(MeasurementUnits.MINUTES)
+ .equals(units)) {
+ unitsItem.setValue(TimeUnit.MINUTES.name().toLowerCase());
+ } else if
(MeasurementConverterClient.getMeasurementUnitAbbreviation(MeasurementUnits.HOURS).equals(units))
{
+ unitsItem.setValue(TimeUnit.HOURS.name().toLowerCase());
+ } else if
(MeasurementConverterClient.getMeasurementUnitAbbreviation(MeasurementUnits.DAYS).equals(units))
{
+ unitsItem.setValue(TimeUnit.DAYS.name().toLowerCase());
+ }
+ }
}
/**
@@ -474,7 +499,7 @@ public class DurationItem extends CanvasItem {
}
private TimeUnit getInputTimeUnit() {
- ComboBoxItem unitsItem = (ComboBoxItem) this.form.getItem(FIELD_UNITS);
+ SelectItem unitsItem = (SelectItem) this.form.getItem(FIELD_UNITS);
String unitString = unitsItem.getValueAsString(); // this will always be
non-null
TimeUnit unit;
try {
commit ecb57a4e3e147e18b000388a2baec312c31c7bf2
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue May 28 12:36:26 2013 -0400
Make sure sub-queries used for updates do not include implicit
paging/sorting.
Also, make a small change to test cleanup in related test class.
Note: Fix by lkrejci
diff --git
a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/measurement/test/MeasurementScheduleManagerTest.java
b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/measurement/test/MeasurementScheduleManagerTest.java
index 9febeb8..24bcc84 100644
---
a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/measurement/test/MeasurementScheduleManagerTest.java
+++
b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/measurement/test/MeasurementScheduleManagerTest.java
@@ -342,10 +342,15 @@ public class MeasurementScheduleManagerTest extends
AbstractMeasurementScheduleM
try {
if (null != em) {
em.flush();
- getTransactionManager().commit();
}
} catch (Throwable t) {
-
+ // best effort
+ }
+ try {
+ getTransactionManager().commit();
+ } catch (Throwable t) {
+ // best effort
}
}
+
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java
index 2e4eeda..d53a037 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java
@@ -820,6 +820,7 @@ public class MeasurementScheduleManagerBean implements
MeasurementScheduleManage
*/
private void markResources(EntityContext context, int agentId) {
ResourceCriteria criteria = new ResourceCriteria();
+ criteria.clearPaging(); //important to avoid setting the ordering in the
generated query
if (context.type == EntityContext.Type.Resource) {
criteria.addFilterId(context.resourceId);
} else if (context.type == EntityContext.Type.ResourceGroup) {
@@ -832,7 +833,7 @@ public class MeasurementScheduleManagerBean implements
MeasurementScheduleManage
try {
CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
- ;
+
generator.alterProjection("resource.id");
String resourceSubQuery = generator.getParameterReplacedQuery(false);
@@ -848,7 +849,7 @@ public class MeasurementScheduleManagerBean implements
MeasurementScheduleManage
markResourceQuery.setParameter("now", System.currentTimeMillis());
int affectedRows = markResourceQuery.executeUpdate();
if (log.isDebugEnabled()) {
- log.debug("Marked " + affectedRows + " for future
measurement scheudle update");
+ log.debug("Marked " + affectedRows + " for future
measurement schedule update");
}
} catch (Throwable t) {
log.error("Could not notify agents of updates", t);
@@ -877,6 +878,7 @@ public class MeasurementScheduleManagerBean implements
MeasurementScheduleManage
}
MeasurementScheduleCriteria criteria = new MeasurementScheduleCriteria();
+ criteria.clearPaging(); //important to avoid setting the ordering in the
generated query
if (context.type == EntityContext.Type.Resource) {
criteria.addFilterResourceId(context.resourceId);
} else if (context.type == EntityContext.Type.ResourceGroup) {
@@ -1607,4 +1609,4 @@ public class MeasurementScheduleManagerBean implements
MeasurementScheduleManage
// }
// }
-}
+}
\ No newline at end of file
commit 2f15379bb357495c558b05fb271e247fa1681d01
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Tue May 28 17:36:13 2013 +0200
Bug 885686 - Tomcat web application configuration form allows save without Config File
required field
It's not a Tomcat specific issue. We had a problem in *EditView classes: the check
to enable/disable the save button was only based on the invalid properties set having been
changed. Now it also looks at the set being empty or not.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionEditView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionEditView.java
index c7604c4..a428a22 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionEditView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionEditView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2011 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.gui.coregui.client.drift;
@@ -190,8 +190,10 @@ public class DriftDefinitionEditView extends EnhancedVLayout
implements Property
.toString()), Message.Severity.Error,
EnumSet.of(Message.Option.Transient, Message.Option.Sticky));
}
messageCenter.notify(message);
- } else {
+ } else if (event.getInvalidPropertyNames().isEmpty()) {
this.saveButton.enable();
+ } else {
+ this.saveButton.disable();
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionTemplateEditView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionTemplateEditView.java
index dd69993..0ccc445 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionTemplateEditView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionTemplateEditView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2011 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.gui.coregui.client.drift;
@@ -178,8 +178,10 @@ public class DriftDefinitionTemplateEditView extends EnhancedVLayout
implements
.toString()), Message.Severity.Error,
EnumSet.of(Message.Option.Transient, Message.Option.Sticky));
}
messageCenter.notify(message);
- } else {
+ } else if (event.getInvalidPropertyNames().isEmpty()) {
this.saveButton.enable();
+ } else {
+ this.saveButton.disable();
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationEditView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationEditView.java
index 55ac8fd..d0c440f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationEditView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationEditView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.configuration;
@@ -261,8 +261,10 @@ public class GroupResourceConfigurationEditView extends
EnhancedVLayout implemen
Message.Severity.Error, EnumSet.of(Message.Option.Transient,
Message.Option.Sticky));
}
messageCenter.notify(message);
- } else {
+ } else if (event.getInvalidPropertyNames().isEmpty()) {
this.saveButton.enable();
+ } else {
+ this.saveButton.disable();
}
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/GroupPluginConfigurationEditView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/GroupPluginConfigurationEditView.java
index b6e892f..8680cc4 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/GroupPluginConfigurationEditView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/GroupPluginConfigurationEditView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory;
@@ -256,8 +256,10 @@ public class GroupPluginConfigurationEditView extends EnhancedVLayout
implements
Message.Severity.Error, EnumSet.of(Message.Option.Transient,
Message.Option.Sticky));
}
messageCenter.notify(message);
- } else {
+ } else if (event.getInvalidPropertyNames().isEmpty()) {
this.saveButton.enable();
+ } else {
+ this.saveButton.disable();
}
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ResourceConfigurationEditView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ResourceConfigurationEditView.java
index ae7fde1..e3b119c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ResourceConfigurationEditView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ResourceConfigurationEditView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2011 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration;
@@ -222,8 +222,10 @@ public class ResourceConfigurationEditView extends EnhancedVLayout
implements Pr
.toString()), Message.Severity.Error,
EnumSet.of(Message.Option.Transient, Message.Option.Sticky));
}
messageCenter.notify(message);
- } else {
+ } else if (event.getInvalidPropertyNames().isEmpty()) {
this.saveButton.enable();
+ } else {
+ this.saveButton.disable();
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/inventory/PluginConfigurationEditView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/inventory/PluginConfigurationEditView.java
index fd374eb..63245a2 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/inventory/PluginConfigurationEditView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/inventory/PluginConfigurationEditView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory;
@@ -171,8 +171,10 @@ public class PluginConfigurationEditView extends EnhancedVLayout
implements Prop
Message.Option.Sticky));
}
messageCenter.notify(message);
- } else {
+ } else if (event.getInvalidPropertyNames().isEmpty()) {
this.saveButton.enable();
+ } else {
+ this.saveButton.disable();
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/configuration/TestConfigurationView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/configuration/TestConfigurationView.java
index 128a540..bdbe026 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/configuration/TestConfigurationView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/configuration/TestConfigurationView.java
@@ -1,8 +1,7 @@
/*
* RHQ Management Platform
- * Copyright 2010-2011, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.gui.coregui.client.test.configuration;
@@ -111,8 +110,10 @@ public class TestConfigurationView extends EnhancedVLayout implements
PropertyVa
EnumSet.of(Message.Option.Transient, Message.Option.Sticky));
}
messageCenter.notify(message);
- } else {
+ } else if (event.getInvalidPropertyNames().isEmpty()) {
this.saveButton.enable();
+ } else {
+ this.saveButton.disable();
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/configuration/TestGroupConfigurationView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/configuration/TestGroupConfigurationView.java
index 483e71c..00da718 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/configuration/TestGroupConfigurationView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/configuration/TestGroupConfigurationView.java
@@ -1,8 +1,7 @@
/*
* RHQ Management Platform
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.gui.coregui.client.test.configuration;
@@ -112,8 +111,10 @@ public class TestGroupConfigurationView extends EnhancedVLayout
implements Prope
EnumSet.of(Message.Option.Transient, Message.Option.Sticky));
}
messageCenter.notify(message);
- } else {
+ } else if (event.getInvalidPropertyNames().isEmpty()) {
this.saveButton.enable();
+ } else {
+ this.saveButton.disable();
}
}
commit eeffaed93e68612eb6a88226479702d4f373e510
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue May 28 03:11:56 2013 +0200
[BZ 967622 - Server CLI script can't require modules from rhq://downloads]
This was primarily caused by a new permission required by EAP 6.1 we've
switched to. To access the ModelControllerClient, the code now needs a
RuntimePermission("canAccessModelController").
We need the ModelControllerClient when determining the EAR installation
dir, which we in turn need when determining where to locate the scripts
in the "rhq://downloads" location. This is done while running a script,
which is done in a restricted access control context which does not and
should not have that permission.
The minimal fix is to wrap the getting of the ModelControllerClient in a
privileged action but some more "defensive" code was added in the
RhqDownloadScriptSourceProvider, too, to guard against different times it
might get instantiated during the script execution.
Javadocs were updated to warn about the security considerations when
writing a script source provider available on the server side.
diff --git
a/modules/enterprise/binding/src/main/java/org/rhq/bindings/script/BaseRhqSchemeScriptSourceProvider.java
b/modules/enterprise/binding/src/main/java/org/rhq/bindings/script/BaseRhqSchemeScriptSourceProvider.java
index 4c6756f..87241ef 100644
---
a/modules/enterprise/binding/src/main/java/org/rhq/bindings/script/BaseRhqSchemeScriptSourceProvider.java
+++
b/modules/enterprise/binding/src/main/java/org/rhq/bindings/script/BaseRhqSchemeScriptSourceProvider.java
@@ -55,8 +55,11 @@ public abstract class BaseRhqSchemeScriptSourceProvider implements
ScriptSourceP
* The base implementation of the {@link #getScriptSource(URI)} method
* only checks that the scheme of the URI is "rhq" and that the scheme
* specific part starts with "//".
- *
- * @param scriptUri
+ * <p/>
+ * Please follow the general suggestions mentioned in {@link
ScriptSourceProvider#getScriptSource(java.net.URI)}
+ * docs.
+ *
+ * @param scriptUri the URI to load the script from
* @return the reader of the script or null if the script could not be
* found using the URI
*
diff --git
a/modules/enterprise/scripting/api/src/main/java/org/rhq/scripting/ScriptSourceProvider.java
b/modules/enterprise/scripting/api/src/main/java/org/rhq/scripting/ScriptSourceProvider.java
index e65f793..fb0f606 100644
---
a/modules/enterprise/scripting/api/src/main/java/org/rhq/scripting/ScriptSourceProvider.java
+++
b/modules/enterprise/scripting/api/src/main/java/org/rhq/scripting/ScriptSourceProvider.java
@@ -29,14 +29,26 @@ import java.net.URI;
* <p>
* Implementations of this interface can be located using the {@link
ScriptSourceProviderFactory}
* if they are registered in META-INF/services.
- *
+ * <p/>
+ * Note that instances of this class can be created and called in an access control
context with limited privileges.
+ * If you need to make safe calls that require privileges not granted to a script run in
the RHQ server (by default this
+ * is determined by the {@code org.rhq.bindings.StandardScriptPermissions} class), make
sure to call such actions with
+ * elevated permissions through
+ * {@link
java.security.AccessController#doPrivileged(java.security.PrivilegedExceptionAction)} or
any of its
+ * derivatives.
+ * <p/>
+ * For example JNDI look-ups are not allowed by default for the scripts, so if your
provider needs to perform some
+ * JNDI lookups to locate the script to include, you need to wrap any code that does a
JNDI look-up as above.
+ *
* @author Lukas Krejci
*/
public interface ScriptSourceProvider {
/**
* Returns the reader of the source of the script specified by given location.
- *
+ * <p/>
+ * Review the class description for the security considerations.
+ *
* @param location the location of the script
* @return the reader of the script source or null if it could not be found
*/
diff --git
a/modules/enterprise/server/client-api/src/main/java/org/rhq/enterprise/client/RhqDownloadsScriptSourceProvider.java
b/modules/enterprise/server/client-api/src/main/java/org/rhq/enterprise/client/RhqDownloadsScriptSourceProvider.java
index 1cbbe39..23e8fb5 100644
---
a/modules/enterprise/server/client-api/src/main/java/org/rhq/enterprise/client/RhqDownloadsScriptSourceProvider.java
+++
b/modules/enterprise/server/client-api/src/main/java/org/rhq/enterprise/client/RhqDownloadsScriptSourceProvider.java
@@ -26,6 +26,11 @@ import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URI;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.util.concurrent.Callable;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -45,20 +50,67 @@ public class RhqDownloadsScriptSourceProvider extends
BaseRhqSchemeScriptSourceP
private CoreServerMBean coreServer;
+ /**
+ * A bunch of methods optionally enclosed in privileged actions to ensure that we can
access the information
+ * inside RHQ server even though it might not be accessible in the access control
context the scripts run in
+ * in the RHQ server.
+ */
+ private static class SecurityActions {
+ private SecurityActions() {
+
+ }
+
+ private static CoreServerMBean lookupCoreServer() {
+ if (System.getSecurityManager() == null) {
+ return LookupUtil.getCoreServer();
+ } else {
+ return AccessController.doPrivileged(new
PrivilegedAction<CoreServerMBean>() {
+ @Override
+ public CoreServerMBean run() {
+ return LookupUtil.getCoreServer();
+ }
+ });
+ }
+ }
+
+ private static File getDownloadDir(final CoreServerMBean coreServer) {
+ File earDeployDir;
+ if (System.getSecurityManager() == null) {
+ earDeployDir = coreServer.getEarDeploymentDir();
+ } else {
+ earDeployDir = AccessController.doPrivileged(new
PrivilegedAction<File>() {
+ @Override
+ public File run() {
+ return coreServer.getEarDeploymentDir();
+ }
+ });
+ }
+ File downloadDir = new File(earDeployDir, "rhq-downloads");
+ return downloadDir;
+ }
+ }
+
public RhqDownloadsScriptSourceProvider() {
- this(LookupUtil.getCoreServer());
+ //we need to do a safe JNDI lookup, but we may run in unprivileged context...
+ this(SecurityActions.lookupCoreServer());
}
-
+
+ /**
+ * This is meant only for testing purposes.
+ *
+ * @param coreServerMBean the CoreServer MBean to use
+ */
public RhqDownloadsScriptSourceProvider(CoreServerMBean coreServerMBean) {
super(AUTHORITY);
this.coreServer = coreServerMBean;
}
-
+
@Override
protected Reader doGetScriptSource(URI scriptUri) {
String path = scriptUri.getPath().substring(1); //remove the leading /
- File downloadsDir = getDownloadHomeDir();
+ //We're going to be doing an MBean call here which the scripts don't have
privs for by default
+ File downloadsDir = SecurityActions.getDownloadDir(coreServer);
File scriptDownloads = new File(downloadsDir, "script-modules");
File file = new File(scriptDownloads, path);
@@ -69,10 +121,4 @@ public class RhqDownloadsScriptSourceProvider extends
BaseRhqSchemeScriptSourceP
return null;
}
}
-
- private File getDownloadHomeDir() {
- File earDeployDir = this.coreServer.getEarDeploymentDir();
- File downloadDir = new File(earDeployDir, "rhq-downloads");
- return downloadDir;
- }
}
diff --git
a/modules/enterprise/server/client-api/src/test/java/org/rhq/enterprise/client/test/RhqDownloadsScriptSourceProviderTest.java
b/modules/enterprise/server/client-api/src/test/java/org/rhq/enterprise/client/test/RhqDownloadsScriptSourceProviderTest.java
index e62dd32..1b366ba 100644
---
a/modules/enterprise/server/client-api/src/test/java/org/rhq/enterprise/client/test/RhqDownloadsScriptSourceProviderTest.java
+++
b/modules/enterprise/server/client-api/src/test/java/org/rhq/enterprise/client/test/RhqDownloadsScriptSourceProviderTest.java
@@ -85,8 +85,8 @@ public class RhqDownloadsScriptSourceProviderTest {
try {
String contents = StreamUtil.slurp(rdr);
assertEquals(contents, EXPECTED_CONTENTS, "Unexpected script
loaded");
- } finally {
- rdr.close();
+ } finally {
+ StreamUtil.safeClose(rdr);
}
}
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java
index 9a60f12..b74b704 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java
@@ -22,6 +22,8 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.management.ManagementFactory;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.Date;
import java.util.HashMap;
import java.util.Properties;
@@ -69,6 +71,24 @@ public class CoreServer implements CoreServerMBean {
*/
private static final String PROP_BUILD_DATE = "Build-Date";
+ private static class SecurityActions {
+ private SecurityActions() {
+
+ }
+
+ private static ModelControllerClient getModelControllerClient() {
+ if (System.getSecurityManager() == null) {
+ return ManagementService.getClient();
+ } else {
+ return AccessController.doPrivileged(new
PrivilegedAction<ModelControllerClient>() {
+ @Override
+ public ModelControllerClient run() {
+ return ManagementService.getClient();
+ }
+ });
+ }
+ }
+ }
private Properties buildProps;
private Date bootTime;
@@ -136,7 +156,10 @@ public class CoreServer implements CoreServerMBean {
@Override
public File getEarDeploymentDir() {
- ModelControllerClient mcc = ManagementService.getClient();
+ //Getting model controller client requires privs our callers might not have, but
we want to provide this
+ //function even to them.
+ ModelControllerClient mcc = SecurityActions.getModelControllerClient();
+
try {
DeploymentJBossASClient client = new DeploymentJBossASClient(mcc);
String earPath = client.getDeploymentPath(RHQConstants.EAR_FILE_NAME);
@@ -229,4 +252,4 @@ public class CoreServer implements CoreServerMBean {
return buildProps;
}
-}
\ No newline at end of file
+}
commit ff37cd971a73a9fefc4024f5022aff85b7b90b90
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri May 24 23:29:46 2013 -0400
remove use of method not supported by GWT
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java
index d8552de..f398020 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java
@@ -179,7 +179,7 @@ public abstract class Criteria implements Serializable, BaseCriteria
{
this.sortId = sortId;
} else {
- throw new UnsupportedOperationException("ID sort is not supported by
" + this.getClass().getSimpleName());
+ throw new UnsupportedOperationException("ID sort is not supported by
supported by this class");
}
}
@@ -188,7 +188,7 @@ public abstract class Criteria implements Serializable, BaseCriteria
{
this.filterId = filterId;
} else {
- throw new UnsupportedOperationException("ID filter is not supported by
" + this.getClass().getSimpleName());
+ throw new UnsupportedOperationException("ID filter is not supported by
this class");
}
}
@@ -197,7 +197,7 @@ public abstract class Criteria implements Serializable, BaseCriteria
{
this.filterIds = CriteriaUtils.getListIgnoringNulls(filterIds);
} else {
- throw new UnsupportedOperationException("IDS filter is not supported by
" + this.getClass().getSimpleName());
+ throw new UnsupportedOperationException("IDS filter is not supported by
this class");
}
}
commit 471b8a20f984f79d448acf58c01ec8c38cee8e67
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri May 24 19:45:41 2013 -0400
Bug 966665
- Criteria queries with paging and sorting on non unique fields may return same item
on different pages
All paged criteria queries now apply ID as the least significant
ordering field (see exceptions below). Since ID is unique, this ensures
that queries for pages always return the same ordering of rows.
ID will not be automatically appended as an ordering field if:
- the paging is unlimited (i.e. no pagesize, all rows returned)
- the Criteria class does not support an ID sort
- the caller has set the Criteria class instance to not support the ID sort
- ID is already specified as an ordering field
- the max number of ordering fields has already been set (3)
Note that CriteriaQuery has had its support for implicit ID sorting removed,
as the new mechanism, which moves support to the CriteriaQueryGenerator,
replaces it.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java
index 2dde3a4..d8552de 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java
@@ -109,6 +109,7 @@ public abstract class Criteria implements Serializable, BaseCriteria
{
private List<Permission> requiredPermissions;
private boolean strict;
private Restriction restriction = null;
+ private boolean supportsAddSortId = true;
protected Map<String, String> filterOverrides;
protected Map<String, String> sortOverrides;
@@ -173,16 +174,54 @@ public abstract class Criteria implements Serializable, BaseCriteria
{
}
public void addSortId(PageOrdering sortId) {
- addSortField("id");
- this.sortId = sortId;
+ if (isSupportsAddSortId()) {
+ addSortField("id");
+ this.sortId = sortId;
+
+ } else {
+ throw new UnsupportedOperationException("ID sort is not supported by
" + this.getClass().getSimpleName());
+ }
}
public void addFilterId(Integer filterId) {
- this.filterId = filterId;
+ if (isSupportsAddFilterId()) {
+ this.filterId = filterId;
+
+ } else {
+ throw new UnsupportedOperationException("ID filter is not supported by
" + this.getClass().getSimpleName());
+ }
}
public void addFilterIds(Integer... filterIds) {
- this.filterIds = CriteriaUtils.getListIgnoringNulls(filterIds);
+ if (isSupportsAddFilterIds()) {
+ this.filterIds = CriteriaUtils.getListIgnoringNulls(filterIds);
+
+ } else {
+ throw new UnsupportedOperationException("IDS filter is not supported by
" + this.getClass().getSimpleName());
+ }
+ }
+
+ /**
+ * By default all Criteria support sort on ID. And this sort is applied implicitly
to criteria
+ * queries involving paging, to ensure consistent ordering of query results. If for
some unlikely reason
+ * the caller needs to disable the implicit ID sort then call this, setting the value
to false.
+ *
+ * @param supportsAddSortId
+ */
+ public void setSupportsAddSortId(boolean supportsAddSortId) {
+ this.supportsAddSortId = supportsAddSortId;
+ }
+
+ public boolean isSupportsAddSortId() {
+ return supportsAddSortId;
+ }
+
+ public boolean isSupportsAddFilterId() {
+ return true;
+ }
+
+ public boolean isSupportsAddFilterIds() {
+ return true;
}
protected void addSortField(String fieldName) {
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/JPADriftChangeSetCriteria.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/JPADriftChangeSetCriteria.java
index af888ea..2b03228 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/JPADriftChangeSetCriteria.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/JPADriftChangeSetCriteria.java
@@ -292,13 +292,12 @@ public class JPADriftChangeSetCriteria extends Criteria implements
DriftChangeSe
}
@Override
- public void addSortId(PageOrdering pageOrdering) {
- throw new UnsupportedOperationException("The sort is not supported by
DriftChangeSetCriteria.");
+ public boolean isSupportsAddSortId() {
+ return false;
}
@Override
- public void addFilterIds(Integer... filterIds) {
- throw new UnsupportedOperationException("The filter is not supported by
DriftChangeSetCriteria.");
+ public boolean isSupportsAddFilterIds() {
+ return false;
}
-
}
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/JPADriftCriteria.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/JPADriftCriteria.java
index 56f0ddf..b13ca90 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/JPADriftCriteria.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/JPADriftCriteria.java
@@ -245,13 +245,12 @@ public class JPADriftCriteria extends Criteria implements
DriftCriteria {
}
@Override
- public void addFilterIds(Integer... filterIds) {
- throw new UnsupportedOperationException("The filter is not supported by
DriftCriteria.");
+ public boolean isSupportsAddSortId() {
+ return false;
}
@Override
- public void addSortId(PageOrdering pageOrdering) {
- throw new UnsupportedOperationException("The sort is not supported by
DriftCriteria.");
+ public boolean isSupportsAddFilterIds() {
+ return false;
}
-
}
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementDataTraitCriteria.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementDataTraitCriteria.java
index a27e58d..3a2a2c1 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementDataTraitCriteria.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementDataTraitCriteria.java
@@ -135,17 +135,17 @@ public class MeasurementDataTraitCriteria extends Criteria {
}
@Override
- public void addSortId(PageOrdering sortId) {
- throw new UnsupportedOperationException("The id column is not defined on
this entity.");
+ public boolean isSupportsAddSortId() {
+ return false;
}
@Override
- public void addFilterId(Integer filterId) {
- throw new UnsupportedOperationException("The id column is not defined on
this entity.");
+ public boolean isSupportsAddFilterId() {
+ return false;
}
@Override
- public void addFilterIds(Integer... filterIds) {
- throw new UnsupportedOperationException("The id column is not defined on
this entity.");
+ public boolean isSupportsAddFilterIds() {
+ return false;
}
}
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/util/PageControl.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/util/PageControl.java
index f87a814..888c821 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/util/PageControl.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/util/PageControl.java
@@ -82,14 +82,22 @@ public class PageControl implements Serializable, Cloneable {
return new PageControl(0, 1);
}
+ /**
+ * Equivalent to initDefaultOrderingField(defaultField, PageOrdering.ASC).
+ *
+ * @param defaultField
+ * @see #initDefaultOrderingField(String, PageOrdering)
+ */
public void initDefaultOrderingField(String defaultField) {
initDefaultOrderingField(defaultField, PageOrdering.ASC);
}
- public void addDefaultOrderingField(String defaultField) {
- addDefaultOrderingField(defaultField, PageOrdering.ASC);
- }
-
+ /**
+ * Sets initial sort. If sorting is already defined this call will have no effect.
+ *
+ * @param defaultField
+ * @param defaultPageOrdering
+ */
public void initDefaultOrderingField(String defaultField, PageOrdering
defaultPageOrdering) {
if (orderingFields.size() > 0) {
return;
@@ -98,6 +106,24 @@ public class PageControl implements Serializable, Cloneable {
addDefaultOrderingField(defaultField, defaultPageOrdering);
}
+ /**
+ * Equivalent to addDefaultOrderingField(defaultField, PageOrdering.ASC).
+ *
+ * @param defaultField
+ * @see #addDefaultOrderingField(String, PageOrdering)
+ */
+ public void addDefaultOrderingField(String defaultField) {
+ addDefaultOrderingField(defaultField, PageOrdering.ASC);
+ }
+
+ /**
+ * Add a default ordering field. If the maximum number of sort fields (currently 3)
are already
+ * defined this call will have no effect. If the field is already a sort field this
call will have no
+ * effect. Otherwise, the ordering field will be appended to the existing ordering
fields.
+ *
+ * @param defaultField
+ * @param defaultPageOrdering
+ */
public void addDefaultOrderingField(String defaultField, PageOrdering
defaultPageOrdering) {
if (orderingFields.size() >= MAX_ORDERING_FIELD_COUNT) {
return; // only need to add defaults if there are less than 3 sort orders
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQuery.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQuery.java
index 2d40388..a2bbfee 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQuery.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQuery.java
@@ -27,7 +27,6 @@ import java.util.NoSuchElementException;
import org.rhq.core.domain.criteria.BaseCriteria;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
-import org.rhq.core.domain.util.PageOrdering;
/** This class provides a way to make PageList results easily iterable with 'for
each','while',etc. loops
* and importantly automatically handles iteration through all PageControl results.
This
@@ -62,17 +61,6 @@ public class CriteriaQuery<T, C extends BaseCriteria> implements
Iterable<T> {
public CriteriaQuery(C criteria, CriteriaQueryExecutor<T, C> queryExecutor) {
this.criteria = criteria;
this.queryExecutor = queryExecutor;
-
- // make sure we have at least a default sort, otherwise chunking doesn't
work
- PageControl pageControlOverrides = this.criteria.getPageControlOverrides();
- if (null != pageControlOverrides) {
- if (pageControlOverrides.getOrderingFields().isEmpty()) {
- pageControlOverrides.addDefaultOrderingField("id");
- }
-
- } else if (this.criteria.getOrderingFieldNames().isEmpty()) {
- this.criteria.addSortId(PageOrdering.ASC);
- }
}
/** Returns iterator for a single page of results as defined by
@@ -110,7 +98,8 @@ public class CriteriaQuery<T, C extends BaseCriteria> implements
Iterable<T> {
public QueryResultsIterator(PageList<T> firstPage) {
currentPage = firstPage;
iterator = currentPage.iterator();
- count = firstPage == null || firstPage.getPageControl() == null ? 0 :
firstPage.getPageControl().getStartRow();
+ count = firstPage == null || firstPage.getPageControl() == null ? 0 :
firstPage.getPageControl()
+ .getStartRow();
}
@Override
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
index d1d2f73..574fe73 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
@@ -951,6 +951,7 @@ public final class CriteriaQueryGenerator {
} else {
pc = new PageControl(criteria.getPageNumber(), criteria.getPageSize());
}
+
for (String fieldName : criteria.getOrderingFieldNames()) {
for (Field sortField : getFields(criteria, Criteria.Type.SORT)) {
if (sortField.getName().equals(fieldName) == false) {
@@ -969,6 +970,15 @@ public final class CriteriaQueryGenerator {
}
}
}
+
+ // Unless paging is unlimited or it's not supported, add a sort on ID. This
ensures that when paging
+ // we always have a consistent ordering. In other words, if the data set is
unchanged between pages, there
+ // will no overlap/repetition of rows. Note that this applies even if other sort
fields have been
+ // set, because they may still not have unique values. See
https://bugzilla.redhat.com/show_bug.cgi?id=966665.
+ if (!pc.isUnlimited() && criteria.isSupportsAddSortId()) {
+ pc.addDefaultOrderingField("id");
+ }
+
return pc;
}
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/util/CriteriaQueryTest.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/util/CriteriaQueryTest.java
index 2e1c897..b1f5272 100644
---
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/util/CriteriaQueryTest.java
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/util/CriteriaQueryTest.java
@@ -24,11 +24,15 @@ import static org.testng.Assert.assertEquals;
import java.util.ArrayList;
import java.util.List;
+import org.testng.AssertJUnit;
import org.testng.annotations.Test;
import org.rhq.core.domain.criteria.Criteria;
+import org.rhq.core.domain.criteria.JPADriftCriteria;
+import org.rhq.core.domain.criteria.ResourceCriteria;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
+import org.rhq.core.domain.util.PageOrdering;
public class CriteriaQueryTest {
@@ -229,4 +233,22 @@ public class CriteriaQueryTest {
assert e.getMessage().contains("NonUniqueResultException");
}
}
+
+ @Test
+ public void testAddSort() {
+ try {
+ JPADriftCriteria c = new JPADriftCriteria();
+ c.addSortId(PageOrdering.ASC);
+ AssertJUnit.fail("Should have thrown exception");
+ } catch (UnsupportedOperationException e) {
+ //expected
+ }
+
+ ResourceCriteria c = new ResourceCriteria();
+ c.addSortName(PageOrdering.ASC);
+
+ assertEquals(2,
CriteriaQueryGenerator.getPageControl(c).getOrderingFields().size());
+ assertEquals("name",
CriteriaQueryGenerator.getPageControl(c).getOrderingFields().get(0).getField());
+ assertEquals("id",
CriteriaQueryGenerator.getPageControl(c).getOrderingFields().get(1).getField());
+ }
}
commit 6613ba3db6f3c57c2d2ecac4823e368269a07152
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri May 24 15:40:51 2013 -0400
Use only apache logger and not the jboss logger from the base class.
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/DelegatingLoginModule.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/DelegatingLoginModule.java
index d89c04b..b83a037 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/DelegatingLoginModule.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/DelegatingLoginModule.java
@@ -84,7 +84,7 @@ public class DelegatingLoginModule extends UsernamePasswordLoginModule
{
public void initialize(Subject subject, CallbackHandler callbackHandler,
Map<String, ?> sharedState,
Map<String, ?> options) {
- debugEnabled = log.isDebugEnabled();
+ debugEnabled = LOG.isDebugEnabled();
super.initialize(subject, callbackHandler, sharedState, options);
@@ -101,14 +101,14 @@ public class DelegatingLoginModule extends
UsernamePasswordLoginModule {
}
if (debugEnabled) {
- log.debug("Delegating to " + delegateTo + " with roles "
+ additionalRoles);
+ LOG.debug("Delegating to " + delegateTo + " with roles "
+ additionalRoles);
}
// Now create the context for later use
try {
loginContext = new LoginContext(delegateTo, new DelegateCallbackHandler());
} catch (LoginException e) {
- log.warn("Initialize failed : " + e.getMessage());
+ LOG.warn("Initialize failed : " + e.getMessage());
}
}
@@ -123,7 +123,7 @@ public class DelegatingLoginModule extends UsernamePasswordLoginModule
{
@Override
public boolean login() throws LoginException {
try {
- // Get the username / password the user entred and save if for later use
+ // Get the username / password the user entered and save if for later use
usernamePassword = super.getUsernameAndPassword();
// Try to log in via the delegate
@@ -141,7 +141,7 @@ public class DelegatingLoginModule extends UsernamePasswordLoginModule
{
loginOk = true;
if (debugEnabled) {
- log.debug("Login ok for " + usernamePassword[0]);
+ LOG.debug("Login ok for " + usernamePassword[0]);
}
return true;
commit dfa94acdf6e92526bf35f08ebd2199c3c4c4db87
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Fri May 24 23:56:54 2013 +0200
Bug 920214 - [as7] add async avail check support to AS7 plugin
Only applies to server level resource (Standalone, Domain and Managed servers)
diff --git a/modules/plugins/jboss-as-7/pom.xml b/modules/plugins/jboss-as-7/pom.xml
index 5f538b7..d85e7e3 100644
--- a/modules/plugins/jboss-as-7/pom.xml
+++ b/modules/plugins/jboss-as-7/pom.xml
@@ -617,6 +617,7 @@
<!--<include>org/rhq/modules/plugins/jbossas7/itest/standalone/InterruptibleOperationsTest.java</include>-->
<!--<include>org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java</include>-->
<!--<include>org/rhq/modules/plugins/jbossas7/itest/domain/DomainServerComponentTest.java</include>-->
+
<!--<include>org/rhq/modules/plugins/jbossas7/itest/domain/ManagedServerTest.java</include>-->
<!--<include>org/rhq/modules/plugins/jbossas7/itest/domain/SecurityModuleOptionsTest.java</include>-->
<!--<include>org/rhq/modules/plugins/jbossas7/itest/nonpc/ManagementConnectionPersistenceTest.java</include>-->
</includes>
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
index b80a39a..5d540fd 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
@@ -16,6 +16,7 @@
* 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.modules.plugins.jbossas7;
import java.io.File;
@@ -40,6 +41,8 @@ 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.core.pluginapi.availability.AvailabilityCollectorRunnable;
+import org.rhq.core.pluginapi.availability.AvailabilityFacet;
import org.rhq.core.pluginapi.event.log.LogFileEventResourceComponentHelper;
import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
import org.rhq.core.pluginapi.inventory.ResourceComponent;
@@ -81,7 +84,8 @@ public abstract class BaseServerComponent<T extends
ResourceComponent<?>> extend
private LogFileEventResourceComponentHelper logFileEventDelegate;
private StartScriptConfiguration startScriptConfig;
private ServerPluginConfiguration serverPluginConfig;
- private AvailabilityType lastAvail;
+ private AvailabilityType previousAvailabilityType;
+ private AvailabilityCollectorRunnable availabilityCollector;
@Override
public void start(ResourceContext<T> resourceContext) throws
InvalidPluginConfigurationException, Exception {
@@ -89,38 +93,69 @@ public abstract class BaseServerComponent<T extends
ResourceComponent<?>> extend
serverPluginConfig = new ServerPluginConfiguration(pluginConfiguration);
connection =
ASConnection.newInstanceForServerPluginConfiguration(serverPluginConfig);
+ // The availabilityCollector is still null at this point. So this call will
always perform a real availability
+ // check and throw InvalidPluginConfigurationException as needed.
getAvailability();
logFileEventDelegate = new LogFileEventResourceComponentHelper(context);
logFileEventDelegate.startLogFileEventPollers();
startScriptConfig = new StartScriptConfiguration(pluginConfiguration);
+
+ Integer availabilityCheckPeriod = null;
+ try {
+ availabilityCheckPeriod = serverPluginConfig.getAvailabilityCheckPeriod();
+ } catch (NumberFormatException e) {
+ log.error("Avail check period config prop was not a valid number. Cause:
" + e);
+ }
+ if (availabilityCheckPeriod != null) {
+ long availCheckMillis = availabilityCheckPeriod * 1000L;
+ this.availabilityCollector =
resourceContext.getAvailabilityContext().createAvailabilityCollectorRunnable(
+ new AvailabilityFacet() {
+ public AvailabilityType getAvailability() {
+ return getAvailabilityNow();
+ }
+ }, availCheckMillis);
+ this.availabilityCollector.start();
+ }
}
@Override
public void stop() {
logFileEventDelegate.stopLogFileEventPollers();
- lastAvail = null;
+ previousAvailabilityType = null;
+ if (this.availabilityCollector != null) {
+ this.availabilityCollector.stop();
+ this.availabilityCollector = null;
+ }
}
@Override
public AvailabilityType getAvailability() {
- AvailabilityType avail;
+ if (this.availabilityCollector != null) {
+ return this.availabilityCollector.getLastKnownAvailability();
+ } else {
+ return getAvailabilityNow();
+ }
+ }
+
+ private AvailabilityType getAvailabilityNow() {
+ AvailabilityType availabilityType;
try {
readAttribute("launch-type");
- avail = AvailabilityType.UP;
+ availabilityType = AvailabilityType.UP;
} catch (Exception e) {
- avail = AvailabilityType.DOWN;
+ availabilityType = AvailabilityType.DOWN;
}
try {
- if ((avail == AvailabilityType.UP) && (lastAvail !=
AvailabilityType.UP)) {
+ if ((availabilityType == AvailabilityType.UP) &&
(previousAvailabilityType != AvailabilityType.UP)) {
validateServerAttributes();
log.info(getResourceDescription() + " has just come UP.");
}
} finally {
- lastAvail = avail;
+ previousAvailabilityType = availabilityType;
}
- return avail;
+ return availabilityType;
}
private void validateServerAttributes() throws InvalidPluginConfigurationException {
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASComponent.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASComponent.java
index e7fcd5b..4f0ea36 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASComponent.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASComponent.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2011 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,11 +13,14 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+
package org.rhq.modules.plugins.jbossas7;
+import static
org.rhq.modules.plugins.jbossas7.helper.ServerPluginConfiguration.Property.AVAIL_CHECK_PERIOD_CONFIG_PROP;
+
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
@@ -30,6 +33,8 @@ 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.core.pluginapi.availability.AvailabilityCollectorRunnable;
+import org.rhq.core.pluginapi.availability.AvailabilityFacet;
import org.rhq.core.pluginapi.event.log.LogFileEventResourceComponentHelper;
import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
import org.rhq.core.pluginapi.inventory.ResourceContext;
@@ -51,6 +56,7 @@ public class ManagedASComponent extends
BaseComponent<HostControllerComponent<?>
private static final String MANAGED_SERVER_TYPE_NAME = "Managed Server";
private LogFileEventResourceComponentHelper logFileEventDelegate;
+ private AvailabilityCollectorRunnable availabilityCollector;
@Override
public void start(ResourceContext<HostControllerComponent<?>>
hostControllerComponentResourceContext)
@@ -59,13 +65,34 @@ public class ManagedASComponent extends
BaseComponent<HostControllerComponent<?>
logFileEventDelegate = new LogFileEventResourceComponentHelper(context);
logFileEventDelegate.startLogFileEventPollers();
+
+ Integer availabilityCheckPeriod = null;
+ try {
+ availabilityCheckPeriod =
pluginConfiguration.getSimple(AVAIL_CHECK_PERIOD_CONFIG_PROP).getIntegerValue();
+ } catch (NumberFormatException e) {
+ log.error("Avail check period config prop was not a valid number. Cause:
" + e);
+ }
+ if (availabilityCheckPeriod != null) {
+ long availCheckMillis = availabilityCheckPeriod * 1000L;
+ this.availabilityCollector =
hostControllerComponentResourceContext.getAvailabilityContext()
+ .createAvailabilityCollectorRunnable(new AvailabilityFacet() {
+ public AvailabilityType getAvailability() {
+ return getAvailabilityNow();
+ }
+ }, availCheckMillis);
+ this.availabilityCollector.start();
+ }
+
}
@Override
public void stop() {
super.stop();
-
logFileEventDelegate.stopLogFileEventPollers();
+ if (this.availabilityCollector != null) {
+ this.availabilityCollector.stop();
+ this.availabilityCollector = null;
+ }
}
/**
@@ -76,6 +103,14 @@ public class ManagedASComponent extends
BaseComponent<HostControllerComponent<?>
*/
@Override
public AvailabilityType getAvailability() {
+ if (this.availabilityCollector != null) {
+ return this.availabilityCollector.getLastKnownAvailability();
+ } else {
+ return getAvailabilityNow();
+ }
+ }
+
+ private AvailabilityType getAvailabilityNow() {
if (context.getResourceType().getName().equals(MANAGED_SERVER_TYPE_NAME)) {
Address theAddress = new Address();
String host = pluginConfiguration.getSimpleValue("domainHost",
"local");
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/helper/ServerPluginConfiguration.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/helper/ServerPluginConfiguration.java
index 1433c17..3832ed2 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/helper/ServerPluginConfiguration.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/helper/ServerPluginConfiguration.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2012 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,14 +13,16 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+
package org.rhq.modules.plugins.jbossas7.helper;
import java.io.File;
import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.modules.plugins.jbossas7.JBossProductType;
/**
@@ -43,6 +45,7 @@ public class ServerPluginConfiguration {
public static final String LOG_DIR = "logDir";
public static final String PRODUCT_TYPE = "productType";
public static final String HOST_CONFIG_FILE = "hostConfigFile";
+ public static final String AVAIL_CHECK_PERIOD_CONFIG_PROP =
"availabilityCheckPeriod";
}
private Configuration pluginConfig;
@@ -143,4 +146,14 @@ public class ServerPluginConfiguration {
hostConfigFile.toString() : null);
}
+ public Integer getAvailabilityCheckPeriod() {
+ PropertySimple propertySimple =
this.pluginConfig.getSimple(Property.AVAIL_CHECK_PERIOD_CONFIG_PROP);
+ return propertySimple == null ? null : propertySimple.getIntegerValue();
+ }
+
+ public void setAvailabilityCheckPeriod(Integer availabilityCheckPeriod) {
+ this.pluginConfig.setSimpleValue(Property.AVAIL_CHECK_PERIOD_CONFIG_PROP,
+ availabilityCheckPeriod == null ? null :
availabilityCheckPeriod.toString());
+ }
+
}
diff --git a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
index ad22370..7213acd 100644
--- a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
@@ -82,6 +82,17 @@
</c:list-property>
</c:group>
'>
+
+ <!ENTITY availabilityCheckPeriod '
+ <c:simple-property name="availabilityCheckPeriod"
+ description="The amount of time, in seconds, that must
elapse between availability checks to see if the server is up. If set, the availability
checks will be performed asynchronously thus allowing slow-responding servers to avoid
being falsely reported as down. Minimum value is 60 seconds."
+ units="seconds" required="false"
type="integer">
+ <c:constraint>
+ <c:integer-constraint minimum="60"/>
+ </c:constraint>
+ </c:simple-property>
+'>
+
<!ENTITY serverKindMetrics '
<metric property="_skm:release-codename" dataType="trait"
displayName="Server Code Name"/>
<metric property="_skm:release-version" dataType="trait"
displayName="Server Version"/>
@@ -862,6 +873,10 @@
&startScriptPluginConfigGroup;
&logSources;
+
+ <c:group name="advanced" displayName="Advanced"
hiddenByDefault="true">
+ &availabilityCheckPeriod;
+ </c:group>
</plugin-configuration>
<process-scan name="HostController"
query="process|basename|match=^java.*,arg|org.jboss.as.host-controller|match=.*"/>
@@ -1173,6 +1188,10 @@
&startScriptPluginConfigGroup;
&logSources;
+
+ <c:group name="advanced" displayName="Advanced"
hiddenByDefault="true">
+ &availabilityCheckPeriod;
+ </c:group>
</plugin-configuration>
<process-scan name="StandaloneAS"
query="process|basename|match=^java.*,arg|org.jboss.as.standalone|match=.*"/>
@@ -1621,6 +1640,9 @@
<plugin-configuration>
<c:simple-property name="path" readOnly="true"/>
&logSources;
+ <c:group name="advanced" displayName="Advanced"
hiddenByDefault="true">
+ &availabilityCheckPeriod;
+ </c:group>
</plugin-configuration>
<operation name="start" description="Start this server
instance." displayName="Start">
diff --git
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractJBossAS7PluginTest.java
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractJBossAS7PluginTest.java
index 43e6e06..8c61c8e 100644
---
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractJBossAS7PluginTest.java
+++
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractJBossAS7PluginTest.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2012 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,11 +13,14 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+
package org.rhq.modules.plugins.jbossas7.itest;
+import static org.rhq.core.domain.measurement.AvailabilityType.UP;
+import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import java.util.Set;
@@ -31,8 +34,10 @@ import org.rhq.core.domain.util.ResourceFilter;
import org.rhq.core.domain.util.ResourceUtility;
import org.rhq.core.domain.util.TypeAndKeyResourceFilter;
import org.rhq.core.pc.inventory.InventoryManager;
+import org.rhq.core.pc.inventory.ResourceContainer;
import org.rhq.core.plugin.testutil.AbstractAgentPluginTest;
import org.rhq.core.pluginapi.operation.OperationResult;
+import org.rhq.modules.plugins.jbossas7.helper.ServerPluginConfiguration;
import org.rhq.modules.plugins.jbossas7.itest.domain.DomainServerComponentTest;
import org.rhq.modules.plugins.jbossas7.itest.standalone.StandaloneServerComponentTest;
import org.rhq.test.arquillian.AfterDiscovery;
@@ -152,4 +157,26 @@ public abstract class AbstractJBossAS7PluginTest extends
AbstractAgentPluginTest
return serverResource;
}
+ protected void testAsynchronousAvailabilityCheck(Resource resource) throws Exception
{
+ // Activate asynchronous availability checking
+ ServerPluginConfiguration serverPluginConfig = new
ServerPluginConfiguration(resource.getPluginConfiguration());
+ int availabilityCheckPeriod = 65;
+ serverPluginConfig.setAvailabilityCheckPeriod(availabilityCheckPeriod);
+ restartResourceComponent(resource);
+
+ Thread.sleep((3 * availabilityCheckPeriod * 1000L) / 2);
+ assertEquals(getAvailability(resource), UP);
+
+ // Deactivate asynchronous availability checking as subsequent tests may rely on
immediate availabilty checking
+ serverPluginConfig.setAvailabilityCheckPeriod(null);
+ restartResourceComponent(resource);
+ }
+
+ private void restartResourceComponent(Resource resource) throws
PluginContainerException {
+ InventoryManager inventoryManager = this.pluginContainer.getInventoryManager();
+ inventoryManager.deactivateResource(resource);
+ ResourceContainer serverContainer =
inventoryManager.getResourceContainer(resource);
+ inventoryManager.activateResource(resource, serverContainer, true);
+ }
+
}
diff --git
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/DomainServerComponentTest.java
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/DomainServerComponentTest.java
index 4effd50..91ece92 100644
---
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/DomainServerComponentTest.java
+++
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/DomainServerComponentTest.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2012 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,9 +13,10 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+
package org.rhq.modules.plugins.jbossas7.itest.domain;
import java.io.File;
@@ -76,14 +77,20 @@ public class DomainServerComponentTest extends
AbstractServerComponentTest {
testServerAttributeValidation();
}
+ @Test(priority = 1002)
+ public void testDomainServerAsynchronousAvailabilityCheck() throws Exception {
+ testAsynchronousAvailabilityCheck(getServerResource());
+ }
+
+
// ******************************* METRICS ******************************* //
- @Test(priority = 1002, enabled = true)
+ @Test(priority = 1003, enabled = true)
public void testDomainReleaseVersionTrait() throws Exception {
super.testReleaseVersionTrait();
}
// ******************************* OPERATIONS ******************************* //
- @Test(priority = 1003, enabled = true)
+ @Test(priority = 1004, enabled = true)
public void testDomainServerShutdownAndStartOperations() throws Exception {
super.testShutdownAndStartOperations();
}
diff --git
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/ManagedServerTest.java
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/ManagedServerTest.java
index 3f9f101..42bab08 100644
---
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/ManagedServerTest.java
+++
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/ManagedServerTest.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2012 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,11 +13,14 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.modules.plugins.jbossas7.itest.domain;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+
import org.testng.annotations.Test;
import org.rhq.core.clientapi.agent.PluginContainerException;
@@ -32,9 +35,6 @@ import org.rhq.core.pc.inventory.InventoryManager;
import org.rhq.modules.plugins.jbossas7.itest.AbstractJBossAS7PluginTest;
import org.rhq.test.arquillian.RunDiscovery;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
/**
* Test dealing with managed servers
* @author Heiko W. Rupp
@@ -45,7 +45,7 @@ public class ManagedServerTest extends AbstractJBossAS7PluginTest {
public static final ResourceType RESOURCE_TYPE = new ResourceType("Managed
Server", PLUGIN_NAME, ResourceCategory.SERVER, null);
private static final String RESOURCE_KEY = "master/server-one";
- @Test(priority = 1020, groups = "discovery", enabled = false)
+ @Test(priority = 1020, groups = "discovery", enabled = true)
@RunDiscovery(discoverServices = true, discoverServers = true)
public void runDiscovery() throws Exception {
Resource platform = this.pluginContainer.getInventoryManager().getPlatform();
@@ -93,6 +93,11 @@ public class ManagedServerTest extends AbstractJBossAS7PluginTest {
assertEquals(avail, AvailabilityType.UP);
}
+ @Test(priority = 1022)
+ public void testManagedServerAsynchronousAvailabilityCheck() throws Exception {
+ testAsynchronousAvailabilityCheck(getResource());
+ }
+
private Resource getResource() {
InventoryManager im = pluginContainer.getInventoryManager();
diff --git
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/StandaloneServerComponentTest.java
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/StandaloneServerComponentTest.java
index 9845b03..8446345 100644
---
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/StandaloneServerComponentTest.java
+++
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/StandaloneServerComponentTest.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2012 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,11 +13,14 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.modules.plugins.jbossas7.itest.standalone;
+import static org.rhq.core.domain.measurement.AvailabilityType.UP;
+import static org.testng.Assert.assertEquals;
+
import java.io.File;
import java.util.Arrays;
import java.util.List;
@@ -38,8 +41,6 @@ import org.rhq.core.domain.resource.ResourceType;
import org.rhq.modules.plugins.jbossas7.itest.AbstractServerComponentTest;
import org.rhq.test.arquillian.RunDiscovery;
-import static org.testng.Assert.assertEquals;
-
/**
* Test discovery and facets of the "JBossAS7 Standalone Server" Resource
type.
*
@@ -105,20 +106,20 @@ public class StandaloneServerComponentTest extends
AbstractServerComponentTest {
}
// TODO: Re-enable once fixed.
- @Test(priority = 5, dependsOnMethods =
"testStandaloneServerShutdownAndStartOperations", enabled = false)
+ @Test(priority = 6, dependsOnMethods =
"testStandaloneServerShutdownAndStartOperations", enabled = false)
public void testRestartOperation() throws Exception {
// First make sure the server is up.
AvailabilityType avail = getAvailability(getServerResource());
- assertEquals(avail, AvailabilityType.UP);
+ assertEquals(avail, UP);
// Make sure the server is back up.
// TODO (ips): Check that the server is a different process now.
invokeOperationAndAssertSuccess(getServerResource(), RESTART_OPERATION_NAME,
null);
avail = getAvailability(getServerResource());
- assertEquals(avail, AvailabilityType.UP);
+ assertEquals(avail, UP);
}
- @Test(priority = 6, enabled = true)
+ @Test(priority = 7, enabled = true)
public void testSystemPropertiesSettings() throws Exception {
Configuration config = loadResourceConfiguration(getServerResource());
@@ -152,6 +153,11 @@ public class StandaloneServerComponentTest extends
AbstractServerComponentTest {
}
+ @Test(priority = 8)
+ public void testStandaloneServerAsynchronousAvailabilityCheck() throws Exception {
+ testAsynchronousAvailabilityCheck(getServerResource());
+ }
+
protected String getExpectedStartScriptFileName() {
return (File.separatorChar == '/') ? "standalone.sh" :
"standalone.bat";
}
commit 64c225a14337769a1f6ce1df40a9e025ee3258e0
Merge: 078a2da e87ea03
Author: Jirka Kremser <jiri.kremser(a)gmail.com>
Date: Fri May 24 14:40:00 2013 -0700
Merge pull request #1 from lzoubek/master
Merging the rhq bot improvements
commit 078a2da4e488645284359940e3df7a61a0299109
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri May 24 16:43:50 2013 +0200
[BZ 965833 - Potential bug in join/fetch/avoidance code]
It is now possible to lazily fetch fields defined in super classes.
The avoidance of the join-fetch with limits exposed a missing feature that
was present in the code from the day one. It would be failing if the
criteria query was used to fetch a custom object (i.e. not the primary
persistent class of the criteria object) using an "altered projection" and
a fetch would be set on a field defined in a super class of the persistent
class of the criteria object. Only by chance this has never happened
before, because we don't use the altered projections on the criteria
queries that often.
Now that we lazily fetch fields much more often (to avoid join fetch
with limits) this is a problem even in cases without an altered projection.
The fix is fortunately very simple - we need to also search the
superclasses of the criteria's persistent class when looking for a field
to lazily fetch.
The possibility of fields being present in super-classes was taken into
account on other places in the CriteriaQueryGenerator class, too.
Documentation on the getJoinFetchFields() and alterProjection() was
enhanced to hopefully better explain the conditions underwhich you can
combine fetching and altered projection together.
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
index 867ea16..d1d2f73 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
@@ -343,7 +343,7 @@ public final class CriteriaQueryGenerator {
} else {
if (this.projection == null) {
/*
- * if not altering the projection, join fetching can be using
+ * if not altering the projection, join fetching can be used
* to retrieve the associated instance in the same SELECT
*
* We further avoid a JOIN FETCH when executing queries with
limits.
@@ -664,14 +664,9 @@ public final class CriteriaQueryGenerator {
}
private boolean isPersistentBag(String fieldName) {
- try {
- Class<?> persistentClass = criteria.getPersistentClass();
- Field field = persistentClass.getDeclaredField(fieldName);
+ Field field = findField(fieldName);
- return isAList(field) &&
!field.isAnnotationPresent(IndexColumn.class);
- } catch (NoSuchFieldException e) {
- return false;
- }
+ return field != null && isAList(field) &&
!field.isAnnotationPresent(IndexColumn.class);
}
private boolean isAList(Field field) {
@@ -690,23 +685,40 @@ public final class CriteriaQueryGenerator {
}
private void addPersistentBag(String fieldName) {
- try {
- Field field = criteria.getPersistentClass().getDeclaredField(fieldName);
- persistentBagFields.add(field);
- } catch (NoSuchFieldException e) {
- LOG.warn("Failed to add persistent bag collection on class [" +
criteria.getPersistentClass().getName() +"]: ", e);
+ Field f = findField(fieldName);
+ if (f == null) {
+ LOG.warn(
+ "Failed to add persistent bag collection [" + fieldName +
"] on class [" + criteria.getPersistentClass().getName() +
+ "]. There doesn't seem to be a field of that name on the
class or any of its superclasses.");
+ } else {
+ persistentBagFields.add(f);
}
}
private void addJoinFetch(String fieldName) {
- try {
- Field field = criteria.getPersistentClass().getDeclaredField(fieldName);
- joinFetchFields.add(field);
- } catch (NoSuchFieldException e) {
- LOG.warn("Failed to add join fetch field on class [" +
criteria.getPersistentClass().getName() + "]: ", e);
+ Field f = findField(fieldName);
+ if (f == null) {
+ LOG.warn(
+ "Failed to add join fetch field [" + fieldName + "] on
class [" + criteria.getPersistentClass().getName() +
+ "]. There doesn't seem to be a field of that name on the
class or any of its superclasses.");
+ } else {
+ joinFetchFields.add(f);
}
}
+ private Field findField(String fieldName) {
+ Class<?> cls = criteria.getPersistentClass();
+ while (cls != null) {
+ try {
+ return cls.getDeclaredField(fieldName);
+ } catch (NoSuchFieldException e) {
+ cls = cls.getSuperclass();
+ }
+ }
+
+ return null;
+ }
+
/**
* <strong>Note:</strong> This method should only be called after {@link
#getQueryString(boolean)}} because it is
* that method where the persistentBagFields property is initialized.
@@ -718,6 +730,21 @@ public final class CriteriaQueryGenerator {
return persistentBagFields;
}
+ /**
+ * <strong>Note:</strong> This method should only be called after {@link
#getQueryString(boolean)}} because it is
+ * that method where the persistentBagFields property is initialized.
+ * <p/>
+ * The elements of the returned list are a (sub)set of the fields that the criteria
object specified to be fetched
+ * (using the fetchXXX() methods). If the {@link CriteriaQueryRunner} is not set to
automatically fetch all the
+ * fields, you need to manually initialize these fields by for example using
+ * {@link CriteriaQueryRunner#initFetchFields(Object)} method on each of the
results.
+ *
+ * @see #alterProjection(String) <code>alterProjection(String)</code> for
special attention you need to make when
+ * mixing fetching fields and altered projection.
+ *
+ * @return Returns a list of fields from the persistent class to which the criteria
class corresponds. The fields in
+ * the list are fields specified by the criteria to be fetched (using the
fetchXXX() methods).
+ */
public List<Field> getJoinFetchFields() {
return joinFetchFields;
}
@@ -728,8 +755,11 @@ public final class CriteriaQueryGenerator {
* only affect the ResultSet for the data query, not the count query.
* <p/>
* If you are projecting a composite object that does not directly extend the entity
your Criteria object
- * represents, then you will need to manually initialize the persistent bags using
the methods exposed on
- * {@link CriteriaQueryRunner}
+ * represents, then you will need to manually initialize the persistent bags and
fetch fields using the
+ * {@link CriteriaQueryRunner#initFetchFields(Object)} method for each object in the
results (for which you need
+ * to instantiate the {@link CriteriaQueryRunner} with automatic fetching switched
OFF). <b>Note</b> that this will
+ * NOT work on the composite object itself. You need to pass an instance of the
entity class to the
+ *{@link CriteriaQueryRunner#initFetchFields(Object)} method.
*/
public void alterProjection(String projection) {
this.projection = projection;
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryRunner.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryRunner.java
index a788fb0..73292be 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryRunner.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryRunner.java
@@ -129,9 +129,7 @@ public class CriteriaQueryRunner<T> {
public void initFetchFields(Object entity) {
initPersistentBags(entity);
- if (queryGenerator.isProjectionAltered()) {
- initJoinFetchFields(entity);
- }
+ initJoinFetchFields(entity);
}
private void initPersistentBags(Object entity) {
commit e87ea0381518ffda4a42be7a119ce0ab764cd551
Author: Libor Zoubek <lzoubek(a)jezzovo.net>
Date: Fri May 24 16:45:08 2013 +0200
rhq-Bot: only devs can send private echo command to bot
diff --git a/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java
b/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java
index 1960f1d..a7b3e78 100644
--- a/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java
+++ b/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java
@@ -209,8 +209,12 @@ public class RhqIrcBotListener extends
ListenerAdapter<RhqIrcBot> {
String message = privateMessageEvent.getMessage();
Matcher echoMatcher = ECHO_PATTERN.matcher(message);
if (echoMatcher.matches()) {
- String echoMessage = echoMatcher.group(1);
- bot.sendMessage(this.channel, echoMessage);
+ if (!JON_DEVS.contains(privateMessageEvent.getUser().getNick())) {
+ privateMessageEvent.respond("You're not my master, I am your master, go
away");
+ } else {
+ String echoMessage = echoMatcher.group(1);
+ bot.sendMessage(this.channel, echoMessage);
+ }
} else if (message.equalsIgnoreCase(Command.PREFIX + "listrenames")) {
//Generate a list of renames in the form of old1 changed to new1, old2
changed to new2, etc
StringBuilder users = new StringBuilder();
commit 66c47dde1721632eca6990d389195708e8deeefe
Author: Libor Zoubek <lzoubek(a)jezzovo.net>
Date: Fri May 24 16:40:57 2013 +0200
ircBot: improved recognition of commands
Bot now recognizes commands only when in the beginning of message or if you
highlight bot's nick and command is the very first word (like rhq-bot:
!help)
diff --git a/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java
b/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java
index cd6d43a..1960f1d 100644
--- a/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java
+++ b/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java
@@ -61,7 +61,7 @@ public class RhqIrcBotListener extends ListenerAdapter<RhqIrcBot>
{
SUPPORT,
WIKI("Our wiki is available from
https://docs.jboss.org/author/display/RHQ/Home", true);
- public static final char PREFIX = '!';
+ public static final String PREFIX = "!";
private final String staticRespond;
private final boolean includeInHelp;
@@ -106,7 +106,7 @@ public class RhqIrcBotListener extends
ListenerAdapter<RhqIrcBot> {
this.channel = channel;
isRedHatChannel = "irc.devel.redhat.com".equals(channel);
StringBuilder commandRegExp = new StringBuilder();
- commandRegExp.append("(?i)\\").append(Command.PREFIX).append("[
]*(");
+ commandRegExp.append("^(?i)[
]*").append(Command.PREFIX).append("(");
for (Command command : Command.values()) {
commandRegExp.append(command.name()).append('|');
}
@@ -173,6 +173,11 @@ public class RhqIrcBotListener extends
ListenerAdapter<RhqIrcBot> {
bot.sendMessage(event.getChannel(), event.getUser().getNick() + ":
" + response);
}
+ if (message.startsWith(event.getBot().getNick())) {
+ // someone asked bot directly, we have to remove that from message
+ message = message.substring(event.getBot().getNick().length());
+ message = message.replaceFirst("[^ ]*", "");
+ }
// react to commands included in the messages
Matcher commandMatcher = commandPattern.matcher(message);
while (commandMatcher.find()) {
commit adac13e48ddd26aa55b6a6cbc6f3c3bcff5f802e
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri May 24 11:14:44 2013 +0200
Add some translations
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 057785a..d158243 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
@@ -10,25 +10,25 @@
#
###################################
##avail_chart_down_label = DOWN
-##avail_chart_title_label = Availability
+avail_chart_title_label = Verfügbarkeit
##avail_chart_up_label = UP
-##chart_date_label = Date
+chart_date_label = Datum
##chart_down_label = Down
##chart_time_label = Start
-##chart_unknown_label = Unknown
-##chart_no_data_label = No Data
-##chart_title_avg_label = Avg
-##chart_title_min_label = Min
-##chart_title_peak_label = Max
-##chart_hover_availability_label = Availability
-##chart_hover_availability_type_warn = MIXED
-##chart_hover_date_format = %m/%d/%y
+chart_unknown_label = Unbekannt
+chart_no_data_label = Keine Daten vorhanden
+chart_title_avg_label = Durchschn.
+chart_title_min_label = Min
+chart_title_peak_label = Max
+chart_hover_availability_label = Verfügbarkeit
+chart_hover_availability_type_warn = Gemischt
+chart_hover_date_format = %d.%m.%y
##chart_hover_time_format = %I:%M:%S %p
-##chart_ie_not_supported = Charting is not available for this browser.
-##chart_hover_start_label = Start
-##chart_hover_end_label = End
+chart_ie_not_supported = Charting ist bei diesem Browser nicht unterstützt
+chart_hover_start_label = Start
+chart_hover_end_label = Ende
##chart_hover_period_label = Period
-##chart_hover_bar_label = Duration
+chart_hover_bar_label = Dauer
common_alert_high = HOCH
common_alert_low = NIEDRIG
common_alert_medium = MITTEL
@@ -68,7 +68,7 @@ common_button_schedule = Planen
common_button_search = Suchen
common_button_set = Setzen
common_button_showDetails = Details anzeigen...
-##common_button_unignore = Unignore
+common_button_unignore = Ignorieren aufheben
common_button_uninventory = Aus dem Inventar löschen
common_calendar_april_short = Apr
common_calendar_august_short = Aug
@@ -91,7 +91,7 @@ common_label_filters = Filter
common_label_hour = Stunde
common_label_item = Eintrag
common_label_items = Einträge
-##common_label_link = Link
+common_label_link = Link
common_label_month = Monat
common_label_none = keine
common_label_none2 = keines
@@ -128,7 +128,7 @@ common_status_nochange = Keine Änderung
common_status_partial = partiell
common_status_success = Erfolg
common_status_unknown = Unbekannt
-##common_title_acknowledged = Acknowledged
+common_title_acknowledged = Bestätigt
common_title_add_column = Spalte hinzufügen
common_title_add_portlet = Portlet hinzufügen
common_title_address = Adresse
@@ -418,7 +418,7 @@ favorites_recentlyViewed = Kürzlich angesehen
favorites_resources = Gemerkte Ressourcen
filter_from_date = Von
filter_to_date = Bis
-##group_tree_groupOfResourceType = Group of [{0}]
+group_tree_groupOfResourceType = Gruppe von [{0}]
group_tree_partialClusterTooltip = {0} der {1} Gruppenmitglieder haben eine
''{2}'' Ressource
util_disambiguationReportDecorator_pluginSuffix = ({0} Plugin)
util_errorHandler_nullException = Exception war null
@@ -441,8 +441,8 @@ view_adminConfig_agentPlugins = Agent Plugins
view_adminConfig_alertDefTemplates = Vorlagen für Alarmdefinitionen
view_adminConfig_downloads = Downloads
view_adminConfig_driftDefTemplates = Vorlagen für Dritf-Definitionen
-##view_adminConfig_ignoreResourceTypes = Ignored Resource Types
-##view_adminConfig_ignoreResourceTypes_changeTitle = Change?
+view_adminConfig_ignoreResourceTypes = Ignorierte Ressource Typen
+view_adminConfig_ignoreResourceTypes_changeTitle = Ändern?
##view_adminConfig_ignoreResourceTypes_confirmIgnore = Are you sure you want to ignore
the resource type [{0}]? You will no longer be able to import resources of this type and
any resources of this type that are already in inventory will be uninventoried and you can
no longer manage them.
##view_adminConfig_ignoreResourceTypes_confirmUnignore = Are you sure you want to
unignore the resource type [{0}]? Any resources of this type that exist in your managed
environment will be able to be discovered and inventoried.
##view_adminConfig_ignoreResourceTypes_failure = Failed to set the ignore flag on the
selected resource type.
@@ -456,7 +456,7 @@ view_adminConfig_systemSettings = Systemeinstellungen
view_adminContent_contentSources = Quellen für Inhalte
view_adminRoles_assignedGroups = Zugewiesene Ressourcen-Gruppen
view_adminRoles_assignedSubjects = Zugewisene Benutzer
-##view_adminRoles_failCreateRoleWithExistingName = Failed to create role with existing
name [{0}]. Please use another name.
+view_adminRoles_failCreateRoleWithExistingName = Konnte die Rolle mit dem existierenden
Namen [{0}] nicht anlegen. Bitte wählen Sie einen anderen Namen.
view_adminRoles_failLdap = Konnte nicht ermitteln, ob LDAP konfiguriert ist - gehe von
keiner LDAP-Konfiguration aus.
view_adminRoles_failLdapGroups = Konnte de LDAP-Gruppen nicht laden. Annahme ist, dass es
keine gibt.
view_adminRoles_failLdapGroupsRole = Konnte die LDAP-Gruppen für die Rolle nicht laden.
@@ -526,23 +526,23 @@ view_adminTemplates_pluginTemplates = Vorlagen für Plugins Plugins
view_adminTemplates_servers = Server
view_adminTemplates_userTemplates = Nutzers-spezifische Vorlagen
view_adminTopology_affinityGroups = Affinitätsgruppen
-##view_adminTopology_affinityGroups_agentCount = Agent Count
-##view_adminTopology_affinityGroups_agentsInThisGroup = Agents in This Group
+view_adminTopology_affinityGroups_agentCount = Anzahl Agenten
+view_adminTopology_affinityGroups_agentsInThisGroup = Agenten in dieser Gruppe
##view_adminTopology_affinityGroups_agentsNotPartOfAnAffinityGroup = Agents not Part of
an Affinity Group
##view_adminTopology_affinityGroups_agetnMembers = Agent Members
-##view_adminTopology_affinityGroups_createNew = Create New
+view_adminTopology_affinityGroups_createNew = Neu anlegen
##view_adminTopology_affinityGroups_details = Affinity Group Details
-##view_adminTopology_affinityGroups_removeSelected = Remove Selected
-##view_adminTopology_affinityGroups_serverCount = Server Count
+view_adminTopology_affinityGroups_removeSelected = Ausgewählte entfernen
+view_adminTopology_affinityGroups_serverCount = Anzahl Server
##view_adminTopology_affinityGroups_serverMembers = Server Members
-##view_adminTopology_agentDetail_address = Address
+view_adminTopology_agentDetail_address = Adresse
##view_adminTopology_agentDetail_agentFailoverList = Agent Failover List
-##view_adminTopology_agentDetail_currentServer = Current Server
+view_adminTopology_agentDetail_currentServer = Aktueller Server
##view_adminTopology_agentDetail_token = Token
##view_adminTopology_agent_agentBindAddress = Agent Bind Address
##view_adminTopology_agent_agentBindPort = Agent Bind Port
-##view_adminTopology_agent_agentName = Agent Name
-##view_adminTopology_agent_connectedServer = Connected Server
+view_adminTopology_agent_agentName = Name des Agenten
+view_adminTopology_agent_connectedServer = Verbundener Server
##view_adminTopology_agent_delete_confirm = This will deregister the selected agents and
uninventory their corresponding platforms and all other resources associated with them.
There is no way to undo this action. Are you sure you want to do this?
##view_adminTopology_agent_lastAvailabilityPing = Last Availability Ping
##view_adminTopology_agent_lastAvailabilityReport = Last Availability Report
@@ -592,7 +592,7 @@ view_adminTopology_partitionEvents = Partitionierungs-Ereignisse
##view_adminTopology_partitionEventsDetail_eventDetails = Event Details
##view_adminTopology_partitionEventsDetail_eventExecutionTime = Event Execution Time
##view_adminTopology_partitionEventsDetail_eventType = Event Type
-##view_adminTopology_partitionEvents_details = Details
+view_adminTopology_partitionEvents_details = Details
##view_adminTopology_partitionEvents_detailsFilter = Details Filter
##view_adminTopology_partitionEvents_execStatusFilter = Execution Status Filter
##view_adminTopology_partitionEvents_execTime = Execution Time
@@ -600,7 +600,7 @@ view_adminTopology_partitionEvents = Partitionierungs-Ereignisse
##view_adminTopology_partitionEvents_forceRepartition = Force Repartition
##view_adminTopology_partitionEvents_initiatedBy = Initiated By
##view_adminTopology_partitionEvents_purgeAll = Purge All
-##view_adminTopology_partitionEvents_type = Type
+view_adminTopology_partitionEvents_type = Typ
##view_adminTopology_partitionEvents_typeFilter = Type Filter
view_adminTopology_remoteAgentInstall = Installation entfernter Agenten
##view_adminTopology_serverDetail_connectedAgents = Connected Agents
@@ -610,7 +610,7 @@ view_adminTopology_remoteAgentInstall = Installation entfernter
Agenten
##view_adminTopology_server_agentCount = Agent Count
##view_adminTopology_server_endpointAddress = Endpoint Address
##view_adminTopology_server_lastUpdateTime = Last Update Time
-##view_adminTopology_server_mode = Mode
+view_adminTopology_server_mode = Modus
##view_adminTopology_server_nonSecurePort = Nonsecure Port
##view_adminTopology_server_removeSelected = Remove Selected
##view_adminTopology_server_securePort = Secure Port
@@ -728,15 +728,15 @@ view_admin_systemSettings_serverDetails_dbUrl = URL der
Datenbankverbindung
view_admin_systemSettings_serverDetails_dbVersion = Produktversion der Datenbank
view_admin_systemSettings_serverDetails_installDir = Installationsverzeichnis des
Servers
view_admin_systemSettings_serverDetails_nextRotation = Nächste Rotation der
Metrik-Tabellen
-##view_admin_systemSettings_serverDetails_productName = Product Name
-##view_admin_systemSettings_serverDetails_serverName = Server Name
+view_admin_systemSettings_serverDetails_productName = Produktname
+view_admin_systemSettings_serverDetails_serverName = Servername
view_admin_systemSettings_serverDetails_time = Lokale Zeit des Servers
view_admin_systemSettings_serverDetails_tz = Zeitzone des Servers
view_admin_topology = Topologie
view_alert_common_tab_conditions = Bedingungen
view_alert_common_tab_conditions_expression = Alarm auslösen wenn
##view_alert_common_tab_conditions_expression_tooltip = Determines if ANY or ALL of the
conditions must evaluate to true in order for the entire condition set to be considered
true.
-##view_alert_common_tab_conditions_modalEdit_title = Edit Condition
+view_alert_common_tab_conditions_modalEdit_title = Bedingungen ändern
view_alert_common_tab_conditions_modal_title = Bedingung hinzufügen
view_alert_common_tab_conditions_recovery_disabled = Dieser Alarm hat seine Definition
deaktiviert.
view_alert_common_tab_conditions_recovery_enabled = Ausgelöst, dass
''{0}'' wieder aktiviert wurde
@@ -883,7 +883,7 @@ view_alert_definition_condition_editor_option_metric_trait_change =
Änderung de
view_alert_definition_condition_editor_option_operation = Ausführung der Operation
view_alert_definition_condition_editor_option_resource_configuration = Änderung der
Konfiguration der Ressource
##view_alert_definition_condition_editor_resource_configuration_tooltip = This condition
is triggered when the resource configuration changes.
-##view_alert_definition_editCondition = Edit Condition
+view_alert_definition_editCondition = Bedingungen ändern
view_alert_definition_for_group = Gruppendefinition ansehen
view_alert_definition_for_type = Vorlage ansehen
view_alert_definition_notification_cliScript_editor_anotherUser = Anderer Benutzer
@@ -892,7 +892,7 @@ view_alert_definition_notification_cliScript_editor_script = Skript
view_alert_definition_notification_cliScript_editor_thisUser = Aktueller Benutzer
view_alert_definition_notification_editor_delete_confirm = Sind Sie sicher, dass sie die
ausgewählten Alarm-Benachrichtigungen löschen wollen?
view_alert_definition_notification_editor_field_configuration = Konfiguration
-##view_alert_definition_notification_editor_field_configuration_loadFailed = Failed to
get notification configuration preview
+view_alert_definition_notification_editor_field_configuration_loadFailed = Konte die
Vorschau der Benachrichtigung nicht laden
view_alert_definition_notification_editor_field_configuration_not_loaded = Unbekannt
view_alert_definition_notification_editor_field_sender = Sender
view_alert_definition_notification_editor_loadFailed = Kann die Alarm-Sender nicht laden
@@ -946,7 +946,7 @@ view_alert_definitions_disable_success = Es wurden {0}
Alarm-Definitionen erfolg
view_alert_definitions_enable_confirm = Die ausgewählten Alarm-Definitionen aktivieren?
view_alert_definitions_enable_failure = Konnte die ausgewählten Alarm-Definitionen nicht
aktivieren
view_alert_definitions_enable_success = Es wurden {0} Alarm-Definitionen erfolgreich
aktiviert
-##view_alert_definitions_leaveUnsaved = Do you want to save the modified alert
definition?
+view_alert_definitions_leaveUnsaved = Möchten Sie die geänderte Alarm-Definition
speichern?
view_alert_definitions_loadFailed = Konnte die Daten für die Alarm-Definitionen nicht
laden
view_alert_definitions_loadFailed_single = Konnte die Daten für die Alarm-Definition mit
der id {0}
view_alert_definitions_table_title_group = Alarm-Definitionen für Gruppen
@@ -1184,7 +1184,7 @@ view_bundle_version_backToBundle = Zurück zum Bundle
##view_bundle_version_deleteSuccessful = You successfully deleted the bundle version
[{0}]
##view_bundle_version_loadFailure = Failed to load bundle version
view_bundle_versions = Versionen
-##view_charts_time_axis_label = Time
+view_charts_time_axis_label = Zeit
view_configCompare_comparingConfigs = Konfigurationen vergleichen
##view_configCompare_configCompare = Configuration Comparison
view_configEdit_addItem = Eintrag zur Liste hinzufügen
@@ -1483,13 +1483,13 @@ view_inventory_groups_children = Kinder
##view_inventory_groups_deleteSuccessful = You have successfully deleted the selected
resource groups
##view_inventory_groups_descendants = Descendants
##view_inventory_groups_loadFailed = Failed to load group composite data
-##view_inventory_ignoredResources = Ignored Resources
+view_inventory_ignoredResources = Ignorierte Ressourcen
view_inventory_mixed = gemischt
view_inventory_platforms = Platformen
view_inventory_problemGroups = Gruppen mit Problemen
##view_inventory_resource_loadFailed = Resource with id [{0}] does not exist or is not
accessible
-##view_inventory_resources_deleteConfirm = Are you sure you want to delete the selected
resources?
-##view_inventory_resources_deleteFailed = Failed to delete the selected resources
+view_inventory_resources_deleteConfirm = Sind Sie sicher, dass Sie die ausgewählten
Ressourcen löschen wollen?
+view_inventory_resources_deleteFailed = Löschen der ausgewählten Ressourcen ist
fehlgeschlagen
##view_inventory_resources_deleteSuccessful = A request to perform the resource deletion
has been submitted successfully to the agent(s).
##view_inventory_resources_disableSuccessful = You have successfully disabled the
selected resources and their children, [{0}] resources.
##view_inventory_resources_ignoreConfirm = Are you sure you want the selected resources
to be ignored? They will no longer show up in inventory.
commit 0d6dcd43a16699348430e81a241ae38da6d431af
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu May 23 17:14:50 2013 -0400
Fix test that started failing after the change to remove JOIN FETCH
from Criteria calls that include paging and optional data. It seems the
new approach changes slightly the way the data is returned.
loadDefinition() returns hibernate proxied data. It is not safe to pass
proxies into equals() impls because these typically access fields directly,
not through getters, and therefore bypass the proxied data.
Note that this change in behavior due to the JOIN FETCH fix would only
affect non-client code (like test code or intra-slsb calls) because return
values to client code would already be cleansed of the proxies. The test
is fixed in the same way, by using HibernateDetachUtility to scrub the
proxies before attempting the assertEquals().
diff --git
a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
index 18c7093..4202d6a 100644
---
a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
+++
b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
@@ -57,6 +57,7 @@ import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.server.safeinvoker.HibernateDetachUtility;
+import org.rhq.enterprise.server.safeinvoker.HibernateDetachUtility.SerializationType;
import org.rhq.enterprise.server.test.TransactionCallback;
import org.rhq.test.AssertUtils;
@@ -91,7 +92,7 @@ public class ManageDriftDefinitionsTest extends AbstractDriftServerTest
{
deleteEntity(ResourceType.class, DRIFT_NOT_SUPPORTED_TYPE);
}
- public void createDefinitionFromUnpinnedTemplate() {
+ public void createDefinitionFromUnpinnedTemplate() throws Exception {
// first create a template
final DriftDefinition templateDef = new DriftDefinition(new Configuration());
templateDef.setName(NAME_PREFIX + "createUnpinnedDefinition");
@@ -114,6 +115,7 @@ public class ManageDriftDefinitionsTest extends
AbstractDriftServerTest {
DriftDefinitionComparator comparator = new DriftDefinitionComparator(
BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS);
+ HibernateDetachUtility.nullOutUninitializedFields(newDef,
SerializationType.SERIALIZATION);
assertEquals("The drift definition was not persisted correctly", 0,
comparator.compare(definition, newDef));
assertEquals("The template association was not set on the definition",
template, newDef.getTemplate());
}
commit 301a28ce97530f69416677a8b8b470e3f157d9bd
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu May 23 22:38:18 2013 +0200
Bit of cleanup and testing of alert->ack and alert->purge
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
index 92d2499..224ab3f 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
@@ -25,12 +25,9 @@ package org.rhq.enterprise.server.rest;
import java.io.IOException;
import java.io.StringWriter;
import java.net.URI;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -251,89 +248,8 @@ public class AbstractRestBean {
return result;
}
- protected void putResourceToCache(Resource res) {
- putToCache(res.getId(), Resource.class, res);
- CacheKey callerKey = new CacheKey("rhq.rest.caller", caller.getId());
- try {
- Set<Integer> visibleResources = (Set<Integer>)
cache.get(callerKey);
-
- if (null == visibleResources) {
- visibleResources = new HashSet<Integer>();
- }
-
- visibleResources.add(res.getId());
- cache.put(callerKey, visibleResources);
-
- Map<Integer, Integer> childParentMap = (Map<Integer, Integer>)
cache.get(META_KEY);
-
- if (null == childParentMap) {
- childParentMap = new HashMap<Integer, Integer>();
- }
- int pid = res.getParentResource() == null ? 0 :
res.getParentResource().getId();
- childParentMap.put(res.getId(), pid);
- cache.put(META_KEY, childParentMap);
-
- } catch (Exception e) {
- log.warn(e.getMessage());
- }
- }
-
- protected List<Resource> getResourcesFromCacheByParentId(int pid) {
- List<Integer> candidateIds = new ArrayList<Integer>();
- List<Resource> ret = new ArrayList<Resource>();
-
- // First determine candidate children
- Map<Integer, Integer> childParentMap = (Map<Integer, Integer>)
cache.get(META_KEY);
-
- if (null != childParentMap) {
- try {
- for (Map.Entry<Integer, Integer> entry : childParentMap.entrySet())
{
- if (entry.getValue() == pid)
- candidateIds.add(entry.getKey());
- }
- // then see if the current user can see them
- CacheKey callerKey = new CacheKey("rhq.rest.caller",
caller.getId());
- Set<Integer> visibleResources = (Set<Integer>)
cache.get(callerKey);
- Iterator<Integer> iter = candidateIds.iterator();
- while (iter.hasNext()) {
- Integer resId = iter.next();
- if (!visibleResources.contains(resId)) {
- iter.remove();
- }
- }
-
- // Last but not least, get the resources and return them
- for (Integer resId : candidateIds) {
- ret.add(getFromCache(resId, Resource.class));
- }
- } catch (Exception e) {
- log.warn(e.getMessage());
- }
-
- }
- return ret;
- }
-
- protected Resource getResourceFromCache(int resourceid) {
-
- Resource res = null;
- // check if the current user can see the resource
- CacheKey callerKey = new CacheKey("rhq.rest.caller", caller.getId());
- Set<Integer> visibleResources = (Set<Integer>) cache.get(callerKey);
- if (null != visibleResources) {
- try {
- if (visibleResources.contains(resourceid)) {
- res = getFromCache(resourceid, Resource.class);
- }
- } catch (Exception e) {
- log.warn(e.getMessage());
- }
- }
-
- return res;
- }
/**
* Remove an item from the cache
@@ -393,6 +309,7 @@ public class AbstractRestBean {
uriBuilder.path("/resource/{id}/children");
uri = uriBuilder.build(res.getId());
link = new Link("children", uri.toString());
+ rwt.addLink(link);
uriBuilder = uriInfo.getBaseUriBuilder();
uriBuilder.path("/resource/{id}/alerts");
uri = uriBuilder.build(res.getId());
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java
index acbb492..355adcd 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java
@@ -1434,6 +1434,8 @@ public class AlertTest extends AbstractBase {
int definitionId = createEmptyAlertDefinition(true);
+ int alertId;
+
// Now add a condition
try {
@@ -1481,7 +1483,7 @@ public class AlertTest extends AbstractBase {
// wait a little
Thread.sleep(5000);
- int alertId =
+ alertId =
given()
.header(acceptJson)
.queryParam("definitionId",definitionId)
@@ -1543,9 +1545,32 @@ public class AlertTest extends AbstractBase {
.when()
.get("/resource/{resourceId}/alerts");
+ if (alertId>0) {
+ // Acknowledge the alert
+ given()
+ .header(acceptWrappedJson)
+ .pathParam("id", alertId)
+ .expect()
+ .statusCode(200)
+ .log().ifError()
+ .when()
+ .put("/alert/{id}");
+
+ Thread.sleep(500);
+
+ // purge the alert
+ given()
+ .header(acceptJson)
+ .pathParam("id", alertId)
+ .expect()
+ .statusCode(204)
+ .log().ifError()
+ .when()
+ .delete("/alert/{id}");
+ }
}
-
finally {
+
// delete the definition again
cleanupDefinition(definitionId);
}
commit e290b1316861f301f25cdef2e537751eb5eed689
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Thu May 23 22:21:32 2013 +0200
rhq irc bot: disabling the !pto and !support commands on Freenode channel
diff --git a/etc/rhq-ircBot/pom.xml b/etc/rhq-ircBot/pom.xml
index 6e66187..a6ab873 100644
--- a/etc/rhq-ircBot/pom.xml
+++ b/etc/rhq-ircBot/pom.xml
@@ -8,7 +8,7 @@
<groupId>org.rhq.etc</groupId>
<artifactId>rhq-ircbot</artifactId>
- <version>1.0</version>
+ <version>1.1</version>
<packaging>jar</packaging>
<name>RHQ IRC Bot</name>
diff --git a/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java
b/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java
index 8a7e578..cd6d43a 100644
--- a/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java
+++ b/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java
@@ -93,6 +93,7 @@ public class RhqIrcBotListener extends ListenerAdapter<RhqIrcBot>
{
private final String server;
private final String channel;
+ private final boolean isRedHatChannel;
private String docspaceLogin;
private String docspacePassword;
private BugzillaConnector bzConnector = new BugzillaConnector();
@@ -103,6 +104,7 @@ public class RhqIrcBotListener extends
ListenerAdapter<RhqIrcBot> {
public RhqIrcBotListener(String server, String channel) {
this.server = server;
this.channel = channel;
+ isRedHatChannel = "irc.devel.redhat.com".equals(channel);
StringBuilder commandRegExp = new StringBuilder();
commandRegExp.append("(?i)\\").append(Command.PREFIX).append("[
]*(");
for (Command command : Command.values()) {
@@ -176,7 +178,9 @@ public class RhqIrcBotListener extends
ListenerAdapter<RhqIrcBot> {
while (commandMatcher.find()) {
Command command = Command.valueOf(commandMatcher.group(1).toUpperCase());
String response = prepareResponseForCommand(command);
- bot.sendMessage(event.getChannel(), event.getUser().getNick() + ":
" + response);
+ if (response != null) {
+ bot.sendMessage(event.getChannel(), event.getUser().getNick() + ":
" + response);
+ }
}
// ping JON devs
@@ -215,9 +219,12 @@ public class RhqIrcBotListener extends
ListenerAdapter<RhqIrcBot> {
// react to commands included in the messages
Matcher commandMatcher = commandPattern.matcher(message);
while (commandMatcher.find()) {
+ isCommand = true;
Command command =
Command.valueOf(commandMatcher.group(1).toUpperCase());
String response = prepareResponseForCommand(command);
- bot.sendMessage(privateMessageEvent.getUser(), response);
+ if (response != null) {
+ bot.sendMessage(privateMessageEvent.getUser(), response);
+ }
}
if (!isCommand) {
bot.sendMessage(privateMessageEvent.getUser(), "Hi, I am " +
bot.getFinger() + ".\n"
@@ -271,8 +278,10 @@ public class RhqIrcBotListener extends
ListenerAdapter<RhqIrcBot> {
}
switch (command) {
case SUPPORT:
+ if (isRedHatChannel)
return whoIsOnSupport(SUPPORT_LINK);
case PTO:
+ if (isRedHatChannel)
return whoIsOnPto(PTO_LINK);
default:
System.err.println("Unknown command:" + command);
commit b33564602373317e5e73adbc71e0521929e0762e
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu May 23 15:04:09 2013 -0400
BZ 962841 962845 fix the resource type admin pages to support types with multiple
parents (i.e. types with <runs-inside>)
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/AlertDefinitionTemplateTypeView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/AlertDefinitionTemplateTypeView.java
index 9b4027e..4f790a1 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/AlertDefinitionTemplateTypeView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/AlertDefinitionTemplateTypeView.java
@@ -197,14 +197,19 @@ public class AlertDefinitionTemplateTypeView extends
ResourceTypeTreeView {
}
public static class TreeNode extends ResourceTypeTreeNode {
-
public TreeNode(ResourceTypeTemplateCountComposite composite, String plugin)
{
-
super(composite, plugin);
-
setAttribute(ATTR_ENABLED_TEMPLATES, composite.getEnabledAlertCount());
setAttribute(ATTR_DISABLED_TEMPLATES,
composite.getDisabledAlertCount());
}
+
+ @Override
+ public ResourceTypeTreeNode copy() {
+ ResourceTypeTreeNode dup = super.copy();
+ dup.setAttribute(ATTR_ENABLED_TEMPLATES,
this.getAttributeAsLong(ATTR_ENABLED_TEMPLATES));
+ dup.setAttribute(ATTR_DISABLED_TEMPLATES,
this.getAttributeAsLong(ATTR_DISABLED_TEMPLATES));
+ return dup;
+ }
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/DriftDefinitionTemplateTypeView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/DriftDefinitionTemplateTypeView.java
index 143c475..ebb2d9d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/DriftDefinitionTemplateTypeView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/DriftDefinitionTemplateTypeView.java
@@ -211,11 +211,8 @@ public class DriftDefinitionTemplateTypeView extends
ResourceTypeTreeView {
}
public static class TreeNode extends ResourceTypeTreeNode {
-
public TreeNode(ResourceTypeTemplateCountComposite composite, String plugin)
{
-
super(composite, plugin);
-
setAttribute(ATTR_PLUGIN_TEMPLATES,
composite.getPluginDriftTemplates());
setAttribute(ATTR_USER_TEMPLATES, composite.getUserDriftTemplates());
// If the type has no plugin templates then drift monitoring is not
enabled for the type
@@ -223,6 +220,14 @@ public class DriftDefinitionTemplateTypeView extends
ResourceTypeTreeView {
setAttribute(ATTRIB_EDIT, ImageManager.getEditDisabledIcon());
}
}
+
+ @Override
+ public ResourceTypeTreeNode copy() {
+ ResourceTypeTreeNode dup = super.copy();
+ dup.setAttribute(ATTR_PLUGIN_TEMPLATES,
this.getAttributeAsLong(ATTR_PLUGIN_TEMPLATES));
+ dup.setAttribute(ATTR_USER_TEMPLATES,
this.getAttributeAsLong(ATTR_USER_TEMPLATES));
+ return dup;
+ }
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/IgnoreResourceTypesView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/IgnoreResourceTypesView.java
index 246a71e..91a4ca2 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/IgnoreResourceTypesView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/IgnoreResourceTypesView.java
@@ -182,6 +182,13 @@ public class IgnoreResourceTypesView extends ResourceTypeTreeView {
super(composite, plugin);
setAttribute(ATTR_ENABLED,
ImageManager.getAvailabilityIcon(!composite.getType().isIgnored()));
}
+
+ @Override
+ public ResourceTypeTreeNode copy() {
+ ResourceTypeTreeNode dup = super.copy();
+ dup.setAttribute(ATTR_ENABLED, this.getAttribute(ATTR_ENABLED));
+ return dup;
+ }
}
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/MetricTemplateTypeView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/MetricTemplateTypeView.java
index 19c53d2..e4aa4fe 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/MetricTemplateTypeView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/MetricTemplateTypeView.java
@@ -170,11 +170,8 @@ public class MetricTemplateTypeView extends ResourceTypeTreeView {
}
public static class TreeNode extends ResourceTypeTreeNode {
-
public TreeNode(ResourceTypeTemplateCountComposite composite, String plugin)
{
-
super(composite, plugin);
-
setAttribute(ATTR_ENABLED_TEMPLATES, composite.getEnabledMetricCount());
setAttribute(ATTR_DISABLED_TEMPLATES,
composite.getDisabledMetricCount());
// If the type has no metrics then metric templates are enabled for the
type
@@ -182,6 +179,14 @@ public class MetricTemplateTypeView extends ResourceTypeTreeView {
setAttribute(ATTRIB_EDIT, ImageManager.getEditDisabledIcon());
}
}
+
+ @Override
+ public ResourceTypeTreeNode copy() {
+ ResourceTypeTreeNode dup = super.copy();
+ dup.setAttribute(ATTR_ENABLED_TEMPLATES,
this.getAttributeAsLong(ATTR_ENABLED_TEMPLATES));
+ dup.setAttribute(ATTR_DISABLED_TEMPLATES,
this.getAttributeAsLong(ATTR_DISABLED_TEMPLATES));
+ return dup;
+ }
}
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/ResourceTypeTreeNodeBuilder.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/ResourceTypeTreeNodeBuilder.java
index 72563c2..e90f398 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/ResourceTypeTreeNodeBuilder.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/ResourceTypeTreeNodeBuilder.java
@@ -18,11 +18,14 @@
*/
package org.rhq.enterprise.gui.coregui.client.admin.templates;
+import java.util.ArrayList;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.types.TreeModelType;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import com.smartgwt.client.widgets.tree.Tree;
@@ -48,7 +51,7 @@ public abstract class ResourceTypeTreeNodeBuilder {
static private final Messages MSG = CoreGUI.getMessages();
public static final String ATTRIB_ID = "id";
- public static final String ATTRIB_PARENT_ID = "parentId";
+ public static final String ATTRIB_CHILDREN = "children";
public static final String ATTRIB_NAME = "name";
public static final String ATTRIB_PLUGIN = "plugin";
public static final String ATTRIB_CATEGORY = "category";
@@ -67,13 +70,18 @@ public abstract class ResourceTypeTreeNodeBuilder {
@Override
public void onSuccess(Map<Integer,
ResourceTypeTemplateCountComposite> result) {
+ // result contains all of our resource types, including the parent
hierarchy
HashSet<ResourceTypeListGridRecord> platformsRecords;
HashSet<ResourceTypeListGridRecord> platformServicesRecords;
- HashSet<ResourceTypeTreeNode> treeNodes;
+ HashMap<Integer, ResourceTypeTreeNode> serversNodes; // all
server nodes (top level and below)
+ HashSet<Integer> topServers; // those servers that are at the
root of the tree
+ HashMap<Integer, ArrayList<Integer>> childrenGraph; //
defines the children of all server nodes
platformsRecords = new HashSet<ResourceTypeListGridRecord>();
platformServicesRecords = new
HashSet<ResourceTypeListGridRecord>();
- treeNodes = new HashSet<ResourceTypeTreeNode>();
+ serversNodes = new HashMap<Integer, ResourceTypeTreeNode>();
+ topServers = new HashSet<Integer>();
+ childrenGraph = new HashMap<Integer,
ArrayList<Integer>>();
for (ResourceTypeTemplateCountComposite composite : result.values())
{
ResourceType type = composite.getType();
@@ -84,7 +92,9 @@ public abstract class ResourceTypeTreeNodeBuilder {
platformsRecords.add(getGridRecordInstance(composite));
} else {
// no parents but not a platform - these are our
top-level servers
- treeNodes.add(getTreeNodeInstance(composite,
type.getPlugin()));
+ ResourceTypeTreeNode node =
getTreeNodeInstance(composite, type.getPlugin());
+ topServers.add(node.getResourceTypeId());
+ serversNodes.put(node.getResourceTypeId(), node);
}
} else {
// has parents; if all the direct parents are top level
platforms
@@ -106,22 +116,37 @@ public abstract class ResourceTypeTreeNodeBuilder {
if (isPlatformService) {
platformServicesRecords.add(getGridRecordInstance(composite));
-
} else {
- // in some cases, a top level server is limited to which
platforms it can run on.
- // therefore, the parents will not be null/empty (as
would be the case if the top level
+ // In some cases, a top level server is limited to which
platforms it can run on.
+ // Therefore, the parents will not be null/empty (as
would be the case if the top level
// server can run on ALL platforms), but instead it will
have the subset of platforms
- // the type is valid on. But its the same type - so we
only want to show it once. Therefore,
- // once we see a parent that is a top level platform, we
don't add the type again for other
- // top level platforms. That's what gotPlatform
boolean tracks.
+ // the type is valid on. But its the same type - so we
only want to show it once.
+ // This is what gotPlatform tracks - whether we saw a
parent platform or not.
+ //
+ // But we also have the case where a server type can run
inside multiple parent server types.
+ // We want to show these under all their parents to make
it easier for the user to find them.
boolean gotPlatform = false;
for (ResourceType parentType :
type.getParentResourceTypes()) {
- boolean isPlatform = (parentType.getCategory() ==
ResourceCategory.PLATFORM && isEmpty(parentType
+ boolean isParentAPlatform = (parentType.getCategory()
== ResourceCategory.PLATFORM && isEmpty(parentType
.getParentResourceTypes()));
- if (!isPlatform || !gotPlatform) {
- treeNodes.add(getTreeNodeInstance(composite,
String.valueOf(parentType.getId())));
+ if (!isParentAPlatform || !gotPlatform) {
+ int parentId = parentType.getId();
+ String parentIdString =
String.valueOf(parentId);
+ ResourceTypeTreeNode node =
getTreeNodeInstance(composite, parentIdString);
+ serversNodes.put(node.getResourceTypeId(),
node);
+ if (isParentAPlatform) {
+ topServers.add(node.getResourceTypeId());
+ } else {
+ // we are a child to other type, add it to
the list of children
+ ArrayList<Integer> childList =
childrenGraph.get(parentId);
+ if (childList == null) {
+ childList = new
ArrayList<Integer>();
+ childrenGraph.put(parentId, childList);
+ }
+ childList.add(node.getResourceTypeId());
+ }
}
- if (isPlatform) {
+ if (isParentAPlatform) {
gotPlatform = true;
}
}
@@ -129,14 +154,50 @@ public abstract class ResourceTypeTreeNodeBuilder {
}
}
+ // now set up our UI components to show the data
+ platformsGrid.setSortField(ATTRIB_NAME);
+ platformServicesGrid.setSortField(ATTRIB_NAME);
+ serversGrid.setSortField(ATTRIB_NAME);
+
platformsGrid.setData(platformsRecords.toArray(new
ListGridRecord[platformsRecords.size()]));
platformServicesGrid.setData(platformServicesRecords
.toArray(new ListGridRecord[platformServicesRecords.size()]));
- Tree tree = serversGrid.getTree();
- if (tree != null) {
- TreeNode[] treeNodeArray = treeNodes.toArray(new
TreeNode[treeNodes.size()]);
- tree.linkNodes(treeNodeArray);
+ Tree tree = new Tree();
+ tree.setModelType(TreeModelType.CHILDREN);
+ tree.setChildrenProperty(ATTRIB_CHILDREN);
+ TreeNode rootNode = new TreeNode("0");
+ tree.setRoot(rootNode);
+
+ for (Integer topServerId : topServers) {
+ ResourceTypeTreeNode topServerNode =
serversNodes.get(topServerId);
+ topServerNode = topServerNode.copy();
+ fillHierarchy(topServerNode, serversNodes, childrenGraph);
+ tree.add(topServerNode, rootNode);
}
+ serversGrid.setData(tree);
+ }
+
+ private void fillHierarchy(ResourceTypeTreeNode node,
+ HashMap<Integer, ResourceTypeTreeNode> serversNodes,
+ HashMap<Integer, ArrayList<Integer>> childrenGraph) {
+
+ if (node.getChildren().length > 0) {
+ return; // we've already populated this node's children
before; nothing to do
+ }
+
+ ArrayList<Integer> childrenIds =
childrenGraph.get(node.getResourceTypeId());
+ if (childrenIds != null) {
+ for (Integer childrenId : childrenIds) {
+ ResourceTypeTreeNode childNode =
serversNodes.get(childrenId);
+ if (childNode != null) { // this should never be null, but
this let's us continue if we have a bug
+ childNode = childNode.copy();
+ fillHierarchy(childNode, serversNodes, childrenGraph);
+ node.addChild(childNode);
+ }
+ }
+ }
+
+ return;
}
@Override
@@ -184,25 +245,63 @@ public abstract class ResourceTypeTreeNodeBuilder {
public static class ResourceTypeTreeNode extends TreeNode {
- private String id;
+ private int id;
private String parentId;
+ private TreeNode[] children;
+
+ private ResourceTypeTreeNode() {
+ // for use by copy() method
+ }
protected ResourceTypeTreeNode(ResourceTypeTemplateCountComposite composite,
String parentId) {
ResourceType resourceType = composite.getType();
- String id = String.valueOf(resourceType.getId());
- setID(id);
- this.id = id;
-
- setParentID(parentId);
+ this.id = resourceType.getId();
this.parentId = parentId;
setAttribute(ATTRIB_ID, id);
- setAttribute(ATTRIB_PARENT_ID, parentId);
setAttribute(ATTRIB_NAME, resourceType.getName());
setAttribute(ATTRIB_PLUGIN, resourceType.getPlugin());
setAttribute(ATTRIB_CATEGORY, resourceType.getCategory().name());
setAttribute(ATTRIB_EDIT, ImageManager.getEditIcon());
+ setChildren(new TreeNode[0]);
+ }
+
+ public int getResourceTypeId() {
+ return this.id;
+ }
+
+ public TreeNode[] getChildren() {
+ return this.children;
+ }
+
+ @Override
+ public void setChildren(TreeNode[] children) {
+ this.children = children;
+ super.setChildren(children);
+ }
+
+ public void addChild(TreeNode newChild) {
+ TreeNode[] newChildren = new TreeNode[this.children.length + 1];
+ System.arraycopy(this.children, 0, newChildren, 0, this.children.length);
+ newChildren[this.children.length] = newChild;
+ setChildren(newChildren);
+ }
+
+ // clone this object and return it - subclasses should override this to copy
their own attributes
+ public ResourceTypeTreeNode copy() {
+ ResourceTypeTreeNode dup = new ResourceTypeTreeNode();
+ dup.id = this.id;
+ dup.parentId = this.parentId;
+ dup.children = this.children;
+
+ dup.setAttribute(ATTRIB_ID, this.getAttributeAsInt(ATTRIB_ID));
+ dup.setAttribute(ATTRIB_NAME, this.getAttribute(ATTRIB_NAME));
+ dup.setAttribute(ATTRIB_PLUGIN, this.getAttribute(ATTRIB_PLUGIN));
+ dup.setAttribute(ATTRIB_CATEGORY, this.getAttribute(ATTRIB_CATEGORY));
+ dup.setAttribute(ATTRIB_EDIT, this.getAttribute(ATTRIB_EDIT));
+
+ return dup;
}
@Override
@@ -216,7 +315,7 @@ public abstract class ResourceTypeTreeNodeBuilder {
ResourceTypeTreeNode that = (ResourceTypeTreeNode) o;
- if (!this.id.equals(that.id)) {
+ if (this.id != that.id) {
return false;
}
if (this.parentId == null) {
@@ -228,7 +327,7 @@ public abstract class ResourceTypeTreeNodeBuilder {
@Override
public int hashCode() {
int result = 31;
- result = result * id.hashCode();
+ result = result * id;
result = result + (parentId != null ? parentId.hashCode() : 0);
return result;
}
commit 6d5e400decd1b55624daedda9a8e0a6814155eda
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu May 23 20:40:21 2013 +0200
BZ use explicit paging fields, as there is no default. In the specific case, the
'name' field was not unique and thus 'random within the resources with the
same name'
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java
index 4ceae82..305d867 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java
@@ -79,6 +79,7 @@ import org.rhq.core.domain.measurement.MeasurementDefinition;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.util.PageList;
+import org.rhq.core.domain.util.PageOrdering;
import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.alert.AlertConditionManagerLocal;
import org.rhq.enterprise.server.alert.AlertDefinitionManagerLocal;
@@ -148,11 +149,11 @@ public class AlertDefinitionHandlerBean extends AbstractRestBean {
public Response listAlertDefinitions(
@ApiParam(value = "Page number") @QueryParam("page")
Integer page,
@ApiParam(value = "Page size") @DefaultValue("20")
@QueryParam("ps") int pageSize,
- @ApiParam(value = "Limit to status, UNUSED AT THE MOMENT ")
@QueryParam("status") String status, // TODO
@Context HttpHeaders headers,
@Context UriInfo uriInfo) {
AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();
+ criteria.addSortId(PageOrdering.ASC);
if (page!=null) {
criteria.setPaging(page,pageSize);
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/EventHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/EventHandlerBean.java
index fd8a835..4f4d6b4 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/EventHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/EventHandlerBean.java
@@ -62,6 +62,7 @@ import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
+import org.rhq.core.domain.util.PageOrdering;
import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.event.EventManagerLocal;
import org.rhq.enterprise.server.rest.domain.EventDefinitionRest;
@@ -243,6 +244,7 @@ public class EventHandlerBean extends AbstractRestBean {
EventSource source = findEventSourceById(sourceId);
EventCriteria criteria = new EventCriteria();
+ criteria.addSortId(PageOrdering.ASC);
criteria.addFilterSourceId(source.getId());
if (startTime>0) {
criteria.addFilterStartTime(startTime);
@@ -291,6 +293,8 @@ public class EventHandlerBean extends AbstractRestBean {
}
EventCriteria criteria = new EventCriteria();
+ criteria.addSortId(PageOrdering.ASC);
+
criteria.addFilterResourceId(resourceId);
if (startTime>0) {
criteria.addFilterStartTime(startTime);
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/GroupHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/GroupHandlerBean.java
index d65a850..006c8a0 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/GroupHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/GroupHandlerBean.java
@@ -27,8 +27,6 @@ import java.util.Set;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.interceptor.Interceptors;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
@@ -67,6 +65,7 @@ import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.group.GroupDefinition;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.util.PageList;
+import org.rhq.core.domain.util.PageOrdering;
import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.resource.ResourceManagerLocal;
import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal;
@@ -105,9 +104,6 @@ public class GroupHandlerBean extends AbstractRestBean {
@EJB
GroupDefinitionManagerLocal definitionManager;
- @PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME)
- EntityManager em;
-
@GZIP
@GET
@@ -119,6 +115,8 @@ public class GroupHandlerBean extends AbstractRestBean {
@Context HttpHeaders headers, @Context UriInfo uriInfo) {
ResourceGroupCriteria criteria = new ResourceGroupCriteria();
+ criteria.addSortId(PageOrdering.ASC);
+
if (q!=null) {
criteria.addFilterName(q);
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
index 81d490b..d46850c 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
@@ -401,12 +401,12 @@ public class OperationsHandlerBean extends AbstractRestBean {
@Context HttpHeaders httpHeaders) {
ResourceOperationHistoryCriteria criteria = new
ResourceOperationHistoryCriteria();
+ criteria.addSortStartTime(PageOrdering.ASC);
if (resourceId>0) {
criteria.addFilterResourceIds(resourceId);
}
if (page!=null) {
criteria.setPaging(page,pageSize);
- criteria.addSortStartTime(PageOrdering.ASC);
}
criteria.addSortEndTime(PageOrdering.DESC);
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
index 0c3a7cd..332dfbc 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
@@ -188,6 +188,8 @@ public class ResourceHandlerBean extends AbstractRestBean {
@Context UriInfo uriInfo) {
ResourceCriteria criteria = new ResourceCriteria();
+ criteria.addSortName(PageOrdering.ASC);
+ criteria.addSortId(PageOrdering.ASC);
if (!status.toLowerCase().equals("all")) {
try {
criteria.addFilterInventoryStatus(InventoryStatus.valueOf(status.toUpperCase()));
@@ -206,7 +208,6 @@ public class ResourceHandlerBean extends AbstractRestBean {
}
if (page!=null) {
criteria.setPaging(page,pageSize);
- criteria.addSortName(PageOrdering.ASC);
}
PageList<Resource> ret = resMgr.findResourcesByCriteria(caller,criteria);
@@ -232,6 +233,7 @@ public class ResourceHandlerBean extends AbstractRestBean {
else {
pc = PageControl.getUnlimitedInstance();
}
+ pc.setPrimarySort("id",PageOrdering.ASC);
PageList<Resource> ret = resMgr.findResourcesByCategory(caller,
ResourceCategory.PLATFORM,
InventoryStatus.COMMITTED, pc);
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
index cd103ca..900ab10 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
@@ -24,11 +24,16 @@ package org.rhq.modules.integrationTests.restApi;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
import com.jayway.restassured.http.ContentType;
import com.jayway.restassured.path.json.JsonPath;
import com.jayway.restassured.path.xml.XmlPath;
import com.jayway.restassured.path.xml.element.Node;
import com.jayway.restassured.response.Response;
+import com.jayway.restassured.response.ResponseBody;
import org.apache.http.HttpStatus;
import org.junit.Test;
@@ -73,8 +78,8 @@ public class ResourcesTest extends AbstractBase {
.contentType(ContentType.JSON)
.log().everything()
.body("links.self", notNullValue())
- .body("resourceId",is(_platformId))
- .body("typeId",is(_platformTypeId))
+ .body("resourceId", is(_platformId))
+ .body("typeId", is(_platformTypeId))
.body("parentId",is(0))
.when()
.get("/resource/{id}");
@@ -94,8 +99,8 @@ public class ResourcesTest extends AbstractBase {
.contentType(WRAPPED_JSON)
.log().everything()
.body("links.self", notNullValue())
- .body("resourceId",is(_platformId))
- .body("typeId",is(_platformTypeId))
+ .body("resourceId", is(_platformId))
+ .body("typeId", is(_platformTypeId))
.body("parentId",is(0))
.when()
.get("/resource/{id}");
@@ -277,13 +282,50 @@ public class ResourcesTest extends AbstractBase {
.statusCode(200)
.log().everything()
// .header("Link", allOf(containsString("page=2"),
containsString("current")))
- .header("Link",not(containsString("prev")))
+ .header("Link", not(containsString("prev")))
.body("links.self", notNullValue())
.when()
.get("/resource");
}
@Test
+ public void testGetResourcesWithPagingAndUniquenessCheck() throws Exception {
+
+ int currentPage = 0;
+ Set<Integer> seen = new HashSet<Integer>();
+
+ for(;;) {
+ JsonPath path =
+ given()
+ .header("Accept",
"application/vnd.rhq.wrapped+json")
+ .with()
+ .queryParam("page", currentPage)
+ .queryParam("ps", 5) // Unusually small to provoke having more
than 1 page
+ .queryParam("status","COMMITTED")
+ .expect()
+ .statusCode(200)
+ .log().ifError()
+ .when()
+ .get("/resource")
+ .jsonPath();
+
+ List<Integer> ids = path.getList("data.resourceId");
+
+ for (Integer id : ids ) {
+ assert !seen.contains(id);
+ seen.add(id);
+ }
+
+ currentPage++;
+ if (currentPage > path.getInt("lastPage")) {
+ break;
+ }
+ System.out.print("+");
+ }
+ System.out.println();
+ }
+
+ @Test
public void testGetResourcesWithPagingAndWrapping() throws Exception {
given()
@@ -314,7 +356,7 @@ public class ResourcesTest extends AbstractBase {
.log().ifError()
.body("links.self", notNullValue())
.header("Link", not(containsString("prev=")))
- .header("Link",
anyOf(containsString("current"),containsString("last")))
+ .header("Link", anyOf(containsString("current"),
containsString("last")))
.when().get("/resource/platforms");
}
commit c09b8f16d4a4375a01241f2a1f042f59a9130735
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu May 23 15:14:23 2013 +0200
Support paging in the body with the appropriate media type
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
index 5652f9f..92d2499 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
@@ -448,14 +448,14 @@ public class AbstractRestBean {
uriBuilder = uriInfo.getRequestUriBuilder(); // adds ?q, ?ps and ?category if
needed
uriBuilder.replaceQueryParam("page",nextPage);
- builder.header("Link",new
Link("next",uriBuilder.build().toString()));
+ builder.header("Link",new
Link("next",uriBuilder.build().toString()).rfc5988String());
}
if (page>0) {
int prevPage = page -1;
uriBuilder = uriInfo.getRequestUriBuilder(); // adds ?q, ?ps and ?category if
needed
uriBuilder.replaceQueryParam("page",prevPage);
- builder.header("Link", new
Link("prev",uriBuilder.build().toString()));
+ builder.header("Link", new
Link("prev",uriBuilder.build().toString()).rfc5988String());
}
// A link to the last page
@@ -463,12 +463,12 @@ public class AbstractRestBean {
int lastPage = resultList.getTotalSize() / pc.getPageSize();
uriBuilder = uriInfo.getRequestUriBuilder(); // adds ?q, ?ps and ?category if
needed
uriBuilder.replaceQueryParam("page",lastPage);
- builder.header("Link", new
Link("last",uriBuilder.build().toString()));
+ builder.header("Link", new
Link("last",uriBuilder.build().toString()).rfc5988String());
}
// A link to the current page
uriBuilder = uriInfo.getRequestUriBuilder(); // adds ?q, ?ps and ?category if
needed
- builder.header("Link", new
Link("current",uriBuilder.build().toString()));
+ builder.header("Link", new
Link("current",uriBuilder.build().toString()).rfc5988String());
// Create a total size header
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/Link.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/Link.java
index 129ccfa..6eecf3e 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/Link.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/Link.java
@@ -59,4 +59,20 @@ public class Link {
href + "; " +
"rel='" + rel + '\'' ;
}
+
+ /**
+ * Return the link in the format of RFC 5988 Web Linking.
+ *
+ * See <a
href="http://tools.ietf.org/html/rfc5988#page-7">RFC 5988
Web Linking</a>
+ * @return String that contains the link with href and rel
+ */
+ public String rfc5988String() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("<")
+ .append(href)
+ .append(">; rel=\"")
+ .append(rel)
+ .append("\"");
+ return builder.toString();
+ }
}
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/EventTest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/EventTest.java
index 40ae7b0..75be637 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/EventTest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/EventTest.java
@@ -366,13 +366,13 @@ public class EventTest extends AbstractBase {
Headers headers = response.getHeaders();
int found = 0;
for (String link: headers.getValues("Link")) {
- if (link.contains("rel='last'"))
+ if (link.contains("rel=\"last\""))
found++;
- if (link.contains("rel='prev'"))
+ if (link.contains("rel=\"prev\""))
found++;
- if (link.contains("rel='current'"))
+ if (link.contains("rel=\"current\""))
found++;
- assert !link.contains("rel='next");
+ assert !link.contains("rel=\"next\"");
}
assert found == 3;
commit cd1087a1789973d74b85e7bffa99893a32ea603e
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed May 22 22:37:33 2013 +0200
Support paging in the body with the appropriate media type
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
index 8e4a826..5652f9f 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
@@ -26,6 +26,7 @@ import java.io.IOException;
import java.io.StringWriter;
import java.net.URI;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -35,7 +36,9 @@ import java.util.Set;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
+import javax.ws.rs.Produces;
import javax.ws.rs.core.CacheControl;
+import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;
@@ -66,6 +69,7 @@ import
org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal;
import org.rhq.enterprise.server.rest.domain.GroupRest;
import org.rhq.enterprise.server.rest.domain.Link;
import org.rhq.enterprise.server.rest.domain.MetricSchedule;
+import org.rhq.enterprise.server.rest.domain.PagingCollection;
import org.rhq.enterprise.server.rest.domain.ResourceWithType;
/**
@@ -77,12 +81,16 @@ import org.rhq.enterprise.server.rest.domain.ResourceWithType;
* @author Heiko W. Rupp
* @author Jay Shaughnessy
*/
+(a)Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML,MediaType.TEXT_HTML,"application/vnd.rhq.wrapped+json"})
@javax.annotation.Resource(name = "ISPN", mappedName =
"java:jboss/infinispan/rhq")
@SuppressWarnings("unchecked")
public class AbstractRestBean {
protected Log log = LogFactory.getLog(getClass().getName());
+ protected final MediaType wrappedCollectionJsonType = new
MediaType("application","vnd.rhq.wrapped+json");
+ protected final String wrappedCollectionJson =
"application/vnd.rhq.wrapped+json";
+
private static final CacheKey META_KEY = new
CacheKey("rhq.rest.resourceMeta", 0);
@javax.annotation.Resource( name = "ISPN")
@@ -468,6 +476,52 @@ public class AbstractRestBean {
}
/**
+ * Wrap the passed collection #resultList in an object with paging information
+ * @param builder ResonseBuilder to add the entity to
+ * @param uriInfo UriInfo to construct paging links
+ * @param originalList The original list to obtain the paging info from
+ * @param resultList The list of result items
+ */
+ protected void wrapForPaging(Response.ResponseBuilder builder, UriInfo uriInfo, final
PageList<?> originalList, final Collection resultList) {
+
+ PagingCollection pColl = new PagingCollection(resultList);
+ pColl.setTotalSize(originalList.getTotalSize());
+ PageControl pageControl = originalList.getPageControl();
+ pColl.setPageSize(pageControl.getPageSize());
+ int page = pageControl.getPageNumber();
+ pColl.setCurrentPage(page);
+ pColl.setLastPage(originalList.getTotalSize()/pageControl.getPageSize());
+
+ UriBuilder uriBuilder;
+ if (originalList.getTotalSize() > (page +1 ) * pageControl.getPageSize()) {
+ int nextPage = page +1;
+ uriBuilder = uriInfo.getRequestUriBuilder(); // adds ?q, ?ps and ?category if
needed
+ uriBuilder.replaceQueryParam("page",nextPage);
+ pColl.addLink(new Link("next",uriBuilder.build().toString()));
+ }
+ if (page > 0) {
+ int prevPage = page -1;
+ uriBuilder = uriInfo.getRequestUriBuilder(); // adds ?q, ?ps and ?category if
needed
+ uriBuilder.replaceQueryParam("page",prevPage);
+ pColl.addLink(new Link("prev",uriBuilder.build().toString()));
+ }
+
+ // A link to the last page
+ if (!pageControl.isUnlimited()) {
+ int lastPage = originalList.getTotalSize() / pageControl.getPageSize();
+ uriBuilder = uriInfo.getRequestUriBuilder(); // adds ?q, ?ps and ?category if
needed
+ uriBuilder.replaceQueryParam("page",lastPage);
+ pColl.addLink( new Link("last",uriBuilder.build().toString()));
+ }
+
+ // A link to the current page
+ uriBuilder = uriInfo.getRequestUriBuilder(); // adds ?q, ?ps and ?category if
needed
+ pColl.addLink(new Link("current",uriBuilder.build().toString()));
+
+ builder.entity(pColl);
+ }
+
+ /**
* Fetch the group with the passed id
*
* @param groupId id of the resource group
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java
index 6ea3d03..4ceae82 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java
@@ -46,6 +46,7 @@ import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.EntityTag;
import javax.ws.rs.core.GenericEntity;
+import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Request;
import javax.ws.rs.core.Response;
@@ -98,7 +99,6 @@ import org.rhq.enterprise.server.rest.domain.Link;
* AlertHandlerBean
* @author Heiko W. Rupp
*/
-@Produces({"application/json","application/xml","text/plain"})
@Path("/alert")
@Api(value = "Deal with Alert Definitions",description = "This api deals
with alert definitions. Everything " +
" is purely experimental at the moment and can change without notice at any
time.")
@@ -149,6 +149,7 @@ public class AlertDefinitionHandlerBean extends AbstractRestBean {
@ApiParam(value = "Page number") @QueryParam("page")
Integer page,
@ApiParam(value = "Page size") @DefaultValue("20")
@QueryParam("ps") int pageSize,
@ApiParam(value = "Limit to status, UNUSED AT THE MOMENT ")
@QueryParam("status") String status, // TODO
+ @Context HttpHeaders headers,
@Context UriInfo uriInfo) {
AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();
@@ -163,10 +164,17 @@ public class AlertDefinitionHandlerBean extends AbstractRestBean {
ret.add(adr);
}
- Response.ResponseBuilder builder = Response.ok(ret);
- createPagingHeader(builder,uriInfo,defs);
+ Response.ResponseBuilder builder = Response.ok();
- // TODO media type etc
+ MediaType mediaType = headers.getAcceptableMediaTypes().get(0);
+ builder.type(mediaType);
+
+ if (mediaType.equals(wrappedCollectionJsonType)) {
+ wrapForPaging(builder,uriInfo,defs,ret);
+ } else {
+ createPagingHeader(builder,uriInfo,defs);
+ builder.entity(ret); // TODO generic entity for XML
+ }
return builder.build();
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerBean.java
index 5da3fb9..5c6a06f 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerBean.java
@@ -32,7 +32,6 @@ import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.EntityTag;
@@ -72,7 +71,6 @@ import org.rhq.enterprise.server.rest.domain.*;
* Deal with alert related stuff
* @author Heiko W. Rupp
*/
-@Produces({"application/json","application/xml","text/html"})
@Path("/alert")
@Api(value = "Deal with Alerts",description = "This api deals with alerts
that have fired.")
@Stateless
@@ -148,17 +146,22 @@ public class AlertHandlerBean extends AbstractRestBean {
}
MediaType type = headers.getAcceptableMediaTypes().get(0);
- Response.ResponseBuilder builder;
+ Response.ResponseBuilder builder = Response.ok();
+ builder.type(type);
if (type.equals(MediaType.TEXT_HTML_TYPE)) {
- builder = Response.ok(renderTemplate("listAlerts.ftl",ret),type);
+ builder.entity(renderTemplate("listAlerts.ftl",ret));
} else {
- GenericEntity<List<AlertRest>> entity = new
GenericEntity<List<AlertRest>>(ret) {};
- builder = Response.ok(entity);
+ if (type.equals(wrappedCollectionJsonType)) {
+ wrapForPaging(builder,uriInfo,alerts,ret);
+ }
+ else {
+ GenericEntity<List<AlertRest>> entity = new
GenericEntity<List<AlertRest>>(ret) {};
+ builder.entity(entity);
+ createPagingHeader(builder,uriInfo,alerts);
+ }
}
- createPagingHeader(builder,uriInfo,alerts);
-
return builder.build();
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/EventHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/EventHandlerBean.java
index 7402550..fd8a835 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/EventHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/EventHandlerBean.java
@@ -37,13 +37,11 @@ import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.GenericEntity;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Request;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
@@ -76,7 +74,6 @@ import org.rhq.enterprise.server.rest.domain.EventSourceRest;
*/
@Path("/event")
@Api("Api that deals with Events (e.g snmp traps, logfile lines)")
-(a)Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML,MediaType.TEXT_HTML})
@Stateless
@Interceptors(SetCallerInterceptor.class)
public class EventHandlerBean extends AbstractRestBean {
@@ -348,17 +345,20 @@ public class EventHandlerBean extends AbstractRestBean {
}
MediaType mediaType = headers.getAcceptableMediaTypes().get(0);
- Response.ResponseBuilder builder;
+ Response.ResponseBuilder builder = Response.ok();
+ builder.type(mediaType);
if (mediaType.equals(MediaType.APPLICATION_XML_TYPE)) {
GenericEntity<List<EventRest>> list = new
GenericEntity<List<EventRest>>(restEvents) {};
- builder = Response.ok(list, mediaType);
+ builder.entity(list);
+ createPagingHeader(builder,uriInfo,eventList);
+ } else if (mediaType.equals(MediaType.APPLICATION_JSON_TYPE)) {
+ builder.entity(restEvents);
+ createPagingHeader(builder,uriInfo,eventList);
}
- else {
- builder = Response.ok(restEvents, mediaType);
+ else {
+ wrapForPaging(builder,uriInfo,eventList,restEvents);
}
- createPagingHeader(builder,uriInfo,eventList);
-
return builder;
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/GroupHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/GroupHandlerBean.java
index be2419b..d65a850 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/GroupHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/GroupHandlerBean.java
@@ -37,7 +37,6 @@ import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.GenericEntity;
@@ -93,7 +92,6 @@ import org.rhq.enterprise.server.rest.domain.ResourceWithType;
@Interceptors(SetCallerInterceptor.class)
@Path("/group")
@Api(value="Deal with groups and DynaGroups", description = "Api that
deals with resource groups and group definitions")
-(a)Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML,MediaType.TEXT_HTML})
public class GroupHandlerBean extends AbstractRestBean {
private final Log log = LogFactory.getLog(GroupHandlerBean.class);
@@ -142,12 +140,15 @@ public class GroupHandlerBean extends AbstractRestBean {
if (mediaType.equals(MediaType.TEXT_HTML_TYPE)) {
builder.entity(renderTemplate("listGroup", list));
}
+ else if (mediaType.equals(wrappedCollectionJsonType)) {
+ wrapForPaging(builder,uriInfo,groups,list);
+ }
else {
GenericEntity<List<GroupRest>> ret = new
GenericEntity<List<GroupRest>>(list) {};
builder.entity(ret);
+ createPagingHeader(builder,uriInfo,groups);
}
- createPagingHeader(builder,uriInfo,groups);
return builder.build();
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
index e32ea03..81d490b 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
@@ -420,16 +420,19 @@ public class OperationsHandlerBean extends AbstractRestBean {
}
MediaType mediaType = httpHeaders.getAcceptableMediaTypes().get(0);
- Response.ResponseBuilder builder;
+ Response.ResponseBuilder builder = Response.ok();
+ builder.type(mediaType);
+
if (mediaType.equals(MediaType.TEXT_HTML_TYPE)) {
- builder = Response.ok(renderTemplate("listOperationHistory.ftl",
result));
+ builder.entity(renderTemplate("listOperationHistory.ftl",
result));
+ } else if (mediaType.equals(wrappedCollectionJsonType)) {
+ wrapForPaging(builder,uriInfo,histories,result);
} else {
GenericEntity<List<OperationHistoryRest>> res = new
GenericEntity<List<OperationHistoryRest>>(result) {};
- builder = Response.ok(res);
+ builder.entity(res);
+ createPagingHeader(builder,uriInfo,histories);
}
- createPagingHeader(builder,uriInfo,histories);
-
return builder.build();
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
index a783ac8..0c3a7cd 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
@@ -114,7 +114,6 @@ import org.rhq.enterprise.server.rest.helper.ConfigurationHelper;
* Class that deals with getting data about resources
* @author Heiko W. Rupp
*/
-(a)Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML,MediaType.TEXT_HTML})
@Path("/resource")
@Api(value="Resource related", description = "This endpoint deals with
individual resources, not resource groups")
@Interceptors(SetCallerInterceptor.class)
@@ -263,15 +262,19 @@ public class ResourceHandlerBean extends AbstractRestBean {
Response.ResponseBuilder builder = Response.ok();
builder.type(mediaType);
- createPagingHeader(builder,uriInfo,resources);
if (mediaType.equals(MediaType.TEXT_HTML_TYPE)) {
builder.entity(renderTemplate("listResourceWithType", rwtList));
} else {
- GenericEntity<List<ResourceWithType>> list = new
GenericEntity<List<ResourceWithType>>(rwtList) {
+ if (mediaType.equals(wrappedCollectionJsonType)) {
+ wrapForPaging(builder,uriInfo,resources,rwtList);
+ } else {
+ GenericEntity<List<ResourceWithType>> list = new
GenericEntity<List<ResourceWithType>>(rwtList) {
};
- builder.entity(list);
+ builder.entity(list);
+ createPagingHeader(builder,uriInfo,resources);
+ }
}
return builder;
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/PagingCollection.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/PagingCollection.java
new file mode 100644
index 0000000..4a0f892
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/PagingCollection.java
@@ -0,0 +1,97 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+package org.rhq.enterprise.server.rest.domain;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * A wrapper for collections with paging entries
+ * @author Heiko W. Rupp
+ */
+@XmlRootElement
+public class PagingCollection<T> {
+
+ Collection<T> data;
+ int pageSize;
+ int currentPage;
+ int lastPage;
+ int totalSize;
+ List<Link> links = new ArrayList<Link>();
+
+ public PagingCollection(Collection<T> data) {
+ this.data = data;
+ }
+
+ public int getCurrentPage() {
+ return currentPage;
+ }
+
+ public void setCurrentPage(int currentPage) {
+ this.currentPage = currentPage;
+ }
+
+ public Collection<T> getData() {
+ return data;
+ }
+
+ public void setData(Collection<T> data) {
+ this.data = data;
+ }
+
+ public int getLastPage() {
+ return lastPage;
+ }
+
+ public void setLastPage(int lastPage) {
+ this.lastPage = lastPage;
+ }
+
+ public int getPageSize() {
+ return pageSize;
+ }
+
+ public void setPageSize(int pageSize) {
+ this.pageSize = pageSize;
+ }
+
+ public int getTotalSize() {
+ return totalSize;
+ }
+
+ public void setTotalSize(int totalSize) {
+ this.totalSize = totalSize;
+ }
+
+ public List<Link> getLinks() {
+ return links;
+ }
+
+ public void setLinks(List<Link> links) {
+ this.links = links;
+ }
+
+ public void addLink(Link link) {
+ links.add(link);
+ }
+}
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationHelperTest.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationHelperTest.java
index 7e20630..3a7e961 100644
---
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationHelperTest.java
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationHelperTest.java
@@ -703,7 +703,7 @@ public class ConfigurationHelperTest {
}
- @Test
+ @Test(enabled = false)
public void testConfigToMapComplexMapWithBadSetupLenient() throws Exception {
Configuration config = new Configuration();
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AbstractBase.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AbstractBase.java
index ae4e81d..fd154ef 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AbstractBase.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AbstractBase.java
@@ -40,6 +40,7 @@ import static com.jayway.restassured.RestAssured.given;
public abstract class AbstractBase {
static final String APPLICATION_JSON = "application/json";
+ static final String WRAPPED_JSON = "application/vnd.rhq.wrapped+json";
private static final String APPLICATION_XML = "application/xml";
private static final String TEXT_CSV = "text/csv";
private static final String TEXT_HTML = "text/html";
@@ -48,6 +49,7 @@ public abstract class AbstractBase {
static Header acceptXml = new Header("Accept", APPLICATION_XML);
static Header acceptHtml = new Header("Accept", TEXT_HTML);
static Header acceptCsv = new Header("Accept", TEXT_CSV);
+ static Header acceptWrappedJson = new Header("Accept",WRAPPED_JSON);
int _platformId ;
int _platformTypeId;
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java
index e02a723..acbb492 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java
@@ -39,6 +39,7 @@ import static org.hamcrest.CoreMatchers.anyOf;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.emptyIterable;
import static org.hamcrest.Matchers.instanceOf;
@@ -116,6 +117,22 @@ public class AlertTest extends AbstractBase {
.get("/alert");
}
+ @Test
+ public void testListAlertsWithPagingAndWrapped() throws Exception {
+
+ given()
+ .header(acceptWrappedJson)
+ .queryParam("ps", 2)
+ .queryParam("page", 0)
+ .expect()
+ .statusCode(200)
+ .header("Link", nullValue())
+ .body("totalSize", notNullValue())
+ .log().ifError()
+ .when()
+ .get("/alert");
+ }
+
@Test
public void testGetAlertCountJson() throws Exception {
@@ -192,6 +209,21 @@ public class AlertTest extends AbstractBase {
}
@Test
+ public void testListAllAlertDefinitionsWithWrapping() throws Exception {
+
+ given()
+ .header(acceptWrappedJson)
+ .log().everything()
+ .expect()
+ .statusCode(200)
+ .log().ifError()
+ .body("currentPage", Matchers.notNullValue())
+ .body("totalSize", Matchers.notNullValue())
+ .when()
+ .get("/alert/definitions");
+ }
+
+ @Test
public void testRedirectForDefinition() throws Exception {
given()
.header(acceptJson)
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ContentTest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ContentTest.java
index 3515fac..ebd72c0 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ContentTest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ContentTest.java
@@ -306,13 +306,13 @@ public class ContentTest extends AbstractBase {
.as(List.class);
if (resources!=null && resources.size()>0) {
- int resourceId = resources.get(0).getResourceId();
+ int resourceId = (Integer) ((Map <
String,Object>)resources.get(0)).get("resourceId");
given()
.pathParam("id", resourceId)
.queryParam("physical", "true") // Also remove target
on the EAP instance
.expect()
- .statusCode(200)
+ .statusCode(204)
.when()
.delete("/resource/{id}");
}
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/GroupTest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/GroupTest.java
index a4ef048..ef575d1 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/GroupTest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/GroupTest.java
@@ -35,6 +35,8 @@ import org.rhq.modules.integrationTests.restApi.d.GroupDef;
import static com.jayway.restassured.RestAssured.expect;
import static com.jayway.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.hasItem;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.iterableWithSize;
@@ -69,17 +71,37 @@ public class GroupTest extends AbstractBase {
@Test
public void testGetGroups() throws Exception {
- expect().statusCode(200)
- .when().get("/group");
+ expect()
+ .statusCode(200)
+ .when()
+ .get("/group");
}
@Test
public void testGetGroupsWithPaging() throws Exception {
given()
+ .header(acceptJson)
+ .queryParam("page",0)
+ .queryParam("ps",2)
+ .expect()
+ .statusCode(200)
+ .header("Link", notNullValue())
+ .when()
+ .get("/group");
+ }
+
+ @Test
+ public void testGetGroupsWithPagingWrapped() throws Exception {
+ given()
+ .header(acceptWrappedJson)
.queryParam("page",0)
.queryParam("ps",2)
.expect()
.statusCode(200)
+ .log().ifError()
+ .header("Link",nullValue())
+ .body("pageSize",is(2))
+ .body("currentPage",is(0))
.when()
.get("/group");
}
@@ -87,10 +109,11 @@ public class GroupTest extends AbstractBase {
@Test
public void testGetGroupsQuery() throws Exception {
given()
- .queryParam("q","lala")
+ .queryParam("q", "lala")
.expect()
- .statusCode(200)
- .when().get("/group");
+ .statusCode(200)
+ .when()
+ .get("/group");
}
@Test
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
index b66d9b5..cd103ca 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
@@ -82,6 +82,27 @@ public class ResourcesTest extends AbstractBase {
}
@Test
+ public void testGetPlatformJsonWrapping() {
+
+ // Actually this object should not be wrapped
+ // as it is no list
+ given()
+ .header(acceptWrappedJson)
+ .pathParam("id",_platformId)
+ .expect()
+ .statusCode(200)
+ .contentType(WRAPPED_JSON)
+ .log().everything()
+ .body("links.self", notNullValue())
+ .body("resourceId",is(_platformId))
+ .body("typeId",is(_platformTypeId))
+ .body("parentId",is(0))
+ .when()
+ .get("/resource/{id}");
+
+ }
+
+ @Test
public void testGetPlatformAndTypeJson() {
Integer typeId =
@@ -258,7 +279,26 @@ public class ResourcesTest extends AbstractBase {
// .header("Link", allOf(containsString("page=2"),
containsString("current")))
.header("Link",not(containsString("prev")))
.body("links.self", notNullValue())
- .when().get("/resource");
+ .when()
+ .get("/resource");
+ }
+
+ @Test
+ public void testGetResourcesWithPagingAndWrapping() throws Exception {
+
+ given()
+ .header("Accept", "application/vnd.rhq.wrapped+json")
+ .with()
+ .queryParam("page", 1)
+ .queryParam("ps", 2) // Unusually small to provoke having more
than 1 page
+ .queryParam("category", "service")
+ .expect()
+ .statusCode(200)
+ .log().everything()
+ .body("pageSize",is(2))
+ .body("currentPage",is(1))
+ .when()
+ .get("/resource");
}
@Test
commit e725ed0658bae7bd5f33dbbc4a2b30eb02a6057f
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Wed May 22 19:36:09 2013 +0200
Improvements to RHQ irc bot. New set of commands is now supported.
diff --git a/etc/rhq-ircBot/pom.xml b/etc/rhq-ircBot/pom.xml
index 40b6952..6e66187 100644
--- a/etc/rhq-ircBot/pom.xml
+++ b/etc/rhq-ircBot/pom.xml
@@ -41,7 +41,7 @@
<dependency>
<groupId>org.pircbotx</groupId>
<artifactId>pircbotx</artifactId>
- <version>1.7</version>
+ <version>1.9</version>
</dependency>
<dependency>
@@ -50,6 +50,17 @@
<version>2.0</version>
</dependency>
+ <dependency>
+ <groupId>org.jsoup</groupId>
+ <artifactId>jsoup</artifactId>
+ <version>1.7.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.4</version>
+ </dependency>
</dependencies>
<build>
diff --git a/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBot.java
b/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBot.java
index ce7535f..7e8f563 100644
--- a/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBot.java
+++ b/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBot.java
@@ -1,163 +1,63 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License 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.etc.ircbot;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import com.j2bugzilla.base.Bug;
-import com.j2bugzilla.base.BugzillaConnector;
-import com.j2bugzilla.base.BugzillaException;
-import com.j2bugzilla.rpc.GetBug;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.KeyManagementException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.CertificateException;
+import java.util.Properties;
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
-import org.apache.xmlrpc.XmlRpcException;
import org.pircbotx.PircBotX;
-import org.pircbotx.User;
-import org.pircbotx.hooks.Listener;
-import org.pircbotx.hooks.ListenerAdapter;
-import org.pircbotx.hooks.events.DisconnectEvent;
-import org.pircbotx.hooks.events.MessageEvent;
-import org.pircbotx.hooks.events.PrivateMessageEvent;
/**
- * An IRC bot for doing helpful stuff on the Freenode #rhq channel.
+ * @author Jirka Kremser
*
- * @author Ian Springer
*/
-public class RhqIrcBot extends ListenerAdapter {
-
- private static final Pattern BUG_PATTERN = Pattern.compile("(?i)(bz|bug)[
]*(\\d{6,7})");
- private static final Pattern ECHO_PATTERN = Pattern.compile("(?i)echo[
]+(.+)");
-
- private static final Set<String> JON_DEVS = new HashSet<String>();
- static {
- JON_DEVS.add("ccrouch");
- JON_DEVS.add("ips");
- JON_DEVS.add("jkremser");
- JON_DEVS.add("jsanda");
- JON_DEVS.add("jshaughn");
- JON_DEVS.add("lkrejci");
- JON_DEVS.add("mazz");
- JON_DEVS.add("mtho11");
- JON_DEVS.add("pilhuhn");
- JON_DEVS.add("spinder");
- JON_DEVS.add("stefan_n");
- }
-
- private String server;
- private String channel;
- private BugzillaConnector bzConnector = new BugzillaConnector();
- private Map<Integer, Long> bugLogTimestamps = new HashMap<Integer,
Long>();
-
- public RhqIrcBot(String server, String channel) {
- this.server = server;
- this.channel = channel;
- }
-
- @Override
- public void onMessage(MessageEvent event) throws Exception {
- PircBotX bot = event.getBot();
- if (!bot.getNick().equals(bot.getName())) {
- bot.changeNick(bot.getName());
- }
-
- String message = event.getMessage();
- Matcher bugMatcher = BUG_PATTERN.matcher(message);
- while (bugMatcher.find()) {
- int bugId = Integer.valueOf(bugMatcher.group(2));
- GetBug getBug = new GetBug(bugId);
- try {
- bzConnector.executeMethod(getBug);
- } catch (Exception e) {
- bzConnector = new BugzillaConnector();
- bzConnector.connectTo("https://bugzilla.redhat.com");
- try {
- bzConnector.executeMethod(getBug);
- } catch (BugzillaException e1) {
- //e1.printStackTrace();
- Throwable cause = e1.getCause();
- String details = (cause instanceof XmlRpcException) ?
cause.getMessage() : e1.getMessage();
- bot.sendMessage(event.getChannel(), "Failed to access BZ "
+ bugId + ": " + details);
- continue;
- }
- }
- Bug bug = getBug.getBug();
- if (bug != null) {
- String product = bug.getProduct();
- if (product.equals("RHQ Project")) {
- product = "RHQ";
- } else if (product.equals("JBoss Operations Network")) {
- product = "JON";
- }
- Long timestamp = bugLogTimestamps.get(bugId);
- if ((timestamp == null) || ((System.currentTimeMillis() - timestamp) >
(5 * 60 * 1000L))) {
- bot.sendMessage(event.getChannel(), "BZ " + bugId + "
[product=" + product
- + ", priority=" + bug.getPriority() + ",
status=" + bug.getStatus() + "] "
- + bug.getSummary() + " [
https://bugzilla.redhat.com/" + bugId + " ]");
- }
- bugLogTimestamps.put(bugId, System.currentTimeMillis());
- } else {
- bot.sendMessage(event.getChannel(), "BZ " + bugId + " does
not exist.");
- }
- }
-
- if (message.matches(".*\\b(jon-team|jboss-on-team)\\b.*")) {
- Set<User> users = bot.getUsers(event.getChannel());
- StringBuilder presentJonDevs = new StringBuilder();
- for (User user : users) {
- String nick = user.getNick();
- if (JON_DEVS.contains(nick) &&
!nick.equals(event.getUser().getNick())) {
- presentJonDevs.append(nick).append(' ');
- }
- }
- bot.sendMessage(event.getChannel(), presentJonDevs + ": see message from
"
- + event.getUser().getNick() + " above");
- }
+public class RhqIrcBot extends PircBotX {
+
+ private static final String TRUSTSTORE_NAME = "cacerts.jks";
+
+ public RhqIrcBot(RhqIrcBotListener rhqBot) {
+ setName("rhq-bot");
+ setVersion("1.1");
+ setFinger("RHQ IRC bot (source code in RHQ git under
etc/rhq-ircBot/)");
+
+ setVerbose(true);
+ setAutoNickChange(true);
+
+ getListenerManager().addListener(rhqBot);
+ setSocketTimeout(1 * 60 * 1000); // 1 minute
}
-
- @Override
- public void onPrivateMessage(PrivateMessageEvent privateMessageEvent) throws
Exception {
- PircBotX bot = privateMessageEvent.getBot();
- String message = privateMessageEvent.getMessage();
- Matcher echoMatcher = ECHO_PATTERN.matcher(message);
- if (echoMatcher.matches()) {
- String echoMessage = echoMatcher.group(1);
- bot.sendMessage(this.channel, echoMessage);
- } else {
- bot.sendMessage(privateMessageEvent.getUser(), "Hi, I am " +
bot.getFinger() + ".");
- }
- // TODO: Implement a HELP command.
- }
-
- @Override
- public void onDisconnect(DisconnectEvent disconnectEvent) throws Exception {
- boolean connected = false;
- while (!connected) {
- Thread.sleep(60 * 1000L); // 1 minute
- try {
- PircBotX newBot = createBot(this);
- newBot.connect(this.server);
- newBot.joinChannel(this.channel);
-
- connected = true;
- } catch (Exception e) {
- System.err.println("Failed to reconnect to " +
disconnectEvent.getBot().getServer() + " IRC server: " + e);
- }
- }
-
- // Try to clean up the old bot, so it can release any memory, sockets, etc.
it's using.
- PircBotX oldBot = disconnectEvent.getBot();
- Set<Listener> oldListeners = new
HashSet<Listener>(oldBot.getListenerManager().getListeners());
- for (Listener oldListener : oldListeners) {
- oldBot.getListenerManager().removeListener(oldListener);
- }
- }
-
+
public static void main(String[] args) throws Exception {
- if (args.length != 2) {
- System.err.println("Usage: RhqIrcBot IRC_SERVER IRC_CHANNEL");
+ if (args.length != 2 && args.length != 3) {
+ System.err.println("Usage: RhqIrcBot IRC_SERVER IRC_CHANNEL
[rhq-ircBot.properties]");
System.err.println(" e.g.: RhqIrcBot
irc.freenode.net
'#rhq'");
System.exit(1);
}
@@ -167,26 +67,62 @@ public class RhqIrcBot extends ListenerAdapter {
channel = '#' + channel;
}
- RhqIrcBot rhqBot = new RhqIrcBot(server, channel);
+ RhqIrcBotListener rhqBotListener = new RhqIrcBotListener(server, channel);
+ if (args.length == 3) {
+ File propertyFile = new File(args[2]);
+ if (!propertyFile.exists()) {
+ System.err.println("Provided property file [" + args[2] +
"] does not exist");
+ System.exit(2);
+ }
+ Properties properties = new Properties();
+ FileInputStream fis = new FileInputStream(propertyFile);
+ properties.load(fis);
+ String docspaceLogin = properties.getProperty("docspace_login");
+ String docspacePassword =
properties.getProperty("docspace_password");
+ if (docspaceLogin == null || docspaceLogin.isEmpty() || docspacePassword ==
null || docspacePassword.isEmpty()) {
+ System.err.println("The property format has bad format");
+ System.err.println("It must contain following key-value
pairs\n");
+ System.err.println("docspace_login=X");
+ System.err.println("docspace_password=Y");
+ System.exit(3);
+ }
+ fis.close();
+
+ setupTrustStore();
+
+ rhqBotListener.setDocspaceLogin(docspaceLogin);
+ rhqBotListener.setDocspacePassword(docspacePassword);
+ }
- PircBotX bot = createBot(rhqBot);
+ PircBotX bot = new RhqIrcBot(rhqBotListener);
bot.connect(server);
bot.joinChannel(channel);
}
-
- private static PircBotX createBot(RhqIrcBot rhqBot) {
- PircBotX bot = new PircBotX();
-
- bot.setName("rhq-bot");
- bot.setVersion("1.0");
- bot.setFinger("RHQ IRC bot (source code in RHQ git under
etc/rhq-ircBot/)");
-
- bot.setVerbose(true);
- bot.setAutoNickChange(true);
-
- bot.getListenerManager().addListener(rhqBot);
- bot.setSocketTimeout(1 * 60 * 1000); // 1 minute
- return bot;
+
+ private static void setupTrustStore() {
+ TrustManagerFactory trustManagerFactory;
+ try {
+ trustManagerFactory =
TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+ KeyStore keystore;
+ keystore = KeyStore.getInstance(KeyStore.getDefaultType());
+ InputStream keystoreStream =
RhqIrcBot.class.getResourceAsStream(TRUSTSTORE_NAME);
+ keystore.load(keystoreStream, "rhqirc".toCharArray());
+ trustManagerFactory.init(keystore);
+ TrustManager[] trustManagers = trustManagerFactory.getTrustManagers();
+ SSLContext ctx = SSLContext.getInstance("SSL");
+ ctx.init(null, trustManagers, null);
+
+ SSLContext.setDefault(ctx);
+ } catch (NoSuchAlgorithmException e) {
+ e.printStackTrace();
+ } catch (KeyStoreException e) {
+ e.printStackTrace();
+ } catch (CertificateException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (KeyManagementException e) {
+ e.printStackTrace();
+ }
}
-
}
diff --git a/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java
b/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java
new file mode 100644
index 0000000..8a7e578
--- /dev/null
+++ b/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java
@@ -0,0 +1,357 @@
+package org.rhq.etc.ircbot;
+
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Random;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import com.j2bugzilla.base.Bug;
+import com.j2bugzilla.base.BugzillaConnector;
+import com.j2bugzilla.base.BugzillaException;
+import com.j2bugzilla.rpc.GetBug;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.xmlrpc.XmlRpcException;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.pircbotx.PircBotX;
+import org.pircbotx.User;
+import org.pircbotx.hooks.Listener;
+import org.pircbotx.hooks.ListenerAdapter;
+import org.pircbotx.hooks.events.DisconnectEvent;
+import org.pircbotx.hooks.events.MessageEvent;
+import org.pircbotx.hooks.events.NickChangeEvent;
+import org.pircbotx.hooks.events.PrivateMessageEvent;
+
+/**
+ * An IRC bot for doing helpful stuff on the Freenode #rhq channel.
+ *
+ * @author Ian Springer
+ * @author Jiri Kremser
+ */
+public class RhqIrcBotListener extends ListenerAdapter<RhqIrcBot> {
+
+ private static final Pattern BUG_PATTERN = Pattern.compile("(?i)(bz|bug)[
]*(\\d{6,7})");
+ private static final Pattern COMMIT_PATTERN =
Pattern.compile("(?i)(\\!commit|cm)[ ]*([0-9a-f]{3,40})");
+ private static final Pattern ECHO_PATTERN = Pattern.compile("(?i)echo[
]+(.+)");
+ private static final String SUPPORT_LINK =
"https://docspace.corp.redhat.com/docs/DOC-124477";
+ private static final String COMMIT_LINK =
"https://git.fedorahosted.org/cgit/rhq/rhq.git/commit/?id=%s";
+ private static final String PTO_LINK =
"https://mail.corp.redhat.com/home/ccrouch@redhat.com/JBoss%20ON%20OOO?fmt=rss&view=day";
+ private static final DateFormat monthFormat = new SimpleDateFormat("MMM");
+ private static final DateFormat dayInMonthFormat = new
SimpleDateFormat("d");
+
+ private static enum Command {
+
+ FORUM("Our forum is available from
https://community.jboss.org/en/rhq?view=discussions", true),
+ HELP("You can use one of the following commands: ", true),
+ LISTS("Feel free to enroll to the user list
https://lists.fedorahosted.org/mailman/listinfo/rhq-users"
+ + " or the devel list
https://lists.fedorahosted.org/mailman/listinfo/rhq-devel", true),
+ LOGS("IRC logs are available from
http://transcripts.jboss.org/channel/irc.freenode.org/%23rhq/index.html", true),
+ PTO,
+ SOURCE("The code could be viewed/cloned on
https://github.com/rhq-project or
https://git.fedorahosted.org/cgit/rhq/rhq.git/", true),
+ SUPPORT,
+ WIKI("Our wiki is available from
https://docs.jboss.org/author/display/RHQ/Home", true);
+
+ public static final char PREFIX = '!';
+ private final String staticRespond;
+ private final boolean includeInHelp;
+
+ Command(String staticRespond, boolean includeInHelp) {
+ this.staticRespond = staticRespond;
+ this.includeInHelp = includeInHelp;
+ }
+
+ Command() {
+ this(null, false);
+ }
+ }
+
+ private static final Set<String> JON_DEVS = new HashSet<String>();
+ static {
+ JON_DEVS.add("ccrouch");
+ JON_DEVS.add("ips");
+ JON_DEVS.add("jkremser");
+ JON_DEVS.add("jsanda");
+ JON_DEVS.add("jshaughn");
+ JON_DEVS.add("lkrejci");
+ JON_DEVS.add("mazz");
+ JON_DEVS.add("mtho11");
+ JON_DEVS.add("pilhuhn");
+ JON_DEVS.add("spinder");
+ JON_DEVS.add("stefan_n");
+ JON_DEVS.add("tsegismont");
+ }
+
+ private final String server;
+ private final String channel;
+ private String docspaceLogin;
+ private String docspacePassword;
+ private BugzillaConnector bzConnector = new BugzillaConnector();
+ private final Map<Integer, Long> bugLogTimestamps = new HashMap<Integer,
Long>();
+ private final Map<String, String> names = new HashMap<String, String>();
+ private final Pattern commandPattern;
+
+ public RhqIrcBotListener(String server, String channel) {
+ this.server = server;
+ this.channel = channel;
+ StringBuilder commandRegExp = new StringBuilder();
+ commandRegExp.append("(?i)\\").append(Command.PREFIX).append("[
]*(");
+ for (Command command : Command.values()) {
+ commandRegExp.append(command.name()).append('|');
+ }
+ commandRegExp.deleteCharAt(commandRegExp.length() - 1);
+ commandRegExp.append(')');
+ commandPattern = Pattern.compile(commandRegExp.toString());
+ }
+
+ @Override
+ public void onMessage(MessageEvent<RhqIrcBot> event) throws Exception {
+ PircBotX bot = event.getBot();
+ if (!bot.getNick().equals(bot.getName())) {
+ bot.changeNick(bot.getName());
+ }
+
+ // react to BZs in the messages
+ String message = event.getMessage();
+ Matcher bugMatcher = BUG_PATTERN.matcher(message);
+ while (bugMatcher.find()) {
+ int bugId = Integer.valueOf(bugMatcher.group(2));
+ GetBug getBug = new GetBug(bugId);
+ try {
+ bzConnector.executeMethod(getBug);
+ } catch (Exception e) {
+ bzConnector = new BugzillaConnector();
+ bzConnector.connectTo("https://bugzilla.redhat.com");
+ try {
+ bzConnector.executeMethod(getBug);
+ } catch (BugzillaException e1) {
+ //e1.printStackTrace();
+ Throwable cause = e1.getCause();
+ String details = (cause instanceof XmlRpcException) ?
cause.getMessage() : e1.getMessage();
+ bot.sendMessage(event.getChannel(), "Failed to access BZ "
+ bugId + ": " + details);
+ continue;
+ }
+ }
+ Bug bug = getBug.getBug();
+ if (bug != null) {
+ String product = bug.getProduct();
+ if (product.equals("RHQ Project")) {
+ product = "RHQ";
+ } else if (product.equals("JBoss Operations Network")) {
+ product = "JON";
+ }
+ Long timestamp = bugLogTimestamps.get(bugId);
+ if ((timestamp == null) || ((System.currentTimeMillis() - timestamp) >
(5 * 60 * 1000L))) {
+ bot.sendMessage(
+ event.getChannel(),
+ "BZ " + bugId + " [product=" + product +
", priority=" + bug.getPriority() + ", status="
+ + bug.getStatus() + "] " + bug.getSummary() +
" [
https://bugzilla.redhat.com/" + bugId
+ + " ]");
+ }
+ bugLogTimestamps.put(bugId, System.currentTimeMillis());
+ } else {
+ bot.sendMessage(event.getChannel(), "BZ " + bugId + " does
not exist.");
+ }
+ }
+
+ // react to the commit hashs included in the messages
+ Matcher commitMatcher = COMMIT_PATTERN.matcher(message);
+ while (commitMatcher.find()) {
+ String shaHash = commitMatcher.group(2);
+ String response = String.format(COMMIT_LINK, shaHash);
+ bot.sendMessage(event.getChannel(), event.getUser().getNick() + ":
" + response);
+ }
+
+ // react to commands included in the messages
+ Matcher commandMatcher = commandPattern.matcher(message);
+ while (commandMatcher.find()) {
+ Command command = Command.valueOf(commandMatcher.group(1).toUpperCase());
+ String response = prepareResponseForCommand(command);
+ bot.sendMessage(event.getChannel(), event.getUser().getNick() + ":
" + response);
+ }
+
+ // ping JON devs
+ if (message.matches(".*\\b(jon-team|jboss-on-team)\\b.*")) {
+ Set<User> users = bot.getUsers(event.getChannel());
+ StringBuilder presentJonDevs = new StringBuilder();
+ for (User user : users) {
+ String nick = user.getNick();
+ if (JON_DEVS.contains(nick) &&
!nick.equals(event.getUser().getNick())) {
+ presentJonDevs.append(nick).append(' ');
+ }
+ }
+ bot.sendMessage(event.getChannel(), presentJonDevs + ": see message from
" + event.getUser().getNick()
+ + " above");
+ }
+ }
+
+ @Override
+ public void onPrivateMessage(PrivateMessageEvent<RhqIrcBot>
privateMessageEvent) throws Exception {
+ PircBotX bot = privateMessageEvent.getBot();
+ String message = privateMessageEvent.getMessage();
+ Matcher echoMatcher = ECHO_PATTERN.matcher(message);
+ if (echoMatcher.matches()) {
+ String echoMessage = echoMatcher.group(1);
+ bot.sendMessage(this.channel, echoMessage);
+ } else if (message.equalsIgnoreCase(Command.PREFIX + "listrenames")) {
+ //Generate a list of renames in the form of old1 changed to new1, old2
changed to new2, etc
+ StringBuilder users = new StringBuilder();
+ for (Map.Entry<String, String> curUser : names.entrySet()) {
+ users.append(curUser.getKey()).append(" changed to
").append(curUser.getValue()).append(", ");
+ }
+ String usersString = users.substring(0, users.length() - 3);
+ privateMessageEvent.respond("Renamed users: " + usersString);
+ } else {
+ boolean isCommand = false;
+ // react to commands included in the messages
+ Matcher commandMatcher = commandPattern.matcher(message);
+ while (commandMatcher.find()) {
+ Command command =
Command.valueOf(commandMatcher.group(1).toUpperCase());
+ String response = prepareResponseForCommand(command);
+ bot.sendMessage(privateMessageEvent.getUser(), response);
+ }
+ if (!isCommand) {
+ bot.sendMessage(privateMessageEvent.getUser(), "Hi, I am " +
bot.getFinger() + ".\n"
+ + prepareResponseForCommand(Command.HELP));
+ }
+ }
+ }
+
+ @Override
+ public void onDisconnect(DisconnectEvent<RhqIrcBot> disconnectEvent) throws
Exception {
+ boolean connected = false;
+ while (!connected) {
+ Thread.sleep(60 * 1000L); // 1 minute
+ try {
+ PircBotX newBot = new RhqIrcBot(this);
+ newBot.connect(this.server);
+ newBot.joinChannel(this.channel);
+
+ connected = true;
+ } catch (Exception e) {
+ System.err.println("Failed to reconnect to " +
disconnectEvent.getBot().getServer() + " IRC server: "
+ + e);
+ }
+ }
+
+ // Try to clean up the old bot, so it can release any memory, sockets, etc.
it's using.
+ PircBotX oldBot = disconnectEvent.getBot();
+ Set<Listener> oldListeners = new
HashSet<Listener>(oldBot.getListenerManager().getListeners());
+ for (Listener oldListener : oldListeners) {
+ oldBot.getListenerManager().removeListener(oldListener);
+ }
+ }
+
+ @Override
+ public void onNickChange(NickChangeEvent<RhqIrcBot> event) throws Exception {
+ //Store the result
+ names.put(event.getOldNick(), event.getNewNick());
+ }
+
+ private String prepareResponseForCommand(Command command) {
+ if (command.staticRespond != null) {
+ String response = command.staticRespond;
+ if (command == Command.HELP) {
+ for (Command com : Command.values()) {
+ if (com.includeInHelp) {
+ response += Command.PREFIX + com.toString().toLowerCase() +
" ";
+ }
+ }
+ }
+ return response;
+ }
+ switch (command) {
+ case SUPPORT:
+ return whoIsOnSupport(SUPPORT_LINK);
+ case PTO:
+ return whoIsOnPto(PTO_LINK);
+ default:
+ System.err.println("Unknown command:" + command);
+ break;
+ }
+ return null;
+ }
+
+ private String whoIsOnSupport(String link) {
+ if (docspaceLogin == null || docspaceLogin.isEmpty() || docspacePassword == null
|| docspacePassword.isEmpty()) {
+ return "This command is not supported.";
+ }
+ String month = monthFormat.format(new Date());
+ String dayInMonth = dayInMonthFormat.format(new Date());
+ int dayInMonthInt = Integer.parseInt(dayInMonth);
+ try {
+ boolean monthFound = false;
+ String login = docspaceLogin + ":" + docspacePassword;
+ String base64login = new String(Base64.encodeBase64(login.getBytes()));
+ Document doc = Jsoup.connect(link).header("Authorization",
"Basic " + base64login).get();
+ Elements cells = doc.select("tr td");
+ for (Element cell : cells) {
+ String cellText = cell.text().toLowerCase();
+ if (cellText.startsWith(month.toLowerCase())) {
+ monthFound = true;
+ if (cellText.substring(cellText.length() - 1,
cellText.length()).equals(dayInMonth)) {
+ return cell.firstElementSibling().text() + " is on support
this week";
+ }
+ continue;
+ }
+ if (monthFound && cellText.equals(dayInMonth)) {
+ return cell.firstElementSibling().text() + " is on support this
week";
+ } else if (monthFound) {
+ if (cell.equals(cell.firstElementSibling()) ||
cell.equals(cell.lastElementSibling())) {
+ continue; //the first row with name or the last row with a
comment
+ }
+ int day = -1;
+ try {
+ day = Integer.parseInt(cellText);
+ if (day > dayInMonthInt) {
+ return cell.parent().previousElementSibling().child(0).text()
+ " is on support this week";
+ }
+ } catch (NumberFormatException nfe) {
+ break; // next month
+ }
+ }
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ // fallback solution if SSL is not set correctly
+ String randomDevel = JON_DEVS.toArray(new String[JON_DEVS.size()])[new
Random().nextInt(JON_DEVS.size())];
+ return "404 Developer Not Found, selecting randomly " + randomDevel +
". Check the " + SUPPORT_LINK;
+ }
+
+ private static String whoIsOnPto(String link) {
+ String month = monthFormat.format(new Date());
+ String dayInMonth = dayInMonthFormat.format(new Date());
+ try {
+ String onPto = "";
+ Document doc = Jsoup.connect(link).ignoreContentType(true).get();
+ Elements dates = doc.getElementsContainingOwnText(dayInMonth + " "
+ month);
+ for (Element date : dates) {
+ onPto += date.firstElementSibling().text() + ", ";
+ }
+ if (!onPto.isEmpty()) {
+ return onPto.substring(0, onPto.length() - 2);
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return "noone is on PTO today";
+ }
+
+ public void setDocspaceLogin(String docspaceLogin) {
+ this.docspaceLogin = docspaceLogin;
+ }
+
+ public void setDocspacePassword(String docspacePassword) {
+ this.docspacePassword = docspacePassword;
+ }
+}
diff --git a/etc/rhq-ircBot/src/main/resources/org/rhq/etc/ircbot/cacerts.jks
b/etc/rhq-ircBot/src/main/resources/org/rhq/etc/ircbot/cacerts.jks
new file mode 100644
index 0000000..3d73cbc
Binary files /dev/null and
b/etc/rhq-ircBot/src/main/resources/org/rhq/etc/ircbot/cacerts.jks differ
diff --git a/etc/rhq-ircBot/src/main/resources/org/rhq/etc/ircbot/rhq-ircbot.properties
b/etc/rhq-ircBot/src/main/resources/org/rhq/etc/ircbot/rhq-ircbot.properties
new file mode 100644
index 0000000..25e325c
--- /dev/null
+++ b/etc/rhq-ircBot/src/main/resources/org/rhq/etc/ircbot/rhq-ircbot.properties
@@ -0,0 +1,2 @@
+docspace_login=
+docspace_password=
commit 6742d1fda892047e45a0b5cffe9df42957318a54
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed May 22 14:12:32 2013 +0200
Enable paging on (some) endpoints that return lists
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
index 0038099..8e4a826 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
@@ -59,6 +59,8 @@ import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.group.GroupCategory;
import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.core.domain.util.PageControl;
+import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.server.resource.ResourceManagerLocal;
import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal;
import org.rhq.enterprise.server.rest.domain.GroupRest;
@@ -419,6 +421,53 @@ public class AbstractRestBean {
}
/**
+ * Create the paging headers for collections and attach them to the passed builder.
Those are represented as
+ * <i>Link:</i> http headers that carry the URL for the pages and the
respective relation.
+ * <br/>In addition a <i>X-total-size</i> header is created that
contains the whole collection size.
+ * @param builder The ResponseBuilder that receives the headers
+ * @param uriInfo The uriInfo of the incoming request to build the urls
+ * @param resultList The collection with its paging information
+ */
+ protected void createPagingHeader(final Response.ResponseBuilder builder, final
UriInfo uriInfo, final PageList<?> resultList) {
+
+ UriBuilder uriBuilder;
+
+ PageControl pc = resultList.getPageControl();
+ int page = pc.getPageNumber();
+
+ if (resultList.getTotalSize()> (pc.getPageNumber() +1 ) * pc.getPageSize()) {
+ int nextPage = page+1;
+ uriBuilder = uriInfo.getRequestUriBuilder(); // adds ?q, ?ps and ?category if
needed
+ uriBuilder.replaceQueryParam("page",nextPage);
+
+ builder.header("Link",new
Link("next",uriBuilder.build().toString()));
+ }
+
+ if (page>0) {
+ int prevPage = page -1;
+ uriBuilder = uriInfo.getRequestUriBuilder(); // adds ?q, ?ps and ?category if
needed
+ uriBuilder.replaceQueryParam("page",prevPage);
+ builder.header("Link", new
Link("prev",uriBuilder.build().toString()));
+ }
+
+ // A link to the last page
+ if (!pc.isUnlimited()) {
+ int lastPage = resultList.getTotalSize() / pc.getPageSize();
+ uriBuilder = uriInfo.getRequestUriBuilder(); // adds ?q, ?ps and ?category if
needed
+ uriBuilder.replaceQueryParam("page",lastPage);
+ builder.header("Link", new
Link("last",uriBuilder.build().toString()));
+ }
+
+ // A link to the current page
+ uriBuilder = uriInfo.getRequestUriBuilder(); // adds ?q, ?ps and ?category if
needed
+ builder.header("Link", new
Link("current",uriBuilder.build().toString()));
+
+
+ // Create a total size header
+ builder.header("X-collection-size",resultList.getTotalSize());
+ }
+
+ /**
* Fetch the group with the passed id
*
* @param groupId id of the resource group
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java
index d203cd3..6ea3d03 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java
@@ -77,6 +77,7 @@ import org.rhq.core.domain.criteria.AlertDefinitionCriteria;
import org.rhq.core.domain.measurement.MeasurementDefinition;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.alert.AlertConditionManagerLocal;
import org.rhq.enterprise.server.alert.AlertDefinitionManagerLocal;
@@ -143,21 +144,31 @@ public class AlertDefinitionHandlerBean extends AbstractRestBean {
@GZIP
@GET
@Path("/definitions")
- @ApiOperation("List all Alert Definition")
- public List<AlertDefinitionRest> listAlertDefinitions(
- @ApiParam(value = "Page number", defaultValue = "0")
@QueryParam("page") int page,
- @ApiParam(value = "Limit to status, UNUSED AT THE MOMENT ")
@QueryParam("status") String status,
+ @ApiOperation(value = "List all Alert Definition", responseClass =
"AlertDefinitionRest", multiValueResponse = true)
+ public Response listAlertDefinitions(
+ @ApiParam(value = "Page number") @QueryParam("page")
Integer page,
+ @ApiParam(value = "Page size") @DefaultValue("20")
@QueryParam("ps") int pageSize,
+ @ApiParam(value = "Limit to status, UNUSED AT THE MOMENT ")
@QueryParam("status") String status, // TODO
@Context UriInfo uriInfo) {
AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();
- criteria.setPaging(page,20); // TODO add link to next page
- List<AlertDefinition> defs =
alertDefinitionManager.findAlertDefinitionsByCriteria(caller, criteria);
+ if (page!=null) {
+ criteria.setPaging(page,pageSize);
+ }
+
+ PageList<AlertDefinition> defs =
alertDefinitionManager.findAlertDefinitionsByCriteria(caller, criteria);
List<AlertDefinitionRest> ret = new
ArrayList<AlertDefinitionRest>(defs.size());
for (AlertDefinition def : defs) {
AlertDefinitionRest adr = definitionToDomain(def, false, uriInfo);
ret.add(adr);
}
- return ret;
+
+ Response.ResponseBuilder builder = Response.ok(ret);
+ createPagingHeader(builder,uriInfo,defs);
+
+ // TODO media type etc
+
+ return builder.build();
}
@GET
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerBean.java
index 4c80bd1..5da3fb9 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerBean.java
@@ -90,10 +90,10 @@ public class AlertHandlerBean extends AbstractRestBean {
@ApiErrors({
@ApiError(code = 406, reason = "There are 'resourceId' and
'definitionId' passed as query parameters"),
@ApiError(code = 406, reason = "Page size was 0"),
- @ApiError(code = 406, reason = "Page number was < 1")
+ @ApiError(code = 406, reason = "Page number was < 0")
})
public Response listAlerts(
- @ApiParam(value = "Page number") @QueryParam("page")
@DefaultValue("1") int page,
+ @ApiParam(value = "Page number") @QueryParam("page")
@DefaultValue("0") int page,
@ApiParam(value = "Page size; use -1 for 'unlimited'")
@QueryParam("size") @DefaultValue("100")int size,
@ApiParam(value = "Limit to priority", allowableValues = "High,
Medium, Low, All") @DefaultValue("All") @QueryParam("prio")
String prio,
@ApiParam(value = "Should full resources and definitions be sent")
@QueryParam("slim") @DefaultValue("false") boolean slim,
@@ -108,7 +108,7 @@ public class AlertHandlerBean extends AbstractRestBean {
if (size==0) {
throw new BadArgumentException("size","Must not be 0");
}
- if (page<1) {
+ if (page<0) {
throw new BadArgumentException("page","Must be >=1");
}
@@ -120,7 +120,7 @@ public class AlertHandlerBean extends AbstractRestBean {
criteria.setPageControl(pageControl);
}
else {
- criteria.setPaging(page-1, size); // TODO implement linking to next page
+ criteria.setPaging(page, size);
}
if (since!=null) {
@@ -157,6 +157,8 @@ public class AlertHandlerBean extends AbstractRestBean {
builder = Response.ok(entity);
}
+ createPagingHeader(builder,uriInfo,alerts);
+
return builder.build();
}
@@ -306,7 +308,7 @@ public class AlertHandlerBean extends AbstractRestBean {
@DELETE
@Path("/{id}")
- @ApiOperation(value = "Remove the alert from the lit of alerts")
+ @ApiOperation(value = "Remove the alert from the list of alerts")
public void purgeAlert(@ApiParam(value = "Id of the alert to remove")
@PathParam("id") int id) {
alertManager.deleteAlerts(caller, new int[]{id});
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/EventHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/EventHandlerBean.java
index becb680..7402550 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/EventHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/EventHandlerBean.java
@@ -32,6 +32,7 @@ import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import javax.ws.rs.DELETE;
+import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
@@ -44,6 +45,7 @@ import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Request;
import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiError;
@@ -61,6 +63,7 @@ import org.rhq.core.domain.event.EventSource;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.util.PageControl;
+import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.event.EventManagerLocal;
import org.rhq.enterprise.server.rest.domain.EventDefinitionRest;
@@ -227,9 +230,19 @@ public class EventHandlerBean extends AbstractRestBean {
@QueryParam("endTime") long endTime,
@ApiParam(value="Select the severity to
display. Default is to show all",
allowableValues =
"DEBUG, INFO, WARN, ERROR, FATAL") @QueryParam("severity") String
severity,
- @Context Request request,
+ @ApiParam("Page size for paging")
@QueryParam("ps") @DefaultValue("20") int pageSize,
+ @ApiParam("Page for paging, 0-based")
@QueryParam("page") Integer page,
+ @Context UriInfo uriInfo,
@Context HttpHeaders headers) {
+ if (severity!=null) {
+ try {
+ EventSeverity.valueOf(severity.toUpperCase());
+ } catch (Exception e) {
+ throw new BadArgumentException("severity",severity + " is
bad. Allowed values are DEBUG, INFO, WARN, ERROR, FATAL");
+ }
+ }
+
EventSource source = findEventSourceById(sourceId);
EventCriteria criteria = new EventCriteria();
@@ -240,13 +253,19 @@ public class EventHandlerBean extends AbstractRestBean {
if (endTime>0) {
criteria.addFilterEndTime(endTime);
}
- if (startTime==0 && endTime==0) {
+ if (page!=null) {
+ criteria.setPaging(page,pageSize);
+ }
+ else if (startTime==0 && endTime==0) {
PageControl pageControl = new PageControl();
pageControl.setPageSize(200);
criteria.setPageControl(pageControl);
}
+ if (severity!=null) {
+ criteria.addFilterSeverities(EventSeverity.valueOf(severity.toUpperCase()));
+ }
- Response.ResponseBuilder builder = getEventsAsBuilderForCriteria(headers,
criteria);
+ Response.ResponseBuilder builder = getEventsAsBuilderForCriteria(headers,
criteria, uriInfo);
return builder.build();
}
@@ -259,10 +278,21 @@ public class EventHandlerBean extends AbstractRestBean {
public Response getEventsForResource(@PathParam("id") int resourceId,
@QueryParam("startTime") long
startTime,
@QueryParam("endTime") long endTime,
- @QueryParam("severity") String
severity,
- @Context Request request,
+ @ApiParam("Page size for paging")
@QueryParam("ps") @DefaultValue("20") int pageSize,
+ @ApiParam("Page for paging, 0-based")
@QueryParam("page") Integer page,
+ @ApiParam(value="Select the severity to
display. Default is to show all",
+ allowableValues
= "DEBUG, INFO, WARN, ERROR, FATAL") @QueryParam("severity") String
severity,
+ @Context UriInfo uriInfo,
@Context HttpHeaders headers) {
+ if (severity!=null) {
+ try {
+ EventSeverity.valueOf(severity.toUpperCase());
+ } catch (Exception e) {
+ throw new BadArgumentException("severity",severity + " is
bad. Allowed values are DEBUG, INFO, WARN, ERROR, FATAL");
+ }
+ }
+
EventCriteria criteria = new EventCriteria();
criteria.addFilterResourceId(resourceId);
if (startTime>0) {
@@ -271,13 +301,19 @@ public class EventHandlerBean extends AbstractRestBean {
if (endTime>0) {
criteria.addFilterEndTime(endTime);
}
- if (startTime==0 && endTime==0) {
+ if (page!=null) {
+ criteria.setPaging(page,pageSize);
+ }
+ else if (startTime==0 && endTime==0) {
PageControl pageControl = new PageControl();
pageControl.setPageSize(200);
criteria.setPageControl(pageControl);
}
+ if (severity!=null) {
+ criteria.addFilterSeverities(EventSeverity.valueOf(severity.toUpperCase()));
+ }
- Response.ResponseBuilder builder = getEventsAsBuilderForCriteria(headers,
criteria);
+ Response.ResponseBuilder builder = getEventsAsBuilderForCriteria(headers,
criteria, uriInfo);
return builder.build();
@@ -304,8 +340,8 @@ public class EventHandlerBean extends AbstractRestBean {
}
- private Response.ResponseBuilder getEventsAsBuilderForCriteria(HttpHeaders headers,
EventCriteria criteria) {
- List<Event> eventList = eventManager.findEventsByCriteria(caller,
criteria);
+ private Response.ResponseBuilder getEventsAsBuilderForCriteria(HttpHeaders headers,
EventCriteria criteria, UriInfo uriInfo) {
+ PageList<Event> eventList = eventManager.findEventsByCriteria(caller,
criteria);
List<EventRest> restEvents = new
ArrayList<EventRest>(eventList.size());
for (Event event : eventList) {
restEvents.add(convertEvent(event));
@@ -320,6 +356,9 @@ public class EventHandlerBean extends AbstractRestBean {
else {
builder = Response.ok(restEvents, mediaType);
}
+
+ createPagingHeader(builder,uriInfo,eventList);
+
return builder;
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/GroupHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/GroupHandlerBean.java
index 6791bdf..be2419b 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/GroupHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/GroupHandlerBean.java
@@ -116,12 +116,17 @@ public class GroupHandlerBean extends AbstractRestBean {
@Path("/")
@ApiOperation(value = "List all groups", multiValueResponse = true,
responseClass = "GroupRest")
public Response getGroups(@ApiParam("String to search in the group name")
@QueryParam("q") String q,
+ @ApiParam("Page size for paging")
@QueryParam("ps") @DefaultValue("20") int pageSize,
+ @ApiParam("Page for paging, 0-based")
@QueryParam("page") Integer page,
@Context HttpHeaders headers, @Context UriInfo uriInfo) {
ResourceGroupCriteria criteria = new ResourceGroupCriteria();
if (q!=null) {
criteria.addFilterName(q);
}
+ if (page!=null) {
+ criteria.setPaging(page,pageSize);
+ }
PageList<ResourceGroup> groups =
resourceGroupManager.findResourceGroupsByCriteria(caller, criteria);
@@ -142,6 +147,8 @@ public class GroupHandlerBean extends AbstractRestBean {
builder.entity(ret);
}
+ createPagingHeader(builder,uriInfo,groups);
+
return builder.build();
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
index 8bc2cb9..e32ea03 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
@@ -29,6 +29,7 @@ import javax.ejb.Stateless;
import javax.interceptor.Interceptors;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
+import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
@@ -353,7 +354,6 @@ public class OperationsHandlerBean extends AbstractRestBean {
public Response outcome(
@ApiParam("Name of the submitted job.") @PathParam("id")
String jobName,
@Context UriInfo uriInfo,
- @Context Request request,
@Context HttpHeaders httpHeaders) {
MediaType mediaType = httpHeaders.getAcceptableMediaTypes().get(0);
@@ -395,21 +395,26 @@ public class OperationsHandlerBean extends AbstractRestBean {
@Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML,MediaType.TEXT_HTML})
public Response listHistory(
@ApiParam("Id of a resource to limit to")
@QueryParam("resourceId") int resourceId,
+ @ApiParam("Page size for paging") @QueryParam("ps")
@DefaultValue("20") int pageSize,
+ @ApiParam("Page for paging, 0-based") @QueryParam("page")
Integer page,
@Context UriInfo uriInfo,
- @Context Request request,
@Context HttpHeaders httpHeaders) {
ResourceOperationHistoryCriteria criteria = new
ResourceOperationHistoryCriteria();
if (resourceId>0) {
criteria.addFilterResourceIds(resourceId);
}
+ if (page!=null) {
+ criteria.setPaging(page,pageSize);
+ criteria.addSortStartTime(PageOrdering.ASC);
+ }
criteria.addSortEndTime(PageOrdering.DESC);
- PageList<ResourceOperationHistory> list =
opsManager.findResourceOperationHistoriesByCriteria(caller, criteria);
+ PageList<ResourceOperationHistory> histories =
opsManager.findResourceOperationHistoriesByCriteria(caller, criteria);
List<OperationHistoryRest> result = new
ArrayList<OperationHistoryRest>();
- for (ResourceOperationHistory roh : list) {
+ for (ResourceOperationHistory roh : histories) {
OperationHistoryRest historyRest = historyToHistoryRest(roh,uriInfo);
result.add(historyRest);
}
@@ -422,6 +427,9 @@ public class OperationsHandlerBean extends AbstractRestBean {
GenericEntity<List<OperationHistoryRest>> res = new
GenericEntity<List<OperationHistoryRest>>(result) {};
builder = Response.ok(res);
}
+
+ createPagingHeader(builder,uriInfo,histories);
+
return builder.build();
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
index 70cc588..a783ac8 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
@@ -211,7 +211,7 @@ public class ResourceHandlerBean extends AbstractRestBean {
}
PageList<Resource> ret = resMgr.findResourcesByCriteria(caller,criteria);
- Response.ResponseBuilder builder =
getResponseBuilderForResourceList(headers,uriInfo,ret, page, pageSize);
+ Response.ResponseBuilder builder =
getResponseBuilderForResourceList(headers,uriInfo,ret);
return builder.build();
}
@@ -221,13 +221,22 @@ public class ResourceHandlerBean extends AbstractRestBean {
@Path("/platforms")
@Cache(isPrivate = true,maxAge = 300)
@ApiOperation(value = "List all platforms in the system",
multiValueResponse = true, responseClass = "ResourceWithType")
- public Response getPlatforms(@Context HttpHeaders headers,
- @Context UriInfo uriInfo) {
+ public Response getPlatforms(
+ @ApiParam("Page size for paging") @QueryParam("ps")
@DefaultValue("20") int pageSize,
+ @ApiParam("Page for paging, 0-based") @QueryParam("page")
Integer page,
+ @Context HttpHeaders headers, @Context UriInfo uriInfo) {
+
+ PageControl pc;
+ if (page!=null) {
+ pc = new PageControl(page,pageSize);
+ }
+ else {
+ pc = PageControl.getUnlimitedInstance();
+ }
- PageControl pc = new PageControl();
PageList<Resource> ret = resMgr.findResourcesByCategory(caller,
ResourceCategory.PLATFORM,
InventoryStatus.COMMITTED, pc);
- Response.ResponseBuilder builder = getResponseBuilderForResourceList(headers,
uriInfo, ret, null, 20);
+ Response.ResponseBuilder builder = getResponseBuilderForResourceList(headers,
uriInfo, ret);
return builder.build();
}
@@ -239,13 +248,10 @@ public class ResourceHandlerBean extends AbstractRestBean {
* @param headers HttpHeaders from the request
* @param uriInfo Uri from the request
* @param resources List of resources
- * @param page Page of pageSize. If null, paging is ignored
- * @param pageSize number of elements on a page
* @return An initialized ResponseBuilder
*/
private Response.ResponseBuilder getResponseBuilderForResourceList(HttpHeaders
headers, UriInfo uriInfo,
-
PageList<Resource> resources, Integer page,
- int pageSize) {
+
PageList<Resource> resources) {
List<ResourceWithType> rwtList = new
ArrayList<ResourceWithType>(resources.size());
for (Resource r : resources) {
putToCache(r.getId(), Resource.class, r);
@@ -256,25 +262,8 @@ public class ResourceHandlerBean extends AbstractRestBean {
MediaType mediaType = headers.getAcceptableMediaTypes().get(0);
Response.ResponseBuilder builder = Response.ok();
builder.type(mediaType);
- UriBuilder uriBuilder;
- if (page!=null) {
- // TODO look a the page control and check if there is a next page at all
- if (resources.getTotalSize()> page*pageSize) {
- int nextPage = page+1;
- uriBuilder = uriInfo.getRequestUriBuilder(); // adds ?q, ?ps and
?category if needed
- uriBuilder.replaceQueryParam("page",nextPage);
-
- builder.header("Link",new
Link("next",uriBuilder.build().toString()));
- }
-
- if (page>1) {
- int prevPage = page -1;
- uriBuilder = uriInfo.getRequestUriBuilder(); // adds ?q, ?ps and
?category if needed
- uriBuilder.replaceQueryParam("page",prevPage);
- builder.header("prev",uriBuilder.build().toString());
- }
- }
+ createPagingHeader(builder,uriInfo,resources);
if (mediaType.equals(MediaType.TEXT_HTML_TYPE)) {
builder.entity(renderTemplate("listResourceWithType", rwtList));
@@ -294,7 +283,7 @@ public class ResourceHandlerBean extends AbstractRestBean {
@ApiError(code = 404, reason = NO_RESOURCE_FOR_ID)
public ResourceWithChildren getHierarchy(@ApiParam("Id of the resource to start
with") @PathParam("id")int baseResourceId) {
// TODO optimize to do less recursion
- Resource start = obtainResource(baseResourceId);
+ Resource start = fetchResource(baseResourceId);
return getHierarchy(start);
}
@@ -425,7 +414,7 @@ public class ResourceHandlerBean extends AbstractRestBean {
if (avail.getResourceId() != resourceId)
throw new IllegalArgumentException("Resource Ids do not match");
- Resource resource = obtainResource(resourceId);
+ Resource resource = fetchResource(resourceId);
AvailabilityType at;
at = AvailabilityType.valueOf(avail.getType());
@@ -541,15 +530,6 @@ public class ResourceHandlerBean extends AbstractRestBean {
}
- private Resource obtainResource(int resourceId) {
- Resource resource = resMgr.getResource(caller, resourceId);
- if (resource == null) {
- resource = resMgr.getResource(caller, resourceId);
- if (resource != null)
- putToCache(resourceId, Resource.class, resource);
- }
- return resource;
- }
@GZIP
@AddLinks
@@ -565,7 +545,7 @@ public class ResourceHandlerBean extends AbstractRestBean {
criteria.addFilterResourceIds(resourceId);
- List<Alert> alerts = alertManager.findAlertsByCriteria(caller, criteria);
+ PageList<Alert> alerts = alertManager.findAlertsByCriteria(caller,
criteria);
List<Link> links = new ArrayList<Link>(alerts.size());
for (Alert al : alerts) {
Link link = new Link();
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationHelperTest.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationHelperTest.java
index 3a7e961..7e20630 100644
---
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationHelperTest.java
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationHelperTest.java
@@ -703,7 +703,7 @@ public class ConfigurationHelperTest {
}
- @Test(enabled = false)
+ @Test
public void testConfigToMapComplexMapWithBadSetupLenient() throws Exception {
Configuration config = new Configuration();
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java
index fca0f50..e02a723 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java
@@ -23,6 +23,7 @@ import com.jayway.restassured.http.ContentType;
import com.jayway.restassured.path.xml.XmlPath;
import com.jayway.restassured.response.Response;
+import org.hamcrest.Matchers;
import org.junit.Test;
import org.rhq.modules.integrationTests.restApi.d.AlertCondition;
@@ -34,7 +35,10 @@ import org.rhq.modules.integrationTests.restApi.d.Group;
import static com.jayway.restassured.RestAssured.delete;
import static com.jayway.restassured.RestAssured.expect;
import static com.jayway.restassured.RestAssured.given;
+import static org.hamcrest.CoreMatchers.anyOf;
+import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.emptyIterable;
import static org.hamcrest.Matchers.instanceOf;
@@ -54,6 +58,7 @@ public class AlertTest extends AbstractBase {
.header(acceptJson)
.expect()
.statusCode(200)
+ .log().ifError()
.when()
.get("/alert");
@@ -66,6 +71,7 @@ public class AlertTest extends AbstractBase {
.header(acceptXml)
.expect()
.statusCode(200)
+ .log().ifError()
.when()
.get("/alert");
}
@@ -95,6 +101,23 @@ public class AlertTest extends AbstractBase {
}
@Test
+ public void testListAlertsWithPaging() throws Exception {
+
+ given()
+ .header(acceptJson)
+ .queryParam("ps", 2)
+ .queryParam("page", 0)
+ .expect()
+ .statusCode(200)
+ .header("Link", anyOf(containsString("current"),
Matchers.containsString("last")))
+ .header("X-collection-size", notNullValue())
+ .log().ifError()
+ .when()
+ .get("/alert");
+ }
+
+
+ @Test
public void testGetAlertCountJson() throws Exception {
given()
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/EventTest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/EventTest.java
index 2e74181..40ae7b0 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/EventTest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/EventTest.java
@@ -23,13 +23,17 @@ import java.util.List;
import java.util.Map;
import com.jayway.restassured.http.ContentType;
+import com.jayway.restassured.response.Headers;
import com.jayway.restassured.response.Response;
+import org.hamcrest.CoreMatchers;
import org.junit.Test;
import org.rhq.modules.integrationTests.restApi.d.Event;
import org.rhq.modules.integrationTests.restApi.d.EventSource;
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.not;
import static com.jayway.restassured.RestAssured.given;
/**
@@ -261,6 +265,131 @@ public class EventTest extends AbstractBase {
}
@Test
+ public void testAddGetEventOnSourceWithPaging() throws Exception {
+
+ EventSource es = new EventSource();
+ es.setResourceId(_platformId);
+ es.setName("Event Log"); // Name of the event definition
+ es.setLocation("-x-test-location");
+
+ Response response =
+ given()
+ .header(acceptJson)
+ .contentType(ContentType.JSON)
+ .pathParam("id",_platformId)
+ .body(es)
+ .expect()
+ .statusCode(200)
+ .log().ifError()
+ .when()
+ .post("/event/{id}/sources");
+
+ EventSource eventSource = response.as(EventSource.class);
+
+ long now = System.currentTimeMillis();
+ try {
+
+ // Add an event
+ Event event = new Event(eventSource.getId(),now,"Li la lu
1:->");
+ Event event1 = new Event(eventSource.getId(),now,"Li la lu
2:->");
+ Event event2 = new Event(eventSource.getId(),now,"Li la lu
3:->");
+ Event event3 = new Event(eventSource.getId(),now,"Li la lu
4:->");
+ List<Event> events = new ArrayList<Event>(4);
+ events.add(event);
+ events.add(event1);
+ events.add(event2);
+ events.add(event3);
+
+ given()
+ .header(acceptJson)
+ .contentType(ContentType.JSON)
+ .pathParam("id",eventSource.getId())
+ .body(events)
+ .expect()
+ .statusCode(204) // no content returned
+ .log().ifError()
+ .when()
+ .post("/event/source/{id}/events");
+
+
+ // and retrieve it again from the event source
+ response =
+ given()
+ .header(acceptJson)
+ .pathParam("id", eventSource.getId())
+ .queryParam("startTime",now - 10)
+ .queryParam("endTime",now + 10)
+ .expect()
+ .statusCode(200)
+ .log().ifError()
+ .header("X-collection-size", CoreMatchers.is("4"))
+ .when()
+ .get("/event/source/{id}/events");
+ List list = response.as(List.class);
+ assert list.size()>0;
+
+ // Get the list of events from the resource
+ response =
+ given()
+ .header(acceptJson)
+ .pathParam("id", _platformId)
+ .queryParam("startTime",now - 10)
+ .queryParam("endTime",now + 10)
+ .queryParam("page",0)
+ .queryParam("ps",2)
+ .expect()
+ .statusCode(200)
+ .log().ifError()
+ .header("X-collection-size", CoreMatchers.is("4"))
+ .header("Link",not(containsString("prev")))
+ .when()
+ .get("/event/{id}/events");
+ list = response.as(List.class);
+ assert list.size()==2;
+
+ response =
+ given()
+ .header(acceptJson)
+ .pathParam("id", _platformId)
+ .queryParam("startTime",now - 10)
+ .queryParam("endTime",now + 10)
+ .queryParam("page",1)
+ .queryParam("ps",2)
+ .expect()
+ .statusCode(200)
+ .log().ifError()
+ .header("X-collection-size", CoreMatchers.is("4"))
+ .header("Link",not(containsString("next")))
+ .when()
+ .get("/event/{id}/events");
+
+ Headers headers = response.getHeaders();
+ int found = 0;
+ for (String link: headers.getValues("Link")) {
+ if (link.contains("rel='last'"))
+ found++;
+ if (link.contains("rel='prev'"))
+ found++;
+ if (link.contains("rel='current'"))
+ found++;
+ assert !link.contains("rel='next");
+ }
+ assert found == 3;
+
+ }
+ finally {
+
+ // Delete the source again
+ given()
+ .pathParam("id", eventSource.getId())
+ .expect()
+ .statusCode(204)
+ .when()
+ .delete("/event/source/{id}");
+ }
+ }
+
+ @Test
public void testDeleteUnknownSource() throws Exception {
given()
.pathParam("id", 123)
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/GroupTest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/GroupTest.java
index 05bae96..a4ef048 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/GroupTest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/GroupTest.java
@@ -74,6 +74,17 @@ public class GroupTest extends AbstractBase {
}
@Test
+ public void testGetGroupsWithPaging() throws Exception {
+ given()
+ .queryParam("page",0)
+ .queryParam("ps",2)
+ .expect()
+ .statusCode(200)
+ .when()
+ .get("/group");
+ }
+
+ @Test
public void testGetGroupsQuery() throws Exception {
given()
.queryParam("q","lala")
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
index 23480a0..b66d9b5 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
@@ -44,6 +44,8 @@ import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.Matchers.anyOf;
+import static org.hamcrest.Matchers.not;
/**
* Test the resources part
@@ -242,7 +244,7 @@ public class ResourcesTest extends AbstractBase {
}
@Test
- public void testPaging() throws Exception {
+ public void testGetResourcesWithPaging() throws Exception {
given()
.header("Accept", "application/json")
@@ -252,12 +254,31 @@ public class ResourcesTest extends AbstractBase {
.queryParam("category", "service")
.expect()
.statusCode(200)
- .header("Link", containsString("page=2"))
+ .log().everything()
+ // .header("Link", allOf(containsString("page=2"),
containsString("current")))
+ .header("Link",not(containsString("prev")))
.body("links.self", notNullValue())
.when().get("/resource");
}
@Test
+ public void testGetPlatformsWithPaging() throws Exception {
+
+ given()
+ .header("Accept", "application/json")
+ .with()
+ .queryParam("page", 0)
+ .queryParam("ps", 5)
+ .expect()
+ .statusCode(200)
+ .log().ifError()
+ .body("links.self", notNullValue())
+ .header("Link", not(containsString("prev=")))
+ .header("Link",
anyOf(containsString("current"),containsString("last")))
+ .when().get("/resource/platforms");
+ }
+
+ @Test
public void testGetPlatformXml() {
assert _platformId!=0 : "Setup did not run or was no success";
commit e5d22cac1559f8f2dc699d3ebe3f54d0abf74a1a
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue May 21 22:10:26 2013 +0200
BZ 962853 - make getRresourceId return an int instead of a string.
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/ResourceWithType.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/ResourceWithType.java
index 703e897..8273737 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/ResourceWithType.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/ResourceWithType.java
@@ -25,19 +25,11 @@ package org.rhq.enterprise.server.rest.domain;
import java.util.ArrayList;
import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementRef;
-import javax.xml.bind.annotation.XmlID;
import javax.xml.bind.annotation.XmlRootElement;
import com.wordnik.swagger.annotations.ApiClass;
import com.wordnik.swagger.annotations.ApiProperty;
-import org.jboss.resteasy.spi.touri.URITemplate;
-
/**
* A (partial) resource with some type information
* @author Heiko W. Rupp
@@ -69,7 +61,6 @@ public class ResourceWithType {
}
@ApiProperty("Name of the resource")
- @XmlElement
public String getResourceName() {
return resourceName;
}
@@ -79,17 +70,15 @@ public class ResourceWithType {
}
@ApiProperty("ID of the resource")
- @XmlID
- public String getResourceId() {
- return String.valueOf(resourceId);
+ public int getResourceId() {
+ return resourceId;
}
public void setResourceId(int resourceId) {
this.resourceId = resourceId;
}
- @ApiProperty("Name of the resource type of teh resource")
- @XmlElement
+ @ApiProperty("Name of the resource type of the resource")
public String getTypeName() {
return typeName;
}
@@ -99,7 +88,6 @@ public class ResourceWithType {
}
@ApiProperty("Id of the resource type of the resource")
- @XmlElement
public Integer getTypeId() {
return typeId;
}
@@ -109,7 +97,6 @@ public class ResourceWithType {
}
@ApiProperty("Name of the plugin defining the resource type")
- @XmlElement
public String getPluginName() {
return pluginName;
}
@@ -136,7 +123,6 @@ public class ResourceWithType {
this.status = status;
}
- @XmlElementRef
public List<Link> getLinks() {
return links;
}
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AbstractBase.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AbstractBase.java
index 9f6a02b..ae4e81d 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AbstractBase.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AbstractBase.java
@@ -98,8 +98,7 @@ public abstract class AbstractBase {
if (res!=null && res.get(0)!=null) {
- String tmp = ((Map
<String,String>)res.get(0)).get("resourceId");
- int pid =Integer.valueOf(tmp);
+ Integer pid = ((Map
<String,Integer>)res.get(0)).get("resourceId");
given()
.pathParam("id", pid)
@@ -125,9 +124,9 @@ public abstract class AbstractBase {
assert res != null;
for (Object entry : res) {
if (entry instanceof Map) {
- Map<String,String> map = (Map<String, String>) entry;
+ Map<String,Object> map = (Map<String, Object>) entry;
if (!map.get("resourceName").equals(REST_TEST_DUMMY)) {
- return Integer.valueOf(map.get("resourceId"));
+ return (Integer)map.get("resourceId");
}
}
}
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ContentTest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ContentTest.java
index 7e3f45a..3515fac 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ContentTest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ContentTest.java
@@ -30,6 +30,7 @@ import com.jayway.restassured.response.Response;
import org.junit.Test;
import org.rhq.modules.integrationTests.restApi.d.CreateCBRRequest;
+import org.rhq.modules.integrationTests.restApi.d.Resource;
import static com.jayway.restassured.RestAssured.given;
import static org.hamcrest.Matchers.*;
@@ -41,6 +42,8 @@ import static org.hamcrest.Matchers.isOneOf;
*/
public class ContentTest extends AbstractBase {
+ private static final String DEPLOYED_WAR_NAME = "test-simple.war";
+
@Test
public void testUpload() throws Exception {
@@ -144,6 +147,8 @@ public class ContentTest extends AbstractBase {
@Test
public void testCreatePackageBasedResource() throws Exception {
+ wipeWarArchiveIfNecessary();
+
InputStream in =
getClass().getClassLoader().getResourceAsStream("test-simple.war");
@@ -187,7 +192,7 @@ public class ContentTest extends AbstractBase {
assert resources.size()>0;
- int as7Id =
Integer.valueOf((String)resources.get(0).get("resourceId"));
+ int as7Id = (Integer)resources.get(0).get("resourceId");
int createdResourceId=-1;
// create child of eap6 as deployment
@@ -203,7 +208,7 @@ public class ContentTest extends AbstractBase {
// set plugin config (path) and deploy config (runtime-name)
resource.getPluginConfig().put("path","deployment");
-
resource.getResourceConfig().put("runtimeName","test-simple.war");
+ resource.getResourceConfig().put("runtimeName",
DEPLOYED_WAR_NAME);
Response response =
given()
@@ -285,6 +290,34 @@ public class ContentTest extends AbstractBase {
}
+
+ private void wipeWarArchiveIfNecessary() {
+
+ @SuppressWarnings("unchecked")
+ List<Resource> resources =
+ given()
+ .queryParam("q",DEPLOYED_WAR_NAME)
+ .queryParam("category", "SERVICE")
+ .header(acceptJson)
+ .expect()
+ .log().everything()
+ .when()
+ .get("/resource")
+ .as(List.class);
+
+ if (resources!=null && resources.size()>0) {
+ int resourceId = resources.get(0).getResourceId();
+
+ given()
+ .pathParam("id", resourceId)
+ .queryParam("physical", "true") // Also remove target
on the EAP instance
+ .expect()
+ .statusCode(200)
+ .when()
+ .delete("/resource/{id}");
+ }
+ }
+
@Test
public void testCreateCBRBadHandle() throws Exception {
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
index cc9558b..23480a0 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
@@ -69,8 +69,11 @@ public class ResourcesTest extends AbstractBase {
.expect()
.statusCode(200)
.contentType(ContentType.JSON)
- .log().ifError()
+ .log().everything()
.body("links.self", notNullValue())
+ .body("resourceId",is(_platformId))
+ .body("typeId",is(_platformTypeId))
+ .body("parentId",is(0))
.when()
.get("/resource/{id}");
@@ -101,9 +104,9 @@ public class ResourcesTest extends AbstractBase {
.log().everything()
.expect()
.statusCode(200)
- .body("id",is(typeId))
- .body("name",is("Linux"))
- .body("pluginName",is("Platforms"))
+ .body("id", is(typeId))
+ .body("name", is("Linux"))
+ .body("pluginName", is("Platforms"))
.log().everything()
.when()
.get("/resource/type/{typeId}");
@@ -187,7 +190,7 @@ public class ResourcesTest extends AbstractBase {
given()
.header("Accept", "application/json")
.with()
- .queryParam("status","NeW")
+ .queryParam("status", "NeW")
.expect()
.statusCode(200)
.when()
@@ -203,7 +206,7 @@ public class ResourcesTest extends AbstractBase {
.header("Accept", "application/json")
.with()
.queryParam("q", platformName)
- .queryParam("status","Frobnitz")
+ .queryParam("status", "Frobnitz")
.queryParam("category", "platform")
.expect()
.statusCode(406)
@@ -322,6 +325,26 @@ public class ResourcesTest extends AbstractBase {
}
@Test
+ public void testCreatePlatformJson() throws Exception {
+
+ Resource resource = new Resource();
+ resource.setResourceName("dummy-test");
+ resource.setTypeName("Linux");
+
+ given()
+ .header(acceptJson)
+ .contentType(ContentType.JSON)
+ .body(resource)
+ .expect()
+ .statusCode(201)
+ .log().everything()
+ .body("resourceId",instanceOf(Number.class))
+ .when()
+ .post("/resource/platforms");
+
+ }
+
+ @Test
public void testCreatePlatformWithBadType() throws Exception {
Resource resource = new Resource();
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/UserTest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/UserTest.java
index ea78d09..e7e1b9e 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/UserTest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/UserTest.java
@@ -94,7 +94,7 @@ public class UserTest extends AbstractBase {
.when()
.get("/user/favorites/resource");
JsonPath jp = r.jsonPath();
- assert
jp.getList("resourceId").contains(String.valueOf(_platformId));
+ assert jp.getList("resourceId").contains(_platformId);
}
finally {
given()
@@ -131,7 +131,7 @@ public class UserTest extends AbstractBase {
.when()
.get("/user/favorites/resource");
JsonPath jp = r.jsonPath();
- assert
jp.getList("resourceId").contains(String.valueOf(_platformId));
+ assert jp.getList("resourceId").contains(_platformId);
}
finally {
given()
commit ec4f0228529bf490d44fc3be5407080f9360ef6c
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue May 21 21:45:23 2013 +0200
Print the failing class along with the failed field.
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
index d7cc470..867ea16 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
@@ -67,8 +67,8 @@ public final class CriteriaQueryGenerator {
private static final Log LOG = LogFactory.getLog(CriteriaQueryGenerator.class);
public enum AuthorizationTokenType {
- RESOURCE, // specifies the resource alias to join on for standard
res-group-role-subject authorization checking
- GROUP; // specifies the group alias to join on for standard group-role-subject
authorization checking
+ RESOURCE, // specifies the resource alias to join on for standard
res-group-role-subject authorization checking
+ GROUP; // specifies the group alias to join on for standard group-role-subject
authorization checking
}
private Criteria criteria;
@@ -333,8 +333,8 @@ public final class CriteriaQueryGenerator {
results.append("FROM ").append(className).append('
').append(alias).append(NL);
if (countQuery == false) {
- /*
- * don't fetch in the count query to avoid: "query specified join
fetching,
+ /*
+ * don't fetch in the count query to avoid: "query specified join
fetching,
* but the owner of the fetched association was not present in the select
list"
*/
for (String fetchField : getFetchFields(criteria)) {
@@ -383,7 +383,7 @@ public final class CriteriaQueryGenerator {
/*
* do not prefix the alias when:
- *
+ *
* 1) if the suffix is numerical, which allows us to sort by column
ordinal
* 2) if the user wants full control and has explicitly chosen to disable
alias prepending
*/
@@ -655,7 +655,7 @@ public final class CriteriaQueryGenerator {
} catch (RuntimeException re) {
LOG.error("Could not get JPQL translation for '" +
searchExpression + "': "
+ ThrowableUtil.getAllMessages(re, true));
- throw re; // don't wrap exceptions that are already RuntimeExceptions in
another RuntimeException
+ throw re; // don't wrap exceptions that are already RuntimeExceptions in
another RuntimeException
} catch (Exception e) {
LOG.error("Could not get JPQL translation for '" +
searchExpression + "': "
+ ThrowableUtil.getAllMessages(e, true));
@@ -694,7 +694,7 @@ public final class CriteriaQueryGenerator {
Field field = criteria.getPersistentClass().getDeclaredField(fieldName);
persistentBagFields.add(field);
} catch (NoSuchFieldException e) {
- LOG.warn("Failed to add persistent bag collection.", e);
+ LOG.warn("Failed to add persistent bag collection on class [" +
criteria.getPersistentClass().getName() +"]: ", e);
}
}
@@ -703,7 +703,7 @@ public final class CriteriaQueryGenerator {
Field field = criteria.getPersistentClass().getDeclaredField(fieldName);
joinFetchFields.add(field);
} catch (NoSuchFieldException e) {
- LOG.warn("Failed to add join fetch field.", e);
+ LOG.warn("Failed to add join fetch field on class [" +
criteria.getPersistentClass().getName() + "]: ", e);
}
}
@@ -741,7 +741,7 @@ public final class CriteriaQueryGenerator {
/**
* The groupBy clause can be set if and only if the projection is altered. The
passed argument should not be
- * prefixed with 'group by'; that part of the query will be auto-generated if
the argument is non-null. The
+ * prefixed with 'group by'; that part of the query will be auto-generated if
the argument is non-null. The
* new projection must follow standard rules as they apply to statements with groupBy
clauses.
*/
public void setGroupByClause(String groupByClause) {
@@ -753,7 +753,7 @@ public final class CriteriaQueryGenerator {
/**
* The having clause can be set if and only if the groupBy clause is set. The passed
argument should not be
- * prefixed with 'having'; that part of the query will be auto-generated if
the argument is non-null. The
+ * prefixed with 'having'; that part of the query will be auto-generated if
the argument is non-null. The
* having clause must follow standard rules as they apply to statements with groupBy
clauses.
*/
public void setHavingClause(String havingClause) {
commit 18aa1bc699a26717acfa2ba9af2ac072aafc2ce3
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue May 21 15:06:55 2013 -0400
add jboss logging to eclipse classpath
diff --git a/.classpath b/.classpath
index 53037dd..2487128 100644
--- a/.classpath
+++ b/.classpath
@@ -230,6 +230,7 @@
<classpathentry exported="true" kind="var"
path="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/taglibs/standard/1.1.2/standard-1.1.2.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/jboss/jboss-common-core/2.2.17.GA/jboss-common-core-2.2.17.GA.jar"/>
+ <classpathentry exported="true" kind="var"
path="M2_REPO/org/jboss/logging/jboss-logging/3.1.2.GA/jboss-logging-3.1.2.GA.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/javax/servlet/jstl/1.1.2/jstl-1.1.2.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/struts-menu/struts-menu/2.3/struts-menu-2.3.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/junit/junit/3.8.2/junit-3.8.2.jar"/>
commit 3ef61c1860a590b16b461b81f85b0011b2ee620d
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Mon May 20 13:36:45 2013 +0200
[BZ 958169] - Modified alert definition is not saved on confirming the save message
after clicking on 'Back to List' button - New method for creating an alert
definitions was added to SLSB, because the UI requires the ids of newly created alert
conditions.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionEditor.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionEditor.java
index b90b209..8fe6d4b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionEditor.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionEditor.java
@@ -140,7 +140,7 @@ public class ConditionEditor extends EnhancedVLayout {
private AlertCondition existingCondition;
public ConditionEditor(HashSet<AlertCondition> conditions, Map<Integer,
AlertCondition> modifiedConditions,
- SelectItem conditionExpression, ResourceType rtype, Runnable closeFunc,
AlertCondition existingCondition) {
+ SelectItem conditionExpression, ResourceType rtype, AlertCondition
existingCondition, Runnable closeFunc) {
super();
this.editMode = existingCondition != null;
this.existingCondition = existingCondition;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsEditor.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsEditor.java
index 782e4b5..8f4a36f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsEditor.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsEditor.java
@@ -196,7 +196,7 @@ public class ConditionsEditor extends EnhancedVLayout {
}
});
- table.addTableAction(MSG.common_button_edit(), null, new
AbstractTableAction(TableActionEnablement.SINGLE) {
+ table.addTableAction(MSG.view_alert_definition_editCondition(), null, new
AbstractTableAction(TableActionEnablement.SINGLE) {
public void executeAction(ListGridRecord[] selection, Object actionValue)
{
AlertCondition condition = getDataSource().copyValues(selection[0]);
showConditionEditor(condition);
@@ -252,7 +252,7 @@ public class ConditionsEditor extends EnhancedVLayout {
final int numConditions = conditions.size();
final ConditionEditor newConditionEditor = new
ConditionEditor(conditions, modifiedConditions,
ConditionsEditor.this.conditionExpression,
ConditionsEditor.this.resourceType,
- new Runnable() {
+ existingCondition, new Runnable() {
@Override
public void run() {
updated = updated || numConditions !=
conditions.size()
@@ -260,7 +260,7 @@ public class ConditionsEditor extends EnhancedVLayout {
winModal.markForDestroy();
refresh();
}
- }, existingCondition);
+ });
winModal.addItem(newConditionEditor);
winModal.show();
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java
index 2cbe8c6..d69f7f4 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java
@@ -197,15 +197,14 @@ public class ResourceAlertDefinitionsView extends
AbstractAlertDefinitionsView {
protected void commitAlertDefinition(final AlertDefinition alertDefinition, boolean
purgeInternals,
final AsyncCallback<AlertDefinition> resultReceiver) {
if (alertDefinition.getId() == 0) {
-
GWTServiceLookup.getAlertDefinitionService().createAlertDefinition(alertDefinition,
- Integer.valueOf(resource.getId()), new AsyncCallback<Integer>() {
+
GWTServiceLookup.getAlertDefinitionService().createAlertDefinitionAndReturn(alertDefinition,
+ Integer.valueOf(resource.getId()), new
AsyncCallback<AlertDefinition>() {
@Override
- public void onSuccess(Integer result) {
+ public void onSuccess(AlertDefinition result) {
CoreGUI.getMessageCenter().notify(
new Message(MSG.view_alert_definitions_create_success(),
Severity.Info));
- alertDefinition.setId(result.intValue());
ResourceAlertDefinitionsView.this.refresh();
- resultReceiver.onSuccess(alertDefinition);
+ resultReceiver.onSuccess(result);
}
@Override
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
index c86d0cd..25742f5 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
@@ -146,10 +146,7 @@ public class SingleAlertDefinitionView extends EnhancedVLayout {
cancelButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
- if (handlerRegistration != null)
- handlerRegistration.removeHandler();
- // enable the back button
- ((EnhancedVLayout)
getParentElement()).getMember("backButton").setDisabled(false);
+ unregisterHandler();
setAlertDefinition(getAlertDefinition()); // reverts data back to
original
makeViewOnly();
}
@@ -159,6 +156,15 @@ public class SingleAlertDefinitionView extends EnhancedVLayout {
addMember(tabSet);
addMember(buttons);
}
+
+ @Override
+ protected void onDraw() {
+ super.onDraw();
+ if (alertDefinition == null || alertDefinition.getId() == 0) {
+ // disable the back button when creating new definition
+ setBackButtonDisabled(true);
+ }
+ }
public AlertDefinition getAlertDefinition() {
return alertDefinition;
@@ -197,8 +203,7 @@ public class SingleAlertDefinitionView extends EnhancedVLayout {
recovery.makeEditable();
dampening.makeEditable();
- if (handlerRegistration != null)
- handlerRegistration.removeHandler();
+ unregisterHandler();
handlerRegistration = addVisibilityChangedHandler(new VisibilityChangedHandler()
{
public void onVisibilityChanged(VisibilityChangedEvent event) {
if (!event.getIsVisible()) {
@@ -207,15 +212,13 @@ public class SingleAlertDefinitionView extends EnhancedVLayout {
if (value) {
save();
}
- if (handlerRegistration != null)
- handlerRegistration.removeHandler();
}
});
}
}
});
// disable the back button
- ((EnhancedVLayout)
getParentElement()).getMember("backButton").setDisabled(true);
+ setBackButtonDisabled(true);
}
public void makeViewOnly() {
@@ -228,6 +231,7 @@ public class SingleAlertDefinitionView extends EnhancedVLayout {
notifications.makeViewOnly();
recovery.makeViewOnly();
dampening.makeViewOnly();
+ setBackButtonDisabled(false);
}
public void saveAlertDefinition() {
@@ -249,20 +253,13 @@ public class SingleAlertDefinitionView extends EnhancedVLayout {
new AsyncCallback<AlertDefinition>() {
@Override
public void onSuccess(final AlertDefinition alertDef) {
- if (handlerRegistration != null)
- handlerRegistration.removeHandler();
setAlertDefinition(alertDef);
- // enable the back button
- ((EnhancedVLayout)
getParentElement()).getMember("backButton").setDisabled(false);
+ unregisterHandler();
}
@Override
public void onFailure(Throwable caught) {
- if (handlerRegistration != null)
- handlerRegistration.removeHandler();
- // enable the back button
- ((EnhancedVLayout)
getParentElement()).getMember("backButton").setDisabled(false);
-
+ unregisterHandler();
// no error handling, the notification is done in the subclasses
of AbstractAlertDefinitionsView
}
});
@@ -270,4 +267,22 @@ public class SingleAlertDefinitionView extends EnhancedVLayout {
tabSet.selectTab(generalPropertiesTab);
}
}
+
+ private void setBackButtonDisabled(boolean enabled) {
+ Canvas layoutCandidate = getParentElement();
+ if (layoutCandidate instanceof EnhancedVLayout) {
+ EnhancedVLayout parentLayout = (EnhancedVLayout) getParentElement();
+ Canvas backButton = parentLayout.getMember("backButton");
+ if (backButton != null) {
+ backButton.setDisabled(enabled);
+ }
+ }
+ }
+
+ private void unregisterHandler() {
+ if (handlerRegistration != null) {
+ handlerRegistration.removeHandler();
+ handlerRegistration = null;
+ }
+ }
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertDefinitionGWTService.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertDefinitionGWTService.java
index 0921b2b..794a67f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertDefinitionGWTService.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertDefinitionGWTService.java
@@ -32,6 +32,9 @@ public interface AlertDefinitionGWTService extends RemoteService {
int createAlertDefinition(AlertDefinition alertDefinition, Integer resourceId) throws
RuntimeException;
+ AlertDefinition createAlertDefinitionAndReturn(AlertDefinition alertDefinition,
Integer resourceId)
+ throws RuntimeException;
+
AlertDefinition updateAlertDefinition(int alertDefinitionId, AlertDefinition
alertDefinition, boolean purgeInternals)
throws RuntimeException;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertDefinitionGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertDefinitionGWTServiceImpl.java
index 181eef5..da1d981 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertDefinitionGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertDefinitionGWTServiceImpl.java
@@ -66,8 +66,18 @@ public class AlertDefinitionGWTServiceImpl extends
AbstractGWTServiceImpl implem
@Override
public int createAlertDefinition(AlertDefinition alertDefinition, Integer resourceId)
throws RuntimeException {
try {
- int results =
alertDefManager.createAlertDefinitionInNewTransaction(getSessionSubject(),
alertDefinition, resourceId, true);
- return results;
+ int result =
alertDefManager.createAlertDefinitionInNewTransaction(getSessionSubject(),
alertDefinition, resourceId, true);
+ return result;
+ } catch (Throwable t) {
+ throw getExceptionToThrowToClient(t);
+ }
+ }
+
+ @Override
+ public AlertDefinition createAlertDefinitionAndReturn(AlertDefinition
alertDefinition, Integer resourceId) throws RuntimeException {
+ try {
+ AlertDefinition result =
alertDefManager.createAlertDefinitionAndRerurnIt(getSessionSubject(), alertDefinition,
resourceId, true);
+ return SerialUtility.prepare(result,
"createAlertDefinitionAndReturn");
} catch (Throwable t) {
throw getExceptionToThrowToClient(t);
}
@@ -77,9 +87,9 @@ public class AlertDefinitionGWTServiceImpl extends
AbstractGWTServiceImpl implem
public AlertDefinition updateAlertDefinition(int alertDefinitionId, AlertDefinition
alertDefinition,
boolean resetMatching) throws RuntimeException {
try {
- AlertDefinition results =
alertDefManager.updateAlertDefinition(getSessionSubject(), alertDefinitionId,
+ AlertDefinition result =
alertDefManager.updateAlertDefinition(getSessionSubject(), alertDefinitionId,
alertDefinition, resetMatching);
- return SerialUtility.prepare(results, "updateAlertDefinition");
+ return SerialUtility.prepare(result, "updateAlertDefinition");
} catch (Throwable t) {
throw getExceptionToThrowToClient(t);
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java
index d00a969..8f8fec5 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java
@@ -201,19 +201,30 @@ public class AlertDefinitionManagerBean implements
AlertDefinitionManagerLocal,
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public int createDependentAlertDefinition(Subject subject, AlertDefinition
alertDefinition, int resourceId)
throws InvalidAlertDefinitionException {
-
- return createAlertDefinitionInternal(subject, alertDefinition, resourceId, false,
false);
+ AlertDefinition newAlertDefinition = createAlertDefinitionInternal(subject,
alertDefinition, resourceId, false,
+ false);
+ return newAlertDefinition.getId();
}
@Override
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
- public int createAlertDefinitionInNewTransaction(Subject subject, AlertDefinition
alertDefinition, Integer resourceId, boolean validateNotificationConfiguration)
- throws InvalidAlertDefinitionException {
-
- return createAlertDefinitionInternal(subject, alertDefinition, resourceId, true,
validateNotificationConfiguration);
+ public int createAlertDefinitionInNewTransaction(Subject subject, AlertDefinition
alertDefinition,
+ Integer resourceId, boolean validateNotificationConfiguration) throws
InvalidAlertDefinitionException {
+ AlertDefinition newAlertDefinition = createAlertDefinitionInternal(subject,
alertDefinition, resourceId, true,
+ validateNotificationConfiguration);
+ return newAlertDefinition.getId();
+ }
+
+ @Override
+ @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
+ public AlertDefinition createAlertDefinitionAndRerurnIt(Subject subject,
AlertDefinition alertDefinition,
+ Integer resourceId, boolean validateNotificationConfiguration) throws
InvalidAlertDefinitionException {
+ AlertDefinition newAlertDefinition = createAlertDefinitionInternal(subject,
alertDefinition, resourceId, true,
+ validateNotificationConfiguration);
+ return newAlertDefinition;
}
- private int createAlertDefinitionInternal(Subject subject, AlertDefinition
alertDefinition, Integer resourceId, boolean checkPerms, boolean
validateNotificationConfiguration) throws InvalidAlertDefinitionException {
+ private AlertDefinition createAlertDefinitionInternal(Subject subject,
AlertDefinition alertDefinition, Integer resourceId, boolean checkPerms, boolean
validateNotificationConfiguration) throws InvalidAlertDefinitionException {
checkAlertDefinition(subject, null, alertDefinition, resourceId,
validateNotificationConfiguration);
// if this is an resource alert definition, set up the link to a resource
@@ -279,7 +290,7 @@ public class AlertDefinitionManagerBean implements
AlertDefinitionManagerLocal,
AlertDefinitionEvent.CREATED);
}
- return alertDefinition.getId();
+ return alertDefinition;
}
private void fixRecoveryId(AlertDefinition definition) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerLocal.java
index 5afa1f9..ee0e161 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerLocal.java
@@ -65,6 +65,29 @@ public interface AlertDefinitionManagerLocal {
*/
int createAlertDefinitionInNewTransaction(Subject subject, AlertDefinition
alertDefinition, Integer resourceId, boolean finalizeNotificationConfiguration)
throws InvalidAlertDefinitionException;
+
+ /**
+ * Creates a new alert definition. Note that the suject is checked to have necessary
authz, which might not
+ * be what you want in all use cases. See {@link
#createDependentAlertDefinition(Subject, AlertDefinition, int)}
+ * for further discussion of this. The only difference between
+ * {@link
GroupAlertDefinitionManagerLocal#createAlertDefinitionInNewTransaction(Subject,
AlertDefinition, Integer, boolean)}
+ * and this method is the return type.
+ *
+ * @param subject the user creating the alert definition
+ * @param alertDefinition the new alert definition to persist
+ * @param resourceId the resource id for which the def is being created
+ * @param finalizeNotificationConfiguration if true, the configuration of the
def's notifications is validated.
+ * This is NOT what you want if, for example, you are merely creating a copy of an
existing definition.
+ * Some notifications might require more input when creating the notification than is
then persisted in their configs
+ * (prominent example being the CLI alert sender).
+ * This would then cause the validation to fail every time you created a copy of a
definition and tried
+ * to persist it. Note that passing false AND having new, unpersisted notifications
in the alert definition can
+ * lead to invalid configuration being stored for the notifications.
+ * @return the instance of newly created alert definition
+ * @throws InvalidAlertDefinitionException
+ */
+ AlertDefinition createAlertDefinitionAndRerurnIt(Subject subject, AlertDefinition
alertDefinition,
+ Integer resourceId, boolean validateNotificationConfiguration) throws
InvalidAlertDefinitionException;
/**
* This is exactly the same as {@link #createAlertDefinitionInNewTransaction(Subject,
AlertDefinition, Integer, boolean)} but
commit b638cc12a5796b7ccb3789bf94768303b0ce0e3c
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Mon May 20 13:29:43 2013 +0200
[BZ 958169] - Modified alert definition is not saved on confirming the save message
after clicking on 'Back to List' button - I18n (Instead of "Edit", now
the button label says "Edit Condition").
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 00a68ef..b630706 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
@@ -977,6 +977,7 @@ view_alert_definition_condition_editor_option_metric_trait_change =
Trait Value
view_alert_definition_condition_editor_option_operation = Operation Execution
view_alert_definition_condition_editor_option_resource_configuration = Resource
Configuration Change
view_alert_definition_condition_editor_resource_configuration_tooltip = This condition is
triggered when the resource configuration changes.
+view_alert_definition_editCondition = Edit Condition
view_alert_definition_for_group = View Group Definition
view_alert_definition_for_type = View Template
view_alert_definition_notification_cliScript_editor_anotherUser = Another User
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
index a27fb3c..cab205f 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
@@ -993,6 +993,7 @@ view_alert_definition_condition_editor_option_metric_trait_change =
Změna hodno
view_alert_definition_condition_editor_option_operation = Spuštění operace
view_alert_definition_condition_editor_option_resource_configuration = Změna konfigurace
zdroje
view_alert_definition_condition_editor_resource_configuration_tooltip = Podmínka je
splněna, když se změní konfigurace zdroje.
+view_alert_definition_editCondition = Editovat podmínku
view_alert_definition_for_group = Zobrazit definici skupiny
view_alert_definition_for_type = Zobrazit šablonu
view_alert_definition_notification_cliScript_editor_anotherUser = Jiný uživatel
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 902951d..057785a 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
@@ -883,6 +883,7 @@ view_alert_definition_condition_editor_option_metric_trait_change =
Änderung de
view_alert_definition_condition_editor_option_operation = Ausführung der Operation
view_alert_definition_condition_editor_option_resource_configuration = Änderung der
Konfiguration der Ressource
##view_alert_definition_condition_editor_resource_configuration_tooltip = This condition
is triggered when the resource configuration changes.
+##view_alert_definition_editCondition = Edit Condition
view_alert_definition_for_group = Gruppendefinition ansehen
view_alert_definition_for_type = Vorlage ansehen
view_alert_definition_notification_cliScript_editor_anotherUser = Anderer Benutzer
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 8f47413..a929966 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
@@ -969,6 +969,7 @@ view_alert_definition_condition_editor_option_metric_trait_change =
トレイト
view_alert_definition_condition_editor_option_operation = オペレーションの実行
view_alert_definition_condition_editor_option_resource_configuration = リソース構成の変化
view_alert_definition_condition_editor_resource_configuration_tooltip =
この条件はリソース構成が変更されると引き起こされます
+##view_alert_definition_editCondition = Edit Condition
view_alert_definition_for_group = ビューグループ定義
view_alert_definition_for_type = ビューテンプレート
view_alert_definition_notification_cliScript_editor_anotherUser = 別のユーザー
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties
index 5d19d06..da0a8a5 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties
@@ -846,6 +846,7 @@ view_alert_definition_condition_editor_option_metric_threshold = 측정
절대
view_alert_definition_condition_editor_option_metric_trait_change = 특성값의 변화
view_alert_definition_condition_editor_option_resource_configuration = 자원 구성의 변화
view_alert_definition_condition_editor_resource_configuration_tooltip = 이 조건은 자원 구성이 변경되면
발생합니다.
+##view_alert_definition_editCondition = Edit Condition
view_alert_definition_for_group = 뷰 그룹 정의
view_alert_definition_notification_cliScript_editor_anotherUser = 다른 사용자
view_alert_definition_notification_cliScript_editor_existingScript = 기존의 스크립트
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 743c4b5..9f342d7 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
@@ -977,6 +977,7 @@ view_alert_definition_condition_editor_option_metric_trait_change =
Mudan\u00E7a
view_alert_definition_condition_editor_option_operation = Execu\u00E7\u00E3o de
Opera\u00E7\u00E3o
view_alert_definition_condition_editor_option_resource_configuration = Mudan\u00E7a na
Configura\u00E7\u00E3o do Recurso
view_alert_definition_condition_editor_resource_configuration_tooltip = Essa
condi\u00E7\u00E3o \u00E9 disparada quando a configura\u00E7\u00E3o do recurso for
alterada.
+##view_alert_definition_editCondition = Edit Condition
view_alert_definition_for_group = Visualizar Defini\u00E7\u00E3o de Grupo
view_alert_definition_for_type = Visualizar Template
view_alert_definition_notification_cliScript_editor_anotherUser = Another User
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
index 772c4e4..c8ee796 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
@@ -943,6 +943,7 @@
#view_alert_definition_condition_editor_option_operation = Operation Execution
#view_alert_definition_condition_editor_option_resource_configuration = Resource
Configuration Change
#view_alert_definition_condition_editor_resource_configuration_tooltip = This condition
is triggered when the resource configuration changes.
+##view_alert_definition_editCondition = Edit Condition
#view_alert_definition_for_group = View Group Definition
#view_alert_definition_for_type = View Template
#view_alert_definition_notification_cliScript_editor_anotherUser = Another User
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 03dfa4e..147b9f8 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
@@ -963,6 +963,7 @@ view_alert_definition_condition_editor_option_metric_trait_change =
Trait Value
view_alert_definition_condition_editor_option_operation = Operation Execution
view_alert_definition_condition_editor_option_resource_configuration =
\u8d44\u6e90\u914d\u7f6e\u6539\u53d8
view_alert_definition_condition_editor_resource_configuration_tooltip = This condition is
triggered when the resource configuration changes.
+##view_alert_definition_editCondition = Edit Condition
view_alert_definition_for_group = \u67e5\u770b\u7ec4\u5b9a\u4e49
view_alert_definition_for_type = \u67e5\u770b\u6a21\u677f
view_alert_definition_notification_cliScript_editor_anotherUser =
\u5176\u4ed6\u7528\u6237
commit edaffb818aec221eb0db5338fcf2e669b06e5a70
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri May 17 17:09:35 2013 -0400
BZ 963982 - make sure we persist the token when the registration was successful, even
if the server endpoint was bad
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
index 6e1a95a..a8d8bdf 100644
--- a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
+++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
@@ -1376,6 +1376,7 @@ public class AgentMain {
try {
AgentRegistrationResults results =
remote_pojo.registerAgent(request);
failover_list = results.getFailoverList();
+ token = results.getAgentToken(); // make sure our
finally block gets this - BZ 963982
// Try to do a simple connect to each server in the
failover list
// If only some of the servers are unreachable, just
keep going;
@@ -1407,7 +1408,6 @@ public class AgentMain {
m_registration = results;
got_registered = true;
retry = false;
- token = results.getAgentToken();
LOG.info(AgentI18NResourceKeys.AGENT_REGISTRATION_RESULTS, results);
} finally {
// stores the new one if successful; restores the old
one if we failed for some reason to register
commit 92fd97dd84324980487972bda6f424114e1e712d
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri May 17 14:11:32 2013 +0200
BZ 962858 check passed resource id and return 404 if invalid
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
index 288e9f7..70cc588 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
@@ -559,6 +559,10 @@ public class ResourceHandlerBean extends AbstractRestBean {
@ApiOperation("Get a list of links to the alerts for the passed resource")
public List<Link> getAlertsForResource(@ApiParam("Id of the resource to
query") @PathParam("id") int resourceId) {
AlertCriteria criteria = new AlertCriteria();
+
+ // Check for resource existence
+ fetchResource(resourceId);
+
criteria.addFilterResourceIds(resourceId);
List<Alert> alerts = alertManager.findAlertsByCriteria(caller, criteria);
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
index 3efd807..cc9558b 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
@@ -593,6 +593,17 @@ public class ResourcesTest extends AbstractBase {
}
@Test
+ public void testAlertsForUnknownResource() throws Exception {
+ given()
+ .header("Accept", "application/json")
+ .pathParam("id", 12345)
+ .expect()
+ .statusCode(404)
+ .when()
+ .get("/resource/{id}/alerts");
+ }
+
+ @Test
public void testSchedulesForResource() throws Exception {
given()
.header("Accept", "application/json")
commit b8207e9ec0efcf679af774e870f1c3b70fafc6fc
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri May 17 09:26:14 2013 +0200
Disable for the moment
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationHelperTest.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationHelperTest.java
index 7e20630..3a7e961 100644
---
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationHelperTest.java
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationHelperTest.java
@@ -703,7 +703,7 @@ public class ConfigurationHelperTest {
}
- @Test
+ @Test(enabled = false)
public void testConfigToMapComplexMapWithBadSetupLenient() throws Exception {
Configuration config = new Configuration();
commit 9a040dd824209eb9e71bb22c7cf7d80a7c468485
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Fri May 17 12:41:31 2013 +0200
[BZ 958169] - Modified alert definition is not saved on confirming the save message
after clicking on 'Back to List' button - Making the "Back to List"
button disabled when editing the alert definition.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/EditAlertDefinitionForm.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/EditAlertDefinitionForm.java
index 14b6abf..d915cb0 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/EditAlertDefinitionForm.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/EditAlertDefinitionForm.java
@@ -1,8 +1,5 @@
package org.rhq.enterprise.gui.coregui.client.alert.definitions;
-import java.util.Map;
-
-import org.rhq.core.domain.alert.AlertCondition;
import org.rhq.core.domain.alert.AlertDefinition;
/**
@@ -12,8 +9,6 @@ public interface EditAlertDefinitionForm {
AlertDefinition getAlertDefinition();
-// Map<Integer, AlertCondition> getUpdatedAlertConditions();
-
boolean isResetMatching();
void setAlertDefinition(AlertDefinition alertDef);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
index b4504c9..c86d0cd 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java
@@ -28,6 +28,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.util.BooleanCallback;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.Button;
+import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.events.VisibilityChangedEvent;
@@ -145,7 +146,10 @@ public class SingleAlertDefinitionView extends EnhancedVLayout {
cancelButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
- handlerRegistration.removeHandler();
+ if (handlerRegistration != null)
+ handlerRegistration.removeHandler();
+ // enable the back button
+ ((EnhancedVLayout)
getParentElement()).getMember("backButton").setDisabled(false);
setAlertDefinition(getAlertDefinition()); // reverts data back to
original
makeViewOnly();
}
@@ -193,6 +197,8 @@ public class SingleAlertDefinitionView extends EnhancedVLayout {
recovery.makeEditable();
dampening.makeEditable();
+ if (handlerRegistration != null)
+ handlerRegistration.removeHandler();
handlerRegistration = addVisibilityChangedHandler(new VisibilityChangedHandler()
{
public void onVisibilityChanged(VisibilityChangedEvent event) {
if (!event.getIsVisible()) {
@@ -201,12 +207,15 @@ public class SingleAlertDefinitionView extends EnhancedVLayout {
if (value) {
save();
}
- handlerRegistration.removeHandler();
+ if (handlerRegistration != null)
+ handlerRegistration.removeHandler();
}
});
}
}
});
+ // disable the back button
+ ((EnhancedVLayout)
getParentElement()).getMember("backButton").setDisabled(true);
}
public void makeViewOnly() {
@@ -240,13 +249,21 @@ public class SingleAlertDefinitionView extends EnhancedVLayout {
new AsyncCallback<AlertDefinition>() {
@Override
public void onSuccess(final AlertDefinition alertDef) {
- handlerRegistration.removeHandler();
+ if (handlerRegistration != null)
+ handlerRegistration.removeHandler();
setAlertDefinition(alertDef);
+ // enable the back button
+ ((EnhancedVLayout)
getParentElement()).getMember("backButton").setDisabled(false);
}
@Override
public void onFailure(Throwable caught) {
- // nothing, the notification is done in the subclasses of
AbstractAlertDefinitionsView
+ if (handlerRegistration != null)
+ handlerRegistration.removeHandler();
+ // enable the back button
+ ((EnhancedVLayout)
getParentElement()).getMember("backButton").setDisabled(false);
+
+ // no error handling, the notification is done in the subclasses
of AbstractAlertDefinitionsView
}
});
} else {
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 efab26d..41819e1 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
@@ -41,6 +41,7 @@ public class BackButton extends StretchImgButton {
public BackButton(String title, final String anchor) {
this();
setTitle("<b>" + title + "</b>");
+ setID("backButton");
addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
CoreGUI.goToView(anchor);
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Disabled_end.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Disabled_end.png
new file mode 100644
index 0000000..c323816
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Disabled_end.png
differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Disabled_start.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Disabled_start.png
new file mode 100644
index 0000000..d6cf484
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Disabled_start.png
differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Disabled_stretch.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Disabled_stretch.png
new file mode 100644
index 0000000..2addd3a
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Disabled_stretch.png
differ
commit d074bd8fa3daf63342bd5426e8599b0cb8f10cef
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu May 16 21:47:39 2013 +0200
We don't need standalone-osgi.xml
diff --git a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
index 05619cb..e9f3bbe 100644
--- a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
+++ b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
@@ -220,6 +220,7 @@
<fileset dir="${jboss.home}/standalone/configuration">
<include name="standalone-ha.xml" />
<include name="standalone.xml" />
+ <include name="standalone-osgi.xml" />
<include name="standalone-full-ha.xml" />
</fileset>
</delete>
commit 4e91d0dc17e549213f61ee6a9251423d65c4ccce
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu May 16 21:47:23 2013 +0200
Fix a small typo
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 5415ed0..902951d 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
@@ -1235,7 +1235,7 @@ view_core_uncaught = Es ist eine nicht abgefangene Ausnahme
aufgetreten.
view_dashboardManager_deleteFail = Konnte das Dashboard nicht löschen.
view_dashboardManager_deleted = Dashboard {0} erfolgreich gelöscht
view_dashboardManager_error = Konnte das Dashboard nicht auf dem Server sichern
-view_dashboardManager_saved = Das Dashboard {0} wurde auf dem Server geichert
+view_dashboardManager_saved = Das Dashboard {0} wurde auf dem Server gesichert
view_dashboardManager_success = Dashboard gespeichert
view_dashboard_favorites_error1 = Konnte die Ressoucen-Lesezeichen nicht laden
view_dashboardsManager_error1 = Konnte das neue Dashboard nicht hinzufügen
commit ba97ade9666a32cd20e071110c98a45e32d7f9fc
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu May 16 21:47:08 2013 +0200
BZ 961656 - enable LDAP support for the REST-api as well.
diff --git
a/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/SecurityDomainJBossASClient.java
b/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/SecurityDomainJBossASClient.java
index 5caa45e..99e2f4d 100644
---
a/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/SecurityDomainJBossASClient.java
+++
b/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/SecurityDomainJBossASClient.java
@@ -39,6 +39,7 @@ public class SecurityDomainJBossASClient extends JBossASClient {
public static final String SECURITY_DOMAIN = "security-domain";
public static final String CACHE_TYPE = "cache-type";
public static final String AUTHENTICATION = "authentication";
+ public static final String LOGIN_MODULE = "login-module";
public static final String LOGIN_MODULES = "login-modules";
public static final String CLASSIC = "classic";
public static final String CODE = "code";
@@ -376,6 +377,36 @@ public class SecurityDomainJBossASClient extends JBossASClient {
return;
}
+ /**
+ * send a :flush-cache operation to the passed security domain
+ * @param domain simple name of the domain
+ * @throws Exception
+ */
+ public void flushSecurityDomainCache(String domain) throws Exception {
+ Address addr = Address.root().add(SUBSYSTEM, SUBSYSTEM_SECURITY,
SECURITY_DOMAIN,domain);
+ ModelNode request = createRequest("flush-cache",addr);
+ ModelNode result = execute(request);
+ if (!isSuccess(result)) {
+ log.warn("Flushing " + domain + " failed - principals may be
longer cached than expected");
+ }
+ }
+
+ /**
+ * Check if a certain login module is present inside the passed security domain
+ * @param domainName Name of the security domain
+ * @param moduleName Name of the Login module - wich usually is it FQCN
+ * @return True if the module is present
+ * @throws Exception
+ */
+ public boolean securityDomainHasLoginModule(String domainName, String moduleName)
throws Exception {
+ Address addr = Address.root().add(SUBSYSTEM, SUBSYSTEM_SECURITY,
SECURITY_DOMAIN,domainName);
+ addr.add(AUTHENTICATION,CLASSIC);
+ addr.add(LOGIN_MODULE,moduleName);
+ ModelNode request = createRequest("read-resource", addr);
+ ModelNode response = execute(request);
+ return isSuccess(response);
+ }
+
/** Immutable helper */
public static class LoginModuleRequest {
private AppConfigurationEntry entry;
diff --git
a/modules/enterprise/gui/rest-examples-war/src/main/webapp/WEB-INF/jboss-web.xml
b/modules/enterprise/gui/rest-examples-war/src/main/webapp/WEB-INF/jboss-web.xml
index 319b990..a98b367 100644
--- a/modules/enterprise/gui/rest-examples-war/src/main/webapp/WEB-INF/jboss-web.xml
+++ b/modules/enterprise/gui/rest-examples-war/src/main/webapp/WEB-INF/jboss-web.xml
@@ -2,4 +2,6 @@
<jboss-web>
<security-domain>RHQRESTSecurityDomain</security-domain>
+ <!-- see
https://community.jboss.org/wiki/JBossAS7SecurityAuditing for the next
tag -->
+ <!--<disable-audit>false</disable-audit>-->
</jboss-web>
diff --git a/modules/enterprise/gui/rest-examples-war/src/main/webapp/WEB-INF/web.xml
b/modules/enterprise/gui/rest-examples-war/src/main/webapp/WEB-INF/web.xml
index fb75d94..b601346 100644
--- a/modules/enterprise/gui/rest-examples-war/src/main/webapp/WEB-INF/web.xml
+++ b/modules/enterprise/gui/rest-examples-war/src/main/webapp/WEB-INF/web.xml
@@ -10,7 +10,7 @@
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
- <role-name>all</role-name>
+ <role-name>rest-user</role-name>
</auth-constraint>
</security-constraint>
@@ -21,7 +21,7 @@
<security-role>
<description>This is valid for all principals, as we do internal
checks</description>
- <role-name>all</role-name>
+ <role-name>rest-user</role-name>
</security-role>
</web-app>
diff --git a/modules/enterprise/gui/rest-war/src/main/webapp/WEB-INF/jboss-web.xml
b/modules/enterprise/gui/rest-war/src/main/webapp/WEB-INF/jboss-web.xml
index 1ef5880..28f365f 100644
--- a/modules/enterprise/gui/rest-war/src/main/webapp/WEB-INF/jboss-web.xml
+++ b/modules/enterprise/gui/rest-war/src/main/webapp/WEB-INF/jboss-web.xml
@@ -3,4 +3,6 @@
<jboss-web>
<context-root>rest</context-root>
<security-domain>RHQRESTSecurityDomain</security-domain>
+ <!-- see
https://community.jboss.org/wiki/JBossAS7SecurityAuditing for the next
tag -->
+ <!--<disable-audit>false</disable-audit>-->
</jboss-web>
diff --git a/modules/enterprise/gui/rest-war/src/main/webapp/WEB-INF/web.xml
b/modules/enterprise/gui/rest-war/src/main/webapp/WEB-INF/web.xml
index f96839d..f336c60 100644
--- a/modules/enterprise/gui/rest-war/src/main/webapp/WEB-INF/web.xml
+++ b/modules/enterprise/gui/rest-war/src/main/webapp/WEB-INF/web.xml
@@ -57,7 +57,7 @@
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
- <role-name>all</role-name>
+ <role-name>rest-user</role-name>
</auth-constraint>
</security-constraint>
@@ -68,7 +68,7 @@
<security-role>
<description>This is valid for all principals, as we do internal
checks</description>
- <role-name>all</role-name>
+ <role-name>rest-user</role-name>
</security-role>
</web-app>
diff --git
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
index 8173e68..0b9c078 100644
---
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
+++
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
@@ -278,6 +278,9 @@ public class InstallerServiceImpl implements InstallerService {
// Set up the logging subsystem
ServerInstallUtil.configureLogging(mcc, serverProperties);
+ ServerInstallUtil.createUserSecurityDomain(mcc);
+ ServerInstallUtil.createRestSecurityDomain(mcc);
+
// create a keystore whose cert has a CN of this server's public endpoint
address
File keystoreFile = ServerInstallUtil.createKeystore(serverDetails != null ?
serverDetails
: getServerDetailsFromPropertiesOnly(serverProperties),
appServerConfigDir);
@@ -601,7 +604,7 @@ public class InstallerServiceImpl implements InstallerService {
* Save the given properties to the server's .properties file.
*
* Note that this is private - it is not exposed to the installer UI. It should have
no need to save
- * this data outside of the normal installation process (see {@link #install()}).
+ * this data outside of the normal installation process (see {@link #install}).
*
* @param serverProperties the server properties to save
* @throws Exception if failed to save the properties to the .properties file
@@ -1013,9 +1016,6 @@ public class InstallerServiceImpl implements InstallerService {
// create the security domain needed by the datasources
ServerInstallUtil.createDatasourceSecurityDomain(mcc, serverProperties);
- // create the security domain needed by REST
- ServerInstallUtil.createRESTSecurityDomain(mcc, serverProperties);
-
// set up REST cache
ServerInstallUtil.createNewCaches(mcc, serverProperties);
diff --git
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java
index d6e0d10..3a19833 100644
---
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java
+++
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java
@@ -38,6 +38,8 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
+import javax.security.auth.login.AppConfigurationEntry;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.tools.ant.Project;
@@ -133,8 +135,6 @@ public class ServerInstallUtil {
"jboss.management.https.port", 6443));
defaultSocketBindings.add(new
SocketBindingInfo(SocketBindingJBossASClient.DEFAULT_BINDING_MGMT_NATIVE,
"jboss.management.native.port", 6999));
- defaultSocketBindings.add(new
SocketBindingInfo(SocketBindingJBossASClient.DEFAULT_BINDING_OSGI_HTTP,
- "rhq.server.socket.binding.port.osgi-http", 7090, false));
defaultSocketBindings.add(new
SocketBindingInfo(SocketBindingJBossASClient.DEFAULT_BINDING_REMOTING,
"rhq.server.socket.binding.port.remoting", 3447));
defaultSocketBindings.add(new
SocketBindingInfo(SocketBindingJBossASClient.DEFAULT_BINDING_TXN_RECOVERY_ENV,
@@ -146,7 +146,10 @@ public class ServerInstallUtil {
private static final String RHQ_DATASOURCE_NAME_NOTX = "NoTxRHQDS";
private static final String RHQ_DATASOURCE_NAME_XA = "RHQDS";
private static final String RHQ_DS_SECURITY_DOMAIN =
"RHQDSSecurityDomain";
+ private static final String RHQ_USER_SECURITY_DOMAIN =
"RHQUserSecurityDomain";
private static final String RHQ_REST_SECURITY_DOMAIN =
"RHQRESTSecurityDomain";
+ private static final String JDBC_LOGIN_MODULE_NAME =
"org.rhq.enterprise.server.core.jaas.JDBCLoginModule";
+ private static final String DELEGATIG_LOGIN_MODULE_NAME =
"org.rhq.enterprise.server.core.jaas.DelegatingLoginModule";
private static final String JDBC_DRIVER_POSTGRES = "postgres";
private static final String JDBC_DRIVER_ORACLE = "oracle";
private static final String JMS_ALERT_CONDITION_QUEUE =
"AlertConditionQueue";
@@ -299,6 +302,48 @@ public class ServerInstallUtil {
}
/**
+ * Create the standard user security domain with the JDBCLogin module installed
+ *
+ * @param mcc ModelControllerClient to talk to the underlying AS
+ * @throws Exception If anything goes wrong
+ */
+ public static void createUserSecurityDomain(ModelControllerClient mcc) throws
Exception {
+
+ Map<String,String> options = new HashMap<String, String>(2);
+ options.put("hashAlgorithm", "MD5");
+ options.put("hashEncoding", "base64");
+
+ SecurityDomainJBossASClient.LoginModuleRequest loginModuleRequest = new
SecurityDomainJBossASClient.LoginModuleRequest(JDBC_LOGIN_MODULE_NAME,
+ AppConfigurationEntry.LoginModuleControlFlag.SUFFICIENT, options);
+
+
+ SecurityDomainJBossASClient client = new SecurityDomainJBossASClient(mcc);
+ client.createNewSecurityDomain(RHQ_USER_SECURITY_DOMAIN,loginModuleRequest);
+
+ }
+
+ /**
+ * Create a security domain for container managed security used with the
rhq-rest.war
+ * @param mcc ModelControllerClient to talk to the underlying AS.
+ * @throws Exception If anything goes wrong
+ */
+ public static void createRestSecurityDomain(ModelControllerClient mcc) throws
Exception {
+
+ Map<String,String> options = new HashMap<String, String>(2);
+ options.put("delegateTo", RHQ_USER_SECURITY_DOMAIN);
+ options.put("roles", "rest-user");
+
+ SecurityDomainJBossASClient.LoginModuleRequest loginModuleRequest = new
SecurityDomainJBossASClient.LoginModuleRequest(DELEGATIG_LOGIN_MODULE_NAME,
+ AppConfigurationEntry.LoginModuleControlFlag.SUFFICIENT, options);
+
+
+ SecurityDomainJBossASClient client = new SecurityDomainJBossASClient(mcc);
+ client.createNewSecurityDomain(RHQ_REST_SECURITY_DOMAIN,loginModuleRequest);
+ }
+
+
+
+ /**
* Creates the JMS Queues required for Drift and Alerting.
*
* @param mcc the JBossAS management client
@@ -367,28 +412,6 @@ public class ServerInstallUtil {
return;
}
- /**
- * Creates the security domain for REST.
- *
- * @param mcc the JBossAS management client
- * @param serverProperties contains the obfuscated password to store in the security
domain
- * @throws Exception
- */
- public static void createRESTSecurityDomain(ModelControllerClient mcc,
HashMap<String, String> serverProperties)
- throws Exception {
-
- final SecurityDomainJBossASClient client = new SecurityDomainJBossASClient(mcc);
- final String securityDomain = RHQ_REST_SECURITY_DOMAIN;
- if (!client.isSecurityDomain(securityDomain)) {
- String dsJndiName = "java:jboss/datasources/" +
RHQ_DATASOURCE_NAME_XA;
- client.createNewDatabaseServerSecurityDomain72(securityDomain, dsJndiName,
- "SELECT PASSWORD FROM RHQ_PRINCIPAL WHERE principal=?",
- "SELECT 'all', 'Roles' FROM RHQ_PRINCIPAL WHERE
principal=?", null, null);
- LOG.info("Security domain [" + securityDomain + "]
created");
- } else {
- LOG.info("Security domain [" + securityDomain + "] already
exists, skipping the creation request");
- }
- }
/**
* Creates the Infinispan caches for RHQ.
@@ -856,7 +879,7 @@ public class ServerInstallUtil {
/**
* Returns a database connection with the given set of properties providing the
settings that allow for a successful
* database connection. If <code>props</code> is
<code>null</code>, it will use the server properties from
- * {@link #getServerProperties()}.
+ * {@link #getServerProperties}.
*
* @param connectionUrl
* @param userName
@@ -898,7 +921,7 @@ public class ServerInstallUtil {
* Use the internal JBossAS mechanism to de-obfuscate a password back to its
* clear text form. This is not true encryption.
*
- * @param obfuscatedPasswordd the obfuscated password
+ * @param obfuscatedPassword the obfuscated password
* @return the clear-text password
*/
public static String deobfuscatePassword(String obfuscatedPassword) {
@@ -1003,7 +1026,7 @@ public class ServerInstallUtil {
/**
* This will create the database schema in the database.
<code>props</code> define the connection to the database -
*
- * <p>Note that if the {@link #isDatabaseSchemaExist(Properties) schema already
exists}, it will be purged of all
+ * <p>Note that if the {@link #isDatabaseSchemaExist schema already exists}, it
will be purged of all
* data/tables and recreated.</p>
*
* @param props the full set of server properties
@@ -1039,7 +1062,7 @@ public class ServerInstallUtil {
/**
* This will update an existing database schema so it can be upgraded to the latest
schema version.
*
- * <p>Note that if the {@link #isDatabaseSchemaExist(Properties) schema does
not already exist}, errors will
+ * <p>Note that if the {@link #isDatabaseSchemaExist schema does not already
exist}, errors will
* occur.</p>
*
* @param props the full set of server properties
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java
index 95dd58f..73eeca5 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java
@@ -57,7 +57,6 @@ import
org.rhq.enterprise.server.util.security.UntrustedSSLSocketFactory;
public class CustomJaasDeploymentService implements CustomJaasDeploymentServiceMBean,
MBeanRegistration {
private Log log = LogFactory.getLog(CustomJaasDeploymentService.class.getName());
- private MBeanServer mbeanServer = null;
/**
* Constructor for {@link CustomJaasDeploymentService}.
@@ -70,21 +69,51 @@ public class CustomJaasDeploymentService implements
CustomJaasDeploymentServiceM
*/
public void installJaasModules() {
try {
- log.info("Installing RHQ Server's JAAS login modules");
+ log.info("Updating RHQ Server's JAAS login modules");
Properties systemConfig =
LookupUtil.getSystemManager().getSystemConfiguration(
LookupUtil.getSubjectManager().getOverlord());
- registerJaasModules(systemConfig);
+ updateJaasModules(systemConfig);
} catch (Exception e) {
log.fatal("Error deploying JAAS login modules", e);
throw new RuntimeException(e);
}
}
+ @Override
+ public void upgradeRhqUserSecurityDomainIfNeeded() {
+ try {
+ Properties systemConfig =
LookupUtil.getSystemManager().getSystemConfiguration(
+ LookupUtil.getSubjectManager().getOverlord());
+
+ String value =
systemConfig.getProperty(SystemSetting.LDAP_BASED_JAAS_PROVIDER.getInternalName());
+ boolean isLdapAuthenticationEnabled = (value != null) ?
RHQConstants.LDAPJAASProvider.equals(value) : false;
+
+ if (isLdapAuthenticationEnabled) {
+
+ ModelControllerClient mcc = null;
+ mcc = ManagementService.getClient();
+ final SecurityDomainJBossASClient client = new
SecurityDomainJBossASClient(mcc);
+
+ boolean ldapModulesPresent =
client.securityDomainHasLoginModule(RHQ_USER_SECURITY_DOMAIN,
+ "org.rhq.enterprise.server.core.jaas.LdapLoginModule");
+
+
+ if (!ldapModulesPresent) {
+ log.info("Updating RHQ Server's JAAS login modules with LDAP
support");
+ updateJaasModules(systemConfig);
+ }
+ }
+ } catch (Exception e) {
+ log.fatal("Error deploying JAAS login modules", e);
+ throw new RuntimeException(e);
+ }
+
+ }
+
/**
* @see
javax.management.MBeanRegistration#preRegister(javax.management.MBeanServer,javax.management.ObjectName)
*/
public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
{
- this.mbeanServer = server;
return name;
}
@@ -107,13 +136,13 @@ public class CustomJaasDeploymentService implements
CustomJaasDeploymentServiceM
}
/**
- * Will register the necessary JAAS login Modules. The RHQ_USER_SECURITY_DOMAIN will
be created, or recreated
- * if it already exists. This allows us to add/remove ldap support as it is enabled
or disabled.
- *
- * @param systemConfig
+ * Will update the necessary JAAS login Modules. The RHQ_USER_SECURITY_DOMAIN will
be created, or recreated
+ * if it already exists. This allows us to add/remove ldap support as it is enabled
or disabled.
+ *
+ * @param systemConfig System configuration to read the LDAP settings from
* @throws Exception
*/
- private void registerJaasModules(Properties systemConfig) throws Exception {
+ private void updateJaasModules(Properties systemConfig) throws Exception {
ModelControllerClient mcc = null;
try {
@@ -144,7 +173,7 @@ public class CustomJaasDeploymentService implements
CustomJaasDeploymentServiceM
AppConfigurationEntry.LoginModuleControlFlag.REQUISITE,
getJdbcOptions(systemConfig));
loginModules.add(jdbcPrincipalCheckLoginModule);
- // this is the LDAP module that checks the LDAP for auth
+ // this is the LDAP module that checks the LDAP for auth
Map<String, String> ldapModuleOptionProperties =
getLdapOptions(systemConfig);
try {
validateLdapOptions(ldapModuleOptionProperties);
@@ -170,7 +199,8 @@ public class CustomJaasDeploymentService implements
CustomJaasDeploymentServiceM
client.createNewSecurityDomain(RHQ_USER_SECURITY_DOMAIN,
loginModules.toArray(new LoginModuleRequest[loginModules.size()]));
- log.info("Security domain [" + RHQ_USER_SECURITY_DOMAIN + "]
created with login modules " + loginModules);
+ client.flushSecurityDomainCache("RHQRESTSecurityDomain");
+ log.info("Security domain [" + RHQ_USER_SECURITY_DOMAIN + "]
re-created with login modules " + loginModules);
} catch (Exception e) {
throw new Exception("Error registering RHQ JAAS modules", e);
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentServiceMBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentServiceMBean.java
index 8d53e2b..47fcc48 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentServiceMBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentServiceMBean.java
@@ -41,4 +41,12 @@ public interface CustomJaasDeploymentServiceMBean {
* Installs the JAAS Modules that JON Server uses to allow users to log in.
*/
void installJaasModules();
+
+ /**
+ * Called from the startup bean and will upgrade an existing
+ * RHQUserSecurityDomain if needed - that is if the system
+ * settings say that LDAP support is enabled, but the underlying
+ * modules are not present
+ */
+ void upgradeRhqUserSecurityDomainIfNeeded();
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
index 90ffbaf..7963b26 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
@@ -95,7 +95,7 @@ import
org.rhq.enterprise.server.util.concurrent.AvailabilityReportSerializer;
* This startup singleton EJB performs the rest of the RHQ Server startup
initialization.
* In order for it to do its work properly, we must ensure everything has been deployed
and started;
* specifically, all EJBs must have been deployed and available.
- *
+ *
* This bean is not meant for client consumption - it is only for startup
initialization.
*/
@Singleton
@@ -195,7 +195,7 @@ public class StartupBean implements StartupLocal {
initScheduler(); // make sure this is initialized before starting the plugin
deployer
startPluginDeployer(); // make sure this is initialized before starting the
server plugin container
startServerPluginContainer(); // before comm in case an agent wants to talk to
it
- installJaasModules();
+ upgradeRhqUserSecurityDomainIfNeeded();
startServerCommunicationServices();
startScheduler();
scheduleJobs();
@@ -396,8 +396,7 @@ public class StartupBean implements StartupLocal {
*
* @throws RuntimeException
*/
- private void installJaasModules() throws RuntimeException {
- log.info("Installing JAAS login modules...");
+ private void upgradeRhqUserSecurityDomainIfNeeded() throws RuntimeException {
try {
CustomJaasDeploymentServiceMBean jaas_mbean;
@@ -406,9 +405,9 @@ public class StartupBean implements StartupLocal {
Class<?> iface = CustomJaasDeploymentServiceMBean.class;
jaas_mbean = (CustomJaasDeploymentServiceMBean)
MBeanServerInvocationHandler.newProxyInstance(mbs, name,
iface, false);
- jaas_mbean.installJaasModules();
+ jaas_mbean.upgradeRhqUserSecurityDomainIfNeeded();
} catch (Exception e) {
- throw new RuntimeException("Cannot install JAAS login modules!",
e);
+ throw new RuntimeException("Cannot upgrade JAAS login modules!",
e);
}
}
@@ -632,7 +631,7 @@ public class StartupBean implements StartupLocal {
log.error("Cannot schedule server plugin jobs.", e);
}
- // Alerting Availability Duration Job (create only, nothing actually scheduled
here)
+ // Alerting Availability Duration Job (create only, nothing actually scheduled
here)
try {
schedulerBean.scheduleTriggeredJob(AlertAvailabilityDurationJob.class, false,
null);
} catch (Exception e) {
@@ -647,7 +646,7 @@ public class StartupBean implements StartupLocal {
* immediately begin to send any persisted guaranteed messages that might already
exist. This method must be called
* at a time when the server is ready to accept messages from agents because any
guaranteed messages that are
* delivered might trigger the agents to send messages back to the server.
- *
+ *
* NOTE: we don't need to do this - so far, none of the messages the server sends
to the agent are marked
* with "guaranteed delivery" (this is on purpose and a good thing) so we
don't need to start all the agent clients
* in case they have persisted messages. Since the number of agents could be large
this cache could be huge and
@@ -673,7 +672,7 @@ public class StartupBean implements StartupLocal {
* Starts the embedded agent, but only if the embedded agent is installed and it is
enabled.
*
* @throws RuntimeException if the agent is installed and enabled but failed to
start
- *
+ *
* @deprecated we don't have an embedded agent anymore, leaving this in case we
resurrect it
*/
private void startEmbeddedAgent() throws RuntimeException {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/DelegatingLoginModule.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/DelegatingLoginModule.java
new file mode 100644
index 0000000..d89c04b
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/DelegatingLoginModule.java
@@ -0,0 +1,209 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+package org.rhq.enterprise.server.core.jaas;
+
+import java.io.IOException;
+import java.security.Principal;
+import java.security.acl.Group;
+import java.util.List;
+import java.util.Map;
+
+import javax.security.auth.Subject;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import javax.security.auth.login.LoginContext;
+import javax.security.auth.login.LoginException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.jboss.security.SimpleGroup;
+import org.jboss.security.SimplePrincipal;
+import org.jboss.security.auth.spi.UsernamePasswordLoginModule;
+
+import org.rhq.core.util.StringUtil;
+
+/**
+ * A login module that just delegates all work to a different security domain.<p/>
+ * When you use container managed security (CMS), EAP 6.1 requires the security domain
being
+ * already present in standalone.xml
+ *
+ * With our setup we (re)-create the security domain of RHQUserSecurityDomain
dynamically,
+ * which makes CMS fail on startup and also on re-create.
+ *
+ * The approach of just exchanging login modules does not work correctly either
(principals
+ * keep being cached, server goes into need-reload state).
+ *
+ * So we now have a security domain for the CMS for the REST api that just delegates to
the
+ * RHQUserSecuritDomain.
+ *
+ * <pre>
+ * <security-domain name="RHQRESTSecurityDomain"
cache-type="default">
+ * <authentication>
+ * <login-module
code="org.rhq.enterprise.server.core.jaas.DelegatingLoginModule"
flag="required">
+ * <module-option name="delegateTo"
value="RHQUserSecurityDomain"/>
+ * <module-option name="additionalRoles"
value="rest-user"/>
+ * </login-module>
+ * </authentication>
+ * </security-domain>
+ *</pre>
+ *
+ * @author Heiko W. Rupp
+ */
+@SuppressWarnings("unused")
+public class DelegatingLoginModule extends UsernamePasswordLoginModule {
+
+ private static Log LOG = LogFactory.getLog("DelegatingLoginModule");
+
+ LoginContext loginContext;
+ private String[] usernamePassword;
+ private Principal identity;
+ private List<String> rolesList;
+ private boolean debugEnabled;
+
+ @Override
+ public void initialize(Subject subject, CallbackHandler callbackHandler,
Map<String, ?> sharedState,
+ Map<String, ?> options) {
+
+ debugEnabled = log.isDebugEnabled();
+
+ super.initialize(subject, callbackHandler, sharedState, options);
+
+ /* This is the login context (=security domain) we want to delegate to */
+ String delegateTo = (String) options.get("delegateTo");
+
+ /* Comma separated list of roles that should be set for the principal */
+ String additionalRoles = (String) options.get("roles");
+ rolesList = StringUtil.explode(additionalRoles, ",");
+
+ if (delegateTo ==null || delegateTo.isEmpty()) {
+ delegateTo = "other";
+ LOG.warn("module-option 'delegateTo' was not set. Defaults to
'other'.");
+ }
+
+ if (debugEnabled) {
+ log.debug("Delegating to " + delegateTo + " with roles "
+ additionalRoles);
+ }
+
+ // Now create the context for later use
+ try {
+ loginContext = new LoginContext(delegateTo, new DelegateCallbackHandler());
+ } catch (LoginException e) {
+ log.warn("Initialize failed : " + e.getMessage());
+ }
+ }
+
+ /**
+ * Do the actual login work - we obtain the user/password passed in and then try to
+ * log into the delegated context. If this succeeds, we tell the super-module,
+ * so this can do further processing (especially running the #commit() method).
+ *
+ * @return True on success
+ * @throws LoginException If anything goes wrong
+ */
+ @Override
+ public boolean login() throws LoginException {
+ try {
+ // Get the username / password the user entred and save if for later use
+ usernamePassword = super.getUsernameAndPassword();
+
+ // Try to log in via the delegate
+ loginContext.login();
+
+ // Nix out the password
+ usernamePassword[1] = null;
+
+ // login was success, so we can continue
+ identity = createIdentity(usernamePassword[0]);
+ useFirstPass=true;
+
+ // This next flag is important. Without it the principal will not be
+ // propagated
+ loginOk = true;
+
+ if (debugEnabled) {
+ log.debug("Login ok for " + usernamePassword[0]);
+ }
+
+ return true;
+ } catch (Exception e) {
+ if (debugEnabled) {
+ LOG.debug("Login failed for : " + usernamePassword[0] + ":
" + e.getMessage());
+ }
+ loginOk = false;
+ return false;
+ }
+ }
+
+
+ @Override
+ protected String getUsersPassword() throws LoginException {
+
+ // This is not used but abstract in super.
+ return null;
+ }
+
+ @Override
+ protected Principal getIdentity() {
+ return identity;
+ }
+
+
+ @Override
+ protected Group[] getRoleSets() throws LoginException {
+
+ SimpleGroup roles = new SimpleGroup("Roles");
+
+ for (String role : rolesList ) {
+ roles.addMember( new SimplePrincipal(role));
+ }
+ Group[] roleSets = { roles };
+ return roleSets;
+ }
+
+
+ /**
+ * Handle the callbacks from the other security domain that we delegate to
+ */
+ private class DelegateCallbackHandler implements CallbackHandler {
+ @Override
+ public void handle(Callback[] callbacks) throws IOException,
UnsupportedCallbackException {
+
+ if (debugEnabled) {
+ LOG.debug("private handle callbacks");
+ }
+ for (Callback cb : callbacks) {
+ if (cb instanceof NameCallback) {
+ NameCallback nc = (NameCallback) cb;
+ nc.setName(usernamePassword[0]);
+ }
+ else if (cb instanceof PasswordCallback) {
+ PasswordCallback pc = (PasswordCallback) cb;
+ pc.setPassword(usernamePassword[1].toCharArray());
+ }
+ else {
+ throw new UnsupportedCallbackException(cb,"Callback " + cb
+ " not supported");
+ }
+ }
+ }
+ }
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/JDBCLoginModule.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/JDBCLoginModule.java
index 10fef1a..d12336e 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/JDBCLoginModule.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/JDBCLoginModule.java
@@ -50,7 +50,7 @@ import org.rhq.enterprise.server.RHQConstants;
* this value is "SELECT password FROM principals WHERE principal=?"
*
* dsJndiName
- * JNDI name of the datasource to use. Default value is java:/HypericDS
+ * JNDI name of the datasource to use. Default value is java:/jboss/datasources/RHQDS
* </pre>
*/
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/JDBCPrincipalCheckLoginModule.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/JDBCPrincipalCheckLoginModule.java
index 5640f3f..2b761f6 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/JDBCPrincipalCheckLoginModule.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/JDBCPrincipalCheckLoginModule.java
@@ -38,6 +38,7 @@ import org.apache.commons.logging.LogFactory;
import org.jboss.crypto.CryptoUtil;
import org.jboss.security.SimpleGroup;
+import org.jboss.security.SimplePrincipal;
import org.jboss.security.auth.spi.UsernamePasswordLoginModule;
import org.rhq.enterprise.server.RHQConstants;
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/LdapLoginModule.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/LdapLoginModule.java
index e476eeb..6b7add6 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/LdapLoginModule.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/LdapLoginModule.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.server.core.jaas;
@@ -42,8 +42,8 @@ import org.rhq.enterprise.server.util.LookupUtil;
import org.rhq.enterprise.server.util.security.UntrustedSSLSocketFactory;
/**
- * A login module for authenticating against an LDAP directory server using JNDI, based
on configuration properites LDAP
- * module options:
+ * A login module for authenticating against an LDAP directory server using JNDI, based
on configuration properties.<br/
+ * LDAP module options:
*
* <pre>
* java.naming.factory.initial
@@ -72,7 +72,7 @@ import
org.rhq.enterprise.server.util.security.UntrustedSSLSocketFactory;
* BaseDN
* The base of the LDAP tree we are authenticating against. For example:
* o=Covalent Technologies,c=US. Multiple LDAP bases can be used by
- * seperating each DN by ';'
+ * separating each DN by ';'
*
* BindDN
* The BindDN to use if the LDAP server does not support anonymous searches.
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
index 52cd33d..de3b836 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
@@ -464,7 +464,7 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
}
} else if (property == SystemSetting.AGENT_MAX_QUIET_TIME_ALLOWED) {
long time = Long.parseLong(value);
- // minimum should be 3 * the agent ping interval, any less risks unwanted
backfilling
+ // minimum should be 3 * the agent ping interval, any less risks unwanted
backfilling
if (time < 1000L * 60 * 3) {
throw new InvalidSystemConfigurationException("Agent Max Quiet Time
Allowed must be at least 3 minutes");
}
commit b9ce1ee3cc01fd2bf5614f10e164a1f4cebfe42c
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu May 16 13:11:14 2013 -0400
BZ 957282 957288 add bundle target of "Base Directory"
diff --git a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
index 4a26d19..ad22370 100644
--- a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
@@ -1337,6 +1337,10 @@
<value-context>pluginConfiguration</value-context>
<value-name>homeDir</value-name>
</destination-base-dir>
+ <destination-base-dir name="Base Directory" description="The base
directory for server content, such as '[install-dir]/standalone' (i.e. the value
found in the 'Base Directory' connection property)">
+ <value-context>pluginConfiguration</value-context>
+ <value-name>baseDir</value-name>
+ </destination-base-dir>
<destination-base-dir name="Deploy Directory" description="The
deployment directory for a standalone server">
<value-context>measurementTrait</value-context>
<value-name>deployDir</value-name>
commit f9052819e3da19359081274d62eb6b0f75dd63e2
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Thu May 16 14:28:01 2013 +0200
Bug 962787 - GloballyUncaughtException when changing a parameter in Connection
Settings tab of a compatible group after a plugin update
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/GroupConfigurationEditor.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/GroupConfigurationEditor.java
index 8b5be2c..b3ccb10 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/GroupConfigurationEditor.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/GroupConfigurationEditor.java
@@ -1,8 +1,7 @@
/*
* RHQ Management Platform
- * Copyright 2010-2011, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.gui.coregui.client.components.configuration;
@@ -71,10 +70,10 @@ import org.rhq.enterprise.gui.coregui.client.ImageManager;
import org.rhq.enterprise.gui.coregui.client.PopupWindow;
import org.rhq.enterprise.gui.coregui.client.components.form.SortedSelectItem;
import org.rhq.enterprise.gui.coregui.client.util.StringUtility;
-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.enhanced.EnhancedToolStrip;
import org.rhq.enterprise.gui.coregui.client.util.enhanced.EnhancedVLayout;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
/**
* A SmartGWT widget for editing a group of RHQ {@link Configuration}s that conform to
the same
@@ -638,28 +637,20 @@ public class GroupConfigurationEditor extends ConfigurationEditor {
}
private Property getProperty(Configuration configuration, Property referenceProperty,
Integer index) {
- LinkedList<Property> propertyHierarchy = new LinkedList<Property>();
- Property currentProperty = referenceProperty;
- propertyHierarchy.add(currentProperty);
- do {
- if (currentProperty.getParentMap() != null) {
- currentProperty = currentProperty.getParentMap();
- } else if (currentProperty.getParentList() != null) {
- currentProperty = currentProperty.getParentList();
- } else if (currentProperty.getConfiguration() == null) {
- throw new IllegalStateException(currentProperty + " has no
parent.");
- }
- propertyHierarchy.addFirst(currentProperty);
- } while (currentProperty.getConfiguration() == null);
-
- Property property = configuration.get(propertyHierarchy.get(0).getName());
- for (int i = 1, propertyHierarchySize = propertyHierarchy.size(); i <
propertyHierarchySize; i++) {
- String childPropertyName = propertyHierarchy.get(i).getName();
+ List<Property> referenceHierarchy =
getParentFirstPropertiesHierarchy(referenceProperty);
+ // Add referenceProperty to the configuration, creating parents if necessary
+ Property property = configuration.get(referenceHierarchy.get(0).getName());
+ if (property == null) {
+ property = createPropertyByExample(referenceHierarchy.get(0));
+ configuration.put(property);
+ }
+ for (int i = 1; i < referenceHierarchy.size(); i++) {
+ String childPropertyName = referenceHierarchy.get(i).getName();
if (property instanceof PropertyMap) {
PropertyMap propertyMap = (PropertyMap) property;
property = propertyMap.get(childPropertyName);
if (property == null) {
- property = new PropertySimple(childPropertyName, null);
+ property = createPropertyByExample(referenceHierarchy.get(i));
propertyMap.put(property);
}
} else if (property instanceof PropertyList) {
@@ -667,7 +658,7 @@ public class GroupConfigurationEditor extends ConfigurationEditor {
if (index < propertyList.getList().size()) {
property = propertyList.getList().get(index);
} else {
- property = new PropertySimple(childPropertyName, null);
+ property = createPropertyByExample(referenceHierarchy.get(i));
propertyList.add(property);
}
}
@@ -676,6 +667,35 @@ public class GroupConfigurationEditor extends ConfigurationEditor {
return property;
}
+ private List<Property> getParentFirstPropertiesHierarchy(Property
bottomProperty) {
+ LinkedList<Property> propertyHierarchy = new LinkedList<Property>();
+ for (Property currentProperty = bottomProperty; currentProperty != null; ) {
+ propertyHierarchy.addFirst(currentProperty);
+ if (currentProperty.getParentMap() != null) {
+ currentProperty = currentProperty.getParentMap();
+ } else if (currentProperty.getParentList() != null) {
+ currentProperty = currentProperty.getParentList();
+ } else if (currentProperty.getConfiguration() == null) {
+ throw new IllegalStateException(currentProperty + " has no
parent.");
+ } else {
+ currentProperty = null;
+ }
+ }
+ return new ArrayList<Property>(propertyHierarchy);
+ }
+
+ private <T extends Property> T createPropertyByExample(T example) {
+ T property = null;
+ if (example instanceof PropertyMap) {
+ property = (T) new PropertyMap(example.getName());
+ } else if (example instanceof PropertyList) {
+ property = (T) new PropertyList(example.getName());
+ } else {
+ property = (T) new PropertySimple(example.getName(), null);
+ }
+ return property;
+ }
+
private boolean isAggregateProperty(PropertySimple propertySimple) {
return (getConfiguration(propertySimple) == getConfiguration());
}
commit ac38cd855156fd93958f82b40ca5cf75a3f6593d
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed May 15 17:13:18 2013 -0400
BZ 951382 - for upgrades, let's use the agent preferences upgrade feature
to set the cert store locations explicitly and copy the files
from data/ to conf/ which is the new default location. Note that if
customers already explicitly set the locations of their cert stores,
we leave those intact and continue using what the customer asked to use.
We only do anything IF those settings weren't set and thus defaults
were taking effect.
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationConstants.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationConstants.java
index 4fe7df9..3f9a89b 100644
---
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationConstants.java
+++
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationConstants.java
@@ -58,7 +58,7 @@ public interface AgentConfigurationConstants {
/**
* This is the current schema version that our agent configuration knows about.
*/
- int CURRENT_CONFIG_SCHEMA_VERSION = 6;
+ int CURRENT_CONFIG_SCHEMA_VERSION = 7;
/**
* Flag to indicate if the agent's configuration has been setup.
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationUpgrade.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationUpgrade.java
index 6c0a2ce..27e68f9 100644
---
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationUpgrade.java
+++
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationUpgrade.java
@@ -18,10 +18,17 @@
*/
package org.rhq.enterprise.agent;
+import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.prefs.Preferences;
+import mazz.i18n.Logger;
+
+import org.rhq.core.util.file.FileUtil;
+import org.rhq.enterprise.agent.i18n.AgentI18NFactory;
+import org.rhq.enterprise.agent.i18n.AgentI18NResourceKeys;
+import org.rhq.enterprise.communications.ServiceContainerConfigurationConstants;
import org.rhq.enterprise.communications.util.prefs.PreferencesUpgrade;
import org.rhq.enterprise.communications.util.prefs.PreferencesUpgradeStep;
@@ -31,6 +38,8 @@ import
org.rhq.enterprise.communications.util.prefs.PreferencesUpgradeStep;
* @author John Mazzitelli
*/
public class AgentConfigurationUpgrade extends PreferencesUpgrade {
+ private static final Logger LOG =
AgentI18NFactory.getLogger(AgentConfigurationUpgrade.class);
+
/**
* This is a convenience method that upgrades the given agent preferences to the
latest configuration schema
* version.
@@ -58,7 +67,8 @@ public class AgentConfigurationUpgrade extends PreferencesUpgrade {
list.add(new Step2to3()); // goes from v2 to v3
list.add(new Step3to4()); // goes from v3 to v4
list.add(new Step4to5()); // goes from v4 to v5
- list.add(new Step5to6());
+ list.add(new Step5to6()); // goes from v5 to v6
+ list.add(new Step6to7()); // goes from v6 to v7
return list;
}
@@ -139,4 +149,55 @@ public class AgentConfigurationUpgrade extends PreferencesUpgrade {
preferences.put(AgentConfigurationConstants.SERVER_ALIAS,
"rhqserver");
}
}
+
+ static class Step6to7 extends PreferencesUpgradeStep {
+ public int getSupportedConfigurationSchemaVersion() {
+ return 7;
+ }
+
+ public void upgrade(Preferences preferences) {
+ // This new schema version indicates when we changed the default locations
for our keystore/truststore
+ // files. Before if these comm settings weren't set, we assumed a default
of "data" directory, but now
+ // we assume a default of "conf" directory (if that directory
exists). See BZ 951382.
+ File confDir = new File("conf");
+ if (!confDir.exists()) {
+ return; // conf/ doesn't exist (perhaps we are running in a test?) -
do nothing and just fallback to the standard defaults
+ }
+
+ String dataDir = preferences.get(AgentConfigurationConstants.DATA_DIRECTORY,
+ AgentConfigurationConstants.DEFAULT_DATA_DIRECTORY);
+
+ String prefNamesFileNames[][] = {
+ {
ServiceContainerConfigurationConstants.CONNECTOR_SECURITY_KEYSTORE_FILE,
+
ServiceContainerConfigurationConstants.DEFAULT_CONNECTOR_SECURITY_KEYSTORE_FILE_NAME },
+ {
ServiceContainerConfigurationConstants.CONNECTOR_SECURITY_TRUSTSTORE_FILE,
+
ServiceContainerConfigurationConstants.DEFAULT_CONNECTOR_SECURITY_TRUSTSTORE_FILE_NAME },
+ { AgentConfigurationConstants.CLIENT_SENDER_SECURITY_KEYSTORE_FILE,
+
AgentConfigurationConstants.DEFAULT_CLIENT_SENDER_SECURITY_KEYSTORE_FILE_NAME },
+ { AgentConfigurationConstants.CLIENT_SENDER_SECURITY_TRUSTSTORE_FILE,
+
AgentConfigurationConstants.DEFAULT_CLIENT_SENDER_SECURITY_TRUSTSTORE_FILE_NAME } };
+
+ for (String[] prefNameFileName : prefNamesFileNames) {
+ String value = preferences.get(prefNameFileName[0], null);
+ if (value == null) {
+ File newFile = new File(confDir, prefNameFileName[1]);
+ value = newFile.getAbsolutePath();
+ preferences.put(prefNameFileName[0], value);
+
+ File oldFile = new File(dataDir, prefNameFileName[1]);
+ if (oldFile.exists()) {
+ try {
+ FileUtil.copyFile(oldFile, newFile);
+ oldFile.delete();
+ } catch (Exception e) {
+ LOG.error(e, AgentI18NResourceKeys.CERT_FILE_COPY_ERROR,
oldFile, newFile);
+ }
+ }
+ LOG.debug(AgentI18NResourceKeys.CERT_FILE_LOCATION,
prefNameFileName[0], value);
+ }
+ }
+
+ return;
+ }
+ }
}
\ No newline at end of file
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
index 21a39a9..16c110a 100644
---
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
+++
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
@@ -28,6 +28,9 @@ import mazz.i18n.annotation.I18NResourceBundle;
*/
@I18NResourceBundle(baseName = "agent-messages", defaultLocale =
"en")
public interface AgentI18NResourceKeys {
+ @I18NMessage("Failed to move old cert file [{0}] to new default location [{1}] -
agent communication may fail!")
+ String CERT_FILE_COPY_ERROR = "AgentConfiguration.cert-file-copy-error";
+
@I18NMessage("Explicitly setting file location [{0}] to [{1}]")
String CERT_FILE_LOCATION = "AgentConfiguration.cert-file-location";
commit 3034e3c906a352723834aa4adce41355d7310bce
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed May 15 12:30:18 2013 -0400
provide another sample plugin that demonstrates using the embedded plugin extension
model
diff --git a/.classpath b/.classpath
index aa4c157..53037dd 100644
--- a/.classpath
+++ b/.classpath
@@ -189,6 +189,8 @@
<classpathentry kind="src"
path="modules/integration-tests/jndi-access/jndi-access-test/src/test/resources"/>
<classpathentry kind="src"
path="modules/integration-tests/mod_cluster-plugin-test/src/test/java"/>
<classpathentry kind="src"
path="etc/samples/skeleton-plugin/src/main/java"/>
+ <classpathentry kind="src"
path="etc/samples/embedded-ext-plugin/src/main/java"/>
+ <classpathentry kind="src"
path="etc/samples/skinny-platform/src/main/java"/>
<classpathentry kind="src"
path="etc/samples/custom-serverplugin/src/main/java"/>
<classpathentry kind="src"
path="etc/samples/simplereport-serverplugin/src/main/java"/>
<classpathentry kind="src"
path="etc/agentspawn/src/main/java"/>
diff --git a/etc/samples/embedded-ext-plugin/pom.xml
b/etc/samples/embedded-ext-plugin/pom.xml
new file mode 100644
index 0000000..9427d71
--- /dev/null
+++ b/etc/samples/embedded-ext-plugin/pom.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.rhq.sample.embeddedextplugin</groupId>
+ <artifactId>embedded-ext-plugin</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <name>Embedded Ext RHQ Plugin</name>
+ <description>A sample plugin showing plugin embedded
extention</description>
+
+ <properties>
+ <rhq.version>4.8.0-SNAPSHOT</rhq.version>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${rhq.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-plugin-api</artifactId>
+ <version>${rhq.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-native-system</artifactId>
+ <version>${rhq.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq.sample.skeletonplugin</groupId>
+ <artifactId>skeleton-plugin</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <id>jboss-public-repository-group</id>
+ <name>JBoss Public Maven Repository Group</name>
+
<
url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+</project>
+
diff --git
a/etc/samples/embedded-ext-plugin/src/main/java/org/rhq/sample/embeddedextplugin/EmbeddedExtensionDiscoveryComponent.java
b/etc/samples/embedded-ext-plugin/src/main/java/org/rhq/sample/embeddedextplugin/EmbeddedExtensionDiscoveryComponent.java
new file mode 100644
index 0000000..6e823c3
--- /dev/null
+++
b/etc/samples/embedded-ext-plugin/src/main/java/org/rhq/sample/embeddedextplugin/EmbeddedExtensionDiscoveryComponent.java
@@ -0,0 +1,58 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.sample.embeddedextplugin;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.sample.skeletonplugin.SamplePluginDiscoveryComponent;
+
+/**
+ * This is a discovery class for the embedded extension resource type.
+ */
+public class EmbeddedExtensionDiscoveryComponent extends SamplePluginDiscoveryComponent
{
+ private final Log log =
LogFactory.getLog(EmbeddedExtensionDiscoveryComponent.class);
+
+ @Override
+ public Set<DiscoveredResourceDetails>
discoverResources(ResourceDiscoveryContext context) {
+ log.info("Discovering embedded extension resources");
+ Set<DiscoveredResourceDetails> discoveredResources =
super.discoverResources(context); // call the parent discovery code
+ Set<DiscoveredResourceDetails> extendedResources = new
HashSet<DiscoveredResourceDetails>();
+
+ int i = -1;
+ for (DiscoveredResourceDetails discoveredResource : discoveredResources) {
+ String key = "Embedded Extension Resource Key" + (++i > 0 ?
String.valueOf(i) : "");
+ String name = "Embedded Extension Resource";
+ String description = "This describes the Embedded Extension
Resource";
+
+ discoveredResource.setResourceKey(key);
+ discoveredResource.setResourceName(name);
+ discoveredResource.setResourceDescription(description);
+
+ extendedResources.add(discoveredResource);
+ }
+
+ return extendedResources;
+ }
+}
\ No newline at end of file
diff --git a/etc/samples/embedded-ext-plugin/src/main/resources/META-INF/rhq-plugin.xml
b/etc/samples/embedded-ext-plugin/src/main/resources/META-INF/rhq-plugin.xml
new file mode 100644
index 0000000..16dbb7b
--- /dev/null
+++ b/etc/samples/embedded-ext-plugin/src/main/resources/META-INF/rhq-plugin.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<plugin name="EmbeddedExtPlugin"
+ displayName="Embedded Extension Plugin"
+ version="1.0"
+ package="org.rhq.sample.embeddedextplugin"
+ description="Defines a resource type that uses the embedded extension
model."
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+ <depends plugin="SkeletonPlugin" useClasses="true" />
+
+ <server name="Embedded Extension Resource"
+ discovery="EmbeddedExtensionDiscoveryComponent"
+ class="org.rhq.sample.skeletonplugin.SamplePluginServerComponent"
+ description="A resource that embeds the skeleton plugin type"
+ sourcePlugin="SkeletonPlugin"
+ sourceType="Sample Plugin Server">
+ </server>
+
+</plugin>
commit 8cbe5ffb7379c26403f9083bc7b0642f490ff9eb
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed May 15 11:47:55 2013 -0400
provide some additions to the sample skeleton plugin
add a new "skinny platform" plugin sample, used mainly for testing -
provides a minimal plugin you can use to run an agent with
diff --git a/etc/samples/skeleton-plugin/pom.xml b/etc/samples/skeleton-plugin/pom.xml
index 56c816e..998bb47 100644
--- a/etc/samples/skeleton-plugin/pom.xml
+++ b/etc/samples/skeleton-plugin/pom.xml
@@ -15,7 +15,7 @@
<description>A template for building a custom RHQ Agent
plugin</description>
<properties>
- <rhq.version>4.3.0</rhq.version>
+ <rhq.version>4.8.0-SNAPSHOT</rhq.version>
</properties>
<dependencies>
@@ -42,30 +42,6 @@
<scope>provided</scope> <!-- provided by the
agent/plugin-container -->
</dependency>
- <!-- Fix for the Javac bug requiring annotations to be available when compiling
classes. (fixed in JDK 6) -->
- <dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>persistence-api</artifactId>
- <version>1.0</version>
- <scope>provided</scope> <!-- provided by the
agent/plugin-container -->
- </dependency>
-
- <!-- Fix for the Javac bug requiring annotations to be available when compiling
classes. (fixed in JDK 6) -->
- <dependency>
- <groupId>hibernate-annotations</groupId>
- <artifactId>hibernate-annotations</artifactId>
- <version>3.2.1.GA</version>
- <scope>provided</scope> <!-- provided by the
agent/plugin-container -->
- </dependency>
-
- <!-- Fix for the Javac bug requiring annotations to be available when compiling
classes. (fixed in JDK 6) -->
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.1</version>
- <scope>provided</scope> <!-- provided by the
agent/plugin-container -->
- </dependency>
-
<!--
Uncomment the one of the three logging systems your plugin uses: log4j,
commons-logging or i18nlog
All three are provided to your plugin by the agent/plugin-container.
@@ -143,79 +119,6 @@
</plugins>
</build>
- <profiles>
- <profile>
- <id>dev</id>
- <properties>
- <!-- define the location of your RHQ root directory - typically
rhq.rootDir is overridden in Maven's settings.xml -->
- <rhq.rootDir>/rhq/trunk</rhq.rootDir>
-
<rhq.defaultDevContainerPath>dev-container</rhq.defaultDevContainerPath>
-
<rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
-
<rhq.deploymentDir>${rhq.containerDir}/${rhq.agentPluginDir}</rhq.deploymentDir>
- </properties>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>deploy</id>
- <phase>compile</phase>
- <configuration>
- <target>
- <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}" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- <execution>
- <id>deploy-jar-meta-inf</id>
- <phase>package</phase>
- <configuration>
- <target>
- <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>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- <execution>
- <id>undeploy</id>
- <phase>clean</phase>
- <configuration>
- <target>
- <property name="deployment.file"
location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
- <echo>*** Deleting
${deployment.file}...</echo>
- <delete file="${deployment.file}" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
<repositories>
<repository>
<id>jboss-public-repository-group</id>
diff --git
a/etc/samples/skeleton-plugin/src/main/java/org/rhq/sample/skeletonplugin/SamplePluginChildDiscoveryComponent.java
b/etc/samples/skeleton-plugin/src/main/java/org/rhq/sample/skeletonplugin/SamplePluginChildDiscoveryComponent.java
new file mode 100644
index 0000000..b8a81ab
--- /dev/null
+++
b/etc/samples/skeleton-plugin/src/main/java/org/rhq/sample/skeletonplugin/SamplePluginChildDiscoveryComponent.java
@@ -0,0 +1,47 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.sample.skeletonplugin;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+public class SamplePluginChildDiscoveryComponent implements ResourceDiscoveryComponent {
+ private final Log log =
LogFactory.getLog(SamplePluginChildDiscoveryComponent.class);
+
+ @Override
+ public Set<DiscoveredResourceDetails>
discoverResources(ResourceDiscoveryContext context) {
+ log.info("Discovering my custom plugin's child resources");
+ HashSet<DiscoveredResourceDetails> set = new
HashSet<DiscoveredResourceDetails>();
+ String key = "My Child Resource Key";
+ String name = "My Child Resource";
+ String version = "1.0";
+ String description = "This describes My Child Resource";
+ DiscoveredResourceDetails resource = new
DiscoveredResourceDetails(context.getResourceType(), key, name,
+ version, description, null, null);
+ set.add(resource);
+ return set;
+ }
+}
\ No newline at end of file
diff --git
a/etc/samples/skeleton-plugin/src/main/java/org/rhq/sample/skeletonplugin/SamplePluginChildServiceComponent.java
b/etc/samples/skeleton-plugin/src/main/java/org/rhq/sample/skeletonplugin/SamplePluginChildServiceComponent.java
new file mode 100644
index 0000000..a3303e7
--- /dev/null
+++
b/etc/samples/skeleton-plugin/src/main/java/org/rhq/sample/skeletonplugin/SamplePluginChildServiceComponent.java
@@ -0,0 +1,61 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.sample.skeletonplugin;
+
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.domain.measurement.MeasurementDataNumeric;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.core.pluginapi.measurement.MeasurementFacet;
+
+public class SamplePluginChildServiceComponent implements ResourceComponent,
MeasurementFacet {
+ private final Log log = LogFactory.getLog(SamplePluginChildServiceComponent.class);
+
+ public void start(ResourceContext context) {
+ log.info("Starting child resource [" + context.getResourceKey() +
"]");
+ }
+
+ public void stop() {
+ }
+
+ public AvailabilityType getAvailability() {
+ return AvailabilityType.UP;
+ }
+
+ public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest>
requests) {
+ for (MeasurementScheduleRequest request : requests) {
+ String name = request.getName();
+ try {
+ Number value = new Integer(2); // dummy measurement value
+ report.addData(new MeasurementDataNumeric(request,
value.doubleValue()));
+ } catch (Exception e) {
+ log.error("Failed to obtain measurement [" + name + "].
Cause: " + e);
+ }
+ }
+
+ return;
+ }
+}
diff --git a/etc/samples/skeleton-plugin/src/main/resources/META-INF/rhq-plugin.xml
b/etc/samples/skeleton-plugin/src/main/resources/META-INF/rhq-plugin.xml
index 4f4966d..cde11c5 100644
--- a/etc/samples/skeleton-plugin/src/main/resources/META-INF/rhq-plugin.xml
+++ b/etc/samples/skeleton-plugin/src/main/resources/META-INF/rhq-plugin.xml
@@ -15,6 +15,7 @@
<plugin name="SkeletonPlugin"
displayName="Skeleton Plugin"
version="1.0"
+ description="This is a skeleton plugin that can be used to start your own
custom plugin."
package="org.rhq.sample.skeletonplugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:xmlns:rhq-plugin"
@@ -110,5 +111,24 @@
<resource-configuration>
<c:simple-property name="port" type="integer"
displayName="Port on which to listen" />
</resource-configuration>
+
+ <!--
+ CHANGE: You can optionally define children resource types to represent internal
services within your
+ server resource type.
+ -->
+ <service name="Sample Plugin Child Service"
+ discovery="SamplePluginChildDiscoveryComponent"
+ class="SamplePluginChildServiceComponent"
+ description="This is a child service found under the main, top-level
server resource type.">
+
+ <plugin-configuration>
+ <c:simple-property name="SamplePluginChildProperty"
displayName="Sample Plugin Child Property" default="Value" />
+ </plugin-configuration>
+
+ <metric property="ChildMeasurementName"
+ displayName="The Child Measurement Name"
+ description="Describes what this child measurement is actually
telling you" />
+
+ </service>
</server>
</plugin>
diff --git a/etc/samples/skinny-platform/pom.xml b/etc/samples/skinny-platform/pom.xml
new file mode 100644
index 0000000..994462f
--- /dev/null
+++ b/etc/samples/skinny-platform/pom.xml
@@ -0,0 +1,60 @@
+<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>
+
+ <groupId>org.rhq.sample.skinnyplugin</groupId>
+ <artifactId>rhq-skinny-platform-plugin</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <name>RHQ Skinny Platform Plugin</name>
+ <description> A very slimmed down platform plugin, used for
testing.</description>
+
+ <properties>
+ <rhq.version>4.8.0-SNAPSHOT</rhq.version>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${rhq.version}</version>
+ <scope>provided</scope> <!-- provided by the
agent/plugin-container -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-plugin-api</artifactId>
+ <version>${rhq.version}</version>
+ <scope>provided</scope> <!-- provided by the
agent/plugin-container -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-native-system</artifactId>
+ <version>${rhq.version}</version>
+ <scope>provided</scope> <!-- provided by the
agent/plugin-container -->
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <id>jboss-public-repository-group</id>
+ <name>JBoss Public Maven Repository Group</name>
+
<
url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+</project>
diff --git
a/etc/samples/skinny-platform/src/main/java/org/rhq/plugins/skinnyplatform/PlatformComponent.java
b/etc/samples/skinny-platform/src/main/java/org/rhq/plugins/skinnyplatform/PlatformComponent.java
new file mode 100644
index 0000000..0c123b1
--- /dev/null
+++
b/etc/samples/skinny-platform/src/main/java/org/rhq/plugins/skinnyplatform/PlatformComponent.java
@@ -0,0 +1,39 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.plugins.skinnyplatform;
+
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+
+public class PlatformComponent implements ResourceComponent<PlatformComponent> {
+ public void start(ResourceContext<PlatformComponent> context) {
+ }
+
+ public void stop() {
+ }
+
+ public AvailabilityType getAvailability() {
+ return AvailabilityType.UP;
+ }
+}
\ No newline at end of file
diff --git
a/etc/samples/skinny-platform/src/main/java/org/rhq/plugins/skinnyplatform/PlatformDiscoveryComponent.java
b/etc/samples/skinny-platform/src/main/java/org/rhq/plugins/skinnyplatform/PlatformDiscoveryComponent.java
new file mode 100644
index 0000000..b53b1c3
--- /dev/null
+++
b/etc/samples/skinny-platform/src/main/java/org/rhq/plugins/skinnyplatform/PlatformDiscoveryComponent.java
@@ -0,0 +1,67 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.plugins.skinnyplatform;
+
+import java.net.InetAddress;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+@SuppressWarnings("rawtypes")
+public class PlatformDiscoveryComponent implements ResourceDiscoveryComponent {
+
+ public Set<DiscoveredResourceDetails>
discoverResources(ResourceDiscoveryContext context) {
+ String pcName = context.getPluginContainerName();
+ String hostname = getHostname();
+
+ String name = (pcName != null ? pcName : hostname);
+ String key = "skinny:" + name;
+ String description = context.getResourceType().getDescription();
+ String version = "1.0";
+
+ DiscoveredResourceDetails discoveredResource = new
DiscoveredResourceDetails(context.getResourceType(), key,
+ name, version, description, null, null);
+
+ HashSet<DiscoveredResourceDetails> results = new
HashSet<DiscoveredResourceDetails>();
+ results.add(discoveredResource);
+ return results;
+ }
+
+ private String getHostname() {
+ String name;
+ try {
+ name = InetAddress.getLocalHost().getHostAddress();
+ } catch (Exception e) {
+ name = null;
+ }
+
+ // we fought the good fight but we just can't get this machine's
hostname, give a generic platform name
+ if (name == null) {
+ name = "Unnamed Skinny Platform";
+ }
+ return name;
+ }
+}
\ No newline at end of file
diff --git a/etc/samples/skinny-platform/src/main/resources/META-INF/rhq-plugin.xml
b/etc/samples/skinny-platform/src/main/resources/META-INF/rhq-plugin.xml
new file mode 100644
index 0000000..fd50a2a
--- /dev/null
+++ b/etc/samples/skinny-platform/src/main/resources/META-INF/rhq-plugin.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<plugin name="Skinny Platform"
+ displayName="Skinny Platform"
+ version="1.0"
+ package="org.rhq.plugins.skinnyplatform"
+ description="Provides a slimmed down, single platform resource type - used
mainly for testing."
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+ <platform name="Generic Platform"
+ class="PlatformComponent"
+ discovery="PlatformDiscoveryComponent"
+ description="A generic platform with very little
functionality.">
+ </platform>
+
+</plugin>
commit 98cb0afd7a2bcfcb8f74f3d8182fb9798edd2b49
Author: mtho11 <mikecthompson(a)gmail.com>
Date: Tue May 14 10:38:22 2013 -0700
[BZ 960646] - Trivial: strengthen opacity on new Availability chart.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
index 5ef57a8..a301e73 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
@@ -243,7 +243,7 @@ public class AvailabilityOverUnderGraphType {
.attr("width", function (d) {
return timeScale(+d.availEnd) - timeScale(+d.availStart);
})
- .attr("opacity", ".3")
+ .attr("opacity", ".75")
.attr("fill", function (d) {
return calcBarFill(d);
});
@@ -265,7 +265,7 @@ public class AvailabilityOverUnderGraphType {
.style("font-size", "12px")
.style("font-family", "Arial, Verdana,
sans-serif;")
.style("font-weight", "bold")
- .attr("fill", "#003168")
+ .attr("fill", "#545454")
.text(availChartContext.chartTitle);
svg.append("text")
commit cf37517727392d04d8ab11182fd94474571462d8
Author: mtho11 <mikecthompson(a)gmail.com>
Date: Tue May 14 09:20:26 2013 -0700
[BZ 960646] - UXD updates to new Availability Charts.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
index fbce610..5ef57a8 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
@@ -169,9 +169,9 @@ public class AvailabilityOverUnderGraphType {
.orient("bottom"),
calcBarY = function (d) {
- var ABOVE = -10,
+ var ABOVE = -6,
BELOW = 0,
- STRADDLE = -5,
+ STRADDLE = -3,
offset;
if (d.availType === 'DOWN') {
@@ -198,19 +198,19 @@ public class AvailabilityOverUnderGraphType {
calcBarFill = function (d) {
if (d.availType === 'DOWN') {
- return "#FF1919"; // red
+ return "#c5888b"; // red
}
else if (d.availType === 'DISABLED') {
return "url(#diagonalHatchFill)"; // grey
diagonal hatches
}
else if (d.availType === 'UNKNOWN') {
- return "#CCC"; // gray
+ return "#d8d8d8"; // gray
}
else if (d.availType === 'UP') {
- return "#198C19"; // green
+ return "#8cbe89"; // green
}
else if (d.availType === 'WARN') {
- return "#FFA500"; // orange
+ return "#e1b36b"; // orange
}
else if (d.availType === 'EMPTY') {
return "#CCC"; // gray
@@ -238,12 +238,12 @@ public class AvailabilityOverUnderGraphType {
return calcBarY(d);
})
.attr("height", function (d) {
- return 10;
+ return 6;
})
.attr("width", function (d) {
return timeScale(+d.availEnd) - timeScale(+d.availStart);
})
- .attr("opacity", ".9")
+ .attr("opacity", ".3")
.attr("fill", function (d) {
return calcBarFill(d);
});
@@ -251,7 +251,7 @@ public class AvailabilityOverUnderGraphType {
// create x-axis
svg.append("g")
.attr("class", "x axis")
- .attr("fill", "#50505a")
+ .attr("fill", "#b0b0b0")
.attr("stroke-width", "0.5")
.attr("transform", "translate(0," + height +
")")
.attr("letter-spacing", "3")
@@ -274,7 +274,7 @@ public class AvailabilityOverUnderGraphType {
.attr("y", 28)
.style("font-family", "Arial, Verdana,
sans-serif;")
.style("font-size", "9px")
- .attr("fill", "#50505a")
+ .attr("fill", "#545454")
.style("text-anchor", "end")
.text(availChartContext.chartUpLabel);
@@ -284,7 +284,7 @@ public class AvailabilityOverUnderGraphType {
.attr("y", 39)
.style("font-family", "Arial, Verdana,
sans-serif;")
.style("font-size", "9px")
- .attr("fill", "#50505a")
+ .attr("fill", "#545454")
.style("text-anchor", "end")
.text(availChartContext.chartDownLabel);
commit af1fdd5d865ab295969f80949b36c3c38c70ccef
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Tue May 14 13:21:44 2013 +0200
Fixing a typo in a sample CLI script.
diff --git
a/modules/enterprise/remoting/cli/src/main/samples/deploy-to-and-restart-JBAS.js
b/modules/enterprise/remoting/cli/src/main/samples/deploy-to-and-restart-JBAS.js
index 9739cb1..a965edf 100644
--- a/modules/enterprise/remoting/cli/src/main/samples/deploy-to-and-restart-JBAS.js
+++ b/modules/enterprise/remoting/cli/src/main/samples/deploy-to-and-restart-JBAS.js
@@ -146,7 +146,7 @@ function _restartFunction(asResourceType) {
(asResourceType.name == "JBossAS7 Standalone Server" ||
asResourceType.name == "Managed Server")) {
- return _restartAS7);
+ return _restartAS7;
} else {
throw "The resource group the destination targets doesn't seem to be a
JBoss AS server group.";
}
commit 9a3b4d105099320c6c6794ff04e12285c5399667
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Thu May 9 15:15:02 2013 +0200
[BZ 620603] - Re-enabling the limited JOIN FETCH reporting
with a more informative message, asking the users to co-operate in
identifying the individual uses of the problematic JOIN FETCH queries that
we potentially missed.
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/util/JoinFetchReportingQueryTranslator.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/util/JoinFetchReportingQueryTranslator.java
index f826e41..8eb4b3e 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/util/JoinFetchReportingQueryTranslator.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/util/JoinFetchReportingQueryTranslator.java
@@ -15,8 +15,8 @@ import org.hibernate.event.spi.EventSource;
import org.hibernate.hql.internal.ast.QueryTranslatorImpl;
/**
- * This class can be used to quickly identify and analyze usages of JOIN FETCH together
with limits on JPA queries.
- * It will log the JPA, generated SQL and a filtered stacktrace for each such usage. This
is to enhance the diagnostics
+ * This class can be used to quickly identify and analyze usages of JOIN FETCH together
with limits on JPA queries. It
+ * will log the JPA, generated SQL and a filtered stacktrace for each such usage. This is
to enhance the diagnostics
* that Hibernate itself offers that merely dumps a message about in-memory filtering of
results resulting from the use
* of JOIN FETCH together with limits.
*
@@ -24,7 +24,7 @@ import org.hibernate.hql.internal.ast.QueryTranslatorImpl;
*/
public class JoinFetchReportingQueryTranslator extends QueryTranslatorImpl {
- private static Log LOG = LogFactory.getLog("JOIN FETCH Perf");
+ private static Log LOG = LogFactory.getLog("JOIN FETCH Performance");
public JoinFetchReportingQueryTranslator(String queryIdentifier, String query, Map
enabledFilters,
SessionFactoryImplementor factory) {
@@ -49,11 +49,14 @@ public class JoinFetchReportingQueryTranslator extends
QueryTranslatorImpl {
}
}
- public void report() {
+ public void report(String method) {
if (time != 0) {
time = System.currentTimeMillis() - time;
- LOG.warn("List with first: " + firstRow + ", max: " +
maxRows + " took " + time + "ms:\n" +
- getQueryString() + "\n\nSQL:\n" + getSQLString() +
"\n" + extractRHQCalls(new Exception()));
+ LOG.warn("Encountered a query with potentially bad performance.
While this is not a bug and the " +
+ "system functions as designed, please report this to RHQ
community so that we can reimplement our" +
+ " code to work better.\n" + method + "() with first:
" + firstRow + ", max: " + maxRows + " took "
+ + time + "ms:\n" + getQueryString() +
"\n\nSQL:\n" + getSQLString() + "\n" +
+ extractRHQCalls(new Exception()));
}
}
@@ -80,7 +83,7 @@ public class JoinFetchReportingQueryTranslator extends
QueryTranslatorImpl {
List ret = super.list(session, queryParameters);
- usage.report();
+ usage.report("list");
return ret;
}
@@ -91,7 +94,7 @@ public class JoinFetchReportingQueryTranslator extends
QueryTranslatorImpl {
Iterator ret = super.iterate(queryParameters, session);
- usage.report();
+ usage.report("iterate");
return ret;
}
@@ -103,7 +106,7 @@ public class JoinFetchReportingQueryTranslator extends
QueryTranslatorImpl {
ScrollableResults ret = super.scroll(queryParameters, session);
- usage.report();
+ usage.report("scroll");
return ret;
}
diff --git a/modules/core/domain/src/main/resources/META-INF/persistence.xml
b/modules/core/domain/src/main/resources/META-INF/persistence.xml
index a15fd2e..1bbd8c2 100644
--- a/modules/core/domain/src/main/resources/META-INF/persistence.xml
+++ b/modules/core/domain/src/main/resources/META-INF/persistence.xml
@@ -21,9 +21,7 @@
<!--<property name="com.intellij.javaee.persistence.datasource"
value="rhq-oracle" />-->
<property name="com.intellij.javaee.persistence.datasource"
value="rhq-postgres" />
- <!-- Used only for debugging the usages of JOIN FETCHes
<property name="hibernate.query.factory_class"
value="org.rhq.core.domain.util.JoinFetchReportingQueryTranslatorFactory" />
- -->
<!-- This value doesn't have any theoretical grounds and is purely based
on experiments. Value of 32 gives
the best compromise between the quick load of queries with low and high
limits (i.e. page size in tens vs.
commit db62629626fdd9049cf89cfa58dc5b14b2a98ea9
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Thu May 9 13:11:50 2013 +0200
[BZ 620603] - Don't use JOIN FETCH in criteria queries with limits.
Use the "manual" initialization of lazy fields and collections in
that case instead.
Together with the "hibernate.default_batch_fetch_size" setting in the
hibernate configuration, this offers superior performance over the join
fetch and in memory filtering of results when the number of rows in the
"primary" tables times the number of rows in the "join-fetched"
table
is non-trivial.
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/util/JoinFetchReportingQueryTranslator.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/util/JoinFetchReportingQueryTranslator.java
new file mode 100644
index 0000000..f826e41
--- /dev/null
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/util/JoinFetchReportingQueryTranslator.java
@@ -0,0 +1,110 @@
+package org.rhq.core.domain.util;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.hibernate.HibernateException;
+import org.hibernate.ScrollableResults;
+import org.hibernate.engine.spi.QueryParameters;
+import org.hibernate.engine.spi.SessionFactoryImplementor;
+import org.hibernate.engine.spi.SessionImplementor;
+import org.hibernate.event.spi.EventSource;
+import org.hibernate.hql.internal.ast.QueryTranslatorImpl;
+
+/**
+ * This class can be used to quickly identify and analyze usages of JOIN FETCH together
with limits on JPA queries.
+ * It will log the JPA, generated SQL and a filtered stacktrace for each such usage. This
is to enhance the diagnostics
+ * that Hibernate itself offers that merely dumps a message about in-memory filtering of
results resulting from the use
+ * of JOIN FETCH together with limits.
+ *
+ * @author Lukas Krejci
+ */
+public class JoinFetchReportingQueryTranslator extends QueryTranslatorImpl {
+
+ private static Log LOG = LogFactory.getLog("JOIN FETCH Perf");
+
+ public JoinFetchReportingQueryTranslator(String queryIdentifier, String query, Map
enabledFilters,
+ SessionFactoryImplementor factory) {
+ super(queryIdentifier, query, enabledFilters, factory);
+ }
+
+ private class JoinFetchUsage {
+ private long time;
+ private Integer firstRow;
+ private Integer maxRows;
+
+ public JoinFetchUsage(QueryParameters queryParameters) {
+ boolean collect = containsCollectionFetches();
+ boolean hasLimit =
+ queryParameters.getRowSelection() != null &&
queryParameters.getRowSelection().definesLimits();
+
+ if (collect && hasLimit) {
+ firstRow = queryParameters.getRowSelection().getFirstRow();
+ maxRows = queryParameters.getRowSelection().getMaxRows();
+
+ time = System.currentTimeMillis();
+ }
+ }
+
+ public void report() {
+ if (time != 0) {
+ time = System.currentTimeMillis() - time;
+ LOG.warn("List with first: " + firstRow + ", max: " +
maxRows + " took " + time + "ms:\n" +
+ getQueryString() + "\n\nSQL:\n" + getSQLString() +
"\n" + extractRHQCalls(new Exception()));
+ }
+ }
+
+ private String extractRHQCalls(Throwable t) {
+ StringBuilder bld = new StringBuilder();
+
+ StackTraceElement[] elements = t.getStackTrace();
+
+ //skip the report() and list() calls, hence 2
+ for (int i = 2; i < elements.length; ++i) {
+ StackTraceElement e = elements[i];
+ if (e.getClassName().startsWith("org.rhq")) {
+ bld.append("\n").append(e.toString());
+ }
+ }
+
+ return bld.toString();
+ }
+ }
+
+ @Override
+ public List list(SessionImplementor session, QueryParameters queryParameters) throws
HibernateException {
+ JoinFetchUsage usage = new JoinFetchUsage(queryParameters);
+
+ List ret = super.list(session, queryParameters);
+
+ usage.report();
+
+ return ret;
+ }
+
+ @Override
+ public Iterator iterate(QueryParameters queryParameters, EventSource session) throws
HibernateException {
+ JoinFetchUsage usage = new JoinFetchUsage(queryParameters);
+
+ Iterator ret = super.iterate(queryParameters, session);
+
+ usage.report();
+
+ return ret;
+ }
+
+ @Override
+ public ScrollableResults scroll(QueryParameters queryParameters, SessionImplementor
session)
+ throws HibernateException {
+ JoinFetchUsage usage = new JoinFetchUsage(queryParameters);
+
+ ScrollableResults ret = super.scroll(queryParameters, session);
+
+ usage.report();
+
+ return ret;
+ }
+}
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/util/JoinFetchReportingQueryTranslatorFactory.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/util/JoinFetchReportingQueryTranslatorFactory.java
new file mode 100644
index 0000000..71e1bf2
--- /dev/null
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/util/JoinFetchReportingQueryTranslatorFactory.java
@@ -0,0 +1,27 @@
+package org.rhq.core.domain.util;
+
+import java.util.Map;
+
+import org.hibernate.engine.spi.SessionFactoryImplementor;
+import org.hibernate.hql.spi.FilterTranslator;
+import org.hibernate.hql.spi.QueryTranslator;
+import org.hibernate.hql.spi.QueryTranslatorFactory;
+
+/**
+ * A query translator factory to be set in the hibernate configuration to report the
usage of JOIN FETCH with limit.
+ *
+ * @author Lukas Krejci
+ */
+public class JoinFetchReportingQueryTranslatorFactory implements QueryTranslatorFactory
{
+ @Override
+ public QueryTranslator createQueryTranslator(String queryIdentifier, String
queryString, Map filters,
+ SessionFactoryImplementor factory) {
+ return new JoinFetchReportingQueryTranslator(queryIdentifier, queryString,
filters, factory);
+ }
+
+ @Override
+ public FilterTranslator createFilterTranslator(String queryIdentifier, String
queryString, Map filters,
+ SessionFactoryImplementor factory) {
+ return new JoinFetchReportingQueryTranslator(queryIdentifier, queryString,
filters, factory);
+ }
+}
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/util/PageControl.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/util/PageControl.java
index 6963141..f87a814 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/util/PageControl.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/util/PageControl.java
@@ -276,6 +276,10 @@ public class PageControl implements Serializable, Cloneable {
orderingFields = new LinkedList<OrderingField>();
}
+ public boolean isUnlimited() {
+ return getPageNumber() == 0 && getPageSize() == SIZE_UNLIMITED;
+ }
+
// TODO (ips, 10/12/11): Incorporate firstRecord field into equals() and hashCode().
@Override
@@ -334,4 +338,4 @@ public class PageControl implements Serializable, Cloneable {
return new PageControl(pageNumber, pageSize, getOrderingFieldsAsArray());
}
-}
\ No newline at end of file
+}
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/util/UnlimitedPageControl.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/util/UnlimitedPageControl.java
index ce7ab20..af5842a 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/util/UnlimitedPageControl.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/util/UnlimitedPageControl.java
@@ -30,6 +30,11 @@ public class UnlimitedPageControl extends PageControl {
}
@Override
+ public boolean isUnlimited() {
+ return true;
+ }
+
+ @Override
public void reset() {
getOrderingFields().clear();
}
diff --git a/modules/core/domain/src/main/resources/META-INF/persistence.xml
b/modules/core/domain/src/main/resources/META-INF/persistence.xml
index 8e28c68..a15fd2e 100644
--- a/modules/core/domain/src/main/resources/META-INF/persistence.xml
+++ b/modules/core/domain/src/main/resources/META-INF/persistence.xml
@@ -20,6 +20,16 @@
<!--<property name="com.intellij.javaee.persistence.datasource"
value="rhq-oracle" />-->
<property name="com.intellij.javaee.persistence.datasource"
value="rhq-postgres" />
+
+ <!-- Used only for debugging the usages of JOIN FETCHes
+ <property name="hibernate.query.factory_class"
value="org.rhq.core.domain.util.JoinFetchReportingQueryTranslatorFactory" />
+ -->
+
+ <!-- This value doesn't have any theoretical grounds and is purely based
on experiments. Value of 32 gives
+ the best compromise between the quick load of queries with low and high
limits (i.e. page size in tens vs.
+ thousands) in an inventory with 30 agents and >20000 resources. -->
+ <property name="hibernate.default_batch_fetch_size"
value="32"/>
+
</properties>
</persistence-unit>
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/RHQDomain.gwt.xml
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/RHQDomain.gwt.xml
index 9066916..afa622f 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/RHQDomain.gwt.xml
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/RHQDomain.gwt.xml
@@ -40,10 +40,11 @@
<!-- These classes are overriden for GWT because their original form
doesn't gwt-compile. -->
<exclude name="**/ObfuscatedPropertySimple.*"/>
+ <exclude name="**/JoinFetchReporting*.*" />
</source>
<!--<generate-with
class="org.rhq.core.rebind.RecordBuilderGenerator">
<when-type-assignable
class="org.rhq.core.domain.util.Recordizable"/>
</generate-with>-->
-</module>
\ No newline at end of file
+</module>
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/domain/util/JoinFetchReportingQueryTranslator.java
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/domain/util/JoinFetchReportingQueryTranslator.java
new file mode 100644
index 0000000..e92696e
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/domain/util/JoinFetchReportingQueryTranslator.java
@@ -0,0 +1,9 @@
+package org.rhq.core.domain.util;
+
+/**
+ * GWT friendly impl of this beast.
+ *
+ * @author Lukas Krejci
+ */
+public class JoinFetchReportingQueryTranslator {
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/domain/util/JoinFetchReportingQueryTranslatorFactory.java
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/domain/util/JoinFetchReportingQueryTranslatorFactory.java
new file mode 100644
index 0000000..9bd8512
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/domain/util/JoinFetchReportingQueryTranslatorFactory.java
@@ -0,0 +1,7 @@
+package org.rhq.core.domain.util;
+
+/**
+ * @author Lukas Krejci
+ */
+public class JoinFetchReportingQueryTranslatorFactory {
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
index 8f0d2cc..d7cc470 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java
@@ -308,7 +308,11 @@ public final class CriteriaQueryGenerator {
public String getQueryString(boolean countQuery) {
StringBuilder results = new StringBuilder();
+
+ PageControl pc = getPageControl(criteria);
+
results.append("SELECT ");
+
if (countQuery) {
if (groupByClause == null) { // non-grouped method
// use count(*) instead of count(alias) due to
https://bugzilla.redhat.com/show_bug.cgi?id=699842
@@ -325,7 +329,9 @@ public final class CriteriaQueryGenerator {
results.append(projection).append(NL);
}
}
+
results.append("FROM ").append(className).append('
').append(alias).append(NL);
+
if (countQuery == false) {
/*
* don't fetch in the count query to avoid: "query specified join
fetching,
@@ -336,19 +342,28 @@ public final class CriteriaQueryGenerator {
addPersistentBag(fetchField);
} else {
if (this.projection == null) {
- /*
+ /*
* if not altering the projection, join fetching can be using
* to retrieve the associated instance in the same SELECT
+ *
+ * We further avoid a JOIN FETCH when executing queries with
limits.
+ * Such execution has performance problems that we solve by
initializing the fields
+ * "manually" in the CriteriaQueryRunner and by
defining a default batch fetch size in the
+ * persistence.xml.
*/
- results.append("LEFT JOIN FETCH
").append(alias).append('.').append(fetchField).append(NL);
+ if (pc.isUnlimited()) {
+ results.append("LEFT JOIN FETCH
").append(alias).append('.').append(fetchField).append(NL);
+ } else {
+ addJoinFetch(fetchField);
+ }
} else {
- /*
+ /*
* if the projection is altered (perhaps converting it into a
constructor query), then all
* fields specified in the fetch must be in the explicit return
list. this is not possible
* today with constructor queries, so any altered projection will
implicitly disable fetching.
* instead, we'll record which fields need to be explicitly
fetched after the primary query
* returns the bulk of the data, and use a similar methodology at
the SLSB layer to eagerly
- * load those before returning the PageList back to the caller.
+ * load those before returning the PageList back to the caller.
*/
addJoinFetch(fetchField);
}
@@ -357,7 +372,6 @@ public final class CriteriaQueryGenerator {
}
// figure out the 'LEFT JOIN's needed for 'ORDER BY' tokens
- PageControl pc = getPageControl(criteria);
List<String> orderingFieldRequiredJoins = new ArrayList<String>();
List<String> orderingFieldTokens = new ArrayList<String>();
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryRunner.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryRunner.java
index d2a28d5..a788fb0 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryRunner.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryRunner.java
@@ -25,6 +25,7 @@ package org.rhq.enterprise.server.util;
import java.lang.reflect.Field;
import java.util.Collection;
+import java.util.Iterator;
import java.util.List;
import javax.persistence.EntityManager;
@@ -46,7 +47,7 @@ public class CriteriaQueryRunner<T> {
private Criteria criteria;
private CriteriaQueryGenerator queryGenerator;
private EntityManager entityManager;
- private boolean automaticFetching;;
+ private boolean automaticFetching;
public CriteriaQueryRunner(Criteria criteria, CriteriaQueryGenerator queryGenerator,
EntityManager entityManager) {
this(criteria, queryGenerator, entityManager, true);
@@ -61,7 +62,7 @@ public class CriteriaQueryRunner<T> {
}
public PageList<T> execute() {
- PageList<T> results = null;
+ PageList<T> results;
PageControl pageControl = CriteriaQueryGenerator.getPageControl(criteria);
Restriction criteriaRestriction = criteria.getRestriction();
@@ -109,7 +110,7 @@ public class CriteriaQueryRunner<T> {
initPersistentBags(entity);
}
}
- if (queryGenerator.isProjectionAltered() &&
!queryGenerator.getJoinFetchFields().isEmpty()) {
+ if (!queryGenerator.getJoinFetchFields().isEmpty()) {
for (T entity : results) {
initJoinFetchFields(entity);
}
@@ -148,7 +149,15 @@ public class CriteriaQueryRunner<T> {
private void initialize(Object entity, Field field) {
try {
field.setAccessible(true);
- Hibernate.initialize(field.get(entity));
+
+ Object instance = field.get(entity);
+
+ Hibernate.initialize(instance);
+
+ if (instance instanceof Iterable) {
+ Iterator<?> it = ((Iterable<?>)instance).iterator();
+ while(it.hasNext()) it.next();
+ }
} catch (Exception e) {
LOG.warn("Could not initialize " + field);
}
diff --git
a/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/safeinvoker/HibernateDetachUtility.java
b/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/safeinvoker/HibernateDetachUtility.java
index c012d90..8259fde 100644
---
a/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/safeinvoker/HibernateDetachUtility.java
+++
b/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/safeinvoker/HibernateDetachUtility.java
@@ -419,7 +419,7 @@ public class HibernateDetachUtility {
String assistNameDelimiter =
assistClassName.contains("javassist") ? "_$$_" : "$$";
assistClassName = assistClassName.substring(0,
assistClassName.indexOf(assistNameDelimiter));
- if
(!replacement.getClass().getName().contains("hibernate")) {
+ if (replacement != null &&
!replacement.getClass().getName().contains("hibernate")) {
nullOutUninitializedFields(replacement, checkedObjects,
checkedObjectCollisionMap,
depth + 1, serializationType);
@@ -607,4 +607,4 @@ public class HibernateDetachUtility {
// ignore this
}
}
-}
\ No newline at end of file
+}
commit 6079e06ac677015c8f87838e7ac8e52cc766d5f6
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Mon May 13 12:36:17 2013 +0200
Bug 962379 - [as7] Garbage Collector Resource misses 'collection-count' and
'collection-time' per minute metrics
diff --git a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
index 742c4d5..4a26d19 100644
--- a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
@@ -7214,8 +7214,8 @@
<c:simple-property name="includeRuntime" readOnly="true"
default="true"/>
</plugin-configuration>
- <metric property="collection-count" description="The total
number of collections that have occurred."/>
- <metric property="collection-time" description="The approximate
accumulated collection elapsed time in milliseconds."/>
+ <metric property="collection-count" description="The total
number of collections that have occurred." measurementType="trendsup"/>
+ <metric property="collection-time" description="The approximate
accumulated collection elapsed time in milliseconds."
measurementType="trendsup"/>
<metric property="name" dataType="trait"
description="The name representing this garbage collector"/>
<metric property="valid" dataType="trait"
description="Whether this this memory manager is valid in the Java virtual
machine."/>
commit 8130e34b50dfc81ae0074ac789d784d159b7b9aa
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri May 10 17:01:01 2013 -0400
BZ 699893 911692 - if the user ran EAP 5 with cmd line option
-Djboss.server.data.dir=/some/data/dir
then the AS5 plugin should look there, too, to try to find the jnp-service.url file
diff --git
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
index 01eb105..670347f 100644
---
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
+++
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
@@ -500,32 +500,42 @@ public class ApplicationServerDiscoveryComponent implements
ResourceDiscoveryCom
}
private String getJnpURL(JBossInstanceInfo cmdLine, File installHome, File configDir)
{
- File jnpServiceUrlFile = new File(configDir, "data/jnp-service.url");
- if (jnpServiceUrlFile.exists() && jnpServiceUrlFile.canRead()) {
- BufferedReader br = null;
- try {
- br = new BufferedReader(new FileReader(jnpServiceUrlFile));
- String jnpUrl = br.readLine();
- if (jnpUrl != null) {
- if (log.isDebugEnabled()) {
- log.debug("Read JNP URL from jnp-service.url file: " +
jnpUrl);
+ ArrayList<File> possibleJnpServiceUrlFiles = new ArrayList<File>(2);
+ possibleJnpServiceUrlFiles.add(new File(configDir,
"data/jnp-service.url"));
+ // if the app server was told to go somewhere else to store its data files, look
in there too (BZ 699893)
+ if (cmdLine.getSystemProperties() != null) {
+ String dataDir =
cmdLine.getSystemProperties().getProperty("jboss.server.data.dir");
+ if (dataDir != null) {
+ possibleJnpServiceUrlFiles.add(new File(dataDir,
"jnp-service.url"));
+ }
+ }
+ for (File jnpServiceUrlFile : possibleJnpServiceUrlFiles) {
+ if (jnpServiceUrlFile.exists() && jnpServiceUrlFile.canRead()) {
+ BufferedReader br = null;
+ try {
+ br = new BufferedReader(new FileReader(jnpServiceUrlFile));
+ String jnpUrl = br.readLine();
+ if (jnpUrl != null) {
+ if (log.isDebugEnabled()) {
+ log.debug("Read JNP URL from jnp-service.url file:
" + jnpUrl);
+ }
+ return jnpUrl;
}
- return jnpUrl;
- }
- } catch (IOException ioe) {
- // Nothing to do
- } finally {
- if (br != null) {
- try {
- br.close();
- } catch (IOException e) {
- // nada
+ } catch (IOException ioe) {
+ // Nothing to do
+ } finally {
+ if (br != null) {
+ try {
+ br.close();
+ } catch (IOException e) {
+ // nada
+ }
}
}
}
}
- log.warn("Failed to read JNP URL from '" + jnpServiceUrlFile +
"'.");
+ log.warn("Failed to read JNP URL from: " +
possibleJnpServiceUrlFiles);
// Above did not work, so fall back to our previous scheme
JnpConfig jnpConfig = getJnpConfig(installHome, configDir,
cmdLine.getSystemProperties());
commit d2523a093115225352825051b5a795a7226a7c23
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri May 10 15:56:04 2013 -0400
BZ 903402 - fix code if windows drive is missing but otherwise the path is absolute
diff --git
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JBossInstanceInfo.java
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JBossInstanceInfo.java
index 35a2263..e3c4a27 100644
---
a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JBossInstanceInfo.java
+++
b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JBossInstanceInfo.java
@@ -243,7 +243,7 @@ public class JBossInstanceInfo {
for (String pathElement : this.classPath) {
if (pathElement.endsWith("run.jar")) {
runJar = new File(pathElement);
- if (!runJar.isAbsolute()) {
+ if (!runJar.isAbsolute() && !runJar.exists()) {
runJar = new File(this.processInfo.getExecutable().getCwd(),
runJar.getPath());
}
if (!runJar.exists()) {
diff --git
a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/helper/JBossInstanceInfo.java
b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/helper/JBossInstanceInfo.java
index 9dadd39..b515af7 100644
---
a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/helper/JBossInstanceInfo.java
+++
b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/helper/JBossInstanceInfo.java
@@ -237,7 +237,7 @@ public class JBossInstanceInfo {
for (String pathElement : this.classPath) {
if (pathElement.endsWith("run.jar")) {
runJar = new File(pathElement);
- if (!runJar.isAbsolute()) {
+ if (!runJar.isAbsolute() && !runJar.exists()) {
runJar = new File(this.processInfo.getExecutable().getCwd(),
runJar.getPath());
}
if (!runJar.exists()) {
commit 01d875b284d842df2ac4f099598b5f2a5f320bf2
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri May 10 16:34:51 2013 +0200
Provide the old method signature as fallback in case other plugins that inherit from
this one, still need it.
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JBossProductType.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JBossProductType.java
index 9eb63f9..48fbf1f 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JBossProductType.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JBossProductType.java
@@ -53,12 +53,23 @@ public enum JBossProductType {
}
/**
+ * Determine the product type of a JBoss install. This implies an api version of 1.x
which
+ * is a JBossAS 7.x
+ * @param homeDir the JBoss product installation directory (e.g.
/opt/jboss-as-7.1.1.Final)
+ * @return the product type
+ * @deprecated "Use the version with the apiVersion"
+ */
+ @Deprecated
+ public static JBossProductType determineJBossProductType(File homeDir) {
+ return determineJBossProductType(homeDir,"1.0");
+ }
+
+ /**
* Determines the product type of a JBoss product installation.
*
- *
* @param homeDir the JBoss product installation directory (e.g.
/opt/jboss-as-7.1.1.Final)
*
- * @param apiVersion
+ * @param apiVersion Api version of the domain api.
* @return the product type
*/
public static JBossProductType determineJBossProductType(File homeDir, String
apiVersion) {
commit 3bba88c36f7d4a91ac5ac824c0e5b7fd43c3dd0b
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri May 10 14:39:21 2013 +0200
BZ 961787 - try to determine AS/WFLY via domain api version before falling back to
directory names, as this is more reliable.
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
index 9a4d5bd..cc13406 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
@@ -193,7 +193,8 @@ public abstract class BaseProcessDiscovery implements
ResourceDiscoveryComponent
serverPluginConfig.setHostname(managementHostPort.host);
serverPluginConfig.setPort(managementHostPort.port);
pluginConfig.setSimpleValue("realm",
hostConfig.getManagementSecurityRealm());
- JBossProductType productType =
JBossProductType.determineJBossProductType(homeDir);
+ String apiVersion = hostConfig.getDomainApiVersion();
+ JBossProductType productType =
JBossProductType.determineJBossProductType(homeDir, apiVersion);
serverPluginConfig.setProductType(productType);
pluginConfig.setSimpleValue("hostXmlFileName",
getHostXmlFileName(commandLine));
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JBossProductType.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JBossProductType.java
index 9edfb2f..9eb63f9 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JBossProductType.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JBossProductType.java
@@ -37,7 +37,7 @@ public enum JBossProductType {
JPP("JPP", "JBoss EAP 6", "JBoss Portal Platform 6",
"Portal Platform"),
// EWP("EWP", "JBoss EWP 6", "JBoss Enterprise Web Platform
6", "EWP"),
SOA("SOA-P", "JBoss SOA-P 6", "JBoss Enterprise SOA Platform
(ESB)", "SOAP"),
- WILDFLY8("WildFly","WildFly 8" ,"WildFly Appliction Server
8" , "WildFly");
+ WILDFLY8("WildFly","WildFly 8" ,"WildFly Application Server
8" , "WildFly");
public final String SHORT_NAME;
public final String NAME;
@@ -55,13 +55,28 @@ public enum JBossProductType {
/**
* Determines the product type of a JBoss product installation.
*
+ *
* @param homeDir the JBoss product installation directory (e.g.
/opt/jboss-as-7.1.1.Final)
*
+ * @param apiVersion
* @return the product type
*/
- public static JBossProductType determineJBossProductType(File homeDir) {
+ public static JBossProductType determineJBossProductType(File homeDir, String
apiVersion) {
try {
- return determineJBossProductTypeViaProductConfFile(homeDir);
+ JBossProductType jBossProductType =
determineJBossProductTypeViaProductConfFile(homeDir);
+ if (jBossProductType==null) {
+ // Wildfly and The Server Formerly Known AS JBossAS share the same
absence of a slot
+ // and thus have no product type. So we need to check differently
+ // AS 7.0/1 use a domain api version of 1.x, while WildFly uses version
2.0+
+ // like 2.0 in "urn:jboss:domain:2.0" from <server
xmlns="..." > element in standalone.xml
+ if (apiVersion.startsWith("1")) {
+ jBossProductType = JBossProductType.AS;
+ } else {
+ // We should later check for newer WildFly versions to differentiate
them
+ jBossProductType = JBossProductType.WILDFLY8;
+ }
+ }
+ return jBossProductType;
} catch (Exception e) {
// TODO: Log an error.
return determineJBossProductTypeViaHomeDirName(homeDir);
@@ -109,9 +124,7 @@ public enum JBossProductType {
throw new RuntimeException("Unknown product type: " + slot);
}
} else {
- // Wildfly and The Server Formerly Known AS JBossAS share the same absence of
a slot
- // so we need another way to distinguish them
- productType = determineJBossProductTypeViaHomeDirName(homeDir);
+ productType = null;
}
return productType;
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/helper/HostConfiguration.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/helper/HostConfiguration.java
index a8909ff..329246e 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/helper/HostConfiguration.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/helper/HostConfiguration.java
@@ -233,6 +233,14 @@ public class HostConfiguration {
return securityPropertyFile;
}
+ public String getDomainApiVersion() {
+
+ String version =
document.getFirstChild().getAttributes().getNamedItem("xmlns").getTextContent();
+
+ version = version.substring(version.lastIndexOf(':')+1);
+ return version;
+ }
+
/**
* Run the passed xpathExpression on the prepopulated hostXml document and
* return the target element or attribute as a String.
commit 8868d16074902e9996f00cce8db697d02fce21ad
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri May 10 12:18:26 2013 +0200
BZ 960959 apply inventory status filtering with COMMITTED as default for searches.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java
index 138ca40..2dde3a4 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java
@@ -52,7 +52,7 @@ public abstract class Criteria implements Serializable, BaseCriteria {
* Use this to get the global fields for this Criteria field type. Don't use
inspection as the field names
* for this abstract base class do not conform (for legacy reasons) to the prefix
convention help by the
* subclasses.
- *
+ *
* @return The set of global fields for this Criteria field type. Meaning, usable
by all subclasses.
*/
public List<String> getGlobalFields() {
@@ -76,7 +76,7 @@ public abstract class Criteria implements Serializable, BaseCriteria {
* private NonBindingOverrideFilter filterResourceOnly; // requires overrides -
finds only those associated with a resource
* ...
* filterOverrides.put("resourceTypeOnly", "resourceType IS NOT
NULL"); // notice no ? parameter
- *
+ *
* Note: Typically a null value is analogous to OFF.
*/
public enum NonBindingOverrideFilter {
@@ -87,12 +87,12 @@ public abstract class Criteria implements Serializable, BaseCriteria
{
* Apply a restriction to reduce the cost of the {@link Criteria}-based query
generation and execution routines.
*/
public enum Restriction {
- /**
+ /**
* This returns an empty {@link PageList} result whose {@link
PageList#getTotalSize()} method otherwise
* contains the correct value.
*/
COUNT_ONLY,
- /**
+ /**
* This will return the {@link PageList} result whose {@link
PageList#isUnbounded()} returned true, meaning
* that the value contained within {@link PageList#getTotalSize()} is invalid /
undefined.
*/
@@ -121,10 +121,10 @@ public abstract class Criteria implements Serializable, BaseCriteria
{
// All Criteria support sorting on ID
protected PageOrdering sortId;
-
+
// All Criteria support filtering on ID
protected Integer filterId;
-
+
// All Criteria support filtering on IDs
protected List<Integer> filterIds;
@@ -176,7 +176,7 @@ public abstract class Criteria implements Serializable, BaseCriteria
{
addSortField("id");
this.sortId = sortId;
}
-
+
public void addFilterId(Integer filterId) {
this.filterId = filterId;
}
@@ -189,6 +189,13 @@ public abstract class Criteria implements Serializable, BaseCriteria
{
orderingFieldNames.add("sort" +
Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1));
}
+ /**
+ * Sets the paging constraints to return items [pageNumber * pageSize ,
((pageNumber+1) * pageSize) -1 ].
+ * For this to work correctly, you also need to set the sort
+ * criteria (do not rely on implicit id-sorting to work correctly.
+ * @param pageNumber The page to fetch. This is 0-based.
+ * @param pageSize The number of items to return.
+ */
public void setPaging(int pageNumber, int pageSize) {
this.pageNumber = pageNumber;
this.pageSize = pageSize;
@@ -196,7 +203,7 @@ public abstract class Criteria implements Serializable, BaseCriteria
{
/**
* If the pageControl is set, then this criteria object will completely ignore any
- * calls made to setPaging(pageNumber, pageSize) as well as addSortField(fieldName),
+ * calls made to setPaging(pageNumber, pageSize) as well as addSortField(fieldName),
* which is useful from a server-side calling context where the PageControl object
* will already have been created for you by the extensions at the JSF layer.
*/
@@ -248,7 +255,7 @@ public abstract class Criteria implements Serializable, BaseCriteria
{
/**
* If set to true, string-based filters will use exact string matches;
- * Default is 'false', which means we'll fuzzy match
+ * Default is 'false', which means we'll fuzzy match
*/
public void setStrict(boolean strict) {
this.strict = strict;
@@ -262,9 +269,9 @@ public abstract class Criteria implements Serializable, BaseCriteria
{
* By default, two queries will be generated for this Criteria: one which fetches the
requested page/subset of
* entity results, and one which fetches the total cardinality of the result set. If
you wish to only retrieve one
* of those pieces of data, you can do so by setting a restriction on the query
generation and execution routines.
- *
+ *
* The restriction, once set, can be removed by passing NULL to this method.
- *
+ *
* @see Restriction
*/
public void setRestriction(Restriction restriction) {
@@ -325,7 +332,7 @@ public abstract class Criteria implements Serializable, BaseCriteria
{
* Somewhat analogous to JPA's Query.getSingleResult. Wrap a CriteriaQuery result
with this method when
* expecting a single result from the fetch. If the result set has only one entry it
is returned. Otherwise
* a RuntimeException is thrown, indicating whether no results, or multiple results
were found.
- *
+ *
* @param result
* @return
* @throws RuntimeException In not exactly one result is found. The message will
include either the String
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
index 7a198bd..0038099 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
@@ -52,8 +52,6 @@ import org.infinispan.Cache;
import org.infinispan.manager.CacheContainer;
import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.measurement.DataType;
import org.rhq.core.domain.measurement.MeasurementDefinition;
import org.rhq.core.domain.measurement.MeasurementSchedule;
@@ -349,6 +347,7 @@ public class AbstractRestBean {
rwt.setTypeName(resourceType.getName());
rwt.setTypeId(resourceType.getId());
rwt.setPluginName(resourceType.getPlugin());
+ rwt.setStatus(res.getInventoryStatus().name());
Resource parent = res.getParentResource();
if (parent != null) {
rwt.setParentId(parent.getId());
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/BadArgumentException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/BadArgumentException.java
index cea84c2..3879f73 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/BadArgumentException.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/BadArgumentException.java
@@ -23,7 +23,10 @@ import javax.ejb.ApplicationException;
/**
* Exception if arguments are bad.
* Don't use java.lang.IllegalArgumentException, as this is no
- * Application Exception and gets wrapped
+ * Application Exception and gets wrapped.
+ *
+ * The ExceptionMapper translates this into a 406 repsonse code
+ *
* @author Heiko W. Rupp
*/
@ApplicationException(rollback = false, inherited = true)
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
index 3e1d195..288e9f7 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
@@ -177,14 +177,28 @@ public class ResourceHandlerBean extends AbstractRestBean {
@GET @GZIP
@Path("/")
+ @ApiError(code = 406, reason = "The passed inventory status was invalid")
@ApiOperation(value = "Search for resources by the given search string, possibly
limited by category and paged", responseClass = "ResourceWithType")
- public Response getResourcesByQuery(@ApiParam("String to search in the resource
name") @QueryParam("q") String q,
+ public Response getResourcesByQuery(@ApiParam("Limit results to param in the
resource name") @QueryParam("q") String q,
@ApiParam("Limit to category (PLATFORM,
SERVER, SERVICE") @QueryParam("category") String category,
@ApiParam("Page size for paging")
@QueryParam("ps") @DefaultValue("20") int pageSize,
- @ApiParam("Page for paging")
@QueryParam("page") Integer page,
+ @ApiParam("Page for paging, 0-based")
@QueryParam("page") Integer page,
+ @ApiParam(value = "Limit to Inventory status
of the resources", allowableValues = "ALL, NEW, IGNORED, COMMITTED, DELETED,
UNINVENTORIED")
+ @DefaultValue("COMMITTED")
@QueryParam("status") String status,
@Context HttpHeaders headers,
@Context UriInfo uriInfo) {
+
ResourceCriteria criteria = new ResourceCriteria();
+ if (!status.toLowerCase().equals("all")) {
+ try {
+
criteria.addFilterInventoryStatus(InventoryStatus.valueOf(status.toUpperCase()));
+ } catch (IllegalArgumentException iae) {
+ throw new BadArgumentException("status","Value " +
status + " is not in the list of allowed values: ALL, NEW, IGNORED, COMMITTED,
DELETED, UNINVENTORIED" );
+ }
+ } else {
+ // JavaDoc says to explicitly set to null in order to get all Status
+ criteria.addFilterInventoryStatus(null);
+ }
if (q!=null) {
criteria.addFilterName(q);
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/ResourceWithType.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/ResourceWithType.java
index 6b9aace..703e897 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/ResourceWithType.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/ResourceWithType.java
@@ -52,6 +52,7 @@ public class ResourceWithType {
Integer typeId;
String pluginName;
Integer parentId;
+ String status;
List<Link> links = new ArrayList<Link>();
private String ancestry;
@@ -126,6 +127,15 @@ public class ResourceWithType {
this.parentId = parentId;
}
+ @ApiProperty(value = "Inventory status of the resource.",allowableValues =
"NEW, IGNORED, COMMITTED, DELETED, UNINVENTORIED" )
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
@XmlElementRef
public List<Link> getLinks() {
return links;
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
index c71bbd8..3efd807 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
@@ -113,7 +113,6 @@ public class ResourcesTest extends AbstractBase {
@Test
public void testGetPlatformUILink() {
- Response response =
given()
.header(acceptJson)
.pathParam("id", _platformId)
@@ -145,6 +144,74 @@ public class ResourcesTest extends AbstractBase {
}
@Test
+ public void testResourceQueryAllStatus() throws Exception {
+ String json = get("/resource/platforms.json").asString();
+ String platformName = JsonPath.with(json).get("[0].resourceName");
+
+ given()
+ .header("Accept", "application/json")
+ .with()
+ .queryParam("q", platformName)
+ .queryParam("status","all")
+ .queryParam("category", "platform")
+ .expect()
+ .statusCode(200)
+ .body("links.self", notNullValue())
+ .when()
+ .get("/resource");
+ }
+
+ @Test
+ public void testResourceQueryCommittedStatus() throws Exception {
+ String json = get("/resource/platforms.json").asString();
+ String platformName = JsonPath.with(json).get("[0].resourceName");
+
+ given()
+ .header("Accept", "application/json")
+ .with()
+ .queryParam("q", platformName)
+ .queryParam("status","committed")
+ .queryParam("category", "platform")
+ .expect()
+ .statusCode(200)
+ .body("links.self", notNullValue())
+ .when()
+ .get("/resource");
+ }
+
+ @Test
+ public void testResourceQueryNewStatus() throws Exception {
+
+ // Unfortunately we can not assume that there are
+ // any resources in other states than COMMITTED
+ given()
+ .header("Accept", "application/json")
+ .with()
+ .queryParam("status","NeW")
+ .expect()
+ .statusCode(200)
+ .when()
+ .get("/resource");
+ }
+
+ @Test
+ public void testResourceQueryBadStatus() throws Exception {
+ String json = get("/resource/platforms.json").asString();
+ String platformName = JsonPath.with(json).get("[0].resourceName");
+
+ given()
+ .header("Accept", "application/json")
+ .with()
+ .queryParam("q", platformName)
+ .queryParam("status","Frobnitz")
+ .queryParam("category", "platform")
+ .expect()
+ .statusCode(406)
+ .when()
+ .get("/resource");
+ }
+
+ @Test
public void testResourceQueryCategory() throws Exception {
with()
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/d/Resource.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/d/Resource.java
index 6cbcea0..f060101 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/d/Resource.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/d/Resource.java
@@ -33,6 +33,7 @@ public class Resource {
String typeName;
String pluginName;
Integer parentId;
+ String status;
int typeId;
List<Map> links;
String ancestry;
@@ -103,4 +104,12 @@ public class Resource {
public void setAncestry(String ancestry) {
this.ancestry = ancestry;
}
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
}
commit c12f45a0dac01b601ce05fc7046042b83e51b184
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri May 10 11:15:25 2013 +0200
Make this test use the RHQ server, so that no external EAP needs to be set up.
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ContentTest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ContentTest.java
index 5532b13..7e3f45a 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ContentTest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ContentTest.java
@@ -176,7 +176,7 @@ public class ContentTest extends AbstractBase {
List<Map<String,Object>> resources =
given()
.header(acceptJson)
- .queryParam("q","EAP (127.0.0.1:9990)") // TODO fragile
-- better search for it?
+ .queryParam("q","EAP (127.0.0.1:6990)") // TODO Can we
identify the RHQ server itself better?
.queryParam("category","SERVER")
.expect()
.statusCode(200)
@@ -188,6 +188,7 @@ public class ContentTest extends AbstractBase {
assert resources.size()>0;
int as7Id =
Integer.valueOf((String)resources.get(0).get("resourceId"));
+ int createdResourceId=-1;
// create child of eap6 as deployment
try {
@@ -223,25 +224,33 @@ public class ContentTest extends AbstractBase {
int status = response.getStatusCode();
String location = response.getHeader("Location");
- System.out.println("Location " + location + "\n\n");
+ System.out.println("\nLocation " + location + "\n\n");
assert location!=null;
// We need to check what we got. A 302 means the deploy is still
// in progress, so we need to wait a little longer
while (status==302) {
- status =
+ response =
given()
.header(acceptJson)
.log().everything()
.expect()
- .statusCode(isOneOf(200,201,302))
+ .statusCode(isOneOf(200, 201, 302))
.log().everything()
.when()
- .get(location)
- .getStatusCode();
+ .get(location);
+
+ status = response.getStatusCode();
}
+ createdResourceId = response.jsonPath().getInt("resourceId");
+
+ System.out.println("\n Deploy is done, resource Id = " +
createdResourceId + " \n");
+ System.out.flush();
+
+ assert createdResourceId != -1;
+
} finally {
// Remove the uploaded content
@@ -254,47 +263,23 @@ public class ContentTest extends AbstractBase {
.when()
.delete("/content/{handle}");
+ System.out.println("\n Content removed \n");
+ System.out.flush();
+
+
+ // We need to wait here a little, as the machinery is not used to
+ // quick create-delete-cycles
+ Thread.sleep(20*1000L);
- // try to remove the created resource
- Response response =
given()
- .queryParam("q", "test-simple.war")
.header(acceptJson)
+ .queryParam("physical", "true") // Also remove target
on the EAP instance
+ .pathParam("id",createdResourceId)
+ .log().everything()
.expect()
.log().everything()
.when()
- .get("/resource");
-
- List links = response.body().jsonPath().getList("links");
-
- System.out.println(links);
- assert links!=null;
-
- if (links.size()>0) {
-
- String link = null;
- @SuppressWarnings("unchecked")
- List<Map<String,Map<String,String>>> listOfMaps =
(List<Map<String, Map<String, String>>>) links.get(0);
-
- for (Map<String,Map<String,String>> map : listOfMaps) {
- if (map.containsKey("self")) {
- link = map.get("self").get("href");
- break;
- }
- }
-
- assert link != null;
-
- System.out.println("Link: " + link);
-
- given()
- .header(acceptJson)
- .queryParam("physical","true") // Also remove
target on the EAP instance
- .expect()
- .log().everything()
- .when()
- .delete(link);
- }
+ .delete("/resource/{id}");
}
commit 80e9f520ab6dfa5fa42357aa7fa5dbfdeb98d631
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu May 9 21:50:21 2013 -0400
BZ 951382 - if keystore/truststore is left undefined in agent config, we'll
explicitly set the pref for the user using the "conf/" location
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
index d959552..6e1a95a 100644
--- a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
+++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
@@ -2313,6 +2313,9 @@ public class AgentMain {
* @throws Exception if any error causes the startup to fail
*/
private void startCommServices(BootstrapLatchCommandListener listener) throws
Exception {
+ // BZ 951382 - if any locations for keystore/truststore are not configured, set
our own defaults to the conf/ directory
+ assignDefaultLocationToKeystoreTruststoreFiles();
+
// create our client sender so we can send commands to our server
// do this before we create our auto-discovery listener and start the server-side
services
// since it will be needed by the listener very quickly if the server is already
online
@@ -2348,6 +2351,41 @@ public class AgentMain {
return;
}
+ private void assignDefaultLocationToKeystoreTruststoreFiles() {
+ File confDir = new File("conf");
+ if (!confDir.exists()) {
+ return; // conf/ doesn't exist (perhaps we are running in a test?) - do
nothing and just fallback to the standard defaults
+ }
+
+ String prefNamesFileNames[][] = {
+ { ServiceContainerConfigurationConstants.CONNECTOR_SECURITY_KEYSTORE_FILE,
+
ServiceContainerConfigurationConstants.DEFAULT_CONNECTOR_SECURITY_KEYSTORE_FILE_NAME },
+ { ServiceContainerConfigurationConstants.CONNECTOR_SECURITY_TRUSTSTORE_FILE,
+
ServiceContainerConfigurationConstants.DEFAULT_CONNECTOR_SECURITY_TRUSTSTORE_FILE_NAME },
+ { AgentConfigurationConstants.CLIENT_SENDER_SECURITY_KEYSTORE_FILE,
+
AgentConfigurationConstants.DEFAULT_CLIENT_SENDER_SECURITY_KEYSTORE_FILE_NAME },
+ { AgentConfigurationConstants.CLIENT_SENDER_SECURITY_TRUSTSTORE_FILE,
+
AgentConfigurationConstants.DEFAULT_CLIENT_SENDER_SECURITY_TRUSTSTORE_FILE_NAME } };
+
+ Preferences prefs = m_configuration.getPreferences();
+ for (String[] prefNameFileName : prefNamesFileNames) {
+ String value = prefs.get(prefNameFileName[0], null);
+ if (value == null) {
+ value = new File(confDir, prefNameFileName[1]).getAbsolutePath();
+ prefs.put(prefNameFileName[0], value);
+ LOG.debug(AgentI18NResourceKeys.CERT_FILE_LOCATION, prefNameFileName[0],
value);
+ }
+ }
+
+ try {
+ prefs.flush();
+ } catch (Exception e) {
+ LOG.warn(AgentI18NResourceKeys.CANNOT_STORE_PREFERENCES,
"keystore/truststore files", e);
+ }
+
+ return;
+ }
+
private boolean isAutoDiscoveryEnabled() {
return m_autoDiscoveryListener != null;
}
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
index 10761ff..21a39a9 100644
---
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
+++
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
@@ -28,6 +28,9 @@ import mazz.i18n.annotation.I18NResourceBundle;
*/
@I18NResourceBundle(baseName = "agent-messages", defaultLocale =
"en")
public interface AgentI18NResourceKeys {
+ @I18NMessage("Explicitly setting file location [{0}] to [{1}]")
+ String CERT_FILE_LOCATION = "AgentConfiguration.cert-file-location";
+
@I18NMessage("The configured server alias [{0}] cannot be resolved - will use
localhost address. Cause: {1}")
String SERVER_ALIAS_UNKNOWN = "AgentConfiguration.server-alias-unknown";
commit 7c4577c895a469b5ddce6aa91eb6935eb5cf6cc9
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed May 8 22:23:58 2013 -0400
BZ 535800 - can't use default protocol because it is automatically initialized and
cached, not allowing us to use a customized one
add a main() for quick testing
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/SecureConnector.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/SecureConnector.java
index 6097ebe..16a4544 100644
---
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/SecureConnector.java
+++
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/SecureConnector.java
@@ -23,7 +23,6 @@ import java.io.File;
import java.io.FileInputStream;
import java.net.URL;
import java.security.KeyStore;
-import java.security.NoSuchAlgorithmException;
import java.security.cert.X509Certificate;
import javax.net.ssl.HostnameVerifier;
@@ -62,29 +61,13 @@ public class SecureConnector {
private final String truststoreAlgorithm;
/**
- * The {@link #openSecureConnection(URL) secure connections} built by this object
will not
- * authenticate the server endpoint, but they will use the default secure socket
protocol to
- * encrypt the connection traffic (see
<code>javax.net.ssl.SSLContext.getDefault().getProtocol()</code>).
- *
- * @throws NoSuchAlgorithmException if the default secure connection protocol cannot
be determined
- */
- public SecureConnector() throws NoSuchAlgorithmException {
- this(null, null, null, null, null);
- }
-
- /**
* The {@link #openSecureConnection(URL) secure connections} built by this object
will
* not authenticate the server endpoint, but they will use the given secure socket
protocol
* to encrypt the connection traffic.
*
- * @param secureSocketProtocol the secure socket protocol to use; if
<code>null</code>, then
- * the JVM's default secure socket protocol will be
used
- * (see
<code>javax.net.ssl.SSLContext.getDefault().getProtocol()</code>)
- *
- * @throws NoSuchAlgorithmException if <code>secureSocketProtocol</code>
is <code>null</code>, and
- * the default secure connection protocol cannot be
determined
+ * @param secureSocketProtocol the secure socket protocol to use (e.g.
"TLS")
*/
- public SecureConnector(String secureSocketProtocol) throws NoSuchAlgorithmException
{
+ public SecureConnector(String secureSocketProtocol) {
this(secureSocketProtocol, null, null, null, null);
}
@@ -97,28 +80,22 @@ public class SecureConnector {
* truststore parameters are ignored and the secure connections built by this object
will
* not authenticate the server endpoint.
*
- * @param secureSocketProtocol the secure socket protocol to use; if
<code>null</code>, then
- * the JVM's default secure socket protocol will be
used
- * (see
<code>javax.net.ssl.SSLContext.getDefault().getProtocol()</code>)
+ * @param secureSocketProtocol the secure socket protocol to use (e.g.
"TLS")
* @param truststoreFile the truststore file containing authorized certificates
- * @param truststorePassword the password to the truststore file
- * @param truststoreType the type of the truststore file; if
<code>null</code>, then the JVM's
+ * @param truststorePassword the password to the truststore file (if a file is given,
this must not be <code>null</code>)
+ * @param truststoreType the type of the truststore file (e.g. "JKS"); if
<code>null</code>, then the JVM's
* default type is used (see
<code>java.security.KeyStore.getDefaultType()</code>)
- * @param truststoreAlgorithm the standard name of the trust management algorithm; if
<code>null</code>,
- * then the JVM's default algorithm is used (see
+ * @param truststoreAlgorithm the standard name of the trust management algorithm
(e.g. "SunX509");
+ * if <code>null</code>, then the JVM's
default algorithm is used (see
*
<code>javax.net.ssl.TrustManagerFactory.getDefaultAlgorithm()</code>)
- *
- * @throws NoSuchAlgorithmException if <code>secureSocketProtocol</code>
is <code>null</code>, and
- * the default secure connection protocol cannot be
determined
*/
public SecureConnector(String secureSocketProtocol, File truststoreFile, String
truststorePassword,
- String truststoreType, String truststoreAlgorithm) throws
NoSuchAlgorithmException {
+ String truststoreType, String truststoreAlgorithm) {
if (secureSocketProtocol == null) {
- this.secureSocketProtocol = SSLContext.getDefault().getProtocol();
- } else {
- this.secureSocketProtocol = secureSocketProtocol;
+ throw new IllegalArgumentException("secure socket protocol cannot be
null");
}
+ this.secureSocketProtocol = secureSocketProtocol;
if (truststoreFile == null) {
// no truststore file was provided, we don't need to know any truststore
parameters
@@ -129,17 +106,21 @@ public class SecureConnector {
} else {
// the truststore file is provided, make sure we have non-null truststore
parameters, using defaults if need be
this.truststoreFile = truststoreFile;
+
+ if (truststorePassword == null) {
+ throw new IllegalArgumentException("truststorePassword cannot be
null");
+ }
this.truststorePassword = truststorePassword;
if (truststoreType == null) {
truststoreType = KeyStore.getDefaultType();
}
- this.truststoreType = (truststoreType != null) ? truststoreType :
"JKS";
+ this.truststoreType = truststoreType;
if (truststoreAlgorithm == null) {
truststoreAlgorithm = TrustManagerFactory.getDefaultAlgorithm();
}
- this.truststoreAlgorithm = (truststoreAlgorithm != null) ?
truststoreAlgorithm : "SunX509";
+ this.truststoreAlgorithm = truststoreAlgorithm;
}
return;
@@ -216,4 +197,16 @@ public class SecureConnector {
return true;
}
};
+
+ public static void main(String[] args) throws Exception {
+ HttpsURLConnection conn = new
SecureConnector("TLS").openSecureConnection(new URL(args[0]));
+ java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();
+ java.io.InputStream input = new
java.io.BufferedInputStream(conn.getInputStream(), 32768);
+ byte[] buffer = new byte[32768];
+ for (int bytesRead = input.read(buffer); bytesRead != -1; bytesRead =
input.read(buffer)) {
+ out.write(buffer, 0, bytesRead);
+ }
+ out.flush();
+ System.out.println(out.toString());
+ }
}
\ No newline at end of file
commit 2c6438cd554b64aa97f2b83d1d5fe7f005d9f68f
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed May 8 16:43:36 2013 -0400
BZ 535800 - allow the agent to download the agent update binary over the configured
SSL channel
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentUpdateDownload.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentUpdateDownload.java
index 9edad7f..ccd46db 100644
---
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentUpdateDownload.java
+++
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentUpdateDownload.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -24,6 +24,8 @@ import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
+import javax.net.ssl.HttpsURLConnection;
+
import mazz.i18n.Logger;
import org.rhq.core.util.MessageDigestGenerator;
@@ -153,7 +155,13 @@ public class AgentUpdateDownload {
// we only support http/s
url = getDownloadUrl();
LOG.info(AgentI18NResourceKeys.UPDATE_DOWNLOAD_RETRIEVAL, info, url);
- conn = (HttpURLConnection) url.openConnection();
+
+ if (url.getProtocol().equals("https")) {
+ conn = openSecureConnection(url);
+ } else {
+ conn = (HttpURLConnection) url.openConnection(); // we only support
http(s), so this cast is OK
+ }
+
inStream = conn.getInputStream();
// put the update content in the local file system
@@ -277,4 +285,24 @@ public class AgentUpdateDownload {
return false;
}
}
+
+ private HttpsURLConnection openSecureConnection(URL url) throws Exception {
+ AgentConfiguration config = this.agent.getConfiguration();
+ String secureSocketProtocol = config.getClientSenderSecuritySocketProtocol();
+ SecureConnector secureConnector;
+ if (config.isClientSenderSecurityServerAuthMode()) {
+ File file = new File(config.getClientSenderSecurityTruststoreFile());
+ if (!file.isAbsolute()) {
+ file = new File(this.agent.getAgentHomeDirectory(), file.getPath());
+ }
+ String password = config.getClientSenderSecurityTruststorePassword();
+ String type = config.getClientSenderSecurityTruststoreType();
+ String algorithm = config.getClientSenderSecurityTruststoreAlgorithm();
+ secureConnector = new SecureConnector(secureSocketProtocol, file, password,
type, algorithm);
+ } else {
+ secureConnector = new SecureConnector(secureSocketProtocol);
+ }
+
+ return secureConnector.openSecureConnection(url);
+ }
}
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentUpdateVersion.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentUpdateVersion.java
index b429fa8..6ef123a 100644
---
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentUpdateVersion.java
+++
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentUpdateVersion.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -18,11 +18,14 @@
*/
package org.rhq.enterprise.agent;
+import java.io.File;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Properties;
+import javax.net.ssl.HttpsURLConnection;
+
import mazz.i18n.Logger;
import org.rhq.core.util.exception.ThrowableUtil;
@@ -100,7 +103,13 @@ public class AgentUpdateVersion {
// we only support http/s
url = getVersionUrl();
LOG.debug(AgentI18NResourceKeys.UPDATE_VERSION_RETRIEVAL, url);
- conn = (HttpURLConnection) url.openConnection();
+
+ if (url.getProtocol().equals("https")) {
+ conn = openSecureConnection(url);
+ } else {
+ conn = (HttpURLConnection) url.openConnection(); // we only support
http(s), so this cast is OK
+ }
+
versionProps = new Properties();
inStream = conn.getInputStream();
versionProps.load(inStream);
@@ -142,4 +151,24 @@ public class AgentUpdateVersion {
return;
}
+
+ private HttpsURLConnection openSecureConnection(URL url) throws Exception {
+ AgentConfiguration config = this.agent.getConfiguration();
+ String secureSocketProtocol = config.getClientSenderSecuritySocketProtocol();
+ SecureConnector secureConnector;
+ if (config.isClientSenderSecurityServerAuthMode()) {
+ File file = new File(config.getClientSenderSecurityTruststoreFile());
+ if (!file.isAbsolute()) {
+ file = new File(this.agent.getAgentHomeDirectory(), file.getPath());
+ }
+ String password = config.getClientSenderSecurityTruststorePassword();
+ String type = config.getClientSenderSecurityTruststoreType();
+ String algorithm = config.getClientSenderSecurityTruststoreAlgorithm();
+ secureConnector = new SecureConnector(secureSocketProtocol, file, password,
type, algorithm);
+ } else {
+ secureConnector = new SecureConnector(secureSocketProtocol);
+ }
+
+ return secureConnector.openSecureConnection(url);
+ }
}
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/SecureConnector.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/SecureConnector.java
new file mode 100644
index 0000000..6097ebe
--- /dev/null
+++
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/SecureConnector.java
@@ -0,0 +1,219 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.agent;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.net.URL;
+import java.security.KeyStore;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.X509Certificate;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+import javax.net.ssl.X509TrustManager;
+
+/**
+ * If you need to make a connection to an external HTTP server using the https protocol,
+ * use this class to build the connection. You can specify which trusted certificates can
be used
+ * to verify and authenticate the remote server via truststore file parameters passed
into the constructor.
+ * In other words, you don't have to rely on the global system properties
javax.net.ssl.keyStore and
+ * javax.net.ssl.trustStore to make your connection.
+ *
+ * This is useful if some other object running in your JVM requires
+ * javax.net.ssl.keyStore/javax.net.ssl.trustStore set to something other than what you
want to use.
+ * Since those system properties can only be set once during the lifetime of the JVM, it
is not possible
+ * to change them at runtime and expect the change to take effect. Besides, even if you
could change them,
+ * this could then effect the other objects that do need those properties set to
particular values.
+ *
+ * This object has the ability to make an encrypted call without requiring a truststore
to exist (that is,
+ * you can encrypt the call but you will not have the server endpoint verified and
authenticated). This
+ * can be useful if you aren't concerned with authenticating the endpoint but do want
to encrypt the
+ * traffic.
+ *
+ * @author John Mazzitelli
+ */
+public class SecureConnector {
+ private final String secureSocketProtocol;
+ private final File truststoreFile;
+ private final String truststorePassword;
+ private final String truststoreType;
+ private final String truststoreAlgorithm;
+
+ /**
+ * The {@link #openSecureConnection(URL) secure connections} built by this object
will not
+ * authenticate the server endpoint, but they will use the default secure socket
protocol to
+ * encrypt the connection traffic (see
<code>javax.net.ssl.SSLContext.getDefault().getProtocol()</code>).
+ *
+ * @throws NoSuchAlgorithmException if the default secure connection protocol cannot
be determined
+ */
+ public SecureConnector() throws NoSuchAlgorithmException {
+ this(null, null, null, null, null);
+ }
+
+ /**
+ * The {@link #openSecureConnection(URL) secure connections} built by this object
will
+ * not authenticate the server endpoint, but they will use the given secure socket
protocol
+ * to encrypt the connection traffic.
+ *
+ * @param secureSocketProtocol the secure socket protocol to use; if
<code>null</code>, then
+ * the JVM's default secure socket protocol will be
used
+ * (see
<code>javax.net.ssl.SSLContext.getDefault().getProtocol()</code>)
+ *
+ * @throws NoSuchAlgorithmException if <code>secureSocketProtocol</code>
is <code>null</code>, and
+ * the default secure connection protocol cannot be
determined
+ */
+ public SecureConnector(String secureSocketProtocol) throws NoSuchAlgorithmException
{
+ this(secureSocketProtocol, null, null, null, null);
+ }
+
+ /**
+ * The {@link #openSecureConnection(URL) secure connections} built by this object
will
+ * authenticate the server endpoint using the given truststore file and its related
parameters.
+ * The connection will use the given secure socket protocol to encrypt the connection
traffic.
+ *
+ * Note that if the given <code>truststoreFile</code> is
<code>null</code>, the other
+ * truststore parameters are ignored and the secure connections built by this object
will
+ * not authenticate the server endpoint.
+ *
+ * @param secureSocketProtocol the secure socket protocol to use; if
<code>null</code>, then
+ * the JVM's default secure socket protocol will be
used
+ * (see
<code>javax.net.ssl.SSLContext.getDefault().getProtocol()</code>)
+ * @param truststoreFile the truststore file containing authorized certificates
+ * @param truststorePassword the password to the truststore file
+ * @param truststoreType the type of the truststore file; if
<code>null</code>, then the JVM's
+ * default type is used (see
<code>java.security.KeyStore.getDefaultType()</code>)
+ * @param truststoreAlgorithm the standard name of the trust management algorithm; if
<code>null</code>,
+ * then the JVM's default algorithm is used (see
+ *
<code>javax.net.ssl.TrustManagerFactory.getDefaultAlgorithm()</code>)
+ *
+ * @throws NoSuchAlgorithmException if <code>secureSocketProtocol</code>
is <code>null</code>, and
+ * the default secure connection protocol cannot be
determined
+ */
+ public SecureConnector(String secureSocketProtocol, File truststoreFile, String
truststorePassword,
+ String truststoreType, String truststoreAlgorithm) throws
NoSuchAlgorithmException {
+
+ if (secureSocketProtocol == null) {
+ this.secureSocketProtocol = SSLContext.getDefault().getProtocol();
+ } else {
+ this.secureSocketProtocol = secureSocketProtocol;
+ }
+
+ if (truststoreFile == null) {
+ // no truststore file was provided, we don't need to know any truststore
parameters
+ this.truststoreFile = null;
+ this.truststorePassword = null;
+ this.truststoreType = null;
+ this.truststoreAlgorithm = null;
+ } else {
+ // the truststore file is provided, make sure we have non-null truststore
parameters, using defaults if need be
+ this.truststoreFile = truststoreFile;
+ this.truststorePassword = truststorePassword;
+
+ if (truststoreType == null) {
+ truststoreType = KeyStore.getDefaultType();
+ }
+ this.truststoreType = (truststoreType != null) ? truststoreType :
"JKS";
+
+ if (truststoreAlgorithm == null) {
+ truststoreAlgorithm = TrustManagerFactory.getDefaultAlgorithm();
+ }
+ this.truststoreAlgorithm = (truststoreAlgorithm != null) ?
truststoreAlgorithm : "SunX509";
+ }
+
+ return;
+ }
+
+ public HttpsURLConnection openSecureConnection(URL url) throws Exception {
+ // we assume the URL is https - if it is not, its an error so just let the cast
throw exception
+ HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
+
+ TrustManager[] trustManagers;
+ SSLContext sslContext = SSLContext.getInstance(getSecureSocketProtocol());
+
+ if (getTruststoreFile() == null) {
+ // we are configured to not care about authenticating the server, just
encrypt but don't worry about certificates
+ trustManagers = new TrustManager[] { NO_OP_TRUST_MANAGER };
+ connection.setHostnameVerifier(NO_OP_HOSTNAME_VERIFIER);
+ } else {
+ // We need to configure our SSL connection with the agent's truststore so
we can authenticate the server.
+ // First, create a KeyStore, but load it with our truststore entries.
+ KeyStore keyStore = KeyStore.getInstance(getTruststoreType());
+ keyStore.load(new FileInputStream(getTruststoreFile()),
getTruststorePassword().toCharArray());
+ // now create a truststore manager instance and initialize it with our
KeyStore we created with all our truststore entries
+ TrustManagerFactory tmf =
TrustManagerFactory.getInstance(getTruststoreAlgorithm());
+ tmf.init(keyStore);
+ trustManagers = tmf.getTrustManagers();
+ }
+
+ sslContext.init(null, trustManagers, null);
+ connection.setSSLSocketFactory(sslContext.getSocketFactory());
+
+ return connection;
+ }
+
+ public String getSecureSocketProtocol() {
+ return this.secureSocketProtocol;
+ }
+
+ public File getTruststoreFile() {
+ return this.truststoreFile;
+ }
+
+ public String getTruststorePassword() {
+ return this.truststorePassword;
+ }
+
+ public String getTruststoreType() {
+ return this.truststoreType;
+ }
+
+ public String getTruststoreAlgorithm() {
+ return this.truststoreAlgorithm;
+ }
+
+ private static TrustManager NO_OP_TRUST_MANAGER = new X509TrustManager() {
+ @Override
+ public X509Certificate[] getAcceptedIssuers() {
+ return new X509Certificate[0];
+ }
+
+ @Override
+ public void checkClientTrusted(X509Certificate[] certs, String authType) {
+ return;
+ }
+
+ @Override
+ public void checkServerTrusted(X509Certificate[] certs, String authType) {
+ return;
+ }
+ };
+
+ private static HostnameVerifier NO_OP_HOSTNAME_VERIFIER = new HostnameVerifier() {
+ @Override
+ public boolean verify(String s, SSLSession sslSession) {
+ return true;
+ }
+ };
+}
\ No newline at end of file
commit 8091c631ae4cebe9a19825f3c107753590bec922
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Wed May 8 10:15:23 2013 -0700
[BZ 960646] - RFE Redesigned Availability Chart - i18n.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
index f0db5a2..fbce610 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
@@ -124,11 +124,13 @@ public class AvailabilityOverUnderGraphType {
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getChartDateLabel()(),
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getChartTimeLabel()(),
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getChartHoverStartLabel()(),
-
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getChartHoverEndLabel()(),
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getChartHoverBarLabel()(),
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getChartHoverAvailabilityLabel()(),
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getChartHoverTimeFormat()(),
-
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getChartHoverDateFormat()()
+
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getChartHoverDateFormat()(),
+
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getAvailChartTitleLabel()(),
+
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getAvailChartUpLabel()(),
+
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getAvailChartDownLabel()()
);
@@ -264,7 +266,7 @@ public class AvailabilityOverUnderGraphType {
.style("font-family", "Arial, Verdana,
sans-serif;")
.style("font-weight", "bold")
.attr("fill", "#003168")
- .text("Availability");
+ .text(availChartContext.chartTitle);
svg.append("text")
.attr("class", "upLabel")
@@ -274,7 +276,7 @@ public class AvailabilityOverUnderGraphType {
.style("font-size", "9px")
.attr("fill", "#50505a")
.style("text-anchor", "end")
- .text("UP");
+ .text(availChartContext.chartUpLabel);
svg.append("text")
.attr("class", "downLabel")
@@ -284,7 +286,7 @@ public class AvailabilityOverUnderGraphType {
.style("font-size", "9px")
.attr("fill", "#50505a")
.style("text-anchor", "end")
- .text("DOWN");
+ .text(availChartContext.chartDownLabel);
}
@@ -355,8 +357,16 @@ public class AvailabilityOverUnderGraphType {
return MSG.chart_hover_start_label();
}
- public String getChartHoverEndLabel() {
- return MSG.chart_hover_end_label();
+ public String getAvailChartDownLabel() {
+ return MSG.avail_chart_down_label();
+ }
+
+ public String getAvailChartUpLabel() {
+ return MSG.avail_chart_up_label();
+ }
+
+ public String getAvailChartTitleLabel() {
+ return MSG.avail_chart_title_label();
}
public String getChartHoverBarLabel() {
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 0c5af20..00a68ef 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
@@ -6,6 +6,9 @@
#
https://docs.jboss.org/author/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
+avail_chart_down_label = DOWN
+avail_chart_title_label = Availability
+avail_chart_up_label = UP
chart_date_label = Date
chart_down_label = Down
chart_hover_availability_label = Availability
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
index 42405aa..a27fb3c 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
@@ -29,6 +29,9 @@
#
https://docs.jboss.org/author/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
+##avail_chart_down_label = DOWN
+##avail_chart_title_label = Availability
+##avail_chart_up_label = UP
##chart_date_label = Date
##chart_down_label = Down
##chart_time_label = Start
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 8185e7f..5415ed0 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
@@ -9,6 +9,9 @@
#
https://docs.jboss.org/author/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
+##avail_chart_down_label = DOWN
+##avail_chart_title_label = Availability
+##avail_chart_up_label = UP
##chart_date_label = Date
##chart_down_label = Down
##chart_time_label = Start
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 c15e129..8f47413 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
@@ -9,6 +9,9 @@
#
https://docs.jboss.org/author/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
+##avail_chart_down_label = DOWN
+##avail_chart_title_label = Availability
+##avail_chart_up_label = UP
##chart_date_label = Date
##chart_down_label = Down
##chart_time_label = Start
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties
index 8105460..5d19d06 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties
@@ -7,6 +7,9 @@
#
https://docs.jboss.org/author/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
+##avail_chart_down_label = DOWN
+##avail_chart_title_label = Availability
+##avail_chart_up_label = UP
##chart_date_label = Date
##chart_down_label = Down
##chart_time_label = Start
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 d50a54e..743c4b5 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
@@ -6,6 +6,9 @@
#
https://docs.jboss.org/author/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
+##avail_chart_down_label = DOWN
+##avail_chart_title_label = Availability
+##avail_chart_up_label = UP
##chart_date_label = Date
##chart_down_label = Down
##chart_time_label = Start
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
index fb45e35..772c4e4 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
@@ -6,6 +6,9 @@
##
http://rhq-project.org/display/RHQ/Working+with+the+Resource+Bundles
##
####################################
+##avail_chart_down_label = DOWN
+##avail_chart_title_label = Availability
+##avail_chart_up_label = UP
##chart_date_label = Date
##chart_down_label = Down
##chart_time_label = Start
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 e929386..03dfa4e 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
@@ -6,6 +6,9 @@
#
https://docs.jboss.org/author/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
+##avail_chart_down_label = DOWN
+##avail_chart_title_label = Availability
+##avail_chart_up_label = UP
##chart_date_label = Date
##chart_down_label = Down
##chart_time_label = Start
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/js/rhq.js
b/modules/enterprise/gui/coregui/src/main/webapp/js/rhq.js
index 081a9a2..3b35252 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/js/rhq.js
+++ b/modules/enterprise/gui/coregui/src/main/webapp/js/rhq.js
@@ -48,7 +48,7 @@ var ChartContext = function (chartId, chartHeight, metricsData,
xAxisLabel, char
this.chartSelection = this.chartHandle + " svg";
},
-AvailChartContext = function (chartId, availData, dateLabel, timeLabel, hoverStartLabel,
hoverEndLabel, hoverBarLabel, availabilityLabel, chartHoverTimeFormat,
chartHoverDateFormat) {
+AvailChartContext = function (chartId, availData, dateLabel, timeLabel, hoverStartLabel,
hoverBarLabel, availabilityLabel, chartHoverTimeFormat, chartHoverDateFormat, chartTitle,
chartUpLabel, chartDownLabel) {
"use strict";
if (!(this instanceof AvailChartContext)) {
throw new Error("AvailChartContext function cannot be called as a
function.")
@@ -60,10 +60,12 @@ AvailChartContext = function (chartId, availData, dateLabel,
timeLabel, hoverSta
this.dateLabel = dateLabel;
this.timeLabel = timeLabel;
this.hoverStartLabel = hoverStartLabel;
- this.hoverEndLabel = hoverEndLabel;
this.hoverBarLabel = hoverBarLabel;
this.hoverBarAvailabilityLabel = availabilityLabel;
this.chartHoverTimeFormat = chartHoverTimeFormat;
this.chartHoverDateFormat = chartHoverDateFormat;
+ this.chartTitle = chartTitle;
+ this.chartDownLabel = chartDownLabel;
+ this.chartUpLabel = chartUpLabel;
};
commit 59df0f08367521576187063a6bbafaa6ba0be9c2
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Wed May 8 08:45:18 2013 -0700
Make x-axis more readable on Safari, IE. These browsers even though they are using the
same SVG fonts, render wider fonts showing up as labels running into one another. Reduced
the clutter on the x-axis for increased readability.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
index e38df39..f0db5a2 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
@@ -162,7 +162,7 @@ public class AvailabilityOverUnderGraphType {
xAxis = $wnd.d3.svg.axis()
.scale(timeScale)
- .ticks(12)
+ .ticks(8)
.tickSize(13, 0, 0)
.orient("bottom"),
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphImpl.java
index bf08615..4d71192 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphImpl.java
@@ -129,13 +129,8 @@ public class StackedBarMetricGraphImpl extends AbstractGraph {
else {
console.log("Using Large Charts Profile");
// we use the width already defined above
- if(isIEBrowserGreaterThanOrEqualTo(9)){
- xTicks = 8;
- xTickSubDivide = 5;
- }else {
- xTicks = 12;
- xTickSubDivide = 5;
- }
+ xTicks = 8;
+ xTickSubDivide = 5;
chartData = chartContext.data;
}
commit c8bbd8b0c5dcfa51a2d653a95bc83d73d80178be
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Wed May 8 08:30:08 2013 -0700
[BZ 960521] Globally uncaught exception on clicking on resource name link on IE9.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
index 4e6a0ce..e38df39 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
@@ -215,7 +215,7 @@ public class AvailabilityOverUnderGraphType {
}
else {
// should not ever happen, but...
- console.warn("AvailabilityType not valid.");
+ console.log("AvailabilityType not valid.");
return "#000"; //black
}
},
@@ -318,13 +318,11 @@ public class AvailabilityOverUnderGraphType {
return {
// Public API
- draw: function (chartContext) {
+ draw: function (availChartContext) {
"use strict";
- console.info("AvailabilityChart");
- //console.time("availabilityChart");
+ console.log("AvailabilityChart");
drawBars(availChartContext);
createHovers();
- //console.timeEnd("availabilityChart");
}
}; // end public closure
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphImpl.java
index 15f400d..bf08615 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphImpl.java
@@ -38,7 +38,7 @@ public class StackedBarMetricGraphImpl extends AbstractGraph {
*/
@Override
public native void drawJsniChart() /*-{
- //console.log("Draw Stacked Bar jsni chart");
+ console.log("Draw Stacked Bar jsni chart");
var global = this,
// create a chartContext object (from rhq.js) with the data required to render to
a chart
@@ -120,14 +120,14 @@ public class StackedBarMetricGraphImpl extends AbstractGraph {
// if window is too small server up small chart
if (useSmallCharts()) {
- //console.log("Using Small Charts Profile for width:
"+getChartWidth());
+ console.log("Using Small Charts Profile for width:
"+getChartWidth());
width = 250;
xTicks = 3;
xTickSubDivide = 2;
chartData = chartContext.data.slice(chartContext.data.length -
numberOfBarsForSmallGraph, chartContext.data.length - 1);
}
else {
- //console.log("Using Large Charts Profile");
+ console.log("Using Large Charts Profile");
// we use the width already defined above
if(isIEBrowserGreaterThanOrEqualTo(9)){
xTicks = 8;
@@ -613,8 +613,7 @@ public class StackedBarMetricGraphImpl extends AbstractGraph {
"use strict";
// Guard condition that can occur when a portlet has not been
configured yet
if (chartContext.data.length > 0) {
- //console.info("Creating Chart: "+
chartContext.chartSelection + " --> "+ chartContext.chartTitle);
- //console.time("chart");
+ console.log("Creating Chart: "+
chartContext.chartSelection + " --> "+ chartContext.chartTitle);
determineScale();
createHeader(chartContext.chartTitle);
@@ -624,11 +623,10 @@ public class StackedBarMetricGraphImpl extends AbstractGraph {
createXandYAxes();
createAvgLines();
if (oobMax > 0) {
- //console.info("OOB Data Exists!");
+ console.log("OOB Data Exists!");
createOOBLines();
}
createHovers(chartContext);
- //console.timeEnd("chart");
}
}
}; // end public closure
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/js/rhq.js
b/modules/enterprise/gui/coregui/src/main/webapp/js/rhq.js
index 27c4cc0..081a9a2 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/js/rhq.js
+++ b/modules/enterprise/gui/coregui/src/main/webapp/js/rhq.js
@@ -2,29 +2,9 @@
* Charting Javascript Functions.
*/
-// Avoid `console` errors in browsers that lack a console.
-(function() {
- var method;
- var noop = function () {};
- var methods = [
- 'assert', 'clear', 'count', 'debug',
'dir', 'dirxml', 'error',
- 'exception', 'group', 'groupCollapsed',
'groupEnd', 'info', 'log',
- 'markTimeline', 'profile', 'profileEnd', 'table',
'time', 'timeEnd',
- 'timeStamp', 'trace', 'warn'
- ];
- var length = methods.length;
- var console = (window.console = window.console || {});
-
- while (length--) {
- method = methods[length];
-
- // Only stub undefined methods.
- if (!console[method]) {
- console[method] = noop;
- }
- }
-} ());
-
+// Handle browsers not supporting console object
+if (!window.console) window.console = {};
+if (!window.console.log) window.console.log = function () { };
/**
* ChartContext Constructor Object
commit db8f9686b96e2e3c44e61162b1a0d2d388fc59e9
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed May 8 13:48:42 2013 +0200
BZ 960529 - check for non-existing resources when obtaining availability
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
index 4e00625..3e1d195 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
@@ -338,6 +338,10 @@ public class ResourceHandlerBean extends AbstractRestBean {
@ApiParam(value="Start time", defaultValue = "30 days
ago") @QueryParam("start") long start,
@ApiParam(value="End time", defaultValue = "Now")
@QueryParam("end") long end,
@Context HttpHeaders headers) {
+
+ // Vaildate it the resource exists
+ fetchResource(resourceId);
+
if (end==0)
end = System.currentTimeMillis();
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
index 1dee0f1..c71bbd8 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/ResourcesTest.java
@@ -499,6 +499,22 @@ public class ResourcesTest extends AbstractBase {
}
@Test
+ public void testCreateChildForUnknownParent() throws Exception {
+
+ given()
+ .body("{\"value\":\"CPU\"}") // Type of new
resource
+ .header("Content-Type", "application/json")
+ .header("Accept", "application/json")
+ .pathParam("name", "test")
+ .queryParam("plugin", "Platforms")
+ .queryParam("parentId", 321)
+ .expect()
+ .statusCode(404)
+ .log().ifError()
+ .when().post("/resource/{name}");
+ }
+
+ @Test
public void testAlertsForResource() throws Exception {
given()
.header("Accept", "application/json")
@@ -521,6 +537,17 @@ public class ResourcesTest extends AbstractBase {
}
@Test
+ public void testSchedulesForUnknownResource() throws Exception {
+ given()
+ .header("Accept", "application/json")
+ .pathParam("id", 123)
+ .expect()
+ .statusCode(404)
+ .when()
+ .get("/resource/{id}/schedules");
+ }
+
+ @Test
public void testAvailabilityForResourceJson() throws Exception {
given()
.header(acceptJson)
@@ -532,6 +559,17 @@ public class ResourcesTest extends AbstractBase {
}
@Test
+ public void testAvailabilityForUnknownResource() throws Exception {
+ given()
+ .header(acceptJson)
+ .pathParam("id", 532)
+ .expect()
+ .statusCode(404)
+ .when()
+ .get("/resource/{id}/availability");
+ }
+
+ @Test
public void testAvailabilityForResourceXml() throws Exception {
given()
.header(acceptXml)
@@ -554,6 +592,17 @@ public class ResourcesTest extends AbstractBase {
}
@Test
+ public void testAvailabilityHistoryForUnknownResource() throws Exception {
+ given()
+ .header(acceptJson)
+ .pathParam("id", -42)
+ .expect()
+ .statusCode(404)
+ .when()
+ .get("/resource/{id}/availability/history");
+ }
+
+ @Test
public void testAvailabilityHistoryForResourceXml() throws Exception {
given()
.header(acceptXml)
commit 17c3db8f19d0b70a6f0d910450523c245cd6f8b9
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed May 8 09:17:48 2013 +0200
Code cleanup and improvements for the REST-api
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
index 2746823..7a198bd 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AbstractRestBean.java
@@ -81,21 +81,21 @@ import org.rhq.enterprise.server.rest.domain.ResourceWithType;
@SuppressWarnings("unchecked")
public class AbstractRestBean {
- Log log = LogFactory.getLog(getClass().getName());
+ protected Log log = LogFactory.getLog(getClass().getName());
- static private final CacheKey META_KEY = new
CacheKey("rhq.rest.resourceMeta", 0);
+ private static final CacheKey META_KEY = new
CacheKey("rhq.rest.resourceMeta", 0);
@javax.annotation.Resource( name = "ISPN")
- protected CacheContainer container;
+ private CacheContainer container;
protected Cache<CacheKey, Object> cache;
/** Subject of the caller that gets injected via {@link SetCallerInterceptor} */
protected Subject caller;
@EJB
- ResourceManagerLocal resMgr;
+ protected ResourceManagerLocal resMgr;
@EJB
- ResourceGroupManagerLocal resourceGroupManager;
+ protected ResourceGroupManagerLocal resourceGroupManager;
@PostConstruct
public void start() {
@@ -116,15 +116,15 @@ public class AbstractRestBean {
freemarker.template.Configuration config = new
freemarker.template.Configuration();
// XXX fall-over to ClassTL after failure in FTL seems not to work
- // FileTemplateLoader ftl = new FileTemplateLoader(new
File("src/main/resources"));
ClassTemplateLoader ctl = new ClassTemplateLoader(getClass(),
"/rest_templates/");
TemplateLoader[] loaders = new TemplateLoader[] { ctl };
MultiTemplateLoader mtl = new MultiTemplateLoader(loaders);
config.setTemplateLoader(mtl);
- if (!templateName.endsWith(".ftl"))
+ if (!templateName.endsWith(".ftl")) {
templateName = templateName + ".ftl";
+ }
Template template = config.getTemplate(templateName);
StringWriter out = new StringWriter();
@@ -171,8 +171,9 @@ public class AbstractRestBean {
CacheValue value = (CacheValue) cache.get(key);
+ boolean debugEnabled = log.isDebugEnabled();
if (null != value) {
- if (log.isDebugEnabled()) {
+ if (debugEnabled) {
log.debug("Cache Hit for " + key);
}
@@ -180,12 +181,12 @@ public class AbstractRestBean {
o = value.getValue();
} else {
- if (log.isDebugEnabled()) {
+ if (debugEnabled) {
log.debug("Cache Hit ignored, caller " + caller.toString()
+ " not found");
}
}
} else {
- if (log.isDebugEnabled()) {
+ if (debugEnabled) {
log.debug("Cache Miss for " + key);
}
}
@@ -351,8 +352,9 @@ public class AbstractRestBean {
Resource parent = res.getParentResource();
if (parent != null) {
rwt.setParentId(parent.getId());
- } else
+ } else {
rwt.setParentId(0);
+ }
rwt.setAncestry(res.getAncestry());
@@ -429,8 +431,9 @@ public class AbstractRestBean {
protected ResourceGroup fetchGroup(int groupId, boolean requireCompatible) {
ResourceGroup resourceGroup;
resourceGroup = resourceGroupManager.getResourceGroup(caller, groupId);
- if (resourceGroup == null)
+ if (resourceGroup == null) {
throw new StuffNotFoundException("Group with id " + groupId);
+ }
if (requireCompatible) {
if (resourceGroup.getGroupCategory() != GroupCategory.COMPATIBLE) {
throw new BadArgumentException("Group with id " +
groupId,"it is no compatible group");
@@ -445,8 +448,9 @@ public class AbstractRestBean {
gr.setId(group.getId());
gr.setCategory(group.getGroupCategory());
gr.setRecursive(group.isRecursive());
- if (group.getGroupDefinition()!=null)
+ if (group.getGroupDefinition()!=null) {
gr.setDynaGroupDefinitionId(group.getGroupDefinition().getId());
+ }
gr.setExplicitCount(group.getExplicitResources().size());
gr.setImplicitCount(group.getImplicitResources().size());
UriBuilder uriBuilder = uriInfo.getBaseUriBuilder();
@@ -526,16 +530,6 @@ public class AbstractRestBean {
return ms;
}
- Configuration mapToConfiguration(Map<String,Object> in) {
- Configuration config = new Configuration();
- for (Map.Entry<String,Object> entry : in.entrySet()) {
- config.put(new PropertySimple(entry.getKey(),entry.getValue())); // TODO
honor more types
- }
-
- return config;
-
- }
-
/**
* Set the caching header on the response
* @param builder Response builder to put the caching header on
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java
index 06bc8ae..d203cd3 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java
@@ -106,22 +106,22 @@ import org.rhq.enterprise.server.rest.domain.Link;
public class AlertDefinitionHandlerBean extends AbstractRestBean {
@EJB
- AlertDefinitionManagerLocal alertDefinitionManager;
+ private AlertDefinitionManagerLocal alertDefinitionManager;
@EJB
- AlertNotificationManagerLocal notificationMgr;
+ private AlertNotificationManagerLocal notificationMgr;
@EJB
- AlertConditionManagerLocal conditionMgr;
+ private AlertConditionManagerLocal conditionMgr;
@EJB
- AlertManagerLocal alertManager;
+ private AlertManagerLocal alertManager;
@EJB
- ResourceGroupManagerLocal resourceGroupMgr;
+ private ResourceGroupManagerLocal resourceGroupMgr;
@EJB
- ResourceTypeManagerLocal resourceTypeMgr;
+ private ResourceTypeManagerLocal resourceTypeMgr;
@PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME)
@@ -169,8 +169,9 @@ public class AlertDefinitionHandlerBean extends AbstractRestBean {
@Context Request request, @Context UriInfo uriInfo) {
AlertDefinition def = alertDefinitionManager.getAlertDefinition(caller,
definitionId);
- if (def==null)
+ if (def==null) {
throw new StuffNotFoundException("AlertDefinition with id " +
definitionId );
+ }
EntityTag eTag = new EntityTag(Integer.toHexString(def.hashCode()));
Response.ResponseBuilder builder = request.evaluatePreconditions(eTag);
@@ -285,8 +286,9 @@ public class AlertDefinitionHandlerBean extends AbstractRestBean {
@Context UriInfo uriInfo) {
AlertDefinition definition =
alertDefinitionManager.getAlertDefinition(caller,definitionId);
- if (definition==null)
+ if (definition==null) {
throw new StuffNotFoundException("AlertDefinition with id " +
definitionId);
+ }
definition = new AlertDefinition(definition); // detach
@@ -302,10 +304,12 @@ public class AlertDefinitionHandlerBean extends AbstractRestBean {
// Set the recovery id if such a definition exists at all
if (definitionRest.getRecoveryId()>0) {
AlertDefinition recoveryDef =
alertDefinitionManager.getAlertDefinition(caller,definitionRest.getRecoveryId());
- if (recoveryDef!=null)
+ if (recoveryDef!=null) {
definition.setRecoveryId(definitionRest.getRecoveryId());
- else
+ }
+ else {
throw new StuffNotFoundException("Alert to recover with id " +
definitionRest.getRecoveryId());
+ }
}
@@ -348,34 +352,24 @@ public class AlertDefinitionHandlerBean extends AbstractRestBean {
StringBuilder builder = new StringBuilder();
for (int i = 0; i < vals.length ; i++) {
builder.append(vals[i].name());
- if (i < vals.length-1)
+ if (i < vals.length-1) {
builder.append(", ");
+ }
}
throw new BadArgumentException("dampening category","Allowed
values are: " + builder.toString());
}
AlertDampening dampening = new AlertDampening(dampeningCategory);
- if (adr.getDampeningCount()!=null) {
- if (adr.getDampeningCount().contains(" ")) {
- String tmp = adr.getDampeningCount().trim();
- int num = Integer.parseInt(tmp.substring(0,tmp.indexOf(' ')));
- tmp = tmp.substring(tmp.lastIndexOf(' ')).trim();
- dampening.setValue(num);
-
dampening.setValueUnits(AlertDampening.TimeUnits.valueOf(tmp.toUpperCase()));
- }
- else {
- dampening.setValue(Integer.parseInt(adr.getDampeningCount()));
- }
- }
- if (adr.getDampeningPeriod()!=null) {
- if (adr.getDampeningPeriod().contains(" ")) {
- String tmp = adr.getDampeningPeriod().trim();
- int num = Integer.parseInt(tmp.substring(0,tmp.indexOf(' ')));
- tmp = tmp.substring(tmp.lastIndexOf(' ')).trim();
- dampening.setPeriod(num);
-
dampening.setPeriodUnits(AlertDampening.TimeUnits.valueOf(tmp.toUpperCase()));
- }
- else {
- dampening.setPeriod(Integer.parseInt(adr.getDampeningPeriod()));
+ if (adr.getDampeningCount()>-1) {
+ dampening.setValue(adr.getDampeningCount());
+ }
+ if (adr.getDampeningPeriod()>0) {
+ dampening.setPeriod(adr.getDampeningPeriod());
+ try {
+ if (adr.getDampeningUnit()!=null) {
+
dampening.setPeriodUnits(AlertDampening.TimeUnits.valueOf(adr.getDampeningUnit().toUpperCase()));
+ }
+ } catch (Exception e) {
+ throw new BadArgumentException("dampenign unit", "Allowed
values are MINUTES,HOURS,DAYS, WEEKS");
}
}
@@ -439,8 +433,9 @@ public class AlertDefinitionHandlerBean extends AbstractRestBean {
definition2 = entityManager.find(AlertDefinition.class,definitionId);
AlertCondition condition=null;
for (AlertCondition c: definition2.getConditions()) {
- if (c.getId() == conditionId)
+ if (c.getId() == conditionId) {
condition=c;
+ }
}
definition2.getConditions().remove(condition);
@@ -522,8 +517,9 @@ public class AlertDefinitionHandlerBean extends AbstractRestBean {
@ApiParam("The id of the condition to retrieve")
@PathParam("cid") int conditionId) {
AlertCondition condition = conditionMgr.getAlertConditionById(conditionId);
- if (condition==null)
+ if (condition==null) {
throw new StuffNotFoundException("No condition with id " +
conditionId);
+ }
AlertConditionRest acr = conditionToConditionRest(condition);
return Response.ok(acr).build();
@@ -565,8 +561,9 @@ public class AlertDefinitionHandlerBean extends AbstractRestBean {
AlertConditionRest result = conditionToConditionRest(createdCondition);
Response.ResponseBuilder builder;
- if (isCreate)
+ if (isCreate) {
builder = Response.created(uri);
+ }
else {
builder = Response.ok();
builder.location(uri);
@@ -583,8 +580,9 @@ public class AlertDefinitionHandlerBean extends AbstractRestBean {
@ApiParam("The id of the notification definition to retrieve")
@PathParam("nid") int notificationId) {
AlertNotification notification =
notificationMgr.getAlertNotification(caller,notificationId);
- if (notification==null)
+ if (notification==null) {
throw new StuffNotFoundException("No notification with id " +
notificationId);
+ }
AlertNotificationRest anr = notificationToNotificationRest(notification);
return Response.ok(anr).build();
@@ -618,8 +616,9 @@ public class AlertDefinitionHandlerBean extends AbstractRestBean {
@ApiParam("The updated notification definition to use")
AlertNotificationRest notificationRest) {
AlertNotification notification =
notificationMgr.getAlertNotification(caller,notificationId);
- if (notification==null)
+ if (notification==null) {
throw new StuffNotFoundException("No notification with id " +
notificationId);
+ }
AlertDefinition definition =
alertDefinitionManager.getAlertDefinition(caller,notification.getAlertDefinition().getId());
@@ -634,8 +633,9 @@ public class AlertDefinitionHandlerBean extends AbstractRestBean {
List<AlertNotification> notifications =
definition.getAlertNotifications();
int newNotifId = 0;
for (AlertNotification n : notifications) {
- if (n.getSenderName().equals(notification.getSenderName()))
+ if (n.getSenderName().equals(notification.getSenderName())) {
newNotifId = n.getId();
+ }
}
AlertNotification result =
notificationMgr.getAlertNotification(caller,newNotifId);
@@ -667,8 +667,9 @@ public class AlertDefinitionHandlerBean extends AbstractRestBean {
// Now check if the definition exists as well
AlertDefinition definition =
alertDefinitionManager.getAlertDefinition(caller,definitionId);
- if (definition==null)
+ if (definition==null) {
throw new StuffNotFoundException("AlertDefinition with id " +
definitionId);
+ }
// definition and sender are valid, continue
int existingNotificationCount = definition.getAlertNotifications().size();
@@ -816,10 +817,13 @@ public class AlertDefinitionHandlerBean extends AbstractRestBean {
adr.setDampeningCategory(dampening.getCategory().name());
AlertDampening.TimeUnits units = dampening.getValueUnits();
String s = units != null ? " " + units.name() : "";
- adr.setDampeningCount(dampening.getValue() + s);
+ adr.setDampeningCount(dampening.getValue());
units = dampening.getPeriodUnits();
s = units != null ? " " + units.name() : "";
- adr.setDampeningPeriod(dampening.getPeriod() + s);
+ adr.setDampeningPeriod(dampening.getPeriod());
+ if (dampening.getPeriodUnits()!=null) {
+ adr.setDampeningUnit(dampening.getPeriodUnits().name());
+ }
if (def.getResource()!=null) {
adr.getLinks().add(createUILink(uriInfo,UILinkTemplate.RESOURCE_ALERT_DEF,def.getResource().getId(),adr.getId()));
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerBean.java
index 0a37a9d..4c80bd1 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerBean.java
@@ -79,10 +79,8 @@ import org.rhq.enterprise.server.rest.domain.*;
@Interceptors(SetCallerInterceptor.class)
public class AlertHandlerBean extends AbstractRestBean {
-// private final Log log = LogFactory.getLog(AlertHandlerBean.class);
-
@EJB
- AlertManagerLocal alertManager;
+ private AlertManagerLocal alertManager;
@GZIP
@@ -107,10 +105,12 @@ public class AlertHandlerBean extends AbstractRestBean {
if (resourceId!=null && definitionId!=null) {
throw new BadArgumentException("At most one of 'resourceId' and
'definitionId' may be given");
}
- if (size==0)
+ if (size==0) {
throw new BadArgumentException("size","Must not be 0");
- if (page<1)
+ }
+ if (page<1) {
throw new BadArgumentException("page","Must be >=1");
+ }
AlertCriteria criteria = new AlertCriteria();
@@ -119,8 +119,9 @@ public class AlertHandlerBean extends AbstractRestBean {
pageControl.setPageNumber(page);
criteria.setPageControl(pageControl);
}
- else
+ else {
criteria.setPaging(page-1, size); // TODO implement linking to next page
+ }
if (since!=null) {
criteria.addFilterStartTime(since);
@@ -335,8 +336,9 @@ public class AlertHandlerBean extends AbstractRestBean {
AlertCriteria criteria = new AlertCriteria();
criteria.addFilterId(id);
List<Alert> alerts = alertManager.findAlertsByCriteria(caller,criteria);
- if (alerts.isEmpty())
+ if (alerts.isEmpty()) {
throw new StuffNotFoundException("Alert with id " + id);
+ }
return alerts.get(0);
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/CustomExceptionMapper.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/CustomExceptionMapper.java
index 07b2a1c..1099679 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/CustomExceptionMapper.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/CustomExceptionMapper.java
@@ -43,9 +43,9 @@ import org.rhq.enterprise.server.rest.domain.RHQErrorWrapper;
public class CustomExceptionMapper implements ExceptionMapper<Exception> {
@Context
- HttpHeaders httpHeaders;
+ private HttpHeaders httpHeaders;
- Log log = LogFactory.getLog(getClass().getName());
+ private Log log = LogFactory.getLog(getClass().getName());
@Override
public Response toResponse(Exception e) {
@@ -53,24 +53,25 @@ public class CustomExceptionMapper implements
ExceptionMapper<Exception> {
Response.ResponseBuilder builder;
Response.Status status;
- if (e instanceof StuffNotFoundException)
+ if (e instanceof StuffNotFoundException) {
status =Response.Status.NOT_FOUND;
- else if (e instanceof ResourceNotFoundException)
+ } else if (e instanceof ResourceNotFoundException) {
status = Response.Status.NOT_FOUND;
- else if (e instanceof ResourceGroupNotFoundException)
+ } else if (e instanceof ResourceGroupNotFoundException) {
status = Response.Status.NOT_FOUND;
- else if (e instanceof ResourceTypeNotFoundException)
+ } else if (e instanceof ResourceTypeNotFoundException) {
status = Response.Status.NOT_FOUND;
- else if (e instanceof ParameterMissingException)
+ } else if (e instanceof ParameterMissingException) {
status = Response.Status.NOT_ACCEPTABLE;
- else if (e instanceof BadArgumentException)
+ } else if (e instanceof BadArgumentException) {
status = Response.Status.NOT_ACCEPTABLE;
- else if (e instanceof PermissionException)
+ } else if (e instanceof PermissionException) {
status = Response.Status.FORBIDDEN;
- else if (e instanceof EJBException && e.getCause()!=null &&
e.getCause() instanceof IllegalArgumentException)
+ } else if (e instanceof EJBException && e.getCause()!=null &&
e.getCause() instanceof IllegalArgumentException) {
status = Response.Status.NOT_ACCEPTABLE;
- else
+ } else {
status = Response.Status.SERVICE_UNAVAILABLE;
+ }
builder = Response.status(status);
String message = e.getMessage();
@@ -93,8 +94,9 @@ public class CustomExceptionMapper implements
ExceptionMapper<Exception> {
log.debug(e.getMessage());
mediaType = MediaType.TEXT_PLAIN_TYPE;
}
- if (mediaType.getType().equals("text") &&
mediaType.getSubtype().equals("csv"))
+ if (mediaType.getType().equals("text") &&
mediaType.getSubtype().equals("csv")) {
mediaType = MediaType.TEXT_PLAIN_TYPE;
+ }
if (mediaType.equals(MediaType.TEXT_PLAIN_TYPE)) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
index ccfed9f..8bc2cb9 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
@@ -47,6 +47,8 @@ import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;
+import com.wordnik.swagger.annotations.ApiError;
+import com.wordnik.swagger.annotations.ApiErrors;
import com.wordnik.swagger.annotations.ApiOperation;
import com.wordnik.swagger.annotations.ApiParam;
@@ -69,13 +71,17 @@ import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.util.PageList;
import org.rhq.core.domain.util.PageOrdering;
+import org.rhq.core.domain.util.StringUtils;
+import org.rhq.enterprise.server.operation.OperationDefinitionNotFoundException;
import org.rhq.enterprise.server.operation.OperationManagerLocal;
import org.rhq.enterprise.server.resource.ResourceManagerLocal;
+import org.rhq.enterprise.server.resource.ResourceNotFoundException;
import org.rhq.enterprise.server.rest.domain.Link;
import org.rhq.enterprise.server.rest.domain.OperationDefinitionRest;
import org.rhq.enterprise.server.rest.domain.OperationHistoryRest;
import org.rhq.enterprise.server.rest.domain.OperationRest;
import org.rhq.enterprise.server.rest.domain.SimplePropDef;
+import org.rhq.enterprise.server.rest.helper.ConfigurationHelper;
/**
* Deal with operations
@@ -88,32 +94,31 @@ import org.rhq.enterprise.server.rest.domain.SimplePropDef;
public class OperationsHandlerBean extends AbstractRestBean {
@EJB
- OperationManagerLocal opsManager;
+ private OperationManagerLocal opsManager;
@EJB
- ResourceManagerLocal resourceManager;
+ private ResourceManagerLocal resourceManager;
@GET
@Path("definition/{id}")
@Cache(maxAge = 1200)
@ApiOperation("Retrieve a single operation definition by its id")
public Response getOperationDefinition(
- @ApiParam("Id of the definition to retrieve")
@PathParam("id") int definitionId,
- @ApiParam("Id of a resource that supports this operation")
@QueryParam("resourceId") Integer resourceId,
- @Context UriInfo uriInfo,
- @Context Request request,
- @Context HttpHeaders httpHeaders) {
-
-
+ @ApiParam("Id of the definition to retrieve")
@PathParam("id") int definitionId,
+ @ApiParam("Id of a resource that supports this operation")
@QueryParam("resourceId") Integer resourceId,
+ @Context UriInfo uriInfo,
+ @Context Request request) {
OperationDefinition def;
def = getFromCache(definitionId, OperationDefinition.class);
if (def==null) {
- def = opsManager.getOperationDefinition(caller,definitionId);
- if (def==null)
- throw new StuffNotFoundException("OperationDefinition with id "
+ definitionId);
- else
+ try {
+ def = opsManager.getOperationDefinition(caller,definitionId);
putToCache(definitionId,OperationDefinition.class,def);
+ }
+ catch (OperationDefinitionNotFoundException ode) {
+ throw new StuffNotFoundException("Operation definition with id
" + definitionId);
+ }
}
EntityTag eTag = new EntityTag(Integer.toHexString(def.hashCode()));
@@ -145,43 +150,27 @@ public class OperationsHandlerBean extends AbstractRestBean {
}
- private void copyParamsForDefinition(OperationDefinition def, OperationDefinitionRest
odr) {
- ConfigurationDefinition cd = def.getParametersConfigurationDefinition();
- if (cd==null)
- return;
-
- for (Map.Entry<String,PropertyDefinition> entry :
cd.getPropertyDefinitions().entrySet()) {
- PropertyDefinition pd = entry.getValue();
- if (pd instanceof PropertyDefinitionSimple) {
- PropertyDefinitionSimple pds = (PropertyDefinitionSimple) pd;
- SimplePropDef prop = new SimplePropDef();
- prop.setName(pds.getName());
- prop.setRequired(pds.isRequired());
- prop.setType(pds.getType());
- prop.setDefaultValue(pds.getDefaultValue());
- odr.addParam(prop);
- }
- log.debug("copyParams: " + pd.getName() + " not yet
supported");
- }
- }
-
@GZIP
@GET
@Path("definitions")
@Cache(maxAge = 1200)
@ApiOperation("List all operation definitions for a resource")
public Response getOperationDefinitions(
- @ApiParam(value = "Id of the resource",required = true)
@QueryParam("resourceId") Integer resourceId,
- @Context UriInfo uriInfo,
- @Context Request request,
- @Context HttpHeaders httpHeaders) {
+ @ApiParam(value = "Id of the resource", required = true)
@QueryParam("resourceId") Integer resourceId,
+ @Context UriInfo uriInfo,
+ @Context Request request) {
- if (resourceId == null)
+ if (resourceId == null) {
throw new ParameterMissingException("resourceId");
+ }
- Resource res =resourceManager.getResource(caller,resourceId);
- if(res==null)
+ Resource res;
+ try {
+ res = resourceManager.getResource(caller,resourceId);
+ }
+ catch (ResourceNotFoundException rnfe) {
throw new StuffNotFoundException("resource with id " +
resourceId);
+ }
ResourceType resourceType = res.getResourceType();
@@ -226,16 +215,24 @@ public class OperationsHandlerBean extends AbstractRestBean {
@ApiParam(value = "Id of the resource", required = true)
@QueryParam("resourceId") Integer resourceId,
@Context UriInfo uriInfo) {
- if (resourceId == null)
+ if (resourceId == null) {
throw new ParameterMissingException("resourceId");
+ }
- Resource res =resourceManager.getResource(caller,resourceId);
- if(res==null)
+ try {
+ // Check if the resource exists at all
+ resourceManager.getResource(caller,resourceId);
+ }
+ catch (ResourceNotFoundException rnfe) {
throw new StuffNotFoundException("resource with id " +
resourceId);
+ }
- OperationDefinition opDef =
opsManager.getOperationDefinition(caller,definitionId);
- if (opDef==null) {
+ OperationDefinition opDef;
+ try {
+ opDef = opsManager.getOperationDefinition(caller,definitionId);
+ }
+ catch (OperationDefinitionNotFoundException odnfe) {
throw new StuffNotFoundException("Operation definition with id " +
definitionId);
}
OperationRest operationRest = new OperationRest(resourceId,definitionId);
@@ -266,9 +263,11 @@ public class OperationsHandlerBean extends AbstractRestBean {
@Path("{id}")
@ApiOperation("Return a (draft) operation")
public Response getOperation(@ApiParam("Id of the operation to retrieve")
@PathParam("id") int operationId) {
+
OperationRest op = getFromCache(operationId,OperationRest.class);
- if (op==null)
+ if (op==null) {
throw new StuffNotFoundException("Operation with id " +
operationId);
+ }
return Response.ok(op).build();
}
@@ -277,20 +276,40 @@ public class OperationsHandlerBean extends AbstractRestBean {
@Path("{id}")
@Consumes({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
@ApiOperation("Update a (draft) operation. If the state is set to
'ready', the operation will be scheduled")
+ @ApiErrors({
+ @ApiError(code = 404, reason = "No draft operation with the passed id
exists"),
+ @ApiError(code = 406, reason = "Draft was set for scheduling, but parameters
failed validation"),
+ @ApiError(code = 200, reason = "Update was successful, operation was
scheduled if requested" )
+ }
+ )
public Response updateOperation(@ApiParam("Id of the operation to update")
@PathParam("id") int operationId,
OperationRest operation, @Context UriInfo uriInfo) {
- if (!operation.isReadyToSubmit() && operation.getDefinitionId()>0
&& !operation.getName().isEmpty()) {
- // TODO check all the required parameters for presence before allowing to
submit
- operation.setReadyToSubmit(true);
+ OperationRest op = getFromCache(operationId,OperationRest.class);
+ if (op==null) {
+ throw new StuffNotFoundException("Operation with id " +
operationId);
}
+
+ Configuration parameters =
ConfigurationHelper.mapToConfiguration(operation.getParams());
+
if (operation.isReadyToSubmit()) {
- // todo check params
- // submit
+ OperationDefinition opDef =
opsManager.getOperationDefinition(caller,operation.getDefinitionId());
- Configuration parameters = mapToConfiguration(operation.getParams());
+ // Validate parameters
+ ConfigurationDefinition parameterDefinition =
opDef.getParametersConfigurationDefinition();
+ List<String> errorMessages =
ConfigurationHelper.checkConfigurationWrtDefinition(parameters, parameterDefinition);
+ if (errorMessages.size()>0) {
+ // Configuration is not ok
+ operation.setReadyToSubmit(false);
+ throw new BadArgumentException("Validation of parameters
failed", StringUtils.getListAsString(errorMessages,", "));
+ }
+ }
+
+ if (operation.isReadyToSubmit()) {
+
+ // submit
ResourceOperationSchedule sched =
opsManager.scheduleResourceOperation(caller,operation.getResourceId(),operation.getName(),0,0,0,-1,
parameters,"Test");
JobId jobId = new JobId(sched.getJobName(),sched.getJobGroup());
@@ -304,12 +323,12 @@ public class OperationsHandlerBean extends AbstractRestBean {
else {
UriBuilder uriBuilder = uriInfo.getBaseUriBuilder();
uriBuilder.path("/operation/{id}");
- URI uri = uriBuilder.build(operation.getId());
+ URI uri = uriBuilder.build(operationId);
Link editLink = new Link("edit",uri.toString());
operation.addLink(editLink);
}
// Update item in cache
- putToCache(operation.getId(),OperationRest.class,operation);
+ putToCache(operationId,OperationRest.class,operation);
Response.ResponseBuilder builder = Response.ok(operation);
return builder.build();
}
@@ -381,8 +400,9 @@ public class OperationsHandlerBean extends AbstractRestBean {
@Context HttpHeaders httpHeaders) {
ResourceOperationHistoryCriteria criteria = new
ResourceOperationHistoryCriteria();
- if (resourceId>0)
+ if (resourceId>0) {
criteria.addFilterResourceIds(resourceId);
+ }
criteria.addSortEndTime(PageOrdering.DESC);
@@ -424,30 +444,41 @@ public class OperationsHandlerBean extends AbstractRestBean {
}
-
+ /**
+ * Create a REST-object from the passed operation history
+ * @param history History object to convert
+ * @param uriInfo URI info of the incoming request, used to create links
+ * @return a populated OperationHistoryRest object
+ */
private OperationHistoryRest historyToHistoryRest(ResourceOperationHistory history,
UriInfo uriInfo) {
String status;
- if (history.getStatus()==null)
+ if (history.getStatus()==null) {
status = " - no information yet -";
- else
+ }
+ else {
status = history.getStatus().getDisplayName();
+ }
OperationHistoryRest hist = new OperationHistoryRest();
hist.setStatus(status);
- if (history.getResource()!=null)
+ if (history.getResource()!=null) {
hist.setResourceName(history.getResource().getName());
+ }
hist.setOperationName(history.getOperationDefinition().getName());
hist.lastModified(history.getModifiedTime());
- if (history.getErrorMessage()!=null)
+ if (history.getErrorMessage()!=null) {
hist.setErrorMessage(history.getErrorMessage());
+ }
if (history.getResults()!=null) {
Configuration results = history.getResults();
for (Property p : results.getProperties()) {
String val;
- if (p instanceof PropertySimple)
+ if (p instanceof PropertySimple) {
val = ((PropertySimple)p).getStringValue();
- else
+ }
+ else {
val = p.toString();
+ }
hist.getResult().put(p.getName(),val);
}
}
@@ -465,4 +496,34 @@ public class OperationsHandlerBean extends AbstractRestBean {
return hist;
}
+ /**
+ * Copies the parameters of an OperationDefinition into to an object that can be
+ * returned to a REST-client, so that this knows which fields are to be filled in,
+ * of which type they are and which ones are required
+ * @param def OperationsDefinition to "copy"
+ * @param definitionRest The definition to fill in
+ */
+ private void copyParamsForDefinition(OperationDefinition def, OperationDefinitionRest
definitionRest) {
+ ConfigurationDefinition cd = def.getParametersConfigurationDefinition();
+ if (cd==null) {
+ return;
+ }
+
+ for (Map.Entry<String,PropertyDefinition> entry :
cd.getPropertyDefinitions().entrySet()) {
+ PropertyDefinition pd = entry.getValue();
+ if (pd instanceof PropertyDefinitionSimple) {
+ PropertyDefinitionSimple pds = (PropertyDefinitionSimple) pd;
+ SimplePropDef prop = new SimplePropDef();
+ prop.setName(pds.getName());
+ prop.setRequired(pds.isRequired());
+ prop.setType(pds.getType());
+ prop.setDefaultValue(pds.getDefaultValue());
+ definitionRest.addParam(prop);
+ }
+ log.debug("copyParams: " + pd.getName() + " not yet
supported");
+ }
+ }
+
+
+
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ParameterMissingException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ParameterMissingException.java
index 16fd62f..d3f3f50 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ParameterMissingException.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ParameterMissingException.java
@@ -1,9 +1,12 @@
package org.rhq.enterprise.server.rest;
+import javax.ejb.ApplicationException;
+
/**
* Exception thrown if (Query) Parameters are missing
* @author Heiko W. Rupp
*/
+@ApplicationException(rollback = false, inherited = true)
public class ParameterMissingException extends RuntimeException {
public ParameterMissingException(String what) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ReportsHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ReportsHandlerBean.java
index 1377be4..1b563da 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ReportsHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ReportsHandlerBean.java
@@ -76,25 +76,25 @@ import org.rhq.enterprise.server.rest.reporting.SuspectMetricLocal;
public class ReportsHandlerBean extends AbstractRestBean {
@EJB
- AlertDefinitionLocal alertDefinitionLocal;
+ private AlertDefinitionLocal alertDefinitionLocal;
@EJB
- ConfigurationHistoryLocal configurationHistoryLocal;
+ private ConfigurationHistoryLocal configurationHistoryLocal;
@EJB
- DriftComplianceLocal driftComplianceLocal;
+ private DriftComplianceLocal driftComplianceLocal;
@EJB
- InventorySummaryLocal inventorySummaryLocal;
+ private InventorySummaryLocal inventorySummaryLocal;
@EJB
- PlatformUtilizationLocal platformUtilizationLocal;
+ private PlatformUtilizationLocal platformUtilizationLocal;
@EJB
- RecentAlertLocal recentAlertLocal;
+ private RecentAlertLocal recentAlertLocal;
@EJB
- RecentDriftLocal recentDriftLocal;
+ private RecentDriftLocal recentDriftLocal;
@EJB
- RecentOperationsLocal recentOperationsLocal;
+ private RecentOperationsLocal recentOperationsLocal;
@EJB
- SuspectMetricLocal suspectMetricLocal;
+ private SuspectMetricLocal suspectMetricLocal;
- String[] reports = {
+ private String[] reports = {
"alertDefinitions",
"configurationHistory",
"driftCompliance",
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
index 1c2b516..4e00625 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
@@ -108,6 +108,7 @@ import org.rhq.enterprise.server.rest.domain.MetricSchedule;
import org.rhq.enterprise.server.rest.domain.ResourceWithChildren;
import org.rhq.enterprise.server.rest.domain.ResourceWithType;
import org.rhq.enterprise.server.rest.domain.StringValue;
+import org.rhq.enterprise.server.rest.helper.ConfigurationHelper;
/**
* Class that deals with getting data about resources
@@ -755,8 +756,8 @@ public class ResourceHandlerBean extends AbstractRestBean {
if (resType==null)
throw new StuffNotFoundException("ResourceType with name [" +
typeName + "] and plugin [" + plugin + "]");
- Configuration pluginConfig = mapToConfiguration(request.getPluginConfig());
- Configuration deployConfig = mapToConfiguration(request.getResourceConfig());
+ Configuration pluginConfig =
ConfigurationHelper.mapToConfiguration(request.getPluginConfig());
+ Configuration deployConfig =
ConfigurationHelper.mapToConfiguration(request.getResourceConfig());
String packageName = DEFAULT_PACKAGE;
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/RootHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/RootHandlerBean.java
index 3aded78..612b3f7 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/RootHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/RootHandlerBean.java
@@ -51,7 +51,7 @@ import org.rhq.enterprise.server.rest.domain.Link;
@Stateless
public class RootHandlerBean extends AbstractRestBean {
- String[] roots = { // rel, target
+ private String[] roots = { // rel, target
"platforms","resource/platforms",
"groups","group",
"dynaGroups","group/definitions",
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/SetCallerInterceptor.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/SetCallerInterceptor.java
index 3db8dc5..1da5411 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/SetCallerInterceptor.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/SetCallerInterceptor.java
@@ -52,10 +52,10 @@ import org.rhq.enterprise.server.auth.SubjectManagerLocal;
public class SetCallerInterceptor {
@Resource
- EJBContext ejbContext;
+ private EJBContext ejbContext;
@EJB
- SubjectManagerLocal subjectManager;
+ private SubjectManagerLocal subjectManager;
private SessionManager sessionManager = SessionManager.getInstance();
@@ -76,8 +76,9 @@ public class SetCallerInterceptor {
caller = subjectManager.getSubjectByName(p.getName());
}
- if (caller==null)
+ if (caller==null) {
throw new IllegalAccessException("No calling principal provided");
+ }
// Get Subject with a session
caller = sessionManager.put(caller);
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/StatusHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/StatusHandlerBean.java
index 23bbd4b..a6c81b3 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/StatusHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/StatusHandlerBean.java
@@ -55,9 +55,9 @@ public class StatusHandlerBean extends AbstractRestBean {
@EJB
- SystemInfoManagerLocal infoMgr;
+ private SystemInfoManagerLocal infoMgr;
@EJB
- ServerManagerLocal serverManager;
+ private ServerManagerLocal serverManager;
@GZIP
@ApiOperation(value="Retrieve the current configured state of the server along
with some runtime information." +
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/UserHandlerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/UserHandlerBean.java
index 9851425..cd57b67 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/UserHandlerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/UserHandlerBean.java
@@ -74,8 +74,6 @@ import org.rhq.enterprise.server.rest.domain.UserRest;
@Stateless
public class UserHandlerBean extends AbstractRestBean {
- // private final Log log = LogFactory.getLog(UserHandlerBean.class);
-
/**
* List of favorite {@link org.rhq.core.domain.resource.Resource} id's, delimited
by '|' characters. Default is "".
*/
@@ -88,10 +86,10 @@ public class UserHandlerBean extends AbstractRestBean {
public static final String GROUP_HEALTH_GROUPS =
".dashContent.grouphealth.groups";
@EJB
- SubjectManagerLocal subjectManager;
+ private SubjectManagerLocal subjectManager;
@EJB
- ResourceManagerLocal resourceManager;
+ private ResourceManagerLocal resourceManager;
@GZIP
@GET
@@ -112,10 +110,12 @@ public class UserHandlerBean extends AbstractRestBean {
ResourceWithType rwt = fillRWT(res, uriInfo);
ret.add(rwt);
} catch (Exception e) {
- if (e instanceof ResourceNotFoundException)
+ if (e instanceof ResourceNotFoundException) {
log.debug("Favorite resource with id " + id + " not
found - not returning to the user");
- else
+ }
+ else {
log.warn("Retrieving resource with id " + id + "
failed: " + e.getLocalizedMessage());
+ }
}
}
Response.ResponseBuilder builder;
@@ -151,11 +151,12 @@ public class UserHandlerBean extends AbstractRestBean {
ResourceGroup res = resourceGroupManager.getResourceGroup(caller, id);
GroupRest rwt = fillGroup(res, uriInfo);
ret.add(rwt);
- } catch (Exception e) {
- if (e instanceof ResourceGroupNotFoundException)
- log.debug("Favorite group with id " + id + " not found
- not returning to the user");
- else
- log.warn("Retrieving group with id " + id + " failed:
" + e.getLocalizedMessage());
+ }
+ catch (ResourceGroupNotFoundException e) {
+ log.debug("Favorite group with id " + id + " not found -
not returning to the user");
+ }
+ catch (Exception e) {
+ log.warn("Retrieving group with id " + id + " failed:
" + e.getLocalizedMessage());
}
}
Response.ResponseBuilder builder;
@@ -222,8 +223,8 @@ public class UserHandlerBean extends AbstractRestBean {
@Path("favorites/group/{id}")
@ApiOperation(value = "Remove a group from favorites")
public void removeResourceGroupFromFavorites(@ApiParam(name = "id", value =
"Id of the group")
- @PathParam("id")
- int id) {
+ @PathParam("id") int id) {
+
Set<Integer> favIds = getGroupIdsForFavorites();
if (favIds.contains(id)) {
favIds.remove(id);
@@ -242,8 +243,9 @@ public class UserHandlerBean extends AbstractRestBean {
HttpHeaders headers) {
Subject subject = subjectManager.getSubjectByName(loginName);
- if (subject == null)
+ if (subject == null) {
throw new StuffNotFoundException("User with login " + loginName);
+ }
EntityTag eTag = new EntityTag(Long.toOctalString(subject.hashCode()));
Response.ResponseBuilder builder = request.evaluatePreconditions(eTag);
@@ -273,7 +275,8 @@ public class UserHandlerBean extends AbstractRestBean {
PropertySimple prop = conf.getSimple(RESOURCE_HEALTH_RESOURCES);
if (prop == null) {
conf.put(new PropertySimple(RESOURCE_HEALTH_RESOURCES, builder.toString()));
- } else {
+ }
+ else {
prop.setStringValue(builder.toString());
}
caller.setUserConfiguration(conf);
@@ -290,7 +293,8 @@ public class UserHandlerBean extends AbstractRestBean {
PropertySimple prop = conf.getSimple(GROUP_HEALTH_GROUPS);
if (prop == null) {
conf.put(new PropertySimple(GROUP_HEALTH_GROUPS, builder.toString()));
- } else {
+ }
+ else {
prop.setStringValue(builder.toString());
}
caller.setUserConfiguration(conf);
@@ -308,13 +312,22 @@ public class UserHandlerBean extends AbstractRestBean {
private Set<Integer> getGroupIdsForFavorites() {
Configuration conf = caller.getUserConfiguration();
- if (conf==null)
+ if (conf==null) {
return new HashSet<Integer>();
+ }
String favsString = conf.getSimpleValue(GROUP_HEALTH_GROUPS, "");
Set<Integer> favIds = getIdsFromFavString(favsString);
return favIds;
}
+ /**
+ * Parse the String with favorites.
+ * The list of favorites is stored in the server as a list
+ * of ids separated by a pipe '|' character.
+ *
+ * @param favsString String as stored in for the user
+ * @return Set of ids of the favorites
+ */
private Set<Integer> getIdsFromFavString(String favsString) {
Set<Integer> favIds = new TreeSet<Integer>();
if (!favsString.isEmpty()) {
@@ -326,13 +339,21 @@ public class UserHandlerBean extends AbstractRestBean {
return favIds;
}
+ /**
+ * Create the String with favorites to store for the user
+ * The list of favorites is stored in the server as a list
+ * of ids separated by a pipe '|' character
+ * @param favIds Set of favorite ids
+ * @return String representation
+ */
private StringBuilder buildFavStringFromSet(Set<Integer> favIds) {
StringBuilder builder = new StringBuilder();
Iterator<Integer> iter = favIds.iterator();
while (iter.hasNext()) {
builder.append(iter.next());
- if (iter.hasNext())
+ if (iter.hasNext()) {
builder.append('|');
+ }
}
return builder;
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/AlertDefinitionRest.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/AlertDefinitionRest.java
index 2224732..f40d92c 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/AlertDefinitionRest.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/AlertDefinitionRest.java
@@ -43,8 +43,9 @@ public class AlertDefinitionRest {
List<AlertConditionRest> conditions = new
ArrayList<AlertConditionRest>();
List<AlertNotificationRest> notifications = new
ArrayList<AlertNotificationRest>();
String dampeningCategory;
- String dampeningCount;
- String dampeningPeriod;
+ int dampeningCount;
+ int dampeningPeriod;
+ String dampeningUnit;
List<Link> links = new ArrayList<Link>();
@SuppressWarnings("unused")
@@ -138,24 +139,33 @@ public class AlertDefinitionRest {
this.dampeningCategory = dampeningCategory;
}
- @ApiProperty(value = "Number of occurrences of an alert (in a given
period)")
- public String getDampeningCount() {
+ @ApiProperty(value = "Number of occurrences of an alert (in a given period).
Valid values are > -1")
+ public int getDampeningCount() {
return dampeningCount;
}
- public void setDampeningCount(String dampeningCount) {
+ public void setDampeningCount(int dampeningCount) {
this.dampeningCount = dampeningCount;
}
@ApiProperty( value = "Period to check events. Only applicable for
PARTIAL_COUNT, DURATION_COUNT, INVERSE_COUNT")
- public String getDampeningPeriod() {
+ public int getDampeningPeriod() {
return dampeningPeriod;
}
- public void setDampeningPeriod(String dampeningPeriod) {
+ public void setDampeningPeriod(int dampeningPeriod) {
this.dampeningPeriod = dampeningPeriod;
}
+ @ApiProperty( value = "Unit of the dampening period.",allowableValues =
"MINUTES, HOURS, DAYS, WEEKS" )
+ public String getDampeningUnit() {
+ return dampeningUnit;
+ }
+
+ public void setDampeningUnit(String dampeningUnit) {
+ this.dampeningUnit = dampeningUnit;
+ }
+
public List<Link> getLinks() {
return links;
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/helper/ConfigurationHelper.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/helper/ConfigurationHelper.java
new file mode 100644
index 0000000..073966d
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/helper/ConfigurationHelper.java
@@ -0,0 +1,432 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+package org.rhq.enterprise.server.rest.helper;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.Property;
+import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.configuration.PropertyMap;
+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.PropertyDefinitionList;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionMap;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
+import org.rhq.core.domain.configuration.definition.PropertySimpleType;
+
+/**
+ * Helper class to deal with configuration objects
+ * @author Heiko W. Rupp
+ */
+public class ConfigurationHelper {
+
+ /**
+ * Convert the passed map into a RHQ configuration object
+ * @param in Map with items to convert. Map.Entry.Key is the name of the property and
Map.Entry.Value the value
+ * @return a new Configuration object
+ */
+ public static Configuration mapToConfiguration(Map<String, Object> in) {
+ Configuration config = new Configuration();
+ Set<String> mapKeys = in.keySet();
+ for (String mapKey : mapKeys) {
+ Object mapValue = in.get(mapKey);
+
+ if (mapValue instanceof Map) {
+ Map<String,Object> map = (Map<String, Object>) mapValue;
+ PropertyMap propertyMap = getPropertyMap(mapKey, map);
+ config.put(propertyMap);
+ }
+ else if (mapValue instanceof List) {
+ List<Object> objects = (List<Object>) mapValue;
+ PropertyList propertyList = getPropertyList(mapKey, objects);
+ config.put(propertyList);
+ }
+ else {
+ config.put(new PropertySimple(mapKey,mapValue));
+ }
+ }
+
+ return config;
+
+ }
+
+ public static Map<String,Object> configurationToMap(Configuration
configuration, ConfigurationDefinition definition,
+ boolean strict) {
+
+ Map<String,Object> result = new HashMap<String, Object>();
+
+ if (configuration==null) {
+ return result;
+ }
+
+ if (configuration.getProperties().isEmpty()) {
+ return result;
+ }
+
+ for (Property property : configuration.getProperties()) {
+
+ String propertyName = property.getName();
+ PropertyDefinition propertyDefinition = definition.get(propertyName);
+ if (propertyDefinition==null) {
+ if (strict) {
+ throw new IllegalArgumentException("No definition for property
" + propertyName + "found");
+ } else {
+ // no definition found and not strict, so skip the property
+ continue;
+ }
+ }
+
+ Object target = convertProperty(property, propertyDefinition, strict);
+ result.put(propertyName,target);
+ }
+
+ return result;
+ }
+
+ private static Object convertProperty(Property property, PropertyDefinition
propertyDefinition, boolean strict) {
+ Object target;
+
+ if (property instanceof PropertyMap) {
+ PropertyMap propertyMap = (PropertyMap) property;
+ target = getInnerMap(propertyMap,(PropertyDefinitionMap) propertyDefinition,
strict);
+ } else if (property instanceof PropertyList) {
+ PropertyList propertyList = (PropertyList) property;
+ target = getInnerList(propertyList,
(PropertyDefinitionList)propertyDefinition, strict);
+ } else {
+ target= convertSimplePropertyValue((PropertySimple) property,
+ ((PropertyDefinitionSimple)propertyDefinition));
+ }
+ return target;
+ }
+
+ private static Map<String, Object> getInnerMap(PropertyMap propertyMap,
PropertyDefinitionMap propertyDefinition,
+ boolean strict) {
+
+ Map<String, Property> map = propertyMap.getMap();
+ Map<String,Object> result = new HashMap<String, Object>(map.size());
+
+ Set<String> names = map.keySet();
+ for (String name : names ) {
+ Property property = map.get(name);
+ PropertyDefinition definition = propertyDefinition.get(name);
+
+ Object target = convertProperty(property,definition, strict);
+ result.put(name,target);
+ }
+
+ return result;
+ }
+
+ private static List<Object> getInnerList(PropertyList propertyList,
PropertyDefinitionList definition,
+ boolean strict) {
+
+ List<Object> result = new
ArrayList<Object>(propertyList.getList().size());
+
+ if (definition==null) {
+ if (strict) {
+ throw new IllegalArgumentException("No Definition exists for "
+ propertyList.getName());
+ } else {
+ return result;
+ }
+ }
+
+
+ PropertyDefinition memberDefinition = definition.getMemberDefinition();
+ for (Property property : propertyList.getList()) {
+ Object target = convertProperty(property,memberDefinition, strict);
+ result.add(target);
+ }
+
+ return result;
+ }
+
+ private static PropertyList getPropertyList(String propertyName, List<Object>
objects) {
+ PropertyList propertyList = new PropertyList(propertyName);
+
+ Property target;
+ for (Object o : objects) {
+ if (o instanceof List) {
+ // Not sure if we actually support that at all inside RHQ
+ List list = (List) o;
+ target = getPropertyList(propertyName,list); // TODO propertyName?
+ } else if (o instanceof Map) {
+ Map map = (Map) o;
+ target = getPropertyMap(propertyName,map); // TODO propertyName?
+ } else {
+ target = new PropertySimple(propertyName,o);
+ }
+ propertyList.add(target);
+ }
+ return propertyList;
+ }
+
+ private static PropertyMap getPropertyMap(String propertyName, Map<String,
Object> map) {
+ PropertyMap propertyMap = new PropertyMap(propertyName);
+ Set<String> keys = map.keySet();
+ for (String key : keys) {
+ Object value = map.get(key);
+ Property target;
+ if (value instanceof Map) {
+ target = getPropertyMap(key, (Map)value);
+ } else if (value instanceof List) {
+ target = getPropertyList(key, (List)value);
+ } else {
+ target = new PropertySimple(key,value);
+ }
+ propertyMap.put(target);
+ }
+ return propertyMap;
+ }
+
+ /**
+ * Convert the passed simple property into an object of a matching type. The
+ * type is determined with the help of the passed definition
+ * @param property Property to convert
+ * @param definition Definition of the Property
+ * @return Object with the correct type
+ */
+ public static Object convertSimplePropertyValue(PropertySimple property,
PropertyDefinitionSimple definition) {
+
+ if (definition==null) {
+ throw new IllegalArgumentException("No definition provided");
+ }
+
+ if (property==null) {
+ return null;
+ }
+
+ PropertySimpleType type = definition.getType();
+ String val = property.getStringValue();
+
+ Object ret;
+
+ switch (type) {
+ case STRING:
+ ret= val;
+ break;
+ case INTEGER:
+ ret= Integer.valueOf(val);
+ break;
+ case BOOLEAN:
+ ret= Boolean.valueOf(val);
+ break;
+ case LONG:
+ ret= Long.valueOf(val);
+ break;
+ case FLOAT:
+ ret= Float.valueOf(val);
+ break;
+ case DOUBLE:
+ ret= Double.valueOf(val);
+ break;
+ default:
+ ret= val;
+ }
+ return ret;
+ }
+
+
+ /**
+ * Check that the passed configuration is valid wrt the passed definition
+ * @param configuration A Configuration to check
+ * @param definition A Definition to check the Configuration against
+ * @return List of validation failure messages. List is empty if no errors were
found.
+ */
+ public static List<String> checkConfigurationWrtDefinition(Configuration
configuration,
+ ConfigurationDefinition definition) {
+
+ List<String> messages = new ArrayList<String>();
+
+ if (configuration==null) {
+ messages.add("Configuration is null");
+
+ }
+
+ if (definition==null) {
+ messages.add("Definition is null");
+ }
+
+ if (configuration==null || definition==null) {
+ return messages;
+ }
+
+ // Basic validation is done, now have a look at the properties
+
+ for (PropertyDefinition propDef : definition.getPropertyDefinitions().values())
{
+ String name = propDef.getName();
+ Property property = configuration.get(name);
+
+ checkProperty(messages, propDef, property);
+ }
+
+
+ return messages;
+ }
+
+ /**
+ * Recursively check the passed property against the passed property definition
+ * @param messages Validation error messages are added here
+ * @param propertyDefinition The definition to check against
+ * @param property The property to check
+ */
+ private static void checkProperty(List<String> messages, PropertyDefinition
propertyDefinition,
+ Property property) {
+
+ String name = propertyDefinition.getName();
+
+ // If a property is required and not present we can bail out early
+ if (propertyDefinition.isRequired() && property ==null) {
+ messages.add("Required property [" + name + "] not
found");
+ return;
+ }
+
+ // If a property is not required and is null, it is fine either
+ if (!propertyDefinition.isRequired() && property==null) {
+ return;
+ }
+
+ // Check if the property and definition are of the same kind (simple, map, list)
+ boolean good = checkIfCompatible(propertyDefinition, property,messages);
+ // We only need to do this dance if the kinds are matching
+ if (good) {
+ if (property instanceof PropertySimple) {
+ checkDataTypeOfSimpleProperty((PropertyDefinitionSimple)
propertyDefinition, (PropertySimple) property,
+ messages);
+ } else if (property instanceof PropertyList) {
+ PropertyList propertyList = (PropertyList) property;
+ PropertyDefinitionList propertyDefinitionList = (PropertyDefinitionList)
propertyDefinition;
+ for (Property prop : propertyList.getList()) {
+ checkProperty(messages, propertyDefinitionList.getMemberDefinition(),
prop);
+ }
+ } else if (property instanceof PropertyMap) {
+ PropertyMap propertyMap = (PropertyMap) property;
+ PropertyDefinitionMap propertyDefinitionMap = (PropertyDefinitionMap)
propertyDefinition;
+ for (Map.Entry<String,Property> entry :
propertyMap.getMap().entrySet()) {
+ Property prop = entry.getValue();
+ PropertyDefinition definition = propertyDefinitionMap.get(name);
+ checkProperty(messages,definition,prop);
+ }
+ }
+ }
+ }
+
+ /**
+ * Check that for a Property that is defined with one of the non-string data types,
the
+ * stored value is actually valid according to this data type.
+ * This also checks if a property is required, but its value is actually null.
+ *
+ * @param propDef Definition of the property, that contains the data type
+ * @param property The property to check
+ * @param messages Validation issues are added to this list.
+ */
+ private static void checkDataTypeOfSimpleProperty(PropertyDefinitionSimple propDef,
PropertySimple property,
+ List<String> messages) {
+
+ String prefix = "Property [" + property.getName() + "] is ";
+ String val = property.getStringValue();
+
+ // If a property is not required and its value is null, we can just return
+ if (!propDef.isRequired() && property.getStringValue()==null) {
+ return;
+ }
+
+ // If a property is required and its value is null, we can just return
+ if (propDef.isRequired() && property.getStringValue()==null) {
+ messages.add(prefix + "required but was 'null'");
+ return;
+ }
+
+
+ switch (propDef.getType()) {
+ case DOUBLE:
+ try {
+ Double.parseDouble(property.getStringValue());
+ } catch (NumberFormatException nfe ) {
+ messages.add(prefix + "no double : " + val);
+ }
+ break;
+ case FLOAT:
+ float f;
+ try {
+ f = Float.parseFloat(property.getStringValue());
+ } catch (NumberFormatException nfe ) {
+ messages.add(prefix + "no float : " + val);
+ break;
+ }
+ if (f < Float.MIN_VALUE || f > Float.MAX_VALUE) {
+ messages.add(prefix + "no valid float : " + val);
+ }
+ break;
+ case INTEGER:
+ try {
+ Integer.parseInt(property.getStringValue());
+ } catch (NumberFormatException nfe ) {
+ messages.add(prefix + "no integer : " + val);
+ }
+ break;
+ case LONG:
+ try {
+ Long.parseLong(property.getStringValue());
+ } catch (NumberFormatException nfe ) {
+ messages.add(prefix + "no long : " + val);
+ }
+ break;
+ case BOOLEAN:
+ String s = val.toLowerCase();
+ if (!(s.equals("true") || s.equals("false"))) {
+ messages.add(prefix + "no boolean : " + val);
+ }
+ break;
+ default:
+ // Strings and long strings and directories and files
+ }
+ }
+
+ /**
+ * Check if the Kind of Definition and Property match. I.e. if a PropertyMap
corresponds to a PropertyDefinitionMap
+ * @param propDef PropertyDefinition to match
+ * @param property Property to match with the definition
+ * @param messages List of messages to add validation errors to.
+ * @return true if the kinds are matching
+ */
+ private static boolean checkIfCompatible(final PropertyDefinition propDef, final
Property property,
+ final List<String> messages) {
+
+ boolean good = false ;
+ if (propDef instanceof PropertyDefinitionSimple && property instanceof
PropertySimple) {
+ good = true;
+ } else if (propDef instanceof PropertyDefinitionMap && property
instanceof PropertyMap) {
+ good = true;
+ } else if (propDef instanceof PropertyDefinitionList && property
instanceof PropertyList) {
+ good = true;
+ }
+ if (!good) {
+ String name = propDef.getName();
+ messages.add("The type of property for [" + name + "] does not
match the definition");
+ }
+ return good;
+ }
+}
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationHelperTest.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationHelperTest.java
new file mode 100644
index 0000000..7e20630
--- /dev/null
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationHelperTest.java
@@ -0,0 +1,756 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+package org.rhq.enterprise.server.configuration;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.testng.annotations.Test;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.Property;
+import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.configuration.PropertyMap;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionList;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionMap;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
+import org.rhq.core.domain.configuration.definition.PropertySimpleType;
+import org.rhq.core.domain.util.StringUtils;
+import org.rhq.enterprise.server.rest.helper.ConfigurationHelper;
+
+/**
+ * Test the ConfigurationHelper class
+ * @author Heiko W. Rupp
+ */
+public class ConfigurationHelperTest {
+
+ @Test
+ public void testConvertSimpleMap() throws Exception {
+
+ Map<String,Object> map = new HashMap<String, Object>(2);
+ map.put("Hello","World");
+ map.put("Answer",42);
+
+ Configuration config = ConfigurationHelper.mapToConfiguration(map);
+
+ assert config!=null;
+ Collection<Property> properties = config.getProperties();
+ assert properties.size()==2;
+
+ PropertySimple hello = config.getSimple("Hello");
+ assert hello !=null;
+ assert hello.getStringValue().equals("World");
+
+ PropertySimple qu = config.getSimple("Answer");
+ assert qu!=null;
+ Integer value = qu.getIntegerValue();
+ assert value !=null;
+ assert value ==42;
+ }
+
+ @Test
+ public void testConvertWithNestedMap() throws Exception {
+
+ Map<String,Object> map = new HashMap<String, Object>(3);
+ map.put("Hello","World");
+ map.put("Answer",42);
+ Map<String,Object> inner = new HashMap<String, Object>(1);
+ inner.put("Foo","Bar");
+ map.put("Inner",inner);
+
+ Configuration config = ConfigurationHelper.mapToConfiguration(map);
+
+ assert config!=null;
+ Collection<Property> properties = config.getProperties();
+ assert properties.size()==3 : "Expected 3 props, got " +
properties.size();
+
+ Property prop = config.get("Inner");
+ assert prop!=null;
+ assert prop instanceof PropertyMap : "Inner is no map";
+
+ PropertyMap pm = (PropertyMap) prop;
+ Map<String, Property> innerMap = pm.getMap();
+ assert innerMap.size()==1;
+
+ assert inner.containsKey("Foo");
+
+ }
+
+ @Test
+ public void testConvertListOfMap() throws Exception {
+
+ Map<String,Object> map = new HashMap<String, Object>(2);
+ map.put("Hello","World");
+ List<Map<String,Object>> list = new ArrayList<Map<String,
Object>>();
+ map.put("list",list);
+
+ Map<String,Object> inner = new HashMap<String, Object>(1);
+ inner.put("Foo","Bar");
+ list.add(inner);
+
+ Configuration config = ConfigurationHelper.mapToConfiguration(map);
+
+ assert config!=null;
+ Collection<Property> properties = config.getProperties();
+ assert properties.size()==2 : "Expected 2 props, got " +
properties.size();
+
+ Property prop = config.get("Inner");
+ assert prop==null;
+
+ prop = config.get("list");
+ assert prop instanceof PropertyList : "list is no list";
+
+ PropertyList pl = (PropertyList) prop;
+ List<Property> propertyList = pl.getList();
+ assert propertyList.size()==1;
+ PropertyMap innerMapProperty = (PropertyMap) propertyList.get(0);
+
+ Map<String, Property> propertyMap = innerMapProperty.getMap();
+ assert propertyMap.size()==1;
+ Map<String,Property> innerMap = propertyMap;
+
+ assert innerMap.containsKey("Foo");
+ Property property = innerMapProperty.get("Foo");
+ assert property != null;
+ assert property instanceof PropertySimple;
+ PropertySimple ps = (PropertySimple) property;
+ assert ps.getStringValue().equals("Bar");
+
+ }
+
+ @Test
+ public void testConvertWithListOfSimple() throws Exception {
+
+ Map<String,Object> map = new HashMap<String, Object>(2);
+ map.put("Hello","World");
+ map.put("Answer",42);
+ List<String> inner = new ArrayList<String>(2);
+ inner.add("Foo");
+ inner.add("Bar");
+ map.put("Inner", inner);
+
+ Configuration config = ConfigurationHelper.mapToConfiguration(map);
+
+ assert config!=null;
+ Collection<Property> properties = config.getProperties();
+ assert properties.size()==3 : "Expected 3 props, got " +
properties.size();
+
+ Property prop = config.get("Inner");
+ assert prop!=null;
+ assert prop instanceof PropertyList : "Inner is no list";
+
+ PropertyList plist = (PropertyList) prop;
+ List<Property> propertyList = plist.getList();
+ assert propertyList.size()==2;
+ for (Property innerProp : propertyList) {
+ assert innerProp instanceof PropertySimple;
+ PropertySimple ps = (PropertySimple) innerProp;
+ assert ps.getName().equals("Inner");
+ assert ps.getStringValue().equals("Foo") ||
ps.getStringValue().equals("Bar");
+ }
+
+ }
+
+ @Test
+ public void testConvertAndValidateBoolean() throws Exception {
+
+ Map<String,Object> map = new HashMap<String, Object>();
+ map.put("bool1","true");
+ map.put("bool2","TruE");
+ map.put("bool3","fAlSe");
+ map.put("bool4", "false");
+ map.put("bool5", 42);
+ map.put("bool6", "Hugo");
+ map.put("bool7",null);
+
+ Configuration config = ConfigurationHelper.mapToConfiguration(map);
+
+ assert config!=null;
+ Collection<Property> properties = config.getProperties();
+ assert properties.size()==7 : "Expected 7 props but got " +
properties.size();
+
+ ConfigurationDefinition definition = new
ConfigurationDefinition("bla","For testing");
+ definition.put(new PropertyDefinitionSimple("bool1","A
boolean",true, PropertySimpleType.BOOLEAN));
+ definition.put(new PropertyDefinitionSimple("bool2","A
boolean",true, PropertySimpleType.BOOLEAN));
+ definition.put(new PropertyDefinitionSimple("bool3","A
boolean",true, PropertySimpleType.BOOLEAN));
+ definition.put(new PropertyDefinitionSimple("bool4","A
boolean",true, PropertySimpleType.BOOLEAN));
+ definition.put(new PropertyDefinitionSimple("bool5","A
boolean",true, PropertySimpleType.BOOLEAN));
+ definition.put(new PropertyDefinitionSimple("bool6","A
boolean",true, PropertySimpleType.BOOLEAN));
+ definition.put(new PropertyDefinitionSimple("bool7","A
boolean",true, PropertySimpleType.BOOLEAN));
+
+ List<String> errors =
ConfigurationHelper.checkConfigurationWrtDefinition(config,definition);
+
+ assert errors!=null;
+ assert errors.size()==3 : "Expected 3 errors, but got " + errors.size()
+ "\n" + StringUtils.getListAsString(errors,",\n ");
+
+ }
+
+ @Test
+ public void testConvertAndValidateMissingRequired() throws Exception {
+
+ Map<String,Object> map = new HashMap<String, Object>(1);
+ map.put("bool1","true");
+ // required 2nd entry is missing
+
+ Configuration config = ConfigurationHelper.mapToConfiguration(map);
+
+ assert config!=null;
+ Collection<Property> properties = config.getProperties();
+ assert properties.size()==1 : "Expected 1 props but got " +
properties.size();
+
+ ConfigurationDefinition definition = new
ConfigurationDefinition("bla","For testing");
+ definition.put(new PropertyDefinitionSimple("bool1","A
boolean",true, PropertySimpleType.BOOLEAN));
+ definition.put(new PropertyDefinitionSimple("bool2","A
boolean",true, PropertySimpleType.BOOLEAN));
+
+ List<String> errors =
ConfigurationHelper.checkConfigurationWrtDefinition(config,definition);
+
+ assert errors!=null;
+ assert errors.size()==1 : "Expected 1 error, but got " + errors.size()
+ "\n" + StringUtils.getListAsString(errors,",\n ");
+
+ }
+
+ @Test
+ public void testConvertAndValidateNotRequiredButNull() throws Exception {
+
+ Map<String,Object> map = new HashMap<String, Object>(1);
+ map.put("bool1","true");
+ map.put("optional",null);
+
+ Configuration config = ConfigurationHelper.mapToConfiguration(map);
+
+ assert config!=null;
+ Collection<Property> properties = config.getProperties();
+ assert properties.size()==2 : "Expected 2 props but got " +
properties.size();
+
+ ConfigurationDefinition definition = new
ConfigurationDefinition("bla","For testing");
+ definition.put(new PropertyDefinitionSimple("bool1","A
boolean",true, PropertySimpleType.BOOLEAN));
+ definition.put(new PropertyDefinitionSimple("optional","null
string",false, PropertySimpleType.STRING));
+
+ List<String> errors =
ConfigurationHelper.checkConfigurationWrtDefinition(config,definition);
+
+ assert errors!=null;
+ assert errors.size()==0 : "Expected 0 error, but got " + errors.size()
+ "\n" + StringUtils.getListAsString(errors,",\n ");
+
+ }
+
+ @Test
+ public void testConvertAndValidateMismatchingKind() throws Exception {
+
+ Map<String,Object> map = new HashMap<String, Object>(1);
+ map.put("bool1","true");
+ map.put("optional",null);
+ Map<String,Object> inner = new HashMap<String, Object>(1);
+ inner.put("Foo","Bar");
+ map.put("Inner",inner);
+
+ Configuration config = ConfigurationHelper.mapToConfiguration(map);
+
+ assert config!=null;
+ Collection<Property> properties = config.getProperties();
+ assert properties.size()==3 : "Expected 3 props but got " +
properties.size();
+
+ ConfigurationDefinition definition = new
ConfigurationDefinition("bla","For testing");
+ definition.put(new PropertyDefinitionSimple("bool1","A
boolean",true, PropertySimpleType.BOOLEAN));
+ definition.put(new PropertyDefinitionSimple("optional","null
string",false, PropertySimpleType.STRING));
+ // We define Inner as a simple property, but the user supplied a map
+ definition.put(new PropertyDefinitionSimple("Inner","null
string",false, PropertySimpleType.STRING));
+
+ List<String> errors =
ConfigurationHelper.checkConfigurationWrtDefinition(config,definition);
+
+ assert errors!=null;
+ assert errors.size()==1 : "Expected 1 error, but got " + errors.size()
+ "\n" + StringUtils.getListAsString(errors,",\n ");
+
+ }
+
+ @Test
+ public void testConvertAndValidateMismatchingKind2() throws Exception {
+
+ Map<String,Object> map = new HashMap<String, Object>(1);
+ map.put("bool1","true");
+ map.put("optional",null);
+ map.put("Inner","Frobnitz");
+
+ Configuration config = ConfigurationHelper.mapToConfiguration(map);
+
+ assert config!=null;
+ Collection<Property> properties = config.getProperties();
+ assert properties.size()==3 : "Expected 3 props but got " +
properties.size();
+
+ ConfigurationDefinition definition = new
ConfigurationDefinition("bla","For testing");
+ definition.put(new PropertyDefinitionSimple("bool1","A
boolean",true, PropertySimpleType.BOOLEAN));
+ definition.put(new PropertyDefinitionSimple("optional","null
string",false, PropertySimpleType.STRING));
+ // We define Inner as a list property, but the user supplied a simple one
+ definition.put(new
PropertyDefinitionList("Inner","Bla",true,
+ new
PropertyDefinitionSimple("Inner","fasel",true,PropertySimpleType.STRING)));
+
+ List<String> errors =
ConfigurationHelper.checkConfigurationWrtDefinition(config,definition);
+
+ assert errors!=null;
+ assert errors.size()==1 : "Expected 1 error, but got " + errors.size()
+ "\n" + StringUtils.getListAsString(errors,",\n ");
+
+ }
+
+ @Test
+ public void testConvertAndValidateNumeric() throws Exception {
+
+ Map<String,Object> map = new HashMap<String, Object>(2);
+ map.put("float1",1.1f);
+ map.put("float2",Double.MAX_VALUE);
+ map.put("float3",null);
+ map.put("float4","abc");
+
+ map.put("double1",1.1d);
+ map.put("double2",null);
+ map.put("double3","hugo");
+
+ map.put("int1",42);
+ map.put("int2",Long.MAX_VALUE);
+ map.put("int3",null);
+ map.put("int4","abc");
+
+ map.put("long1",-5);
+ map.put("long2",null);
+ map.put("long3","Frobnitz");
+
+ Configuration config = ConfigurationHelper.mapToConfiguration(map);
+
+ assert config!=null;
+ Collection<Property> properties = config.getProperties();
+ assert properties.size()==14 : "Expected 14 props but got " +
properties.size();
+
+ ConfigurationDefinition definition = new
ConfigurationDefinition("bla","For testing");
+ definition.put(new PropertyDefinitionSimple("float1","A
float",true, PropertySimpleType.FLOAT));
+ definition.put(new PropertyDefinitionSimple("float2","A
float",true, PropertySimpleType.FLOAT));
+ definition.put(new PropertyDefinitionSimple("float3","A
float",true, PropertySimpleType.FLOAT));
+ definition.put(new PropertyDefinitionSimple("float4","A
float",true, PropertySimpleType.FLOAT));
+
+ definition.put(new PropertyDefinitionSimple("double1","A
double",true, PropertySimpleType.DOUBLE));
+ definition.put(new PropertyDefinitionSimple("double2","A
double",true, PropertySimpleType.DOUBLE));
+ definition.put(new PropertyDefinitionSimple("double3","A
double",true, PropertySimpleType.DOUBLE));
+
+ definition.put(new PropertyDefinitionSimple("int1","An
int",true, PropertySimpleType.INTEGER));
+ definition.put(new PropertyDefinitionSimple("int2","An
int",true, PropertySimpleType.INTEGER));
+ definition.put(new PropertyDefinitionSimple("int3","An
int",true, PropertySimpleType.INTEGER));
+ definition.put(new PropertyDefinitionSimple("int4","An
int",true, PropertySimpleType.INTEGER));
+
+ definition.put(new PropertyDefinitionSimple("long1","A
long",true, PropertySimpleType.LONG));
+ definition.put(new PropertyDefinitionSimple("long2","A
long",true, PropertySimpleType.LONG));
+ definition.put(new PropertyDefinitionSimple("long3","A
long",true, PropertySimpleType.LONG));
+
+ List<String> errors =
ConfigurationHelper.checkConfigurationWrtDefinition(config,definition);
+
+ assert errors!=null;
+ assert errors.size()==10 : "Expected 10 errors, but got " +
errors.size() + "\n" + StringUtils.getListAsString(errors,",\n");
+
+ }
+
+ @Test
+ public void testValidateNullConfiguration() throws Exception {
+
+ List<String> errors =
ConfigurationHelper.checkConfigurationWrtDefinition(null,new
ConfigurationDefinition("bla",null));
+ assert errors != null;
+ assert errors.size()==1;
+
+ }
+
+ @Test
+ public void testValidateNullDefinition() throws Exception {
+
+ List<String> errors =
ConfigurationHelper.checkConfigurationWrtDefinition(new Configuration(),null);
+ assert errors != null;
+ assert errors.size()==1;
+
+ }
+
+ @Test
+ public void testConvertAndValidateSimpleMap() throws Exception {
+
+ Map<String,Object> map = new HashMap<String, Object>(2);
+ map.put("Hello","World");
+ map.put("Answer",42);
+
+ Configuration config = ConfigurationHelper.mapToConfiguration(map);
+
+ ConfigurationDefinition definition = new
ConfigurationDefinition("bla",null);
+ definition.put(new
PropertyDefinitionSimple("Hello",null,true,PropertySimpleType.STRING));
+ definition.put(new
PropertyDefinitionSimple("Answer",null,true,PropertySimpleType.INTEGER));
+ definition.put(new
PropertyDefinitionSimple("Optional",null,false,PropertySimpleType.INTEGER));
+
+ assert config!=null;
+ Collection<Property> properties = config.getProperties();
+ assert properties.size()==2;
+
+ PropertySimple hello = config.getSimple("Hello");
+ assert hello !=null;
+ assert hello.getStringValue().equals("World");
+
+ PropertySimple qu = config.getSimple("Answer");
+ assert qu!=null;
+ Integer integerValue = qu.getIntegerValue();
+ assert integerValue !=null;
+ assert integerValue ==42;
+ }
+
+ @Test
+ public void testConvertValidateNonRequiredNotPresent() throws Exception {
+
+ Map<String,Object> map = new HashMap<String, Object>(2);
+
+ Configuration config = ConfigurationHelper.mapToConfiguration(map);
+
+ assert config!=null;
+ Collection<Property> properties = config.getProperties();
+ assert properties.size()==0 : "Expected 0 props, got " +
properties.size();
+
+ ConfigurationDefinition definition = new
ConfigurationDefinition("bla",null);
+ definition.put(new
PropertyDefinitionSimple("Answer",null,false,PropertySimpleType.INTEGER));
+
+ List<String> errors =
ConfigurationHelper.checkConfigurationWrtDefinition(config,definition);
+
+ assert errors!=null;
+ assert errors.size()==0 : "Expected 0 errors, but got " + errors.size()
+ "\n" + StringUtils.getListAsString(errors,",\n");
+
+ }
+
+ @Test
+ public void testConvertAndValidateListOfMap() throws Exception {
+
+ Map<String,Object> map = new HashMap<String, Object>(2);
+ map.put("Hello","World");
+ List<Map<String,Object>> list = new ArrayList<Map<String,
Object>>();
+ map.put("list",list);
+
+ Map<String,Object> inner = new HashMap<String, Object>(1);
+ inner.put("Foo","Bar");
+ list.add(inner);
+
+ Configuration config = ConfigurationHelper.mapToConfiguration(map);
+
+ assert config!=null;
+ Collection<Property> properties = config.getProperties();
+ assert properties.size()==2 : "Expected 2 props, got " +
properties.size();
+
+
+ ConfigurationDefinition definition = new
ConfigurationDefinition("bla",null);
+ definition.put(new
PropertyDefinitionSimple("Hello",null,true,PropertySimpleType.STRING));
+ definition.put(new
PropertyDefinitionSimple("Answer",null,false,PropertySimpleType.INTEGER));
+ definition.put(new PropertyDefinitionList("list",null,true,
+ new PropertyDefinitionMap("list",null,true,
+ new
PropertyDefinitionSimple("list",null,true,PropertySimpleType.STRING))));
+ definition.put(new
PropertyDefinitionSimple("aString",null,false,PropertySimpleType.INTEGER));
+
+
+ List<String> errors =
ConfigurationHelper.checkConfigurationWrtDefinition(config,definition);
+
+ assert errors!=null;
+ assert errors.size()==0 : "Expected 0 errors, but got " + errors.size()
+ "\n" + StringUtils.getListAsString(errors,",\n");
+
+ }
+
+ @Test
+ public void testConvertAndValidateMapOfMap() throws Exception {
+
+ Map<String,Object> map = new HashMap<String, Object>(2);
+ map.put("Hello","World");
+ Map<String,Map<String,Object>> list = new HashMap<String,
Map<String, Object>>();
+ map.put("list",list);
+
+ Map<String,Object> inner = new HashMap<String, Object>(1);
+ inner.put("Foo","Bar");
+ list.put("outer", inner);
+
+ Configuration config = ConfigurationHelper.mapToConfiguration(map);
+
+ assert config!=null;
+ Collection<Property> properties = config.getProperties();
+ assert properties.size()==2 : "Expected 2 props, got " +
properties.size();
+
+
+ ConfigurationDefinition definition = new
ConfigurationDefinition("bla",null);
+ definition.put(new
PropertyDefinitionSimple("Hello",null,true,PropertySimpleType.STRING));
+ definition.put(new PropertyDefinitionMap("list",null,true,
+ new PropertyDefinitionMap("list",null,true,
+ new
PropertyDefinitionSimple("list",null,true,PropertySimpleType.STRING))));
+
+
+ List<String> errors =
ConfigurationHelper.checkConfigurationWrtDefinition(config,definition);
+
+ assert errors!=null;
+ assert errors.size()==0 : "Expected 0 errors, but got " + errors.size()
+ "\n" + StringUtils.getListAsString(errors,",\n");
+
+ }
+
+ @Test
+ public void testConvertAndValidateMapWithListOfSimple() throws Exception {
+
+ Map<String,Object> map = new HashMap<String, Object>(2);
+ map.put("Hello","World");
+
+ Map<String,List<String>> list = new HashMap<String,
List<String>>();
+ map.put("list",list);
+
+ List<String> inner = new ArrayList<String>();
+ inner.add("Foo");
+ inner.add("Bar");
+ list.put("outer", inner);
+
+ Configuration config = ConfigurationHelper.mapToConfiguration(map);
+
+ assert config!=null;
+ Collection<Property> properties = config.getProperties();
+ assert properties.size()==2 : "Expected 2 props, got " +
properties.size();
+
+
+ ConfigurationDefinition definition = new
ConfigurationDefinition("bla",null);
+ definition.put(new
PropertyDefinitionSimple("Hello",null,true,PropertySimpleType.STRING));
+ definition.put(new PropertyDefinitionMap("list",null,true,
+ new PropertyDefinitionList("list",null,true,
+ new
PropertyDefinitionSimple("list",null,true,PropertySimpleType.STRING))));
+
+
+ List<String> errors =
ConfigurationHelper.checkConfigurationWrtDefinition(config,definition);
+
+ assert errors!=null;
+ assert errors.size()==0 : "Expected 0 errors, but got " + errors.size()
+ "\n" + StringUtils.getListAsString(errors,",\n");
+
+ }
+
+ @Test
+ public void testConfigToMapSimple() throws Exception {
+
+ Configuration config = new Configuration();
+ config.put(new PropertySimple("number",42));
+ config.put(new PropertySimple("string","Hello"));
+ config.put(new PropertySimple("bool",true));
+ config.put(new PropertySimple("float",1.1f));
+ config.put(new PropertySimple("double",2.3d));
+ config.put(new PropertySimple("long",Long.MAX_VALUE));
+
+
+ ConfigurationDefinition definition = new
ConfigurationDefinition("bla",null);
+ definition.put(new
PropertyDefinitionSimple("number",null,false,PropertySimpleType.INTEGER));
+ definition.put(new
PropertyDefinitionSimple("string",null,false,PropertySimpleType.STRING));
+ definition.put(new
PropertyDefinitionSimple("bool",null,false,PropertySimpleType.BOOLEAN));
+ definition.put(new
PropertyDefinitionSimple("float",null,false,PropertySimpleType.FLOAT));
+ definition.put(new
PropertyDefinitionSimple("double",null,false,PropertySimpleType.DOUBLE));
+ definition.put(new
PropertyDefinitionSimple("long",null,false,PropertySimpleType.LONG));
+
+ Map<String,Object> map =
ConfigurationHelper.configurationToMap(config,definition, true);
+
+ assert map != null;
+ assert map.entrySet().size()==6;
+
+ assert map.containsKey("number");
+ assert map.containsKey("string");
+
+ assert map.get("number") != null;
+ assert (Integer)map.get("number") == 42;
+
+ assert map.get("string") != null;
+ assert map.get("string").equals("Hello");
+
+ assert (Boolean)map.get("bool") == true;
+
+ assert map.get("float") != null;
+ assert (Float)map.get("float") ==1.1f;
+
+ assert map.get("double") != null;
+ assert (Double) map.get("double") ==2.3d;
+
+ assert map.get("long") != null;
+ assert (Long)map.get("long") == Long.MAX_VALUE;
+
+ }
+
+ @Test
+ public void testEmptyConfigToMap() throws Exception {
+
+ Configuration config = new Configuration();
+
+ ConfigurationDefinition definition = new
ConfigurationDefinition("bla",null);
+ definition.put(new
PropertyDefinitionSimple("number",null,false,PropertySimpleType.INTEGER));
+ definition.put(new
PropertyDefinitionSimple("string",null,false,PropertySimpleType.STRING));
+
+ Map<String,Object> map =
ConfigurationHelper.configurationToMap(config,definition, true);
+
+ assert map != null;
+ assert map.entrySet().size()==0;
+
+
+ }
+
+ @Test
+ public void testNullConfigToMap() throws Exception {
+
+ Configuration config = null;
+
+ ConfigurationDefinition definition = new
ConfigurationDefinition("bla",null);
+ definition.put(new
PropertyDefinitionSimple("number",null,false,PropertySimpleType.INTEGER));
+ definition.put(new
PropertyDefinitionSimple("string",null,false,PropertySimpleType.STRING));
+
+ Map<String,Object> map =
ConfigurationHelper.configurationToMap(config,definition, true);
+
+ assert map != null;
+ assert map.entrySet().size()==0;
+
+ }
+
+ @Test
+ public void testConfigToMapComplexList() throws Exception {
+
+ Configuration config = new Configuration();
+ PropertyList propertyList = new PropertyList("aList");
+ propertyList.add(new PropertySimple("string", "Hello"));
+ propertyList.add(new PropertySimple("string", "World"));
+ config.put(propertyList);
+
+
+ ConfigurationDefinition definition = new
ConfigurationDefinition("bla",null);
+ definition.put(new PropertyDefinitionList("aList",null,false,
+ new
PropertyDefinitionSimple("string",null,false,PropertySimpleType.STRING)));
+
+ Map<String,Object> map =
ConfigurationHelper.configurationToMap(config,definition, true);
+
+ assert map != null;
+ assert map.entrySet().size()==1;
+
+ assert map.containsKey("aList");
+
+ }
+
+ @Test
+ public void testConfigToMapComplexMap() throws Exception {
+
+ Configuration config = new Configuration();
+ PropertyMap propertyMap = new PropertyMap("aMap");
+ config.put(propertyMap);
+ PropertyList propertyList = new PropertyList("aList");
+ propertyList.add(new PropertySimple("string", "Hello"));
+ propertyList.add(new PropertySimple("string", "World"));
+ propertyMap.put(propertyList);
+
+ propertyMap.put(new PropertySimple("aString","Frobnitz"));
+
+
+ ConfigurationDefinition definition = new
ConfigurationDefinition("bla",null);
+ definition.put(new PropertyDefinitionMap("aMap",null,false,
+ new PropertyDefinitionList("aList",null,false,
+ new
PropertyDefinitionSimple("string",null,false,PropertySimpleType.STRING)),
+ new
PropertyDefinitionSimple("aString",null,false,PropertySimpleType.STRING)));
+
+ Map<String,Object> map =
ConfigurationHelper.configurationToMap(config,definition, true);
+
+ assert map != null;
+ assert map.entrySet().size()==1;
+
+ assert map.containsKey("aMap");
+ assert map.get("aMap") instanceof Map;
+ Map<String,Object> innerMap = (Map<String, Object>)
map.get("aMap");
+
+ assert innerMap.containsKey("aString");
+ assert innerMap.containsKey("aList");
+
+ }
+
+ @Test
+ public void testConfigToMapComplexMapWithBadSetupStrict() throws Exception {
+
+ Configuration config = new Configuration();
+ PropertyMap propertyMap = new PropertyMap("aMap");
+ config.put(propertyMap);
+ PropertyList propertyList = new PropertyList("aList");
+ propertyList.add(new PropertySimple("string", "Hello"));
+ propertyList.add(new PropertySimple("string", "World"));
+ propertyMap.put(propertyList);
+
+ propertyMap.put(new PropertySimple("aString","Frobnitz"));
+
+
+ ConfigurationDefinition definition = new
ConfigurationDefinition("bla",null);
+ definition.put(new PropertyDefinitionMap("aMap",null,false,
+ new PropertyDefinitionList("aBla",null,false,
+ new
PropertyDefinitionSimple("string",null,false,PropertySimpleType.STRING)),
+ new
PropertyDefinitionSimple("aFoo",null,false,PropertySimpleType.STRING)));
+
+ try {
+ ConfigurationHelper.configurationToMap(config,definition, true);
+ assert false;
+ } catch (IllegalArgumentException iae ) {
+ System.out.println("Yep, caught the error");
+ }
+
+
+ }
+
+ @Test
+ public void testConfigToMapComplexMapWithBadSetupLenient() throws Exception {
+
+ Configuration config = new Configuration();
+ PropertyMap propertyMap = new PropertyMap("aMap");
+ config.put(propertyMap);
+ PropertyList propertyList = new PropertyList("aList");
+ propertyList.add(new PropertySimple("string", "Hello"));
+ propertyList.add(new PropertySimple("string", "World"));
+ propertyMap.put(propertyList);
+
+ propertyMap.put(new PropertySimple("aString","Frobnitz"));
+
+
+ ConfigurationDefinition definition = new
ConfigurationDefinition("bla",null);
+ definition.put(new PropertyDefinitionMap("aMap",null,false,
+ new PropertyDefinitionList("aBla",null,false,
+ new
PropertyDefinitionSimple("string",null,false,PropertySimpleType.STRING)),
+ new
PropertyDefinitionSimple("aFoo",null,false,PropertySimpleType.STRING)));
+
+ Map<String,Object> map =
ConfigurationHelper.configurationToMap(config,definition, false);
+
+ assert map != null;
+ assert map.entrySet().size()==1;
+
+ assert map.containsKey("aMap");
+
+ }
+
+ @Test
+ public void testConvertSingleValueNoProperty() throws Exception {
+
+ Object o = ConfigurationHelper.convertSimplePropertyValue(null,new
PropertyDefinitionSimple("dummy",null,false,PropertySimpleType.STRING));
+
+ assert o == null;
+
+ }
+
+ @Test
+ public void testConvertSingleValueNoDefinition() throws Exception {
+
+ try {
+ ConfigurationHelper.convertSimplePropertyValue(new
PropertySimple("foo","bar"),null);
+ assert false;
+ }
+ catch (IllegalArgumentException iae) {
+ System.out.println("Yep, good");
+ }
+
+ }
+}
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java
index 3d9f735..fca0f50 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java
@@ -266,8 +266,8 @@ public class AlertTest extends AbstractBase {
.expect()
.statusCode(201)
.body("dampeningCategory",is("NONE"))
- .body("dampeningCount",is("0"))
- .body("dampeningPeriod",is("0"))
+ .body("dampeningCount",is(0))
+ .body("dampeningPeriod",is(0))
.when()
.post("/alert/definitions")
.as(AlertDefinition.class);
@@ -369,8 +369,8 @@ public class AlertTest extends AbstractBase {
alertDefinition.setEnabled(false);
alertDefinition.setPriority("LOW");
alertDefinition.setDampeningCategory("PARTIAL_COUNT");
- alertDefinition.setDampeningCount("3");
- alertDefinition.setDampeningPeriod("5");
+ alertDefinition.setDampeningCount(3);
+ alertDefinition.setDampeningPeriod(5);
AlertDefinition result =
given()
@@ -381,8 +381,8 @@ public class AlertTest extends AbstractBase {
.expect()
.statusCode(201)
.body("dampeningCategory",is("PARTIAL_COUNT"))
- .body("dampeningCount",is("3"))
- .body("dampeningPeriod",is("5"))
+ .body("dampeningCount",is(3))
+ .body("dampeningPeriod",is(5))
.when()
.post("/alert/definitions")
.as(AlertDefinition.class);
@@ -404,8 +404,9 @@ public class AlertTest extends AbstractBase {
alertDefinition.setEnabled(false);
alertDefinition.setPriority("LOW");
alertDefinition.setDampeningCategory("DURATION_COUNT");
- alertDefinition.setDampeningCount("1");
- alertDefinition.setDampeningPeriod("3 minutes");
+ alertDefinition.setDampeningCount(1);
+ alertDefinition.setDampeningPeriod(3);
+ alertDefinition.setDampeningUnit("minutes");
AlertDefinition result =
given()
@@ -416,8 +417,9 @@ public class AlertTest extends AbstractBase {
.expect()
.statusCode(201)
.body("dampeningCategory",is("DURATION_COUNT"))
- .body("dampeningCount", is("1"))
- .body("dampeningPeriod", is("3 MINUTES"))
+ .body("dampeningCount", is(1))
+ .body("dampeningPeriod", is(3))
+ .body("dampeningUnit", is("MINUTES"))
.when()
.post("/alert/definitions")
.as(AlertDefinition.class);
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/OperationsTest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/OperationsTest.java
index 713a755..e6aea1f 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/OperationsTest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/OperationsTest.java
@@ -61,8 +61,9 @@ public class OperationsTest extends AbstractBase {
definitionId = -1;
List<Map<String,Object>> list = r.as(List.class);
for (Map<String,Object> map : list) {
- if (map.get("name").equals("discovery"))
+ if (map.get("name").equals("discovery")) {
definitionId = (Integer) map.get("id");
+ }
}
assert definitionId !=-1 : "No discovery operation found";
@@ -85,6 +86,92 @@ public class OperationsTest extends AbstractBase {
}
@Test
+ public void testGetDefinitionByUnknownId() throws Exception {
+
+ // Now retrieve that definition by id
+
+ given()
+ .header(acceptJson)
+ .pathParam("did",-42)
+ .expect()
+ .statusCode(404)
+ .when()
+ .get("/operation/definition/{did}");
+
+ }
+
+ @Test
+ public void testGetDefinitionsForUnknownResource() throws Exception {
+
+ // Now retrieve that definition by id
+
+ given()
+ .header(acceptJson)
+ .queryParam("resourceId",42)
+ .expect()
+ .statusCode(404)
+ .when()
+ .get("/operation/definitions");
+ }
+
+ @Test
+ public void testGetDefinitionsForMissingResourceId() throws Exception {
+
+ // Now retrieve that definition by id
+
+ given()
+ .header(acceptJson)
+ .expect()
+ .statusCode(406)
+ .when()
+ .get("/operation/definitions");
+ }
+
+ @Test
+ public void testCreateScheduleByUnknownDefinitionId() throws Exception {
+
+ // Now retrieve that definition by id
+
+ given()
+ .header(acceptJson)
+ .pathParam("did",-42)
+ .expect()
+ .statusCode(406)
+ .when()
+ .post("/operation/definition/{did}");
+
+ }
+
+ @Test
+ public void testCreateScheduleForUnknownResource() throws Exception {
+
+ // Now retrieve that definition by id
+
+ given()
+ .header(acceptJson)
+ .queryParam("resourceId", 42)
+ .pathParam("definitionId", definitionId)
+ .expect()
+ .statusCode(404)
+ .when()
+ .post("/operation/definition/{definitionId}");
+ }
+
+ @Test
+ public void testCreateScheduleForMissingResourceId() throws Exception {
+
+ // Now retrieve that definition by id
+
+ given()
+ .header(acceptJson)
+ .pathParam("definitionId", definitionId)
+ .expect()
+ .statusCode(406)
+ .when()
+ .post("/operation/definition/{definitionId}");
+ }
+
+ @Test
public void testCreateDraftOperation() throws Exception {
Operation draft =
@@ -196,8 +283,9 @@ public class OperationsTest extends AbstractBase {
String history = null;
List<Link> links = scheduled.getLinks();
for (Link link : links) {
- if (link.getRel().equals("history"))
- history = (String) link.getHref();
+ if (link.getRel().equals("history")) {
+ history = link.getHref();
+ }
}
assert history != null;
@@ -272,4 +360,98 @@ public class OperationsTest extends AbstractBase {
}
}
+ @Test
+ public void testOpsScheduleMissingRequiredParam() throws Exception {
+
+ int platformId = findIdOfARealPlatform();
+
+ Operation draft =
+ given()
+ .header(acceptJson)
+ .pathParam("definitionId",definitionId)
+ .queryParam("resourceId",platformId)
+ .expect()
+ .statusCode(200)
+ .log().ifError()
+ .when()
+ .post("/operation/definition/{definitionId}")
+ .as(Operation.class);
+
+ assert draft != null;
+ assert draft.getDefinitionId() == definitionId;
+
+ int draftId = draft.getId();
+
+ // explicitly remove the param from the draft for
+ // the test
+ Map<String, Object> params = draft.getParams();
+ if (params.containsKey("detailedDiscovery")) {
+ params.remove("detailedDiscovery");
+ }
+
+ // Update to put the new version in the server
+ // We don't want to submit, so the server does not
+ // validate and we should get a 200 back
+ draft.setReadyToSubmit(false);
+ given()
+ .contentType(ContentType.JSON)
+ .pathParam("id",draftId)
+ .body(draft)
+ .expect()
+ .statusCode(200)
+ .log().ifError()
+ .when()
+ .put("/operation/{id}");
+
+
+ // update to schedule, lacking the required param
+ draft.setReadyToSubmit(true);
+
+ given()
+ .contentType(ContentType.JSON)
+ .pathParam("id",draftId)
+ .body(draft)
+ .expect()
+ .statusCode(406)
+ .log().ifError()
+ .when()
+ .put("/operation/{id}");
+ }
+
+ @Test
+ public void testOpsScheduleRequiredParamWrongDataType() throws Exception {
+
+ int platformId = findIdOfARealPlatform();
+
+ Operation draft =
+ given()
+ .header(acceptJson)
+ .pathParam("definitionId",definitionId)
+ .queryParam("resourceId",platformId)
+ .expect()
+ .statusCode(200)
+ .log().ifError()
+ .when()
+ .post("/operation/definition/{definitionId}")
+ .as(Operation.class);
+
+ assert draft != null;
+ assert draft.getDefinitionId() == definitionId;
+
+ int draftId = draft.getId();
+
+ draft.getParams().put("detailedDiscovery", 42);
+ draft.setReadyToSubmit(true);
+
+ // update to schedule
+ given()
+ .contentType(ContentType.JSON)
+ .pathParam("id",draftId)
+ .body(draft)
+ .expect()
+ .statusCode(406)
+ .log().ifError()
+ .when()
+ .put("/operation/{id}");
+ }
}
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/RootURITest.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/RootURITest.java
index 5922770..d6da534 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/RootURITest.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/RootURITest.java
@@ -50,7 +50,7 @@ public class RootURITest extends AbstractBase {
.expect().statusCode(200)
.when().get("/");
- given().header("Accept","application/json")
+ given().header("Accept","application/xml")
.expect().statusCode(200)
.when().get("/index");
diff --git
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/d/AlertDefinition.java
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/d/AlertDefinition.java
index 5049a98..b870443 100644
---
a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/d/AlertDefinition.java
+++
b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/d/AlertDefinition.java
@@ -41,8 +41,9 @@ public class AlertDefinition {
List<AlertCondition> conditions = new ArrayList<AlertCondition>();
List<AlertNotification> notifications = new
ArrayList<AlertNotification>();
String dampeningCategory = "NONE";
- String dampeningCount;
- String dampeningPeriod;
+ int dampeningCount;
+ int dampeningPeriod;
+ String dampeningUnit;
List<Link> links;
@@ -121,22 +122,30 @@ public class AlertDefinition {
this.dampeningCategory = dampeningCategory;
}
- public String getDampeningCount() {
+ public int getDampeningCount() {
return dampeningCount;
}
- public void setDampeningCount(String dampeningCount) {
+ public void setDampeningCount(int dampeningCount) {
this.dampeningCount = dampeningCount;
}
- public String getDampeningPeriod() {
+ public int getDampeningPeriod() {
return dampeningPeriod;
}
- public void setDampeningPeriod(String dampeningPeriod) {
+ public void setDampeningPeriod(int dampeningPeriod) {
this.dampeningPeriod = dampeningPeriod;
}
+ public String getDampeningUnit() {
+ return dampeningUnit;
+ }
+
+ public void setDampeningUnit(String dampeningUnit) {
+ this.dampeningUnit = dampeningUnit;
+ }
+
public List<Link> getLinks() {
return links;
}
commit d72ac1e6bba8cbeb054a7cbfc8d7df026a09a5fc
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed May 8 09:17:22 2013 +0200
Add another email for Thomas
diff --git a/.mailmap b/.mailmap
index 384ec04..ac0fdc9 100644
--- a/.mailmap
+++ b/.mailmap
@@ -75,5 +75,6 @@ Test JON User <test_jon(a)jon01.qa.atl2.redhat.com>
Todd B Sanders <tsanders(a)dhcp231-67.rdu.redhat.com>
Torben Jäger <torben(a)jit-central.com>
Thomas Segismont <tsegismo(a)redhat.com> Thomas SEGISMONT
<tsegismo(a)redhat.com>
+Thomas Segismont <tsegismo(a)redhat.com> Thomas Segismont
<tsegismont(a)gmail.com>
Thomas Segismont <tsegismo(a)redhat.com>
hudson auto <wnstb(a)yahoo.com>
commit bbe5654f0755eac835b78351a8ef71a7e3398037
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Tue May 7 16:58:43 2013 -0700
[BZ 960646] - RFE Redesigned Availability Chart - Add disabled state cross hatch SVG
pattern. Pixel tweeks.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
index 76c8f69..4e6a0ce 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
@@ -18,6 +18,9 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.common.charttype;
+import java.util.Date;
+import java.util.List;
+
import org.rhq.core.domain.measurement.Availability;
import org.rhq.core.domain.measurement.MeasurementUnits;
import org.rhq.core.domain.resource.group.composite.ResourceGroupAvailability;
@@ -27,9 +30,6 @@ import org.rhq.enterprise.gui.coregui.client.Messages;
import org.rhq.enterprise.gui.coregui.client.util.Log;
import org.rhq.enterprise.gui.coregui.client.util.MeasurementConverterClient;
-import java.util.Date;
-import java.util.List;
-
/**
* Contains the javascript chart definition for an implementation of the d3 availability
chart. This implementation is
* just a line that changes color based on availability type: up=green, down=red,
orange=disabled, unknown=grey,
@@ -66,7 +66,7 @@ public class AvailabilityOverUnderGraphType {
// loop through the avail intervals
for (Availability availability : availabilityList) {
sb.append("{ \"availType\":\"" +
availability.getAvailabilityType() + "\", ");
- sb.append(" \"availTypeMessage\":\"" +
availability.getAvailabilityType()+ "\", ");
+ sb.append(" \"availTypeMessage\":\"" +
availability.getAvailabilityType() + "\", ");
sb.append(" \"availStart\":" +
availability.getStartTime() + ", ");
// last record will be null
long endTime = availability.getEndTime() != null ?
availability.getEndTime() : (new Date()).getTime();
@@ -84,8 +84,9 @@ public class AvailabilityOverUnderGraphType {
// loop through the group avail down intervals
for (ResourceGroupAvailability groupAvailability : groupAvailabilityList) {
// allows substitution for situations like WARN=MIXED for easier
terminology
- String availabilityTypeMessage =
(groupAvailability.getGroupAvailabilityType().equals(ResourceGroupComposite.GroupAvailabilityType.WARN))
- ? MSG.chart_hover_availability_type_warn() :
groupAvailability.getGroupAvailabilityType().name();
+ String availabilityTypeMessage =
(groupAvailability.getGroupAvailabilityType()
+ .equals(ResourceGroupComposite.GroupAvailabilityType.WARN)) ? MSG
+ .chart_hover_availability_type_warn() :
groupAvailability.getGroupAvailabilityType().name();
sb.append("{ \"availType\":\"" +
groupAvailability.getGroupAvailabilityType() + "\", ");
sb.append(" \"availTypeMessage\":\"" +
availabilityTypeMessage + "\", ");
@@ -139,7 +140,6 @@ public class AvailabilityOverUnderGraphType {
barOffset = 10,
width = 750 - margin.left - margin.right + barOffset,
height = 40 - margin.top - margin.bottom,
- pixelsOffHeight = 0,
svg;
@@ -161,65 +161,65 @@ public class AvailabilityOverUnderGraphType {
.domain([0, 4]),
xAxis = $wnd.d3.svg.axis()
- .scale(timeScale)
- .ticks(12)
- .tickSize(10, 0, 0)
- .orient("bottom"),
-
- calcBarY = function(d) {
- var ABOVE = -10,
- BELOW = 0,
- STRADDLE = -5,
- offset;
-
- if (d.availType === 'DOWN') {
- offset = BELOW;
- }
- else if (d.availType === 'DISABLED') {
- offset = STRADDLE;
- }
- else if (d.availType === 'UNKNOWN') {
- offset = STRADDLE;
- }
- else if (d.availType === 'UP') {
- offset = ABOVE;
- }
- else if (d.availType === 'WARN') {
- offset = STRADDLE;
- }
- else if (d.availType === 'EMPTY') {
- offset = STRADDLE;
- }
- return yScale(0) + offset;
-
- },
-
- calcBarFill = function(d) {
- if (d.availType === 'DOWN') {
- return "#FF1919"; // red
- }
- else if (d.availType === 'DISABLED') {
- return "#FF9933"; // orange
- }
- else if (d.availType === 'UNKNOWN') {
- return "#CCC"; // gray
- }
- else if (d.availType === 'UP') {
- return "#198C19"; // green
- }
- else if (d.availType === 'WARN') {
- return "#FFA500"; // yellow
- }
- else if (d.availType === 'EMPTY') {
- return "#CCC"; // gray
- }
- else {
- // should not ever happen, but...
- console.warn("AvailabilityType not valid.");
- return "#000"; //black
- }
- },
- svg =
$wnd.d3.select(availChartContext.chartSelection).append("g")
+ .scale(timeScale)
+ .ticks(12)
+ .tickSize(13, 0, 0)
+ .orient("bottom"),
+
+ calcBarY = function (d) {
+ var ABOVE = -10,
+ BELOW = 0,
+ STRADDLE = -5,
+ offset;
+
+ if (d.availType === 'DOWN') {
+ offset = BELOW;
+ }
+ else if (d.availType === 'DISABLED') {
+ offset = STRADDLE;
+ }
+ else if (d.availType === 'UNKNOWN') {
+ offset = STRADDLE;
+ }
+ else if (d.availType === 'UP') {
+ offset = ABOVE;
+ }
+ else if (d.availType === 'WARN') {
+ offset = STRADDLE;
+ }
+ else if (d.availType === 'EMPTY') {
+ offset = STRADDLE;
+ }
+ return yScale(0) + offset;
+
+ },
+
+ calcBarFill = function (d) {
+ if (d.availType === 'DOWN') {
+ return "#FF1919"; // red
+ }
+ else if (d.availType === 'DISABLED') {
+ return "url(#diagonalHatchFill)"; // grey
diagonal hatches
+ }
+ else if (d.availType === 'UNKNOWN') {
+ return "#CCC"; // gray
+ }
+ else if (d.availType === 'UP') {
+ return "#198C19"; // green
+ }
+ else if (d.availType === 'WARN') {
+ return "#FFA500"; // orange
+ }
+ else if (d.availType === 'EMPTY') {
+ return "#CCC"; // gray
+ }
+ else {
+ // should not ever happen, but...
+ console.warn("AvailabilityType not valid.");
+ return "#000"; //black
+ }
+ },
+ svg =
$wnd.d3.select(availChartContext.chartSelection).append("g")
.attr("width", width + margin.left +
margin.right)
.attr("height", height + margin.top +
margin.bottom)
.attr("transform", "translate(" +
margin.left + "," + margin.top + ")");
@@ -234,11 +234,9 @@ public class AvailabilityOverUnderGraphType {
})
.attr("y", function (d) {
return calcBarY(d);
-
})
.attr("height", function (d) {
return 10;
-
})
.attr("width", function (d) {
return timeScale(+d.availEnd) - timeScale(+d.availStart);
@@ -250,43 +248,43 @@ public class AvailabilityOverUnderGraphType {
// create x-axis
svg.append("g")
- .attr("class", "x axis")
- .attr("stroke", "#50505a")
- .attr("stroke-width", "0.5")
- .attr("transform", "translate(0," + height +
")")
- .attr("letter-spacing", "3")
- .style("text-anchor", "end")
- .call(xAxis);
+ .attr("class", "x axis")
+ .attr("fill", "#50505a")
+ .attr("stroke-width", "0.5")
+ .attr("transform", "translate(0," + height +
")")
+ .attr("letter-spacing", "3")
+ .style("text-anchor", "end")
+ .call(xAxis);
svg.append("text")
- .attr("class", "availabilityLabel")
- .attr("x", -40)
- .attr("y", 10)
- .style("font-size", "12px")
- .style("font-family", "Arial, Verdana,
sans-serif;")
- .style("font-weight", "bold")
- .attr("fill", "#003168")
- .text("Availability");
+ .attr("class", "availabilityLabel")
+ .attr("x", -40)
+ .attr("y", 10)
+ .style("font-size", "12px")
+ .style("font-family", "Arial, Verdana,
sans-serif;")
+ .style("font-weight", "bold")
+ .attr("fill", "#003168")
+ .text("Availability");
svg.append("text")
- .attr("class", "upLabel")
- .attr("x", -5)
- .attr("y", 28)
- .style("font-family", "Arial, Verdana,
sans-serif;")
- .style("font-size", "9px")
- .attr("fill", "#50505a")
- .style("text-anchor", "end")
- .text("UP");
+ .attr("class", "upLabel")
+ .attr("x", -5)
+ .attr("y", 28)
+ .style("font-family", "Arial, Verdana,
sans-serif;")
+ .style("font-size", "9px")
+ .attr("fill", "#50505a")
+ .style("text-anchor", "end")
+ .text("UP");
svg.append("text")
- .attr("class", "downLabel")
- .attr("x", -5)
- .attr("y", 39)
- .style("font-family", "Arial, Verdana,
sans-serif;")
- .style("font-size", "9px")
- .attr("fill", "#50505a")
- .style("text-anchor", "end")
- .text("DOWN");
+ .attr("class", "downLabel")
+ .attr("x", -5)
+ .attr("y", 39)
+ .style("font-family", "Arial, Verdana,
sans-serif;")
+ .style("font-size", "9px")
+ .attr("fill", "#50505a")
+ .style("text-anchor", "end")
+ .text("DOWN");
}
@@ -306,19 +304,15 @@ public class AvailabilityOverUnderGraphType {
}
function formatHovers(d) {
- var hoverString,
- timeFormatter =
$wnd.d3.time.format(availChartContext.chartHoverTimeFormat),
+ var timeFormatter =
$wnd.d3.time.format(availChartContext.chartHoverTimeFormat),
dateFormatter =
$wnd.d3.time.format(availChartContext.chartHoverDateFormat),
- availStart = new Date(+d.availStart),
- availEnd = new Date(+d.availEnd);
+ availStart = new Date(+d.availStart);
- hoverString =
- '<div class="chartHoverEnclosingDiv">' +
+ return '<div class="chartHoverEnclosingDiv">' +
'<div
class="chartHoverAlignLeft"><span >' +
availChartContext.hoverBarAvailabilityLabel + ': </span><span
style="width:50px;">' + d.availTypeMessage +
'</span></div>' +
- '<div
class="chartHoverAlignLeft"><span>'+ dateFormatter(availStart) +
' ' + timeFormatter(availStart) + '</span></div>' +
+ '<div
class="chartHoverAlignLeft"><span>' + dateFormatter(availStart) +
' ' + timeFormatter(availStart) + '</span></div>' +
'<div
class="chartHoverAlignLeft"><span >' +
availChartContext.hoverBarLabel + ': </span><span
style="width:50px;">' + d.availDuration +
'</span></div>' +
'</div>';
- return hoverString;
}
@@ -341,7 +335,7 @@ public class AvailabilityOverUnderGraphType {
availabilityGraph.draw(availChartContext);
}
- }-*/;
+ }-*/;
public String getChartId() {
return String.valueOf(entityId);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
index 7df45d1..b876c74 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
@@ -634,7 +634,7 @@ public abstract class AbstractActivityView extends EnhancedVLayout
implements Re
setIsModal(true);
setShowModalMask(true);
setWidth(950);
- setHeight(350);
+ setHeight(370);
setShowResizer(true);
setCanDragResize(true);
centerInPage();
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/MetricD3GraphView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/MetricD3GraphView.java
index b590e86..f8887bf 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/MetricD3GraphView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/MetricD3GraphView.java
@@ -67,6 +67,31 @@ public class MetricD3GraphView extends EnhancedVLayout {
+ " width=\"6\"
height=\"3\">"
+ " <path d=\"M 0 0 6 0\"
style=\"stroke:#2E9EC2; fill:none;\"/>"
+ " </pattern>"
+ + "<pattern id=\"diagonalHatchFill\"
patternUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\"
width=\"105\" height=\"105\">"
+ + "<g style=\"fill:none; stroke:black;
stroke-width:1\">"
+ + "<circle cx=\"0\" cy=\"0\" r=\"1000\"
fill=\"grey\"/>"
+ + "<path d=\"M0 90 l15,15\"/>"
+ + "<path d=\"M0 75 l30,30\"/>"
+ + "<path d=\"M0 60 l45,45\"/>"
+ + "<path d=\"M0 45 l60,60\"/>"
+ + "<path d=\"M0 30 l75,75\"/>"
+ + "<path d=\"M0 15 l90,90\"/>"
+ + "<path d=\"M0 0 l105,105\"/>"
+ + "<path d=\"M15 0 l90,90\"/>"
+ + "<path d=\"M30 0 l75,75\"/>"
+ + "<path d=\"M45 0 l60,60\"/>"
+ + "<path d=\"M60 0 l45,45\"/>"
+ + "<path d=\"M75 0 l30,30\"/>"
+ + "<path d=\"M90 0 l15,15\"/>"
+ + "</g>"
+ + "</pattern>"
+ + "<pattern id=\"diagonalHatch\"
patternUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\"
width=\"105\" height=\"105\">"
+ + "<g style=\"fill:none; stroke:black;
stroke-width:1\">" + "<path d=\"M0 90 l15,15\"/>"
+ + "<path d=\"M0 75 l30,30\"/>" + "<path
d=\"M0 60 l45,45\"/>" + "<path d=\"M0 45
l60,60\"/>"
+ + "<path d=\"M0 30 l75,75\"/>" + "<path
d=\"M0 15 l90,90\"/>" + "<path d=\"M0 0
l105,105\"/>"
+ + "<path d=\"M15 0 l90,90\"/>" + "<path
d=\"M30 0 l75,75\"/>" + "<path d=\"M45 0
l60,60\"/>"
+ + "<path d=\"M60 0 l45,45\"/>" + "<path
d=\"M75 0 l30,30\"/>" + "<path d=\"M90 0
l15,15\"/>" + "</g>"
+ + "</pattern>"
+ " <pattern id=\"downStripes\"
patternUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\""
+ " width=\"6\"
height=\"3\">"
+ " <path d=\"M 0 0 6 0\"
style=\"stroke:#ff8a9a; fill:none;\"/>"
@@ -101,9 +126,9 @@ public class MetricD3GraphView extends EnhancedVLayout {
StringBuilder divAndSvgDefs = new StringBuilder();
divAndSvgDefs
.append("<div id=\""
- + getFullChartId()
- + "\" ><svg
xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"
xmlns:xlink=\"http://www.w3.org/1999/xlink\" style=\"height:"
- + getChartHeight() + "px;\">");
+ + getFullChartId()
+ + "\" ><svg
xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"
xmlns:xlink=\"http://www.w3.org/1999/xlink\" style=\"height:"
+ + getChartHeight() + "px;\">");
divAndSvgDefs.append(getSvgDefs());
divAndSvgDefs.append("</svg></div>");
@@ -133,14 +158,11 @@ public class MetricD3GraphView extends EnhancedVLayout {
graph.drawJsniChart();
}
-
public String getFullChartId() {
return "rChart-" + graph.getMetricGraphData().getChartId();
}
-
-
public Integer getChartHeight() {
return graph.getMetricGraphData().getChartHeight();
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityD3Graph.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityD3Graph.java
index d06bab2..ca8b117 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityD3Graph.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityD3Graph.java
@@ -25,7 +25,6 @@ import com.smartgwt.client.widgets.HTMLFlow;
import org.rhq.core.domain.measurement.Availability;
import org.rhq.core.domain.resource.group.composite.ResourceGroupAvailability;
import
org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityGraph;
-import
org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityLineGraphType;
import
org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType;
import org.rhq.enterprise.gui.coregui.client.util.Log;
import org.rhq.enterprise.gui.coregui.client.util.enhanced.EnhancedVLayout;
@@ -43,7 +42,7 @@ public class AvailabilityD3Graph extends EnhancedVLayout implements
Availability
public AvailabilityD3Graph(AvailabilityOverUnderGraphType graphType) {
super();
this.availabilityGraphType = graphType;
- setHeight(70);
+ setHeight(65);
setWidth100();
}
@@ -83,15 +82,26 @@ public class AvailabilityD3Graph extends EnhancedVLayout implements
Availability
StringBuilder divAndSvgDefs = new StringBuilder();
divAndSvgDefs.append("<div id=\"availChart-" +
availabilityGraphType.getChartId()
- + "\" ><svg
xmlns=\"http://www.w3.org/2000/svg\"
version=\"1.1\" style=\"height:110px;\">");
+ + "\" ><svg
xmlns=\"http://www.w3.org/2000/svg\"
version=\"1.1\" style=\"height:65px;\">");
+ divAndSvgDefs.append(getSvgDefs());
divAndSvgDefs.append("</svg></div>");
HTMLFlow graph = new HTMLFlow(divAndSvgDefs.toString());
graph.setWidth100();
- graph.setHeight(25);
+ graph.setHeight(65);
addMember(graph);
}
+ /**
+ * Svg definitions for patterns and gradients to use on SVG shapes.
+ * @return xml String
+ */
+ private static String getSvgDefs() {
+ return " <defs>"+
+ "<pattern id=\"diagonalHatch\"
patternUnits=\"userSpaceOnUse\" width=\"4\" height=\"4\">
<path d=\"M-1,1 l2,-2 M0,4 l4,-4 M3,5 l2,-2\" />
</pattern>"
+ + "</defs>";
+ }
+
@Override
public void destroy() {
super.destroy();
commit ee5255b684d733fa01989930676f5d0e7e17d51e
Author: mtho11 <mikecthompson(a)gmail.com>
Date: Mon May 6 14:23:28 2013 -0700
[BZ 960646] - RFE Redesigned Availability Charts.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
new file mode 100644
index 0000000..76c8f69
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/AvailabilityOverUnderGraphType.java
@@ -0,0 +1,381 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2012 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.inventory.common.charttype;
+
+import org.rhq.core.domain.measurement.Availability;
+import org.rhq.core.domain.measurement.MeasurementUnits;
+import org.rhq.core.domain.resource.group.composite.ResourceGroupAvailability;
+import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.Messages;
+import org.rhq.enterprise.gui.coregui.client.util.Log;
+import org.rhq.enterprise.gui.coregui.client.util.MeasurementConverterClient;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Contains the javascript chart definition for an implementation of the d3 availability
chart. This implementation is
+ * just a line that changes color based on availability type: up=green, down=red,
orange=disabled, unknown=grey,
+ * empty=grey, warn=yellow. This version of the availability graph shows continuous
intervals.
+ *
+ * @author Mike Thompson
+ */
+public class AvailabilityOverUnderGraphType {
+
+ private static Messages MSG = CoreGUI.getMessages();
+ private List<Availability> availabilityList;
+ private List<ResourceGroupAvailability> groupAvailabilityList;
+ private Integer entityId;
+
+ /**
+ * General constructor for stacked bar graph when you have all the data needed to
produce the graph. (This is true
+ * for all cases but the dashboard portlet).
+ */
+ public AvailabilityOverUnderGraphType(Integer entityId) {
+ this.entityId = entityId;
+ }
+
+ public void setAvailabilityList(List<Availability> availabilityList) {
+ this.availabilityList = availabilityList;
+ }
+
+ public void setGroupAvailabilityList(List<ResourceGroupAvailability>
groupAvailabilityList) {
+ this.groupAvailabilityList = groupAvailabilityList;
+ }
+
+ public String getAvailabilityJson() {
+ StringBuilder sb = new StringBuilder("[");
+ if (null != availabilityList) {
+ // loop through the avail intervals
+ for (Availability availability : availabilityList) {
+ sb.append("{ \"availType\":\"" +
availability.getAvailabilityType() + "\", ");
+ sb.append(" \"availTypeMessage\":\"" +
availability.getAvailabilityType()+ "\", ");
+ sb.append(" \"availStart\":" +
availability.getStartTime() + ", ");
+ // last record will be null
+ long endTime = availability.getEndTime() != null ?
availability.getEndTime() : (new Date()).getTime();
+ sb.append(" \"availEnd\":" + endTime + ",
");
+
+ long availDuration = endTime - availability.getStartTime();
+ String availDurationString = MeasurementConverterClient.format((double)
availDuration,
+ MeasurementUnits.MILLISECONDS, true);
+ sb.append(" \"availDuration\": \"" +
availDurationString + "\" },");
+
+ }
+ sb.setLength(sb.length() - 1);
+
+ } else if (null != groupAvailabilityList) {
+ // loop through the group avail down intervals
+ for (ResourceGroupAvailability groupAvailability : groupAvailabilityList) {
+ // allows substitution for situations like WARN=MIXED for easier
terminology
+ String availabilityTypeMessage =
(groupAvailability.getGroupAvailabilityType().equals(ResourceGroupComposite.GroupAvailabilityType.WARN))
+ ? MSG.chart_hover_availability_type_warn() :
groupAvailability.getGroupAvailabilityType().name();
+
+ sb.append("{ \"availType\":\"" +
groupAvailability.getGroupAvailabilityType() + "\", ");
+ sb.append(" \"availTypeMessage\":\"" +
availabilityTypeMessage + "\", ");
+ sb.append(" \"availStart\":" +
groupAvailability.getStartTime() + ", ");
+ // last record will be null
+ long endTime = groupAvailability.getEndTime() != null ?
groupAvailability.getEndTime() : (new Date())
+ .getTime();
+ sb.append(" \"availEnd\":" + endTime + ",
");
+
+ long availDuration = endTime - groupAvailability.getStartTime();
+ String availDurationString = MeasurementConverterClient.format((double)
availDuration,
+ MeasurementUnits.MILLISECONDS, true);
+ sb.append(" \"availDuration\": \"" +
availDurationString + "\" },");
+
+ }
+ sb.setLength(sb.length() - 1);
+ }
+
+ sb.append("]");
+ Log.debug(sb.toString());
+ return sb.toString();
+ }
+
+ /**
+ * The magic JSNI to draw the charts with d3.
+ */
+ public native void drawJsniChart() /*-{
+ console.log("Draw Enhanced Availability chart");
+
+ var global = this,
+ // tidy up all of our interactions with java (via JSNI) thru AvailChartContext
class
+ // NOTE: rhq.js has the javascript object constructors in it.
+ availChartContext = new
$wnd.AvailChartContext(global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getChartId()(),
+
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getAvailabilityJson()(),
+
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getChartDateLabel()(),
+
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getChartTimeLabel()(),
+
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getChartHoverStartLabel()(),
+
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getChartHoverEndLabel()(),
+
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getChartHoverBarLabel()(),
+
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getChartHoverAvailabilityLabel()(),
+
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getChartHoverTimeFormat()(),
+
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType::getChartHoverDateFormat()()
+ );
+
+
+ var availabilityGraph = function () {
+ "use strict";
+ // privates
+
+ var margin = {top: 5, right: 5, bottom: 5, left: 40},
+ barOffset = 10,
+ width = 750 - margin.left - margin.right + barOffset,
+ height = 40 - margin.top - margin.bottom,
+ pixelsOffHeight = 0,
+ svg;
+
+
+ function drawBars(availChartContext) {
+ var xAxisMin = $wnd.d3.min(availChartContext.data, function (d) {
+ return +d.availStart;
+ }),
+ xAxisMax = $wnd.d3.max(availChartContext.data, function (d) {
+ return +d.availEnd;
+ }),
+
+ timeScale = $wnd.d3.time.scale()
+ .range([0, width])
+ .domain([xAxisMin, xAxisMax]),
+
+ yScale = $wnd.d3.scale.linear()
+ .clamp(true)
+ .rangeRound([height, 0])
+ .domain([0, 4]),
+
+ xAxis = $wnd.d3.svg.axis()
+ .scale(timeScale)
+ .ticks(12)
+ .tickSize(10, 0, 0)
+ .orient("bottom"),
+
+ calcBarY = function(d) {
+ var ABOVE = -10,
+ BELOW = 0,
+ STRADDLE = -5,
+ offset;
+
+ if (d.availType === 'DOWN') {
+ offset = BELOW;
+ }
+ else if (d.availType === 'DISABLED') {
+ offset = STRADDLE;
+ }
+ else if (d.availType === 'UNKNOWN') {
+ offset = STRADDLE;
+ }
+ else if (d.availType === 'UP') {
+ offset = ABOVE;
+ }
+ else if (d.availType === 'WARN') {
+ offset = STRADDLE;
+ }
+ else if (d.availType === 'EMPTY') {
+ offset = STRADDLE;
+ }
+ return yScale(0) + offset;
+
+ },
+
+ calcBarFill = function(d) {
+ if (d.availType === 'DOWN') {
+ return "#FF1919"; // red
+ }
+ else if (d.availType === 'DISABLED') {
+ return "#FF9933"; // orange
+ }
+ else if (d.availType === 'UNKNOWN') {
+ return "#CCC"; // gray
+ }
+ else if (d.availType === 'UP') {
+ return "#198C19"; // green
+ }
+ else if (d.availType === 'WARN') {
+ return "#FFA500"; // yellow
+ }
+ else if (d.availType === 'EMPTY') {
+ return "#CCC"; // gray
+ }
+ else {
+ // should not ever happen, but...
+ console.warn("AvailabilityType not valid.");
+ return "#000"; //black
+ }
+ },
+ svg =
$wnd.d3.select(availChartContext.chartSelection).append("g")
+ .attr("width", width + margin.left +
margin.right)
+ .attr("height", height + margin.top +
margin.bottom)
+ .attr("transform", "translate(" +
margin.left + "," + margin.top + ")");
+
+
+ svg.selectAll("rect.availBars")
+ .data(availChartContext.data)
+ .enter().append("rect")
+ .attr("class", "availBars")
+ .attr("x", function (d) {
+ return timeScale(+d.availStart);
+ })
+ .attr("y", function (d) {
+ return calcBarY(d);
+
+ })
+ .attr("height", function (d) {
+ return 10;
+
+ })
+ .attr("width", function (d) {
+ return timeScale(+d.availEnd) - timeScale(+d.availStart);
+ })
+ .attr("opacity", ".9")
+ .attr("fill", function (d) {
+ return calcBarFill(d);
+ });
+
+ // create x-axis
+ svg.append("g")
+ .attr("class", "x axis")
+ .attr("stroke", "#50505a")
+ .attr("stroke-width", "0.5")
+ .attr("transform", "translate(0," + height +
")")
+ .attr("letter-spacing", "3")
+ .style("text-anchor", "end")
+ .call(xAxis);
+
+ svg.append("text")
+ .attr("class", "availabilityLabel")
+ .attr("x", -40)
+ .attr("y", 10)
+ .style("font-size", "12px")
+ .style("font-family", "Arial, Verdana,
sans-serif;")
+ .style("font-weight", "bold")
+ .attr("fill", "#003168")
+ .text("Availability");
+
+ svg.append("text")
+ .attr("class", "upLabel")
+ .attr("x", -5)
+ .attr("y", 28)
+ .style("font-family", "Arial, Verdana,
sans-serif;")
+ .style("font-size", "9px")
+ .attr("fill", "#50505a")
+ .style("text-anchor", "end")
+ .text("UP");
+
+ svg.append("text")
+ .attr("class", "downLabel")
+ .attr("x", -5)
+ .attr("y", 39)
+ .style("font-family", "Arial, Verdana,
sans-serif;")
+ .style("font-size", "9px")
+ .attr("fill", "#50505a")
+ .style("text-anchor", "end")
+ .text("DOWN");
+
+ }
+
+ function createHovers() {
+ $wnd.jQuery('svg rect.availBars').tipsy({
+ gravity: 's',
+ html: true,
+ trigger: 'hover',
+ title: function () {
+ var d = this.__data__;
+ return formatHovers(d);
+ },
+ show: function (e, el) {
+ el.css({ 'z-index': '990000'})
+ }
+ });
+ }
+
+ function formatHovers(d) {
+ var hoverString,
+ timeFormatter =
$wnd.d3.time.format(availChartContext.chartHoverTimeFormat),
+ dateFormatter =
$wnd.d3.time.format(availChartContext.chartHoverDateFormat),
+ availStart = new Date(+d.availStart),
+ availEnd = new Date(+d.availEnd);
+
+ hoverString =
+ '<div class="chartHoverEnclosingDiv">' +
+ '<div
class="chartHoverAlignLeft"><span >' +
availChartContext.hoverBarAvailabilityLabel + ': </span><span
style="width:50px;">' + d.availTypeMessage +
'</span></div>' +
+ '<div
class="chartHoverAlignLeft"><span>'+ dateFormatter(availStart) +
' ' + timeFormatter(availStart) + '</span></div>' +
+ '<div
class="chartHoverAlignLeft"><span >' +
availChartContext.hoverBarLabel + ': </span><span
style="width:50px;">' + d.availDuration +
'</span></div>' +
+ '</div>';
+ return hoverString;
+
+ }
+
+ return {
+ // Public API
+ draw: function (chartContext) {
+ "use strict";
+ console.info("AvailabilityChart");
+ //console.time("availabilityChart");
+ drawBars(availChartContext);
+ createHovers();
+ //console.timeEnd("availabilityChart");
+ }
+ }; // end public closure
+
+
+ }();
+
+ if (availChartContext.data !== undefined && availChartContext.data.length
> 0) {
+ availabilityGraph.draw(availChartContext);
+ }
+
+ }-*/;
+
+ public String getChartId() {
+ return String.valueOf(entityId);
+ }
+
+ public String getChartTimeLabel() {
+ return MSG.chart_time_label();
+ }
+
+ public String getChartDateLabel() {
+ return MSG.chart_date_label();
+ }
+
+ public String getChartHoverAvailabilityLabel() {
+ return MSG.chart_hover_availability_label();
+ }
+
+ public String getChartHoverStartLabel() {
+ return MSG.chart_hover_start_label();
+ }
+
+ public String getChartHoverEndLabel() {
+ return MSG.chart_hover_end_label();
+ }
+
+ public String getChartHoverBarLabel() {
+ return MSG.chart_hover_bar_label();
+ }
+
+ public String getChartHoverTimeFormat() {
+ return MSG.chart_hover_time_format();
+ }
+
+ public String getChartHoverDateFormat() {
+ return MSG.chart_hover_date_format();
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphImpl.java
index d9a4205..15f400d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphImpl.java
@@ -234,8 +234,10 @@ public class StackedBarMetricGraphImpl extends AbstractGraph {
chart.append("g").append("rect")
.attr("class", "rightSidePanel")
.attr("x", xLabel - 10)
- .attr("y", margin.top + 60)
- .attr("height", 100)
+ .attr("y", margin.top + 70)
+ .attr("rx", 10)
+ .attr("ry", 10)
+ .attr("height", 80)
.attr("width", 135)
.attr("opacity", "0.3")
.attr("fill", "#E8E8E8");
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/D3GroupGraphListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/D3GroupGraphListView.java
index 786701b..7691c5f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/D3GroupGraphListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/D3GroupGraphListView.java
@@ -42,6 +42,7 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.AutoRefresh;
import org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractD3GraphListView;
import
org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityLineGraphType;
+import
org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType;
import org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.MetricGraphData;
import
org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.StackedBarMetricGraphImpl;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.MetricD3GraphView;
@@ -74,7 +75,7 @@ public final class D3GroupGraphListView extends AbstractD3GraphListView
implemen
addMember(measurementRangeEditor);
if (showAvailabilityGraph) {
- availabilityGraph = new AvailabilityD3Graph(new
AvailabilityLineGraphType(resourceGroup.getId()));
+ availabilityGraph = new AvailabilityD3Graph(new
AvailabilityOverUnderGraphType(resourceGroup.getId()));
// first step in 2 step to create d3 chart
// create a placeholder for avail graph
availabilityGraph.createGraphMarker();
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/D3GraphListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/D3GraphListView.java
index 26f3626..58d3050 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/D3GraphListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/D3GraphListView.java
@@ -47,6 +47,7 @@ import
org.rhq.enterprise.gui.coregui.client.components.measurement.UserPreferen
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractD3GraphListView;
import
org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityLineGraphType;
+import
org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType;
import org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.MetricGraphData;
import
org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.StackedBarMetricGraphImpl;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.avail.AvailabilityD3Graph;
@@ -130,7 +131,7 @@ public class D3GraphListView extends AbstractD3GraphListView {
addMember(measurementRangeEditor);
if (showAvailabilityGraph) {
- availabilityGraph = new AvailabilityD3Graph(new
AvailabilityLineGraphType(resource.getId()));
+ availabilityGraph = new AvailabilityD3Graph(new
AvailabilityOverUnderGraphType(resource.getId()));
// first step in 2 step to create d3 chart
// create a placeholder for avail graph
availabilityGraph.createGraphMarker();
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityD3Graph.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityD3Graph.java
index d03fefe..d06bab2 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityD3Graph.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityD3Graph.java
@@ -26,6 +26,7 @@ import org.rhq.core.domain.measurement.Availability;
import org.rhq.core.domain.resource.group.composite.ResourceGroupAvailability;
import
org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityGraph;
import
org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityLineGraphType;
+import
org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.AvailabilityOverUnderGraphType;
import org.rhq.enterprise.gui.coregui.client.util.Log;
import org.rhq.enterprise.gui.coregui.client.util.enhanced.EnhancedVLayout;
@@ -37,12 +38,12 @@ import
org.rhq.enterprise.gui.coregui.client.util.enhanced.EnhancedVLayout;
*/
public class AvailabilityD3Graph extends EnhancedVLayout implements AvailabilityGraph {
- protected AvailabilityLineGraphType availabilityGraphType;
+ protected AvailabilityOverUnderGraphType availabilityGraphType;
- public AvailabilityD3Graph(AvailabilityLineGraphType graphType) {
+ public AvailabilityD3Graph(AvailabilityOverUnderGraphType graphType) {
super();
this.availabilityGraphType = graphType;
- setHeight(25);
+ setHeight(70);
setWidth100();
}
@@ -82,7 +83,7 @@ public class AvailabilityD3Graph extends EnhancedVLayout implements
Availability
StringBuilder divAndSvgDefs = new StringBuilder();
divAndSvgDefs.append("<div id=\"availChart-" +
availabilityGraphType.getChartId()
- + "\" ><svg
xmlns=\"http://www.w3.org/2000/svg\"
version=\"1.1\" style=\"height:20px;\">");
+ + "\" ><svg
xmlns=\"http://www.w3.org/2000/svg\"
version=\"1.1\" style=\"height:110px;\">");
divAndSvgDefs.append("</svg></div>");
HTMLFlow graph = new HTMLFlow(divAndSvgDefs.toString());
graph.setWidth100();
commit 85215f76e7ec578a7cad3a13e983c6cbffa0650f
Author: mtho11 <mikecthompson(a)gmail.com>
Date: Wed Apr 24 16:16:15 2013 -0700
Trivial: add *.DS_Store files to .gitignore
diff --git a/.gitignore b/.gitignore
index 92b2176..3bd9232 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,7 +12,6 @@ modules/enterprise/gui/coregui/build/classes/
modules/enterprise/gui/content_http-war/build/classes/
#created by rhq-enterprise-server's unit tests
modules/enterprise/server/jar/transaction.log
-
.idea/
.metadata/
*cache.html
@@ -27,6 +26,7 @@ modules/enterprise/server/jar/transaction.log
.*.jsfdia
.wtpmodules
*~
+*.DS_Store
#these are created by the python script engine during the tests
cachedir/
commit f875212be4a8cfaf0905e2fd376a579197b83148
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Tue May 7 14:25:34 2013 +0200
Bug 865629 - (PRODMGT-245) Add more metrics to AS7 plugin
Added missing metrics
Added integration test
diff --git a/modules/plugins/jboss-as-7/pom.xml b/modules/plugins/jboss-as-7/pom.xml
index cfe756d..5f538b7 100644
--- a/modules/plugins/jboss-as-7/pom.xml
+++ b/modules/plugins/jboss-as-7/pom.xml
@@ -615,6 +615,7 @@
<include>org/rhq/modules/plugins/jbossas7/itest/**/*Test.java</include>
<!--<include>org/rhq/modules/plugins/jbossas7/itest/standalone/StandaloneServerComponentTest.java</include>-->
<!--<include>org/rhq/modules/plugins/jbossas7/itest/standalone/InterruptibleOperationsTest.java</include>-->
+
<!--<include>org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java</include>-->
<!--<include>org/rhq/modules/plugins/jbossas7/itest/domain/DomainServerComponentTest.java</include>-->
<!--<include>org/rhq/modules/plugins/jbossas7/itest/domain/SecurityModuleOptionsTest.java</include>-->
<!--<include>org/rhq/modules/plugins/jbossas7/itest/nonpc/ManagementConnectionPersistenceTest.java</include>-->
diff --git a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
index 45f4e05..742c4d5 100644
--- a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
@@ -8864,6 +8864,22 @@
<metric property="responseTime"
dataType="calltime" defaultOn="false"
units="milliseconds" destinationType="URL"
description="the minimum, maximum, and average response times for
requests serviced by this webapp"/>
+ <metric property="active-sessions" displayName="Currently Active
Sessions"
+ description="The number of sessions that are currently
active"/>
+ <metric property="duplicated-session-ids" displayName="Duplicated
Session Ids"
+ description="The number of duplicated session identifiers"/>
+ <metric property="expired-sessions" measurementType="trendsup"
displayName="Expired Sessions"
+ description="The number of expired sessions"/>
+ <metric property="max-active-sessions" displayName="Maximum Active
Sessions"
+ description="The maximum number of sessions that have been
active"/>
+ <metric property="rejected-sessions"
measurementType="trendsup" displayName="Rejected Sessions"
+ description="The number of sessions rejected"/>
+ <metric property="session-avg-alive-time" units="milliseconds"
displayName="Average Session Alive Time"
+ description="The average alive time of sessions"/>
+ <metric property="session-max-alive-time" units="milliseconds"
displayName="Max Session Alive Time"
+ description="The maximum alive time of sessions"/>
+ <metric property="sessions-created" measurementType="trendsup"
displayName="Created Sessions"
+ description="The number of sessions created"/>
</service>
diff --git
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java
index 6f84e34..5b552bc 100644
---
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java
+++
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java
@@ -19,6 +19,11 @@
package org.rhq.modules.plugins.jbossas7.itest.standalone;
+import static java.util.concurrent.TimeUnit.SECONDS;
+import static org.rhq.core.domain.util.ResourceTypeUtility.getMeasurementDefinitions;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -27,6 +32,8 @@ import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashSet;
import java.util.Set;
import org.mockito.Mockito;
@@ -47,8 +54,18 @@ import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.content.PackageDetailsKey;
import org.rhq.core.domain.content.transfer.DeployPackagesResponse;
import org.rhq.core.domain.content.transfer.ResourcePackageDetails;
+import org.rhq.core.domain.measurement.DataType;
+import org.rhq.core.domain.measurement.MeasurementDataNumeric;
+import org.rhq.core.domain.measurement.MeasurementDataTrait;
+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.CreateResourceStatus;
import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.util.MeasurementDefinitionFilter;
+import org.rhq.core.pc.inventory.ResourceContainer;
+import org.rhq.core.pc.util.FacetLockType;
+import org.rhq.core.pluginapi.measurement.MeasurementFacet;
import org.rhq.modules.plugins.jbossas7.StandaloneASComponent;
import org.rhq.modules.plugins.jbossas7.itest.AbstractJBossAS7PluginTest;
import org.rhq.test.arquillian.DiscoveredResources;
@@ -101,6 +118,9 @@ public class DeploymentTest extends AbstractJBossAS7PluginTest {
@DiscoveredResources(plugin = PLUGIN_NAME, resourceType = "Deployment")
private Set<Resource> deploymentResources;
+ @DiscoveredResources(plugin = PLUGIN_NAME, resourceType = "Web Runtime")
+ private Set<Resource> webRuntimeResources;
+
private static TestDeployments DEPLOYMENT_TO_SERVE = TestDeployments.DEPLOYMENT_1;
private static long copyStreamAndReturnCount(InputStream in, OutputStream out) throws
IOException {
@@ -242,6 +262,60 @@ public class DeploymentTest extends AbstractJBossAS7PluginTest {
}
@Test(priority = 15)
+ @RunDiscovery
+ public void testWebRuntimeMetricsHaveNonNullValues() throws Exception {
+ assertTrue(webRuntimeResources != null &&
!webRuntimeResources.isEmpty(),
+ "Web Runtime resource should have been discovered");
+ assertEquals(webRuntimeResources.size(), 1, "Found more than one Web Runtime
resource: " + webRuntimeResources);
+
+ Resource webRuntimeResource = webRuntimeResources.iterator().next();
+ ResourceContainer webRuntimeResourceContainer =
pluginContainer.getInventoryManager().getResourceContainer(
+ webRuntimeResource);
+ MeasurementFacet measurementFacet =
webRuntimeResourceContainer.createResourceComponentProxy(
+ MeasurementFacet.class, FacetLockType.READ, SECONDS.toMillis(5), false,
false);
+ MeasurementReport report = new MeasurementReport();
+ Set<MeasurementScheduleRequest> measurementScheduleRequests =
getMeasurementScheduleRequests(webRuntimeResource);
+ measurementFacet.getValues(report, measurementScheduleRequests);
+ assertEquals(report.getCallTimeData().size(), 0, "No calltime data was
requested");
+ assertTrue(
+ report.getNumericData().size() + report.getTraitData().size() ==
measurementScheduleRequests.size(),
+ "Some requested measurements are missing: "
+ + getMissingMeasurements(measurementScheduleRequests,
report.getNumericData(), report.getTraitData()));
+ }
+
+ private Set<String>
getMissingMeasurements(Set<MeasurementScheduleRequest> measurementScheduleRequests,
+ Set<MeasurementDataNumeric> numericData, Set<MeasurementDataTrait>
traitData) {
+ Set<String> missingMeasurements = new HashSet<String>();
+ for (MeasurementScheduleRequest measurementScheduleRequest :
measurementScheduleRequests) {
+ missingMeasurements.add(measurementScheduleRequest.getName());
+ }
+ for (MeasurementDataNumeric measurementDataNumeric : numericData) {
+ missingMeasurements.remove(measurementDataNumeric.getName());
+ }
+ for (MeasurementDataTrait measurementDataTrait : traitData) {
+ missingMeasurements.remove(measurementDataTrait.getName());
+ }
+ return missingMeasurements;
+ }
+
+ private Set<MeasurementScheduleRequest> getMeasurementScheduleRequests(Resource
webRuntimeResource) {
+ Set<MeasurementDefinition> measurementDefinitions =
getMeasurementDefinitions(
+ webRuntimeResource.getResourceType(), new MeasurementDefinitionFilter() {
+ private final Set<DataType> acceptableDataTypes =
EnumSet.of(DataType.MEASUREMENT, DataType.TRAIT);
+
+ public boolean accept(MeasurementDefinition measurementDefinition) {
+ return
acceptableDataTypes.contains(measurementDefinition.getDataType());
+ }
+ });
+ Set<MeasurementScheduleRequest> measurementScheduleRequests = new
HashSet<MeasurementScheduleRequest>();
+ for (MeasurementDefinition measurementDefinition : measurementDefinitions) {
+ measurementScheduleRequests.add(new MeasurementScheduleRequest(-1,
measurementDefinition.getName(), -1,
+ true, measurementDefinition.getDataType(),
measurementDefinition.getRawNumericType()));
+ }
+ return measurementScheduleRequests;
+ }
+
+ @Test(priority = 16)
public void testUndeploy() throws Exception {
Resource deployment = deploymentResources.iterator().next();
DeleteResourceRequest request = new DeleteResourceRequest(0,
deployment.getId());
commit e589245b50710f5487ce3efcd527f73c02df8ea3
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon May 6 19:02:55 2013 -0400
BZ 817825 don't show "Loading..." for leaf nodes in resource type drop
down menus
this still doesn't fix the Platform plugin's platform type submenus.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
index e2650e4..90511d7 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java
@@ -77,8 +77,6 @@ public class ResourceSelector extends AbstractSelector<Resource,
ResourceCriteri
typeSelectItem.setValueField("id");
typeSelectItem.setCanSelectParentItems(true);
typeSelectItem.setLoadDataOnDemand(false);
- typeSelectItem.setEmptyMenuMessage(MSG.common_msg_loading());
- typeSelectItem.setShowIcons(false);
if (this.forceResourceTypeFilter) {
typeSelectItem.setDisabled(true);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java
index 136db95..c1c9e66 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java
@@ -19,8 +19,6 @@
package org.rhq.enterprise.gui.coregui.client.inventory.resource.type;
import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
import java.util.HashMap;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -144,12 +142,6 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
}
}
- Collections.sort(nodes, new Comparator<TreeNode>() {
- public int compare(TreeNode o1, TreeNode o2) {
- return o1.getName().compareTo(o2.getName());
- }
- });
-
TreeNode[] treeNodes = nodes.toArray(new TreeNode[nodes.size()]);
return treeNodes;
}
@@ -198,9 +190,8 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
setParentID(null);
setAttribute("name", pluginName + " " + pluginStr);
- // setAttribute("plugin",pluginName);
- setIcon("types/plugin_16.png"); // todo doesn't work
setEnabled(true);
+ // setIcon(IconEnum.PLUGIN.getIcon16x16Path()); // IPickTreeItem doesn't
appear to want to use this
}
@Override
@@ -245,10 +236,7 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
setAttribute("name", resourceType.getName());
setAttribute("plugin", resourceType.getPlugin());
setAttribute("category",
resourceType.getCategory().getDisplayName());
-
- setIcon("types/" + resourceType.getCategory().getDisplayName() +
"_up_16.png");
-
- setIsFolder(true);
+ // setIcon(ImageManager.getResourceIcon(resourceType.getCategory())); //
IPickTreeItem doesn't appear to want to use this
}
public ResourceType getResourceType() {
commit 82a86c90fcc05ec19b1b9b63771fe12905cb2f09
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon May 6 16:03:20 2013 -0400
BZ 960265 bring back the GWT calltime page
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index a68170a..91db630 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -28,6 +28,7 @@ import com.smartgwt.client.widgets.Canvas;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
+import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.criteria.ResourceCriteria;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.measurement.DataType;
@@ -55,7 +56,6 @@ import
org.rhq.enterprise.gui.coregui.client.drift.ResourceDriftDefinitionsView;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.InventoryView;
import
org.rhq.enterprise.gui.coregui.client.inventory.common.detail.AbstractTwoLevelTabSetView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.common.detail.monitoring.IFrameWithMeasurementRangeEditorView;
import
org.rhq.enterprise.gui.coregui.client.inventory.common.event.EventCompositeHistoryView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupListView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceCompositeSearchView;
@@ -64,6 +64,7 @@ import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configura
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory.PluginConfigurationEditView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory.PluginConfigurationHistoryListView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory.ResourceAgentView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.CalltimeView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.D3GraphListView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.avail.ResourceAvailabilityView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.schedules.ResourceSchedulesView;
@@ -437,8 +438,7 @@ public class ResourceDetailView extends
viewFactory = (!visible) ? null : new ViewFactory() {
@Override
public Canvas createView() {
- return new
IFrameWithMeasurementRangeEditorView("/rhq/resource/monitor/response-plain.xhtml?id="
- + resource.getId());
+ return new CalltimeView(EntityContext.forResource(resource.getId()));
}
};
updateSubTab(this.monitoringTab, this.monitorCallTime, visible, true,
viewFactory);
commit 98f5814fe4acb2dd5a9305170460638e3cd984e1
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Mon May 6 11:05:04 2013 -0500
Update development version to 4.8.0-SNAPSHOT.
diff --git a/code-coverage/pom.xml b/code-coverage/pom.xml
index f1f8cec..dbb487d 100644
--- a/code-coverage/pom.xml
+++ b/code-coverage/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>rhq-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-code-coverage</artifactId>
diff --git a/modules/cli-tests/pom.xml b/modules/cli-tests/pom.xml
index c4dadc9..efe6d1f 100644
--- a/modules/cli-tests/pom.xml
+++ b/modules/cli-tests/pom.xml
@@ -8,7 +8,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index 4cf6703..138e9ca 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/drift/pom.xml b/modules/common/drift/pom.xml
index 9d7a132..5afdead 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-common-drift</artifactId>
diff --git a/modules/common/filetemplate-bundle/pom.xml
b/modules/common/filetemplate-bundle/pom.xml
index 32692b5..0beb20b 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-filetemplate-bundle-common</artifactId>
diff --git a/modules/common/jboss-as-dmr-client/pom.xml
b/modules/common/jboss-as-dmr-client/pom.xml
index 4f43692..b8c1682 100644
--- a/modules/common/jboss-as-dmr-client/pom.xml
+++ b/modules/common/jboss-as-dmr-client/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-jboss-as-dmr-client</artifactId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index b9ee5be..6dac77b 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-jboss-as-common</artifactId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index 4ed6d92..088e268 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/arquillian-integration/archive/pom.xml
b/modules/core/arquillian-integration/archive/pom.xml
index 7c7e949..fe5f377 100644
--- a/modules/core/arquillian-integration/archive/pom.xml
+++ b/modules/core/arquillian-integration/archive/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-arquillian-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<!-- Model Version -->
diff --git a/modules/core/arquillian-integration/container/pom.xml
b/modules/core/arquillian-integration/container/pom.xml
index 75a7a05..258d050 100644
--- a/modules/core/arquillian-integration/container/pom.xml
+++ b/modules/core/arquillian-integration/container/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-arquillian-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<!-- Model Version -->
diff --git a/modules/core/arquillian-integration/pom.xml
b/modules/core/arquillian-integration/pom.xml
index 9637dfc..67b02a8 100644
--- a/modules/core/arquillian-integration/pom.xml
+++ b/modules/core/arquillian-integration/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/arquillian-integration/suite-extension/pom.xml
b/modules/core/arquillian-integration/suite-extension/pom.xml
index 5d80c3f..231ab67 100644
--- a/modules/core/arquillian-integration/suite-extension/pom.xml
+++ b/modules/core/arquillian-integration/suite-extension/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-arquillian-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<!-- Model Version -->
diff --git a/modules/core/arquillian-integration/test-agent-plugin/pom.xml
b/modules/core/arquillian-integration/test-agent-plugin/pom.xml
index f086ca3..4ed7bca 100644
--- a/modules/core/arquillian-integration/test-agent-plugin/pom.xml
+++ b/modules/core/arquillian-integration/test-agent-plugin/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-arquillian-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index acd19c9..7adcd3b 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 9fd9f98..1fb2161 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index d77ee51..cc040f8 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index d572d9d..776459d 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-domain</artifactId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index b3b7706..dc21aad 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 04be12b..46fe305 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 a24c330..8060a89 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container-itest/pom.xml
b/modules/core/plugin-container-itest/pom.xml
index 900eb72..9c801de 100644
--- a/modules/core/plugin-container-itest/pom.xml
+++ b/modules/core/plugin-container-itest/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-plugin-container-itest</artifactId>
diff --git a/modules/core/plugin-container/pom.xml
b/modules/core/plugin-container/pom.xml
index 06395a2..3c070a9 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-plugin-container</artifactId>
diff --git a/modules/core/plugin-test-api/pom.xml b/modules/core/plugin-test-api/pom.xml
index fc49cf3..18fa318 100644
--- a/modules/core/plugin-test-api/pom.xml
+++ b/modules/core/plugin-test-api/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-plugin-test-api</artifactId>
diff --git a/modules/core/plugin-test-util/pom.xml
b/modules/core/plugin-test-util/pom.xml
index c75dcbc..0374729 100644
--- a/modules/core/plugin-test-util/pom.xml
+++ b/modules/core/plugin-test-util/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 d05b721..99c875d 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml
index c3c7175..426d298 100644
--- a/modules/core/plugindoc/pom.xml
+++ b/modules/core/plugindoc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index c4992af..c41a8f4 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index b799891..cdc3b9b 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-util</artifactId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index cb1fad0..2d7093d 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/agentupdate/pom.xml
b/modules/enterprise/agentupdate/pom.xml
index 3b66b92..67ed9a8 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/binding/pom.xml b/modules/enterprise/binding/pom.xml
index a41fb6c..d5b7643 100644
--- a/modules/enterprise/binding/pom.xml
+++ b/modules/enterprise/binding/pom.xml
@@ -3,10 +3,10 @@
<parent>
<artifactId>rhq-enterprise-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-script-bindings</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 c312dc1..8148262 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 333aa5d..a140a9c 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 035ade8..cb7dd3a 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index 1fa9ec1..018a802 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -8,7 +8,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 a827c3c..d2998cc 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/remoting-war/pom.xml
b/modules/enterprise/gui/remoting-war/pom.xml
index 70ece03..638bccd 100644
--- a/modules/enterprise/gui/remoting-war/pom.xml
+++ b/modules/enterprise/gui/remoting-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/rest-examples-war/pom.xml
b/modules/enterprise/gui/rest-examples-war/pom.xml
index 2a5091c..c9aa075 100644
--- a/modules/enterprise/gui/rest-examples-war/pom.xml
+++ b/modules/enterprise/gui/rest-examples-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/rest-war/pom.xml
b/modules/enterprise/gui/rest-war/pom.xml
index 5d3dbfc..33e330e 100644
--- a/modules/enterprise/gui/rest-war/pom.xml
+++ b/modules/enterprise/gui/rest-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index 489d603..3fad441 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 e371826..dec19d0 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 2c7b6f9..cba50db 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 b411a87..6db40f2 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index 3ab9e66..7bf574e 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/scripting/api/pom.xml
b/modules/enterprise/scripting/api/pom.xml
index 07768cd..268af3a 100644
--- a/modules/enterprise/scripting/api/pom.xml
+++ b/modules/enterprise/scripting/api/pom.xml
@@ -3,10 +3,10 @@
<parent>
<artifactId>rhq-scripting-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-scripting-api</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<name>RHQ Scripting API</name>
<description>Provides API for adding scripting support to RHQ using different
javax.scripting - based interpreters</description>
diff --git a/modules/enterprise/scripting/javascript/pom.xml
b/modules/enterprise/scripting/javascript/pom.xml
index 32eb12d..acc09aa 100644
--- a/modules/enterprise/scripting/javascript/pom.xml
+++ b/modules/enterprise/scripting/javascript/pom.xml
@@ -4,10 +4,10 @@
<parent>
<artifactId>rhq-scripting-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-scripting-javascript</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<name>RHQ Javascript support</name>
<description>Provides RHQ scripting in Javascript using
Rhino</description>
diff --git a/modules/enterprise/scripting/pom.xml b/modules/enterprise/scripting/pom.xml
index 5c82958..a58f1ca 100644
--- a/modules/enterprise/scripting/pom.xml
+++ b/modules/enterprise/scripting/pom.xml
@@ -3,12 +3,12 @@
<parent>
<artifactId>rhq-enterprise-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-scripting-parent</artifactId>
<packaging>pom</packaging>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<name>RHQ Scripting Parent Module</name>
<modules>
diff --git a/modules/enterprise/scripting/python/pom.xml
b/modules/enterprise/scripting/python/pom.xml
index f6a1149c..dc69d9e 100644
--- a/modules/enterprise/scripting/python/pom.xml
+++ b/modules/enterprise/scripting/python/pom.xml
@@ -3,10 +3,10 @@
<parent>
<artifactId>rhq-scripting-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-scripting-python</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<name>RHQ Python support</name>
<description>Provides RHQ scripting in Python using Jython</description>
diff --git a/modules/enterprise/server/appserver/pom.xml
b/modules/enterprise/server/appserver/pom.xml
index 0e46986..f186d70 100644
--- a/modules/enterprise/server/appserver/pom.xml
+++ b/modules/enterprise/server/appserver/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 6bb6ea2..3e69ded 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-server-client-api</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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/ear/pom.xml
b/modules/enterprise/server/ear/pom.xml
index 939f107..867ebe1 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/installer/pom.xml
b/modules/enterprise/server/installer/pom.xml
index 150daf2..23d8e94 100644
--- a/modules/enterprise/server/installer/pom.xml
+++ b/modules/enterprise/server/installer/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/itests-2/pom.xml
b/modules/enterprise/server/itests-2/pom.xml
index 9f9ba81..5e4e076 100644
--- a/modules/enterprise/server/itests-2/pom.xml
+++ b/modules/enterprise/server/itests-2/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 acb8931..84e34c4 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 68ea87a..ea9bd42 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>alert-cli</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 ec91baf..a2102a3 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.server</groupId>
<artifactId>alert-email</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 ea7bd90..bd5f656 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-irc</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 c50b5cb..934cb7e 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-log4j</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 c576b41..28d1d56 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-microblog</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 5d9fb43..4338526 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-mobicents</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 24813ad..21ec5f7 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-operations</artifactId>
<packaging>jar</packaging>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 31acb49..a6c054a 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-roles</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 b09ed2a..f84398b 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-snmp</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 cd0263b..d4d2564 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-subject</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 489b37b..648b451 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 94cbe7d..6f56e82 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>rhq-serverplugin-cobbler</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 c111bcc..21bb689 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 52b3a7c..7111543 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 b43da47..6ab0964 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml
b/modules/enterprise/server/plugins/jboss-software/pom.xml
index 33a11a1..32ffc76 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 80799ab..2a75e07 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>packagetype-cli</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<name>RHQ Enterprise Server CLI Package Type Plugin</name>
diff --git a/modules/enterprise/server/plugins/pom.xml
b/modules/enterprise/server/plugins/pom.xml
index 827bc41..dc862db 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/url/pom.xml
b/modules/enterprise/server/plugins/url/pom.xml
index 5660473..bb1740d 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 0d80df3..06da613 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 75b3cdc..6f8ac10 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/pom.xml b/modules/enterprise/server/pom.xml
index 494e98e..9c60e30 100644
--- a/modules/enterprise/server/pom.xml
+++ b/modules/enterprise/server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml
b/modules/enterprise/server/safe-invoker/pom.xml
index 8c509f4..b2b741e 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/sars/pom.xml
b/modules/enterprise/server/sars/pom.xml
index 2b00e67..d4f7715 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/sars/services-sar/pom.xml
b/modules/enterprise/server/sars/services-sar/pom.xml
index 4586a8b..014420b 100644
--- a/modules/enterprise/server/sars/services-sar/pom.xml
+++ b/modules/enterprise/server/sars/services-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/startup-subsystem/pom.xml
b/modules/enterprise/server/startup-subsystem/pom.xml
index 3359f33..7152fc3 100644
--- a/modules/enterprise/server/startup-subsystem/pom.xml
+++ b/modules/enterprise/server/startup-subsystem/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 98783f1..00e558b 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/bundleGen/pom.xml b/modules/helpers/bundleGen/pom.xml
index 82fabfc..f2f2455 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.helpers</groupId>
<artifactId>bundleGen</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<build>
<plugins>
diff --git a/modules/helpers/jeeGen/pom.xml b/modules/helpers/jeeGen/pom.xml
index 348b780..6f36514 100644
--- a/modules/helpers/jeeGen/pom.xml
+++ b/modules/helpers/jeeGen/pom.xml
@@ -9,7 +9,7 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/perftest-support/pom.xml
b/modules/helpers/perftest-support/pom.xml
index ed71426..8772058 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>perftest-support</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 bd47d23..ecebf6c 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/rest-docs-generator/pom.xml
b/modules/helpers/rest-docs-generator/pom.xml
index e72aab4..c5a4a41 100644
--- a/modules/helpers/rest-docs-generator/pom.xml
+++ b/modules/helpers/rest-docs-generator/pom.xml
@@ -24,7 +24,7 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/helpers/rtfilter-subsystem/pom.xml
b/modules/helpers/rtfilter-subsystem/pom.xml
index f3cbb2e..baf0801 100644
--- a/modules/helpers/rtfilter-subsystem/pom.xml
+++ b/modules/helpers/rtfilter-subsystem/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index da9cf66..bf4ca3d 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/integration-tests/apache-plugin-test/pom.xml
b/modules/integration-tests/apache-plugin-test/pom.xml
index ce66fd5..a9d7296 100644
--- a/modules/integration-tests/apache-plugin-test/pom.xml
+++ b/modules/integration-tests/apache-plugin-test/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-integration-tests</artifactId>
<groupId>org.rhq</groupId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
b/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
index f83573d..48808ac 100644
--- a/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
+++ b/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>jndi-access-test-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>jndi-access-test</artifactId>
diff --git a/modules/integration-tests/jndi-access/pom.xml
b/modules/integration-tests/jndi-access/pom.xml
index caef075..6ded494 100644
--- a/modules/integration-tests/jndi-access/pom.xml
+++ b/modules/integration-tests/jndi-access/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-integration-tests</artifactId>
<groupId>org.rhq</groupId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/integration-tests/jndi-access/remote-server/pom.xml
b/modules/integration-tests/jndi-access/remote-server/pom.xml
index b28b9bf..d11992a 100644
--- a/modules/integration-tests/jndi-access/remote-server/pom.xml
+++ b/modules/integration-tests/jndi-access/remote-server/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>jndi-access-test-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>jndi-access-remote-server</artifactId>
diff --git a/modules/integration-tests/pom.xml b/modules/integration-tests/pom.xml
index f110387..7e5f521 100644
--- a/modules/integration-tests/pom.xml
+++ b/modules/integration-tests/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/integration-tests/rest-api/pom.xml
b/modules/integration-tests/rest-api/pom.xml
index 6061752..bca2fe4 100644
--- a/modules/integration-tests/rest-api/pom.xml
+++ b/modules/integration-tests/rest-api/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-integration-tests</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index 14874eb..2809e95 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 9c3e48d..75a98a4 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index 3f6bca5..380f6e6 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index 4e663e6..ada89b3 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/byteman/pom.xml b/modules/plugins/byteman/pom.xml
index 6a85842..37ffe0e 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cassandra/pom.xml b/modules/plugins/cassandra/pom.xml
index d576083..a17a3d8 100644
--- a/modules/plugins/cassandra/pom.xml
+++ b/modules/plugins/cassandra/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index c01634b..9424397 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index 27f290b..3aa5463 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index 7959a32..03349f8 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 c67fc10..8a5f0e6 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index 4a3ad1d..a1c3353 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hadoop/pom.xml b/modules/plugins/hadoop/pom.xml
index dd99a37..d8325e4 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index 0303046..adee980 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 9ca39d3..f587112 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index 1a8d193..d1f3e43 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-hudson-plugin</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 69f1dbb..93a915f 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/irc/pom.xml b/modules/plugins/irc/pom.xml
index 875e82f..b043e7b 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 221d4cc..f2e6f8a 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 81b2322..cfe756d 100644
--- a/modules/plugins/jboss-as-7/pom.xml
+++ b/modules/plugins/jboss-as-7/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.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 bd58a06..b792d26 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 c83611c..837852d 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 421f24d..3828a6a 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index 48e3f93..864f675 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/kickstart/pom.xml b/modules/plugins/kickstart/pom.xml
index 9255d09..094f451 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 62ffc81..54b9f53 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index 14e39a3..572851e 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index 22db736..6b663ff 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/noop/pom.xml b/modules/plugins/noop/pom.xml
index 1f43ea4..68af26a 100644
--- a/modules/plugins/noop/pom.xml
+++ b/modules/plugins/noop/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index dc4f4aa..ed93d10 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 1d40834..5653d69 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index 593a70b..f852e8a 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index ef210b6..e28148c 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index 9d6a147..0e27179 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index 6ee7474..12ae83c 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index 1e323fb..26d37b3 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 e187c17..6bf549f 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 5327977..968a154 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 23dadb6..20e41c4 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index 3772829..d31500b 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script2/pom.xml b/modules/plugins/script2/pom.xml
index 3bec031..36ab8be 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index ae92638..74d740b 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index 93856c9..e0a216e 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index d10ef73..3891b84 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index 8cdd836..eb97008 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index 52e155c..45c2544 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.7.0-SNAPSHOT</version>
+ <version>4.8.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 1e8c6fc..63eb6ae 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/virt/pom.xml b/modules/plugins/virt/pom.xml
index 1c2bbca..de510c5 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index 82d911d..8f4cf31 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index f536119..c343deb 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.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
</parent>
<artifactId>test-utils</artifactId>
diff --git a/pom.xml b/pom.xml
index da1506f..b46ee9e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
+ <version>4.8.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RHQ</name>
commit 0989c0c6cad40b787e4148d40b95418d1dd7a4cf
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Mon May 6 11:02:05 2013 -0500
Disable all the arquillian-integration submodules from building when maven.test.skip
is true. Also, fix modules that depended on these modules to include them only if they are
built.
(cherry picked from commit 7e9678418a8ee2683aafb395c1cc25415ab375e3)
diff --git a/modules/core/arquillian-integration/pom.xml
b/modules/core/arquillian-integration/pom.xml
index 7e215a3..9637dfc 100644
--- a/modules/core/arquillian-integration/pom.xml
+++ b/modules/core/arquillian-integration/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<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>
@@ -19,11 +19,30 @@
<name>RHQ Arquillian Integration Modules</name>
<description>parent POM for integration modules with
Arquillian</description>
- <modules>
- <module>test-agent-plugin</module>
- <module>container</module>
- <module>archive</module>
- <module>suite-extension</module>
- </modules>
+
+ <profiles>
+ <profile>
+ <!--
+ This profile has been created to avoid unnecessary resolution of test
dependencies during a build that
+ does not run, compile or need tests.
+ More test dependencies are to be moved here if the set of sub-dependencies is
complex, references project
+ test jars, or conflicts with changing the container version.
+ -->
+ <id>test.dependencies</id>
+ <activation>
+ <property>
+ <name>maven.test.skip</name>
+ <value>!true</value>
+ </property>
+ </activation>
+
+ <modules>
+ <module>test-agent-plugin</module>
+ <module>container</module>
+ <module>archive</module>
+ <module>suite-extension</module>
+ </modules>
+ </profile>
+ </profiles>
</project>
diff --git a/modules/core/plugin-test-api/pom.xml b/modules/core/plugin-test-api/pom.xml
index 9c91bc0..fc49cf3 100644
--- a/modules/core/plugin-test-api/pom.xml
+++ b/modules/core/plugin-test-api/pom.xml
@@ -1,5 +1,5 @@
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<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>
@@ -24,59 +24,80 @@
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>test-utils</artifactId>
- <version>${project.version}</version>
- </dependency>
+ </dependencies>
- <dependency>
- <groupId>org.rhq</groupId>
-
<artifactId>rhq-arquillian-agent-plugin-container-embedded</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.powermock</groupId>
- <artifactId>powermock-module-testng</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.powermock</groupId>
- <artifactId>powermock-api-mockito</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.arquillian.container</groupId>
- <artifactId>arquillian-container-spi</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.arquillian.core</groupId>
- <artifactId>arquillian-core-spi</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.arquillian.container</groupId>
- <artifactId>arquillian-container-test-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.arquillian.test</groupId>
- <artifactId>arquillian-test-spi</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.arquillian.testng</groupId>
- <artifactId>arquillian-testng-container</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.shrinkwrap.resolver</groupId>
- <artifactId>shrinkwrap-resolver-depchain</artifactId>
- <type>pom</type>
- </dependency>
- </dependencies>
+ <profiles>
+ <profile>
+ <!--
+ This profile has been created to avoid unnecessary resolution of test
dependencies during a build that
+ does not run, compile or need tests.
+ More test dependencies are to be moved here if the set of sub-dependencies is
complex, references project
+ test jars, or conflicts with changing the container version.
+ -->
+ <id>test.dependencies</id>
+ <activation>
+ <property>
+ <name>maven.test.skip</name>
+ <value>!true</value>
+ </property>
+ </activation>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>test-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+
<artifactId>rhq-arquillian-agent-plugin-container-embedded</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-module-testng</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-api-mockito</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-container-spi</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.core</groupId>
+ <artifactId>arquillian-core-spi</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-container-test-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.test</groupId>
+ <artifactId>arquillian-test-spi</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.testng</groupId>
+ <artifactId>arquillian-testng-container</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.shrinkwrap.resolver</groupId>
+ <artifactId>shrinkwrap-resolver-depchain</artifactId>
+ <type>pom</type>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
</project>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index c51fb51..c4992af 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -1,5 +1,5 @@
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<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>
@@ -23,9 +23,7 @@
<profile>
<id>default</id>
<activation>
- <property>
- <name>java.home</name>
- </property>
+ <activeByDefault>true</activeByDefault>
</activation>
<modules>
<module>util</module>
@@ -47,6 +45,38 @@
</modules>
</profile>
+ <profile>
+ <!--
+ This profile has been created to avoid unnecessary resolution of test
dependencies during a build that
+ does not run, compile or need tests.
+ More test dependencies are to be moved here if the set of sub-dependencies is
complex, references project
+ test jars, or conflicts with changing the container version.
+ -->
+ <id>avoid.test.dependencies</id>
+ <activation>
+ <property>
+ <name>maven.test.skip</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <modules>
+ <module>util</module>
+ <module>native-system</module>
+ <module>comm-api</module>
+ <module>dbutils</module>
+ <module>domain</module>
+ <module>plugin-api</module>
+ <module>client-api</module>
+ <module>plugin-container</module>
+ <module>gui</module>
+ <module>plugin-validator</module>
+ <module>arquillian-integration</module>
+ <module>plugin-test-api</module>
+ <module>plugin-container-itest</module>
+ </modules>
+ </profile>
+
+
<profile>
<id>plugindoc</id>
<modules>
diff --git a/modules/plugins/cassandra/pom.xml b/modules/plugins/cassandra/pom.xml
index 9888aa0..d576083 100644
--- a/modules/plugins/cassandra/pom.xml
+++ b/modules/plugins/cassandra/pom.xml
@@ -63,20 +63,6 @@
<artifactId>snakeyaml</artifactId>
<version>1.10</version>
</dependency>
- <dependency>
- <groupId>${rhq.groupId}</groupId>
- <artifactId>rhq-core-plugin-test-api</artifactId>
- <version>${project.version}</version>
- <type>pom</type>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>${rhq.groupId}</groupId>
- <artifactId>rhq-core-plugin-test-util</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
@@ -231,6 +217,39 @@
</build>
<profiles>
+ <profile>
+ <!--
+ This profile has been created to avoid unnecessary resolution of test
dependencies during a build that
+ does not run, compile or need tests.
+ More test dependencies are to be moved here if the set of sub-dependencies is
complex, references project
+ test jars, or conflicts with changing the container version.
+ -->
+ <id>test.dependencies</id>
+ <activation>
+ <property>
+ <name>maven.test.skip</name>
+ <value>!true</value>
+ </property>
+ </activation>
+
+ <dependencies>
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-core-plugin-test-api</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-core-plugin-test-util</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+
<profile>
<id>dev</id>
diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml
index d9838cf..221d4cc 100644
--- a/modules/plugins/jboss-as-5/pom.xml
+++ b/modules/plugins/jboss-as-5/pom.xml
@@ -119,21 +119,6 @@
<!-- Test Deps -->
<dependency>
- <groupId>${rhq.groupId}</groupId>
- <artifactId>rhq-core-plugin-test-api</artifactId>
- <version>${project.version}</version>
- <type>pom</type>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>${rhq.groupId}</groupId>
- <artifactId>rhq-core-plugin-test-util</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
<groupId>org.jboss.spec.javax.jms</groupId>
<artifactId>jboss-jms-api_1.1_spec</artifactId>
<version>1.0.0.Final</version>
@@ -218,6 +203,39 @@
<profiles>
+ <profile>
+ <!--
+ This profile has been created to avoid unnecessary resolution of test
dependencies during a build that
+ does not run, compile or need tests.
+ More test dependencies are to be moved here if the set of sub-dependencies is
complex, references project
+ test jars, or conflicts with changing the container version.
+ -->
+ <id>test.dependencies</id>
+ <activation>
+ <property>
+ <name>maven.test.skip</name>
+ <value>!true</value>
+ </property>
+ </activation>
+
+ <dependencies>
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-core-plugin-test-api</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-core-plugin-test-util</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+
<profile>
<id>integration-tests</id>
<!--
diff --git a/modules/plugins/jboss-as-7/pom.xml b/modules/plugins/jboss-as-7/pom.xml
index 33b2bd7..81b2322 100644
--- a/modules/plugins/jboss-as-7/pom.xml
+++ b/modules/plugins/jboss-as-7/pom.xml
@@ -99,21 +99,6 @@
<!-- === Test Deps === -->
<dependency>
- <groupId>${rhq.groupId}</groupId>
- <artifactId>rhq-core-plugin-test-api</artifactId>
- <version>${project.version}</version>
- <type>pom</type>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>${rhq.groupId}</groupId>
- <artifactId>rhq-core-plugin-test-util</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>test</scope>
@@ -250,6 +235,39 @@
<profiles>
+ <profile>
+ <!--
+ This profile has been created to avoid unnecessary resolution of test
dependencies during a build that
+ does not run, compile or need tests.
+ More test dependencies are to be moved here if the set of sub-dependencies is
complex, references project
+ test jars, or conflicts with changing the container version.
+ -->
+ <id>test.dependencies</id>
+ <activation>
+ <property>
+ <name>maven.test.skip</name>
+ <value>!true</value>
+ </property>
+ </activation>
+
+ <dependencies>
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-core-plugin-test-api</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-core-plugin-test-util</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+
<profile>
<id>java7</id>
<activation>
commit cad0a43803d781bf2ba28eab71b80f822bf2d07d
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Mon May 6 11:01:37 2013 -0500
Update test to avoid disabled managers. This is especially important for the
TagManager that can be disabled via build properties.
(cherry picked from commit c9ccdbf61842dd115ce0d3067752e85dbb1db730)
diff --git
a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/client/security/test/ScriptingAPIServerTest.java
b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/client/security/test/ScriptingAPIServerTest.java
index aa0ebd4..024e4f6 100644
---
a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/client/security/test/ScriptingAPIServerTest.java
+++
b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/client/security/test/ScriptingAPIServerTest.java
@@ -87,6 +87,10 @@ public class ScriptingAPIServerTest extends ScriptableAbstractEJB3Test
{
//Simplification itself is unit tested separately.
for (RhqManager m : RhqManager.values()) {
+ if (!m.enabled()) {
+ continue;
+ }
+
String name = m.name();
// Only check for the TagManager if it is enabled at all
if (name.contains("TagManager") &&
!RhqManager.TagManager.enabled()) {
commit 5fecc675d08aa9220a163f0e35530dc6c07447b6
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Mon May 6 16:20:24 2013 +0200
Add test case for Bug 911321 - [EAP 6.1] Reload operation fails in standalone mode
diff --git a/modules/plugins/jboss-as-7/pom.xml b/modules/plugins/jboss-as-7/pom.xml
index 23a02c4..33b2bd7 100644
--- a/modules/plugins/jboss-as-7/pom.xml
+++ b/modules/plugins/jboss-as-7/pom.xml
@@ -30,6 +30,7 @@
<java.tieredCompilation>-Dxxx</java.tieredCompilation>
<java.useCompressedOOPS>-Dxxx</java.useCompressedOOPS>
<rhq.internal>false</rhq.internal>
+
<as7.itest.mock.http.management.server.port>32259</as7.itest.mock.http.management.server.port>
</properties>
@@ -118,6 +119,13 @@
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty.aggregate</groupId>
+ <artifactId>jetty-all</artifactId>
+ <version>8.1.8.v20121106</version>
+ <scope>test</scope>
+ </dependency>
+
<!-- For native subsystem -->
<dependency>
<groupId>org.hyperic</groupId>
@@ -588,6 +596,7 @@
<!-- only include integration tests; normal unit tests are handled
above by surefire plugin -->
<include>org/rhq/modules/plugins/jbossas7/itest/**/*Test.java</include>
<!--<include>org/rhq/modules/plugins/jbossas7/itest/standalone/StandaloneServerComponentTest.java</include>-->
+
<!--<include>org/rhq/modules/plugins/jbossas7/itest/standalone/InterruptibleOperationsTest.java</include>-->
<!--<include>org/rhq/modules/plugins/jbossas7/itest/domain/DomainServerComponentTest.java</include>-->
<!--<include>org/rhq/modules/plugins/jbossas7/itest/domain/SecurityModuleOptionsTest.java</include>-->
<!--<include>org/rhq/modules/plugins/jbossas7/itest/nonpc/ManagementConnectionPersistenceTest.java</include>-->
@@ -609,6 +618,7 @@
<jboss.domain.portOffset>${jboss.domain.portOffset}</jboss.domain.portOffset>
<jboss.domain.httpManagementPort>${jboss.domain.httpManagementPort}</jboss.domain.httpManagementPort>
<settings.localRepository>${settings.localRepository}</settings.localRepository>
+
<as7.itest.mock.http.management.server.port>${as7.itest.mock.http.management.server.port}</as7.itest.mock.http.management.server.port>
</systemPropertyVariables>
</configuration>
<executions>
diff --git
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/InterruptibleOperationsTest.java
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/InterruptibleOperationsTest.java
new file mode 100644
index 0000000..9597d47
--- /dev/null
+++
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/InterruptibleOperationsTest.java
@@ -0,0 +1,239 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+package org.rhq.modules.plugins.jbossas7.itest.standalone;
+
+import static java.util.concurrent.TimeUnit.SECONDS;
+import static org.mockito.Mockito.when;
+import static
org.rhq.core.pluginapi.event.log.LogFileEventResourceComponentHelper.LOG_EVENT_SOURCES_CONFIG_PROP;
+import static
org.rhq.modules.plugins.jbossas7.helper.ServerPluginConfiguration.Property.HOSTNAME;
+import static
org.rhq.modules.plugins.jbossas7.helper.ServerPluginConfiguration.Property.MANAGEMENT_CONNECTION_TIMEOUT;
+import static
org.rhq.modules.plugins.jbossas7.helper.ServerPluginConfiguration.Property.PASSWORD;
+import static
org.rhq.modules.plugins.jbossas7.helper.ServerPluginConfiguration.Property.PORT;
+import static
org.rhq.modules.plugins.jbossas7.helper.ServerPluginConfiguration.Property.USER;
+import static org.testng.Assert.assertEquals;
+
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.servlet.ServletContextHandler;
+import org.eclipse.jetty.servlet.ServletHolder;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.pluginapi.availability.AvailabilityContext;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.core.pluginapi.operation.OperationResult;
+import org.rhq.core.system.SystemInfoFactory;
+import org.rhq.core.util.StringUtil;
+import org.rhq.modules.plugins.jbossas7.StandaloneASComponent;
+import org.rhq.modules.plugins.jbossas7.json.Operation;
+import org.rhq.modules.plugins.jbossas7.json.Result;
+
+/**
+ * Check that management operations that might be interrupted by AS server (connection
closed before the http response
+ * is sent) don't make RHQ operations fail.
+ *
+ * See
https://bugzilla.redhat.com/show_bug.cgi?id=911321
+ *
+ * @author Thomas Segismont
+ */
+public class InterruptibleOperationsTest {
+
+ private static final Log LOG = LogFactory.getLog(InterruptibleOperationsTest.class);
+
+ private static final String HTTP_HOST = "localhost";
+
+ private static final int HTTP_PORT = 31159;
+
+ private static final String HTTP_PORT_VARIABLE =
"as7.itest.mock.http.management.server.port";
+
+ @Mock
+ private ResourceContext resourceContext;
+
+ private StandaloneASComponent serverComponent;
+
+ private Server jettyServer;
+
+ private ExecutorService executorService;
+
+ @BeforeMethod
+ private void setup() throws Exception {
+ MockitoAnnotations.initMocks(this);
+ serverComponent = new TestStandaloneASComponent();
+ int httpPort = getJettyPort();
+ setupResourceContext(httpPort);
+ setupJettyServer(httpPort);
+ jettyServer.start();
+ executorService = Executors.newSingleThreadExecutor();
+ serverComponent.start(resourceContext);
+ }
+
+ private void setupJettyServer(int httpPort) {
+ jettyServer = new Server(new InetSocketAddress(HTTP_HOST, httpPort));
+ ServletContextHandler context = new
ServletContextHandler(ServletContextHandler.SESSIONS);
+ context.setContextPath("/");
+ jettyServer.setHandler(context);
+ HttpServlet testServlet = new TestServlet();
+ context.addServlet(new ServletHolder(testServlet), "/*");
+ }
+
+ private static int getJettyPort() {
+ String httpPortVariable = System.getProperty(HTTP_PORT_VARIABLE);
+ if (StringUtil.isNotBlank(httpPortVariable)) {
+ try {
+ int port = Integer.parseInt(httpPortVariable);
+ LOG.info("Using port " + httpPortVariable + " for http
server");
+ return port;
+ } catch (NumberFormatException e) {
+ LOG.warn("Invalid port variable: " + httpPortVariable);
+ }
+ }
+ LOG.info("Using default port " + String.valueOf(HTTP_PORT) + " for
http server");
+ return HTTP_PORT;
+ }
+
+ private void setupResourceContext(int httpPort) {
+
when(resourceContext.getPluginConfiguration()).thenReturn(pluginConfig(httpPort));
+ when(resourceContext.getResourceKey()).thenReturn("/TestServer");
+
when(resourceContext.getSystemInformation()).thenReturn(SystemInfoFactory.createJavaSystemInfo());
+
when(resourceContext.getAvailabilityContext()).thenReturn(Mockito.mock(AvailabilityContext.class));
+ }
+
+ private Configuration pluginConfig(int httpPort) {
+ Configuration pluginConfig = new Configuration();
+ pluginConfig.setSimpleValue(HOSTNAME, "localhost");
+ pluginConfig.setSimpleValue(PORT, String.valueOf(httpPort));
+ pluginConfig.setSimpleValue(USER, "pipo");
+ pluginConfig.setSimpleValue(PASSWORD, "molo");
+ pluginConfig.setSimpleValue(MANAGEMENT_CONNECTION_TIMEOUT, "-1");
+ pluginConfig.getMap().put(LOG_EVENT_SOURCES_CONFIG_PROP, new PropertyList());
+ return pluginConfig;
+ }
+
+ @AfterMethod
+ private void tearDown() throws Exception {
+ LOG.info("Shutting down Jetty test server");
+ try {
+ if (jettyServer != null) {
+ jettyServer.stop();
+ }
+ } catch (Exception ignore) {
+ }
+ if (executorService != null) {
+ executorService.shutdownNow();
+ }
+ }
+
+ @Test(timeOut = 60 * 1000)
+ public void testReloadOperation() throws Exception {
+ OperationResult operationResult =
serverComponent.invokeOperation("reload", new Configuration());
+ assertEquals(operationResult.getSimpleResult(), "Success");
+ }
+
+ @Test(timeOut = 60 * 1000)
+ public void testShutdown() throws Exception {
+ OperationResult operationResult =
serverComponent.invokeOperation("shutdown", new Configuration());
+ assertEquals(operationResult.getSimpleResult(), "Success");
+ }
+
+ private class RestartJetty implements Runnable {
+ @Override
+ public void run() {
+ try {
+ jettyServer.stop();
+ } catch (Exception ignore) {
+ }
+ try {
+ Thread.sleep(SECONDS.toMillis(2));
+ } catch (Exception ignore) {
+ }
+ try {
+ jettyServer.start();
+ } catch (Exception ignore) {
+ }
+ }
+ }
+
+ private class TestServlet extends HttpServlet {
+
+ private ObjectMapper objectMapper = new ObjectMapper();
+
+ @Override
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
+ Operation operation = objectMapper.readValue(req.getInputStream(),
Operation.class);
+ // Check if we recevied an operation which a real http management interface
might interrupt
+ if (operation.getOperation().equals("reload") ||
operation.getOperation().equals("shutdown")) {
+ // Schedule a Jetty restart
+ executorService.submit(new RestartJetty());
+ // Then wait until Jetty is shutdown
+ try {
+ Thread.sleep(Long.MAX_VALUE);
+ } catch (InterruptedException ignore) {
+ }
+ return;
+ }
+ // Standard operation. Return simple success
+ Result result = new Result();
+ result.setOutcome("success");
+ objectMapper.writeValue(resp.getOutputStream(), result);
+ }
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
+ doPost(req, resp);
+ }
+
+ }
+
+ // Tweak StandaloneASComponent implementation for this test case
+ private class TestStandaloneASComponent extends StandaloneASComponent {
+
+ @Override
+ public AvailabilityType getAvailability() {
+ // Avoid various management requests when component is started
+ return AvailabilityType.DOWN;
+ }
+
+ @Override
+ protected boolean waitUntilDown() throws InterruptedException {
+ // Standard implementation relies on discovery of some resource properties
+ return true;
+ }
+ }
+
+}
commit 1dba477c3fc0034a5a21960db8447fa9b43f5a56
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Fri May 3 17:10:53 2013 -0500
[BZ 959591] Add back specific ant version based on local pom variables to force the
download of the dependency even if not directly used in the pom. Without this, the pom
would assume that the version referred here is the version from parent poms. This can
cause the submodule artifact to miss ant binaries if not already in the local maven
repository.
(cherry picked from commit 2bb45d3c4c9d5edc71acf4380ce7a10a93937aae)
diff --git a/modules/enterprise/agentupdate/pom.xml
b/modules/enterprise/agentupdate/pom.xml
index ddec938..3b66b92 100644
--- a/modules/enterprise/agentupdate/pom.xml
+++ b/modules/enterprise/agentupdate/pom.xml
@@ -37,12 +37,14 @@
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
+ <version>${ant.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-launcher</artifactId>
+ <version>${ant.version}</version>
<scope>provided</scope>
</dependency>
commit 17865107e38aa503c35f5a608cc1972c09bf5a73
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Fri May 3 15:01:26 2013 -0700
[BZ 958754] - d3 multi-line chart: time units should have minutes when appropriate.
Added the appropriate d3 time format string and updated the nvd3 chart library neither of
which fixed the issue. It appears to be an error in nvd3 chart library.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/MetricNvd3BarChartGraph.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/MetricNvd3BarChartGraph.java
index 1fec750..a2de9c6 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/MetricNvd3BarChartGraph.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/MetricNvd3BarChartGraph.java
@@ -19,7 +19,7 @@
package org.rhq.enterprise.gui.coregui.client.inventory.common.charttype;
/**
- * Contains the chart definition for a Bar Chart Graph.
+ * Contains the chart definition for a MultiLine Graph.
*
* @author Mike Thompson
*/
@@ -39,7 +39,7 @@ public final class MetricNvd3BarChartGraph extends AbstractGraph
*/
public native void drawJsniChart() /*-{
console.log("Draw NVD3 Bar jsni chart");
- console.time("multiChart")
+ console.time("multiChart");
var global = this,
chartId =
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.MetricGraphData::getChartId()(),
chartHandle = "#rChart-"+chartId,
@@ -49,7 +49,7 @@ public final class MetricNvd3BarChartGraph extends AbstractGraph
yAxisUnits =
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.MetricGraphData::getYAxisUnits()(),
xAxisLabel =
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.MetricGraphData::getXAxisTitle()(),
displayDayOfWeek =
global.@org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.MetricGraphData::shouldDisplayDayOfWeekInXAxisLabel()(),
- xAxisTimeFormat = (displayDayOfWeek) ? "%a %I %p" : "%I
%p",
+ xAxisTimeFormat = (displayDayOfWeek) ? "%a %I %p" : "%I : %M
%p",
// nvd3 defines their json models a standard way (same model for other graphs)
data = function() {
@@ -63,7 +63,7 @@ public final class MetricNvd3BarChartGraph extends AbstractGraph
};
$wnd.nv.addGraph(function() {
var chart = $wnd.nv.models.multiBarChart()
- .showControls(false)
+ .showControls(true)
.tooltips(true);
chart.xAxis.axisLabel(xAxisLabel)
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/css/nv.d3.css
b/modules/enterprise/gui/coregui/src/main/webapp/css/nv.d3.css
index cc40dfb..163b9a8 100755
--- a/modules/enterprise/gui/coregui/src/main/webapp/css/nv.d3.css
+++ b/modules/enterprise/gui/coregui/src/main/webapp/css/nv.d3.css
@@ -18,8 +18,8 @@
.nvtooltip {
position: absolute;
background-color: rgba(255,255,255,1);
- padding: 10px;
- border: 1px solid #ddd;
+ padding: 1px;
+ border: 1px solid rgba(0,0,0,.2);
z-index: 10000;
font-family: Arial;
@@ -33,12 +33,13 @@
-moz-transition-delay: 500ms;
-webkit-transition-delay: 500ms;
- -moz-box-shadow: 4px 4px 8px rgba(0,0,0,.5);
- -webkit-box-shadow: 4px 4px 8px rgba(0,0,0,.5);
- box-shadow: 4px 4px 8px rgba(0,0,0,.5);
+ -moz-box-shadow: 0 5px 10px rgba(0,0,0,.2);
+ -webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2);
+ box-shadow: 0 5px 10px rgba(0,0,0,.2);
- -moz-border-radius: 10px;
- border-radius: 10px;
+ -webkit-border-radius: 6px;
+ -moz-border-radius: 6px;
+ border-radius: 6px;
pointer-events: none;
@@ -50,15 +51,29 @@
user-select: none;
}
+.nvtooltip.x-nvtooltip,
+.nvtooltip.y-nvtooltip {
+ padding: 8px;
+}
+
.nvtooltip h3 {
margin: 0;
- padding: 0;
+ padding: 4px 14px;
+ line-height: 18px;
+ font-weight: normal;
+ background-color: #f7f7f7;
text-align: center;
+
+ border-bottom: 1px solid #ebebeb;
+
+ -webkit-border-radius: 5px 5px 0 0;
+ -moz-border-radius: 5px 5px 0 0;
+ border-radius: 5px 5px 0 0;
}
.nvtooltip p {
margin: 0;
- padding: 0;
+ padding: 5px 14px;
text-align: center;
}
@@ -93,7 +108,7 @@ svg {
svg text {
- font: normal 12px sans-serif;
+ font: normal 12px Arial;
}
svg .title {
@@ -101,7 +116,8 @@ svg .title {
}
.nvd3 .nv-background {
- fill: none;
+ fill: white;
+ fill-opacity: 0;
/*
pointer-events: none;
*/
@@ -109,7 +125,7 @@ svg .title {
.nvd3.nv-noData {
font-size: 18px;
- font-weight: bolf;
+ font-weight: bold;
}
@@ -197,12 +213,10 @@ svg .title {
.nvd3 .nv-bars .negative rect {
zfill: brown;
- cursor: pointer;
}
.nvd3 .nv-bars rect {
zfill: steelblue;
- cursor: pointer;
fill-opacity: .75;
transition: fill-opacity 250ms linear;
@@ -226,10 +240,6 @@ svg .title {
fill: rgba(0,0,0,1);
}
-.nvd3 .nv-x.nv-axis text {
- transform: rotate(90);
-}
-
/**********
* Bars
@@ -302,10 +312,10 @@ svg .title {
.nvd3 .nv-groups path.nv-line {
fill: none;
stroke-width: 2.5px;
+ /*
stroke-linecap: round;
shape-rendering: geometricPrecision;
- /*
transition: stroke-width 250ms linear;
-moz-transition: stroke-width 250ms linear;
-webkit-transition: stroke-width 250ms linear;
@@ -318,10 +328,10 @@ svg .title {
.nvd3 .nv-groups path.nv-area {
stroke: none;
+ /*
stroke-linecap: round;
shape-rendering: geometricPrecision;
- /*
stroke-width: 2.5px;
transition: stroke-width 250ms linear;
-moz-transition: stroke-width 250ms linear;
@@ -350,8 +360,8 @@ svg .title {
}
.nvd3.nv-scatter.nv-single-point .nv-groups .nv-point {
- fill-opacity: .5;
- stroke-opacity: .5;
+ fill-opacity: .5 !important;
+ stroke-opacity: .5 !important;
}
@@ -397,9 +407,11 @@ svg .title {
* Scatter
*/
+/* **Attempting to remove this for useVoronoi(false), need to see if it's required
anywhere
.nvd3 .nv-groups .nv-point {
pointer-events: none;
}
+*/
.nvd3 .nv-groups .nv-point.hover {
stroke-width: 20px;
@@ -485,21 +497,27 @@ svg .title {
* Bullet
*/
-.nvd3.nv-bullet { font: 10px sans-serif; cursor: pointer; }
-.nvd3.nv-bullet rect { fill-opacity: .6; }
-.nvd3.nv-bullet rect:hover { fill-opacity: 1; }
+.nvd3.nv-bullet { font: 10px sans-serif; }
+.nvd3.nv-bullet .nv-measure { fill-opacity: .8; }
+.nvd3.nv-bullet .nv-measure:hover { fill-opacity: 1; }
.nvd3.nv-bullet .nv-marker { stroke: #000; stroke-width: 2px; }
.nvd3.nv-bullet .nv-markerTriangle { stroke: #000; fill: #fff; stroke-width: 1.5px; }
.nvd3.nv-bullet .nv-tick line { stroke: #666; stroke-width: .5px; }
.nvd3.nv-bullet .nv-range.nv-s0 { fill: #eee; }
.nvd3.nv-bullet .nv-range.nv-s1 { fill: #ddd; }
.nvd3.nv-bullet .nv-range.nv-s2 { fill: #ccc; }
-.nvd3.nv-bullet .nv-measure.nv-s0 { fill: steelblue; }
-.nvd3.nv-bullet .nv-measure.nv-s1 { fill: darkblue; }
.nvd3.nv-bullet .nv-title { font-size: 14px; font-weight: bold; }
.nvd3.nv-bullet .nv-subtitle { fill: #999; }
+.nvd3.nv-bullet .nv-range {
+ fill: #999;
+ fill-opacity: .4;
+}
+.nvd3.nv-bullet .nv-range:hover {
+ fill-opacity: .7;
+}
+
/**********
@@ -515,7 +533,7 @@ svg .title {
}
.nvd3.nv-sparklineplus .nv-hoverValue line {
- stroke: #f44;
+ stroke: #333;
stroke-width: 1.5px;
}
@@ -531,8 +549,11 @@ svg .title {
.nvd3.nv-sparklineplus .nv-xValue,
.nvd3.nv-sparklineplus .nv-yValue {
+ /*
stroke: #666;
- font-size: .5em;
+ */
+ stroke-width: 0;
+ font-size: .9em;
font-weight: normal;
}
@@ -540,6 +561,24 @@ svg .title {
stroke: #f66;
}
+.nvd3.nv-sparklineplus .nv-maxValue {
+ stroke: #2ca02c;
+ fill: #2ca02c;
+}
+
+.nvd3.nv-sparklineplus .nv-minValue {
+ stroke: #d62728;
+ fill: #d62728;
+}
+
+.nvd3.nv-sparklineplus .nv-currentValue {
+ /*
+ stroke: #444;
+ fill: #000;
+ */
+ font-weight: bold;
+ font-size: 1.1em;
+}
/**********
* historical stock
@@ -629,4 +668,35 @@ svg .title {
*/
}
+/**********
+* Parallel Coordinates
+*/
+
+.nvd3 .background path {
+ fill: none;
+ stroke: #ccc;
+ stroke-opacity: .4;
+ shape-rendering: crispEdges;
+}
+
+.nvd3 .foreground path {
+ fill: none;
+ stroke: steelblue;
+ stroke-opacity: .7;
+}
+
+.nvd3 .brush .extent {
+ fill-opacity: .3;
+ stroke: #fff;
+ shape-rendering: crispEdges;
+}
+
+.nvd3 .axis line, .axis path {
+ fill: none;
+ stroke: #000;
+ shape-rendering: crispEdges;
+}
+.nvd3 .axis text {
+ text-shadow: 0 1px 0 #fff;
+}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/js/nv.d3.js
b/modules/enterprise/gui/coregui/src/main/webapp/js/nv.d3.js
index 2fe2c64..e405d2e 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/js/nv.d3.js
+++ b/modules/enterprise/gui/coregui/src/main/webapp/js/nv.d3.js
@@ -36,29 +36,34 @@ if (nv.dev) {
// Logs all arguments, and returns the last so you can test things in place
nv.log = function() {
- if (nv.dev && console.log && console.log.apply)
console.log.apply(console, arguments);
+ if (nv.dev && console.log && console.log.apply)
+ console.log.apply(console, arguments)
+ else if (nv.dev && console.log && Function.prototype.bind) {
+ var log = Function.prototype.bind.call(console.log, console);
+ log.apply(console, arguments);
+ }
return arguments[arguments.length - 1];
};
nv.render = function render(step) {
- step = step || 1; // number of graphs to generate in each timout loop
+ step = step || 1; // number of graphs to generate in each timeout loop
- render.active = true;
+ nv.render.active = true;
nv.dispatch.render_start();
setTimeout(function() {
- var chart;
+ var chart, graph;
- for (var i = 0; i < step && (graph = render.queue[i]); i++) {
+ for (var i = 0; i < step && (graph = nv.render.queue[i]); i++) {
chart = graph.generate();
if (typeof graph.callback == typeof(Function)) graph.callback(chart);
nv.graphs.push(chart);
}
- render.queue.splice(0, i);
+ nv.render.queue.splice(0, i);
- if (render.queue.length) setTimeout(arguments.callee, 0);
+ if (nv.render.queue.length) setTimeout(arguments.callee, 0);
else { nv.render.active = false; nv.dispatch.render_end(); }
}, 0);
};
@@ -114,7 +119,7 @@ d3.time.monthEnds = d3_time_range(d3.time.monthEnd, function(date) {
/*****
- * A no frills tooltip implementation.
+ * A no-frills tooltip implementation.
*****/
@@ -143,39 +148,67 @@ d3.time.monthEnds = d3_time_range(d3.time.monthEnd, function(date)
{
width = parseInt(container.offsetWidth),
windowWidth = nv.utils.windowSize().width,
windowHeight = nv.utils.windowSize().height,
- scrollTop = body.scrollTop,
- scrollLeft = body.scrollLeft,
+ scrollTop = window.scrollY,
+ scrollLeft = window.scrollX,
left, top;
+ windowHeight = window.innerWidth >= document.body.scrollWidth ? windowHeight :
windowHeight - 16;
+ windowWidth = window.innerHeight >= document.body.scrollHeight ? windowWidth :
windowWidth - 16;
+
+ var tooltipTop = function ( Elem ) {
+ var offsetTop = top;
+ do {
+ if( !isNaN( Elem.offsetTop ) ) {
+ offsetTop += (Elem.offsetTop);
+ }
+ } while( Elem = Elem.offsetParent );
+ return offsetTop;
+ }
+
+ var tooltipLeft = function ( Elem ) {
+ var offsetLeft = left;
+ do {
+ if( !isNaN( Elem.offsetLeft ) ) {
+ offsetLeft += (Elem.offsetLeft);
+ }
+ } while( Elem = Elem.offsetParent );
+ return offsetLeft;
+ }
switch (gravity) {
case 'e':
left = pos[0] - width - dist;
top = pos[1] - (height / 2);
- if (left < scrollLeft) left = pos[0] + dist;
- if (top < scrollTop) top = scrollTop + 5;
- if (top + height > scrollTop + windowHeight) top = scrollTop - height - 5;
+ var tLeft = tooltipLeft(container);
+ var tTop = tooltipTop(container);
+ if (tLeft < scrollLeft) left = pos[0] + dist > scrollLeft ? pos[0] + dist :
scrollLeft - tLeft + left;
+ if (tTop < scrollTop) top = scrollTop - tTop + top;
+ if (tTop + height > scrollTop + windowHeight) top = scrollTop + windowHeight -
tTop + top - height;
break;
case 'w':
left = pos[0] + dist;
top = pos[1] - (height / 2);
- if (left + width > windowWidth) left = pos[0] - width - dist;
- if (top < scrollTop) top = scrollTop + 5;
- if (top + height > scrollTop + windowHeight) top = scrollTop - height - 5;
+ if (tLeft + width > windowWidth) left = pos[0] - width - dist;
+ if (tTop < scrollTop) top = scrollTop + 5;
+ if (tTop + height > scrollTop + windowHeight) top = scrollTop - height - 5;
break;
case 'n':
- left = pos[0] - (width / 2);
+ left = pos[0] - (width / 2) - 5;
top = pos[1] + dist;
- if (left < scrollLeft) left = scrollLeft + 5;
- if (left + width > windowWidth) left = windowWidth - width - 5;
- if (top + height > scrollTop + windowHeight) top = pos[1] - height - dist;
+ var tLeft = tooltipLeft(container);
+ var tTop = tooltipTop(container);
+ if (tLeft < scrollLeft) left = scrollLeft + 5;
+ if (tLeft + width > windowWidth) left = left - width/2 + 5;
+ if (tTop + height > scrollTop + windowHeight) top = scrollTop + windowHeight -
tTop + top - height;
break;
case 's':
left = pos[0] - (width / 2);
top = pos[1] - height - dist;
- if (left < scrollLeft) left = scrollLeft + 5;
- if (left + width > windowWidth) left = windowWidth - width - 5;
- if (scrollTop > top) top = pos[1] + 20;
+ var tLeft = tooltipLeft(container);
+ var tTop = tooltipTop(container);
+ if (tLeft < scrollLeft) left = scrollLeft + 5;
+ if (tLeft + width > windowWidth) left = left - width/2 + 5;
+ if (scrollTop > tTop) top = scrollTop;
break;
}
@@ -243,7 +276,7 @@ nv.utils.windowSize = function() {
// Easy way to bind multiple functions to window.onresize
-// TODO: give a way to remove a function after its bound, other than removing alkl of
them
+// TODO: give a way to remove a function after its bound, other than removing all of
them
nv.utils.windowResize = function(fun){
var oldresize = window.onresize;
@@ -255,7 +288,7 @@ nv.utils.windowResize = function(fun){
// Backwards compatible way to implement more d3-like coloring of graphs.
// If passed an array, wrap it in a function which implements the old default
-// behaviour
+// behavior
nv.utils.getColor = function(color) {
if (!arguments.length) return nv.utils.defaultColor(); //if you pass in nothing, get
default colors back
@@ -263,7 +296,7 @@ nv.utils.getColor = function(color) {
return function(d, i) { return d.color || color[i % color.length]; };
else
return color;
- //can't really help it if someone passes rubish as color
+ //can't really help it if someone passes rubbish as color
}
// Default color chooser uses the index of an object as before.
@@ -328,7 +361,7 @@ nv.models.axis = function() {
;
var margin = {top: 0, right: 0, bottom: 0, left: 0}
- , width = 60 //only used for tickLabel currently
+ , width = 75 //only used for tickLabel currently
, height = 60 //only used for tickLabel currently
, scale = d3.scale.linear()
, axisLabelText = null
@@ -337,6 +370,7 @@ nv.models.axis = function() {
, rotateLabels = 0
, rotateYLabel = true
, staggerLabels = false
+ , isOrdinal = false
, ticks = null
;
@@ -398,11 +432,11 @@ nv.models.axis = function() {
axisLabel.exit().remove();
switch (axis.orient()) {
case 'top':
- axisLabel.enter().append('text').attr('class',
'nv-axislabel')
- .attr('text-anchor', 'middle')
- .attr('y', 0);
+ axisLabel.enter().append('text').attr('class',
'nv-axislabel');
var w = (scale.range().length==2) ? scale.range()[1] :
(scale.range()[scale.range().length-1]+(scale.range()[1]-scale.range()[0]));
axisLabel
+ .attr('text-anchor', 'middle')
+ .attr('y', 0)
.attr('x', w/2);
if (showMaxMin) {
var axisMaxMin = wrap.selectAll('g.nv-axisMaxMin')
@@ -428,7 +462,7 @@ nv.models.axis = function() {
}
break;
case 'bottom':
- var xLabelMargin = 30;
+ var xLabelMargin = 36;
var maxTextWidth = 30;
var xTicks = g.selectAll('g').select("text");
if (rotateLabels%360) {
@@ -445,20 +479,22 @@ nv.models.axis = function() {
.attr('transform', function(d,i,j) { return 'rotate(' +
rotateLabels + ' 0,0)' })
.attr('text-anchor', rotateLabels%360 > 0 ? 'start' :
'end');
}
- axisLabel.enter().append('text').attr('class',
'nv-axislabel')
- .attr('text-anchor', 'middle')
- .attr('y', xLabelMargin);
+ axisLabel.enter().append('text').attr('class',
'nv-axislabel');
var w = (scale.range().length==2) ? scale.range()[1] :
(scale.range()[scale.range().length-1]+(scale.range()[1]-scale.range()[0]));
axisLabel
+ .attr('text-anchor', 'middle')
+ .attr('y', xLabelMargin)
.attr('x', w/2);
if (showMaxMin) {
+ //if (showMaxMin && !isOrdinal) {
var axisMaxMin = wrap.selectAll('g.nv-axisMaxMin')
- .data(scale.domain());
+ //.data(scale.domain())
+ .data([scale.domain()[0], scale.domain()[scale.domain().length
- 1]]);
axisMaxMin.enter().append('g').attr('class',
'nv-axisMaxMin').append('text');
axisMaxMin.exit().remove();
axisMaxMin
.attr('transform', function(d,i) {
- return 'translate(' + scale(d) + ',0)'
+ return 'translate(' + (scale(d) + (isOrdinal ?
scale.rangeBand() / 2 : 0)) + ',0)'
})
.select('text')
.attr('dy', '.71em')
@@ -471,7 +507,9 @@ nv.models.axis = function() {
});
d3.transition(axisMaxMin)
.attr('transform', function(d,i) {
- return 'translate(' + scale.range()[i] + ',0)'
+ //return 'translate(' + scale.range()[i] + ',0)'
+ //return 'translate(' + scale(d) + ',0)'
+ return 'translate(' + (scale(d) + (isOrdinal ?
scale.rangeBand() / 2 : 0)) + ',0)'
});
}
if (staggerLabels)
@@ -480,11 +518,11 @@ nv.models.axis = function() {
break;
case 'right':
- axisLabel.enter().append('text').attr('class',
'nv-axislabel')
+ axisLabel.enter().append('text').attr('class',
'nv-axislabel');
+ axisLabel
.attr('text-anchor', rotateYLabel ? 'middle' :
'begin')
.attr('transform', rotateYLabel ? 'rotate(90)' :
'')
- .attr('y', rotateYLabel ? (-Math.max(margin.right,width) - 12) :
-10); //TODO: consider calculating this based on largest tick width... OR at least expose
this on chart
- axisLabel
+ .attr('y', rotateYLabel ? (-Math.max(margin.right,width) + 12) :
-10) //TODO: consider calculating this based on largest tick width... OR at least expose
this on chart
.attr('x', rotateYLabel ? (scale.range()[0] / 2) :
axis.tickPadding());
if (showMaxMin) {
var axisMaxMin = wrap.selectAll('g.nv-axisMaxMin')
@@ -514,11 +552,19 @@ nv.models.axis = function() {
}
break;
case 'left':
- axisLabel.enter().append('text').attr('class',
'nv-axislabel')
+ /*
+ //For dynamically placing the label. Can be used with dynamically-sized chart
axis margins
+ var yTicks = g.selectAll('g').select("text");
+ yTicks.each(function(d,i){
+ var labelPadding = this.getBBox().width + axis.tickPadding() + 16;
+ if(labelPadding > width) width = labelPadding;
+ });
+ */
+ axisLabel.enter().append('text').attr('class',
'nv-axislabel');
+ axisLabel
.attr('text-anchor', rotateYLabel ? 'middle' :
'end')
.attr('transform', rotateYLabel ? 'rotate(-90)' :
'')
- .attr('y', rotateYLabel ? (-Math.max(margin.left,width) + 12) :
-10); //TODO: consider calculating this based on largest tick width... OR at least expose
this on chart
- axisLabel
+ .attr('y', rotateYLabel ? (-Math.max(margin.left,width) + 12) :
-10) //TODO: consider calculating this based on largest tick width... OR at least expose
this on chart
.attr('x', rotateYLabel ? (-scale.range()[0] / 2) :
-axis.tickPadding());
if (showMaxMin) {
var axisMaxMin = wrap.selectAll('g.nv-axisMaxMin')
@@ -552,27 +598,41 @@ nv.models.axis = function() {
.text(function(d) { return d });
- //check if max and min overlap other values, if so, hide the values that overlap
if (showMaxMin && (axis.orient() === 'left' || axis.orient() ===
'right')) {
+ //check if max and min overlap other values, if so, hide the values that overlap
g.selectAll('g') // the g's wrapping each tick
.each(function(d,i) {
+ d3.select(this).select('text').attr('opacity', 1);
if (scale(d) < scale.range()[1] + 10 || scale(d) > scale.range()[0] -
10) { // 10 is assuming text height is 16... if d is 0, leave it!
if (d > 1e-10 || d < -1e-10) // accounts for minor floating point
errors... though could be problematic if the scale is EXTREMELY SMALL
- d3.select(this).remove();
- else
- d3.select(this).select('text').remove(); // Don't remove
the ZERO line!!
+ d3.select(this).attr('opacity', 0);
+
+ d3.select(this).select('text').attr('opacity', 0); //
Don't remove the ZERO line!!
}
});
+
+ //if Max and Min = 0 only show min, Issue #281
+ if (scale.domain()[0] == scale.domain()[1] && scale.domain()[0] == 0)
+ wrap.selectAll('g.nv-axisMaxMin')
+ .style('opacity', function(d,i) { return !i ? 1 : 0 });
+
}
if (showMaxMin && (axis.orient() === 'top' || axis.orient() ===
'bottom')) {
var maxMinRange = [];
wrap.selectAll('g.nv-axisMaxMin')
.each(function(d,i) {
- if (i) // i== 1, max position
- maxMinRange.push(scale(d) - this.getBBox().width - 4) //assuming the max
and min labels are as wide as the next tick (with an extra 4 pixels just in case)
- else // i==0, min position
- maxMinRange.push(scale(d) + this.getBBox().width + 4)
+ try {
+ if (i) // i== 1, max position
+ maxMinRange.push(scale(d) - this.getBBox().width - 4) //assuming
the max and min labels are as wide as the next tick (with an extra 4 pixels just in case)
+ else // i==0, min position
+ maxMinRange.push(scale(d) + this.getBBox().width + 4)
+ }catch (err) {
+ if (i) // i== 1, max position
+ maxMinRange.push(scale(d) - 4) //assuming the max and min labels
are as wide as the next tick (with an extra 4 pixels just in case)
+ else // i==0, min position
+ maxMinRange.push(scale(d) + 4)
+ }
});
g.selectAll('g') // the g's wrapping each tick
.each(function(d,i) {
@@ -660,6 +720,7 @@ nv.models.axis = function() {
if (!arguments.length) return scale;
scale = _;
axis.scale(scale);
+ isOrdinal = typeof scale.rangeBands === 'function';
d3.rebind(chart, scale, 'domain', 'range', 'rangeBand',
'rangeBands');
return chart;
}
@@ -705,6 +766,7 @@ nv.models.historicalBar = function() {
, getY = function(d) { return d.y }
, forceX = []
, forceY = [0]
+ , padData = false
, clipEdge = true
, color = nv.utils.defaultColor()
, xDomain
@@ -726,9 +788,13 @@ nv.models.historicalBar = function() {
// Setup Scales
x .domain(xDomain || d3.extent(data[0].values.map(getX).concat(forceX) ))
- .range([0, availableWidth]);
- y .domain(yDomain || d3.extent(data[0].values.map(getY).concat(forceY) ))
+ if (padData)
+ x.range([availableWidth * .5 / data[0].values.length, availableWidth *
(data[0].values.length - .5) / data[0].values.length ]);
+ else
+ x.range([0, availableWidth]);
+
+ y .domain(yDomain || d3.extent(data[0].values.map(getY).concat(forceY) ))
.range([availableHeight, 0]);
// If scale's domain don't have a range, slightly adjust to make one... so
a chart can show a single data point
@@ -846,13 +912,20 @@ nv.models.historicalBar = function() {
bars
.attr('fill', function(d,i) { return color(d, i); })
.attr('class', function(d,i,j) { return (getY(d,i) < 0 ? 'nv-bar
negative' : 'nv-bar positive') + ' nv-bar-' + j + '-' + i })
- .attr('transform', function(d,i) { return 'translate(' +
(x(getX(d,i)) - ((availableWidth / data[0].values.length) * .5)) + ',0)'; })
//TODO: better width calculations that don't assume always uniform data spacing;w
+ .attr('transform', function(d,i) { return 'translate(' +
(x(getX(d,i)) - availableWidth / data[0].values.length * .45) + ',0)'; }) //TODO:
better width calculations that don't assume always uniform data spacing;w
.attr('width', (availableWidth / data[0].values.length) * .9 )
d3.transition(bars)
- .attr('y', function(d,i) { return y(Math.max(0, getY(d,i))) })
- .attr('height', function(d,i) { return Math.abs(y(getY(d,i)) - y(0))
});
+ //.attr('y', function(d,i) { return y(Math.max(0, getY(d,i))) })
+ .attr('y', function(d,i) {
+ return getY(d,i) < 0 ?
+ y(0) :
+ y(0) - y(getY(d,i)) < 1 ?
+ y(0) - 1 :
+ y(getY(d,i))
+ })
+ .attr('height', function(d,i) { return Math.max(Math.abs(y(getY(d,i)) -
y(0)),1) });
//.order(); // not sure if this makes any sense for this model
});
@@ -936,6 +1009,12 @@ nv.models.historicalBar = function() {
return chart;
};
+ chart.padData = function(_) {
+ if (!arguments.length) return padData;
+ padData = _;
+ return chart;
+ };
+
chart.clipEdge = function(_) {
if (!arguments.length) return clipEdge;
clipEdge = _;
@@ -980,6 +1059,7 @@ nv.models.bullet = function() {
, width = 380
, height = 30
, tickFormat = null
+ , color = nv.utils.getColor(['#1f77b4'])
, dispatch = d3.dispatch('elementMouseover', 'elementMouseout')
;
@@ -1002,7 +1082,7 @@ nv.models.bullet = function() {
// Compute the new x-scale.
var x1 = d3.scale.linear()
- .domain([0, Math.max(rangez[0], markerz[0], measurez[0])]) // TODO: need to
allow forceX and forceY, and xDomain, yDomain
+ .domain( d3.extent(d3.merge([forceX, rangez])) )
.range(reverse ? [availableWidth, 0] : [0, availableWidth]);
// Retrieve the old x-scale, if this is an update.
@@ -1013,6 +1093,11 @@ nv.models.bullet = function() {
// Stash the new scale.
this.__chart__ = x1;
+
+ var rangeMin = d3.min(rangez), //rangez[2]
+ rangeMax = d3.max(rangez), //rangez[0]
+ rangeAvg = rangez[1];
+
//------------------------------------------------------------
@@ -1024,6 +1109,12 @@ nv.models.bullet = function() {
var gEnter = wrapEnter.append('g');
var g = wrap.select('g');
+ gEnter.append('rect').attr('class', 'nv-range
nv-rangeMax');
+ gEnter.append('rect').attr('class', 'nv-range
nv-rangeAvg');
+ gEnter.append('rect').attr('class', 'nv-range
nv-rangeMin');
+ gEnter.append('rect').attr('class', 'nv-measure');
+ gEnter.append('path').attr('class', 'nv-markerTriangle');
+
wrap.attr('transform', 'translate(' + margin.left + ',' +
margin.top + ')');
//------------------------------------------------------------
@@ -1032,8 +1123,118 @@ nv.models.bullet = function() {
var w0 = function(d) { return Math.abs(x0(d) - x0(0)) }, // TODO: could optimize by
precalculating x0(0) and x1(0)
w1 = function(d) { return Math.abs(x1(d) - x1(0)) };
+ var xp0 = function(d) { return d < 0 ? x0(d) : x0(0) },
+ xp1 = function(d) { return d < 0 ? x1(d) : x1(0) };
+
+
+ g.select('rect.nv-rangeMax')
+ .attr('height', availableHeight)
+ .attr('width', w1(rangeMax > 0 ? rangeMax : rangeMin))
+ .attr('x', xp1(rangeMax > 0 ? rangeMax : rangeMin))
+ .datum(rangeMax > 0 ? rangeMax : rangeMin)
+ /*
+ .attr('x', rangeMin < 0 ?
+ rangeMax > 0 ?
+ x1(rangeMin)
+ : x1(rangeMax)
+ : x1(0))
+ */
+
+ g.select('rect.nv-rangeAvg')
+ .attr('height', availableHeight)
+ .attr('width', w1(rangeAvg))
+ .attr('x', xp1(rangeAvg))
+ .datum(rangeAvg)
+ /*
+ .attr('width', rangeMax <= 0 ?
+ x1(rangeMax) - x1(rangeAvg)
+ : x1(rangeAvg) - x1(rangeMin))
+ .attr('x', rangeMax <= 0 ?
+ x1(rangeAvg)
+ : x1(rangeMin))
+ */
+
+ g.select('rect.nv-rangeMin')
+ .attr('height', availableHeight)
+ .attr('width', w1(rangeMax))
+ .attr('x', xp1(rangeMax))
+ .attr('width', w1(rangeMax > 0 ? rangeMin : rangeMax))
+ .attr('x', xp1(rangeMax > 0 ? rangeMin : rangeMax))
+ .datum(rangeMax > 0 ? rangeMin : rangeMax)
+ /*
+ .attr('width', rangeMax <= 0 ?
+ x1(rangeAvg) - x1(rangeMin)
+ : x1(rangeMax) - x1(rangeAvg))
+ .attr('x', rangeMax <= 0 ?
+ x1(rangeMin)
+ : x1(rangeAvg))
+ */
+
+ g.select('rect.nv-measure')
+ .style('fill', color)
+ .attr('height', availableHeight / 3)
+ .attr('y', availableHeight / 3)
+ .attr('width', measurez < 0 ?
+ x1(0) - x1(measurez[0])
+ : x1(measurez[0]) - x1(0))
+ .attr('x', xp1(measurez))
+ .on('mouseover', function() {
+ dispatch.elementMouseover({
+ value: measurez[0],
+ label: 'Current',
+ pos: [x1(measurez[0]), availableHeight/2]
+ })
+ })
+ .on('mouseout', function() {
+ dispatch.elementMouseout({
+ value: measurez[0],
+ label: 'Current'
+ })
+ })
+
+ var h3 = availableHeight / 6;
+ if (markerz[0]) {
+ g.selectAll('path.nv-markerTriangle')
+ .attr('transform', function(d) { return 'translate(' +
x1(markerz[0]) + ',' + (availableHeight / 2) + ')' })
+ .attr('d', 'M0,' + h3 + 'L' + h3 + ',' +
(-h3) + ' ' + (-h3) + ',' + (-h3) + 'Z')
+ .on('mouseover', function() {
+ dispatch.elementMouseover({
+ value: markerz[0],
+ label: 'Previous',
+ pos: [x1(markerz[0]), availableHeight/2]
+ })
+ })
+ .on('mouseout', function() {
+ dispatch.elementMouseout({
+ value: markerz[0],
+ label: 'Previous'
+ })
+ });
+ } else {
+ g.selectAll('path.nv-markerTriangle').remove();
+ }
+
+
+ wrap.selectAll('.nv-range')
+ .on('mouseover', function(d,i) {
+ var label = !i ? "Maximum" : i == 1 ? "Mean" :
"Minimum";
+
+ dispatch.elementMouseover({
+ value: d,
+ label: label,
+ pos: [x1(d), availableHeight/2]
+ })
+ })
+ .on('mouseout', function(d,i) {
+ var label = !i ? "Maximum" : i == 1 ? "Mean" :
"Minimum";
+ dispatch.elementMouseout({
+ value: d,
+ label: label
+ })
+ })
+/* // THIS IS THE PREVIOUS BULLET IMPLEMENTATION, WILL REMOVE SHORTLY
// Update the range rects.
var range = g.selectAll('rect.nv-range')
.data(rangez);
@@ -1069,6 +1270,7 @@ nv.models.bullet = function() {
measure.enter().append('rect')
.attr('class', function(d, i) { return 'nv-measure nv-s' + i;
})
+ .style('fill', function(d,i) { return color(d,i ) })
.attr('width', w0)
.attr('height', availableHeight / 3)
.attr('x', reverse ? x0 : 0)
@@ -1119,13 +1321,14 @@ nv.models.bullet = function() {
});
d3.transition(marker)
- .attr('transform', function(d) { return 'translate(' + x1(d) +
',' + (availableHeight / 2) + ')' });
+ .attr('transform', function(d) { return 'translate(' + (x1(d) -
x1(0)) + ',' + (availableHeight / 2) + ')' });
marker.exit().remove();
+*/
});
- d3.timer.flush();
+ // d3.timer.flush(); // Not needed?
return chart;
}
@@ -1199,6 +1402,12 @@ nv.models.bullet = function() {
return chart;
};
+ chart.color = function(_) {
+ if (!arguments.length) return color;
+ color = nv.utils.getColor(_);
+ return chart;
+ };
+
//============================================================
@@ -1271,9 +1480,7 @@ nv.models.bulletChart = function() {
//------------------------------------------------------------
// Display No Data message if there's nothing to show.
- /*
- // Disabled until I figure out a better way to check for no data with the bullet
chart
- if (!data || !data.length || !data.filter(function(d) { return d.values.length
}).length) {
+ if (!d || !ranges.call(this, d, i)) {
var noDataText = container.selectAll('.nv-noData').data([noData]);
noDataText.enter().append('text')
@@ -1283,14 +1490,13 @@ nv.models.bulletChart = function() {
noDataText
.attr('x', margin.left + availableWidth / 2)
- .attr('y', margin.top + availableHeight / 2)
+ .attr('y', 18 + margin.top + availableHeight / 2)
.text(function(d) { return d });
return chart;
} else {
container.selectAll('.nv-noData').remove();
}
- */
//------------------------------------------------------------
@@ -1382,7 +1588,7 @@ nv.models.bulletChart = function() {
// Update the tick groups.
var tick = g.selectAll('g.nv-tick')
- .data(x1.ticks( availableWidth / 100 ), function(d) {
+ .data(x1.ticks( availableWidth / 50 ), function(d) {
return this.textContent || format(d);
});
@@ -1467,6 +1673,8 @@ nv.models.bulletChart = function() {
chart.dispatch = dispatch;
chart.bullet = bullet;
+ d3.rebind(chart, bullet, 'color');
+
// left, right, top, bottom
chart.orient = function(x) {
if (!arguments.length) return orient;
@@ -1577,13 +1785,15 @@ nv.models.cumulativeLineChart = function() {
, x //can be accessed via chart.xScale()
, y //can be accessed via chart.yScale()
, id = lines.id()
+ , state = { index: 0, rescaleY: rescaleY }
+ , defaultState = null
, noData = 'No Data Available.'
- , dispatch = d3.dispatch('tooltipShow', 'tooltipHide')
+ , dispatch = d3.dispatch('tooltipShow', 'tooltipHide',
'stateChange', 'changeState')
;
xAxis
.orient('bottom')
- .tickPadding(5)
+ .tickPadding(7)
;
yAxis
.orient('left')
@@ -1610,24 +1820,32 @@ nv.models.cumulativeLineChart = function() {
nv.tooltip.show([left, top], content, null, null, offsetElement);
};
-
+/*
+ //Moved to see if we can get better behavior to fix issue #315
var indexDrag = d3.behavior.drag()
.on('dragstart', dragStart)
.on('drag', dragMove)
.on('dragend', dragEnd);
- function dragStart(d,i) {}
+ function dragStart(d,i) {
+ d3.select(chart.container)
+ .style('cursor', 'ew-resize');
+ }
function dragMove(d,i) {
d.x += d3.event.dx;
d.i = Math.round(dx.invert(d.x));
d3.select(this).attr('transform', 'translate(' + dx(d.i) +
',0)');
+ chart.update();
}
function dragEnd(d,i) {
+ d3.select(chart.container)
+ .style('cursor', 'auto');
chart.update();
}
+*/
//============================================================
@@ -1646,6 +1864,48 @@ nv.models.cumulativeLineChart = function() {
chart.update = function() { chart(selection) };
chart.container = this;
+ //set state.disabled
+ state.disabled = data.map(function(d) { return !!d.disabled });
+
+ if (!defaultState) {
+ var key;
+ defaultState = {};
+ for (key in state) {
+ if (state[key] instanceof Array)
+ defaultState[key] = state[key].slice(0);
+ else
+ defaultState[key] = state[key];
+ }
+ }
+
+ var indexDrag = d3.behavior.drag()
+ .on('dragstart', dragStart)
+ .on('drag', dragMove)
+ .on('dragend', dragEnd);
+
+
+ function dragStart(d,i) {
+ d3.select(chart.container)
+ .style('cursor', 'ew-resize');
+ }
+
+ function dragMove(d,i) {
+ index.x = d3.event.x;
+ index.i = Math.round(dx.invert(index.x));
+ updateZero();
+ }
+
+ function dragEnd(d,i) {
+ d3.select(chart.container)
+ .style('cursor', 'auto');
+
+ // update state and send stateChange with new index
+ state.index = index.i;
+ dispatch.stateChange(state);
+ }
+
+
+
//------------------------------------------------------------
// Display No Data message if there's nothing to show.
@@ -1684,6 +1944,9 @@ nv.models.cumulativeLineChart = function() {
.map(function(series,i) {
var initialDomain = d3.extent(series.values, lines.y());
+ //account for series being disabled when losing 95% or more
+ if (initialDomain[0] < -.95) initialDomain[0] = -.95;
+
return [
(initialDomain[0] - initialDomain[1]) / (1 + initialDomain[1]),
(initialDomain[1] - initialDomain[0]) / (1 + initialDomain[0])
@@ -1720,6 +1983,7 @@ nv.models.cumulativeLineChart = function() {
gEnter.append('g').attr('class', 'nv-x nv-axis');
gEnter.append('g').attr('class', 'nv-y nv-axis');
+ gEnter.append('g').attr('class', 'nv-background');
gEnter.append('g').attr('class', 'nv-linesWrap');
gEnter.append('g').attr('class', 'nv-legendWrap');
gEnter.append('g').attr('class', 'nv-controlsWrap');
@@ -1771,9 +2035,30 @@ nv.models.cumulativeLineChart = function() {
wrap.attr('transform', 'translate(' + margin.left + ',' +
margin.top + ')');
+ // Show error if series goes below 100%
+ var tempDisabled = data.filter(function(d) { return d.tempDisabled });
+
+ wrap.select('.tempDisabled').remove(); //clean-up and prevent duplicates
+ if (tempDisabled.length) {
+ wrap.append('text').attr('class', 'tempDisabled')
+ .attr('x', availableWidth / 2)
+ .attr('y', '-.71em')
+ .style('text-anchor', 'end')
+ .text(tempDisabled.map(function(d) { return d.key }).join(', ') +
' values cannot be calculated for this time period.');
+ }
+
+
+
//------------------------------------------------------------
// Main Chart Component(s)
+ gEnter.select('.nv-background')
+ .append('rect');
+
+ g.select('.nv-background rect')
+ .attr('width', availableWidth)
+ .attr('height', availableHeight);
+
lines
//.x(function(d) { return d.x })
.y(function(d) { return d.display.y })
@@ -1781,14 +2066,15 @@ nv.models.cumulativeLineChart = function() {
.height(availableHeight)
.color(data.map(function(d,i) {
return d.color || color(d, i);
- }).filter(function(d,i) { return !data[i].disabled }));
+ }).filter(function(d,i) { return !data[i].disabled &&
!data[i].tempDisabled }));
var linesWrap = g.select('.nv-linesWrap')
- .datum(data.filter(function(d) { return !d.disabled }))
+ .datum(data.filter(function(d) { return !d.disabled && !d.tempDisabled
}));
- d3.transition(linesWrap).call(lines);
+ //d3.transition(linesWrap).call(lines);
+ linesWrap.call(lines);
var indexLine = linesWrap.selectAll('.nv-indexLine')
@@ -1812,7 +2098,8 @@ nv.models.cumulativeLineChart = function() {
xAxis
.scale(x)
- .ticks( availableWidth / 100 )
+ //Suggest how many ticks based on the chart width and D3 should listen (70 is the
optimal number for MM/DD/YY dates)
+ .ticks( Math.min(data[0].values.length,availableWidth/70) )
.tickSize(-availableHeight, 0);
g.select('.nv-x.nv-axis')
@@ -1836,11 +2123,46 @@ nv.models.cumulativeLineChart = function() {
// Event Handling/Dispatching (in chart's scope)
//------------------------------------------------------------
+
+ function updateZero() {
+ indexLine
+ .data([index]);
+
+ chart.update();
+ }
+
+ g.select('.nv-background rect')
+ .on('click', function() {
+ index.x = d3.mouse(this)[0];
+ index.i = Math.round(dx.invert(index.x));
+
+ // update state and send stateChange with new index
+ state.index = index.i;
+ dispatch.stateChange(state);
+
+ updateZero();
+ });
+
+ lines.dispatch.on('elementClick', function(e) {
+ index.i = e.pointIndex;
+ index.x = dx(index.i);
+
+ // update state and send stateChange with new index
+ state.index = index.i;
+ dispatch.stateChange(state);
+
+ updateZero();
+ });
+
controls.dispatch.on('legendClick', function(d,i) {
d.disabled = !d.disabled;
rescaleY = !d.disabled;
- selection.transition().call(chart);
+ state.rescaleY = rescaleY;
+ dispatch.stateChange(state);
+
+ //selection.transition().call(chart);
+ selection.call(chart);
});
@@ -1855,7 +2177,11 @@ nv.models.cumulativeLineChart = function() {
});
}
- selection.transition().call(chart);
+ state.disabled = data.map(function(d) { return !!d.disabled });
+ dispatch.stateChange(state);
+
+ //selection.transition().call(chart);
+ selection.call(chart);
});
/*
@@ -1875,6 +2201,37 @@ nv.models.cumulativeLineChart = function() {
if (tooltips) showTooltip(e, that.parentNode);
});
+
+ // Update chart from a state object passed to event handler
+ dispatch.on('changeState', function(e) {
+
+ if (typeof e.disabled !== 'undefined') {
+ data.forEach(function(series,i) {
+ series.disabled = e.disabled[i];
+ });
+
+ state.disabled = e.disabled;
+ }
+
+
+ if (typeof e.index !== 'undefined') {
+ index.i = e.index;
+ index.x = dx(index.i);
+
+ state.index = e.index;
+
+ indexLine
+ .data([index]);
+ }
+
+
+ if (typeof e.rescaleY !== 'undefined') {
+ rescaleY = e.rescaleY;
+ }
+
+ selection.call(chart);
+ });
+
//============================================================
});
@@ -1944,6 +2301,12 @@ nv.models.cumulativeLineChart = function() {
return chart;
};
+ chart.rescaleY = function(_) {
+ if (!arguments.length) return rescaleY;
+ rescaleY = _
+ return rescaleY;
+ };
+
chart.showControls = function(_) {
if (!arguments.length) return showControls;
showControls = _;
@@ -1968,6 +2331,18 @@ nv.models.cumulativeLineChart = function() {
return chart;
};
+ chart.state = function(_) {
+ if (!arguments.length) return state;
+ state = _;
+ return chart;
+ };
+
+ chart.defaultState = function(_) {
+ if (!arguments.length) return defaultState;
+ defaultState = _;
+ return chart;
+ };
+
chart.noData = function(_) {
if (!arguments.length) return noData;
noData = _;
@@ -1986,16 +2361,20 @@ nv.models.cumulativeLineChart = function() {
return data.map(function(line, i) {
var v = lines.y()(line.values[idx], idx);
+ //TODO: implement check below, and disable series if series loses 100% or more
cause divide by 0 issue
+ if (v < -.95) {
+ //if a series loses more than 100%, calculations fail.. anything close can cause
major distortion (but is mathematically correct till it hits 100)
+ line.tempDisabled = true;
+ return line;
+ }
+
+ line.tempDisabled = false;
+
line.values = line.values.map(function(point, pointIndex) {
point.display = {'y': (lines.y()(point, pointIndex) - v) / (1 + v) };
return point;
})
- /*
- TODO: implement check below, and disable series if series loses 100% or more cause
divide by 0 issue
- if (v < -.9) {
- //if a series loses more than 100%, calculations fail.. anything close can cause
major distortion (but is mathematically currect till it hits 100)
- }
- */
+
return line;
})
}
@@ -2027,6 +2406,7 @@ nv.models.discreteBar = function() {
, xDomain
, yDomain
, dispatch = d3.dispatch('chartClick', 'elementClick',
'elementDblClick', 'elementMouseover', 'elementMouseout')
+ , rectClass = 'discreteBar'
;
//============================================================
@@ -2128,7 +2508,7 @@ nv.models.discreteBar = function() {
var barsEnter = bars.enter().append('g')
.attr('transform', function(d,i,j) {
- return 'translate(' + x(getX(d,i)) + ', ' + y(0) +
')'
+ return 'translate(' + (x(getX(d,i)) + x.rangeBand() * .05 ) +
', ' + y(0) + ')'
})
.on('mouseover', function(d,i) { //TODO: figure out why j works above,
but not here
d3.select(this).classed('hover', true);
@@ -2180,13 +2560,13 @@ nv.models.discreteBar = function() {
barsEnter.append('rect')
.attr('height', 0)
- .attr('width', x.rangeBand() / data.length )
+ .attr('width', x.rangeBand() * .9 / data.length )
if (showValues) {
barsEnter.append('text')
.attr('text-anchor', 'middle')
bars.select('text')
- .attr('x', x.rangeBand() / 2)
+ .attr('x', x.rangeBand() * .9 / 2)
.attr('y', function(d,i) { return getY(d,i) < 0 ? y(getY(d,i)) -
y(0) + 12 : -4 })
.text(function(d,i) { return valueFormat(getY(d,i)) });
} else {
@@ -2198,16 +2578,24 @@ nv.models.discreteBar = function() {
.style('fill', function(d,i) { return d.color || color(d,i) })
.style('stroke', function(d,i) { return d.color || color(d,i) })
.select('rect')
- .attr('width', x.rangeBand() / data.length);
+ .attr('class', rectClass)
+ .attr('width', x.rangeBand() * .9 / data.length);
d3.transition(bars)
//.delay(function(d,i) { return i * 1200 / data[0].values.length })
- .attr('transform', function(d,i) {
- return 'translate(' + x(getX(d,i)) + ', ' + (getY(d,i) <
0 ? y(0) : y(getY(d,i))) + ')'
+ .attr('transform', function(d,i) {
+ var left = x(getX(d,i)) + x.rangeBand() * .05,
+ top = getY(d,i) < 0 ?
+ y(0) :
+ y(0) - y(getY(d,i)) < 1 ?
+ y(0) - 1 : //make 1 px positive bars show up above y=0
+ y(getY(d,i));
+
+ return 'translate(' + left + ', ' + top + ')'
})
- .select('rect')
- .attr('height', function(d,i) {
- return Math.abs(y(getY(d,i)) - y(0))
- });
+ .select('rect')
+ .attr('height', function(d,i) {
+ return Math.max(Math.abs(y(getY(d,i)) - y(0)) || 1)
+ });
//store old scales for use in transitions on update
@@ -2313,6 +2701,11 @@ nv.models.discreteBar = function() {
return chart;
};
+ chart.rectClass= function(_) {
+ if (!arguments.length) return rectClass;
+ rectClass = _;
+ return chart;
+ }
//============================================================
@@ -2343,7 +2736,7 @@ nv.models.discreteBarChart = function() {
, x
, y
, noData = "No Data Available."
- , dispatch = d3.dispatch('tooltipShow', 'tooltipHide')
+ , dispatch = d3.dispatch('tooltipShow', 'tooltipHide',
'beforeUpdate')
;
xAxis
@@ -2388,7 +2781,7 @@ nv.models.discreteBarChart = function() {
- margin.top - margin.bottom;
- chart.update = function() { selection.transition().call(chart); };
+ chart.update = function() { dispatch.beforeUpdate();
selection.transition().call(chart); };
chart.container = this;
@@ -2486,10 +2879,11 @@ nv.models.discreteBarChart = function() {
var xTicks = g.select('.nv-x.nv-axis').selectAll('g');
- if (staggerLabels)
+ if (staggerLabels) {
xTicks
.selectAll('text')
- .attr('transform', function(d,i,j) { return 'translate(0,' +
(j % 2 == 0 ? '0' : '12') + ')' })
+ .attr('transform', function(d,i,j) { return 'translate(0,' +
(j % 2 == 0 ? '5' : '17') + ')' })
+ }
yAxis
.scale(y)
@@ -2753,7 +3147,6 @@ nv.models.distribution = function() {
return chart;
}
-
nv.models.indentedTree = function() {
//============================================================
@@ -2766,6 +3159,7 @@ nv.models.indentedTree = function() {
, color = nv.utils.defaultColor()
, id = Math.floor(Math.random() * 10000)
, header = true
+ , filterZero = false
, noData = "No Data Available."
, childIndent = 20
, columns = [{key:'key', label: 'Name', type:'text'}] //TODO:
consider functions like chart.addColumn, chart.removeColumn, instead of a block like this
@@ -2777,30 +3171,32 @@ nv.models.indentedTree = function() {
//============================================================
+ var idx = 0;
function chart(selection) {
selection.each(function(data) {
- var i = 0,
- depth = 1;
+ var depth = 1,
+ container = d3.select(this);
var tree = d3.layout.tree()
.children(function(d) { return d.values })
.size([height, childIndent]); //Not sure if this is needed now that the result
is HTML
- chart.update = function() { selection.transition().call(chart) };
- chart.container = this;
+ chart.update = function() { container.transition().duration(600).call(chart) };
//------------------------------------------------------------
// Display No Data message if there's nothing to show.
-
- if (!data[0].key) data[0].key = noData;
+ if (!data[0]) data[0] = {key: noData};
//------------------------------------------------------------
var nodes = tree.nodes(data[0]);
+ // nodes.map(function(d) {
+ // d.id = i++;
+ // })
//------------------------------------------------------------
// Setup containers and skeleton of chart
@@ -2830,7 +3226,7 @@ nv.models.indentedTree = function() {
var tbody = table.selectAll('tbody')
- .data(function(d) {return d });
+ .data(function(d) { return d });
tbody.enter().append('tbody');
@@ -2842,12 +3238,12 @@ nv.models.indentedTree = function() {
// Update the nodes…
var node = tbody.selectAll('tr')
- .data(function(d) { return d }, function(d) { return d.id || (d.id == ++i)});
+ // .data(function(d) { return d; }, function(d) { return d.id || (d.id ==
++i)});
+ .data(function(d) { return d.filter(function(d) { return (filterZero &&
!d.children) ? filterZero(d) : true; } )}, function(d,i) { return d.id || (d.id ||
++idx)});
//.style('display', 'table-row'); //TODO: see if this does
anything
node.exit().remove();
-
node.select('img.nv-treeicon')
.attr('src', icon)
.classed('folded', folded);
@@ -2880,22 +3276,24 @@ nv.models.indentedTree = function() {
.text(function(d) { return column.format ? column.format(d) :
(d[column.key] || '-') });
- if (column.showCount)
+ if (column.showCount) {
nodeName.append('span')
- .attr('class', 'nv-childrenCount')
- .text(function(d) {
- return ((d.values && d.values.length) || (d._values &&
d._values.length)) ?
- '(' + ((d.values && d.values.length) || (d._values
&& d._values.length)) + ')'
- : ''
- });
+ .attr('class', 'nv-childrenCount');
+ node.selectAll('span.nv-childrenCount').text(function(d) {
+ return ((d.values && d.values.length) || (d._values &&
d._values.length)) ? //If this is a parent
+ '(' + ((d.values && (d.values.filter(function(d) {
return filterZero ? filterZero(d) : true; }).length)) //If children are in values check
its children and filter
+ || (d._values && d._values.filter(function(d) { return
filterZero ? filterZero(d) : true; }).length) //Otherwise, do the same, but with the
other name, _values...
+ || 0) + ')'
//This is the catch-all in case there are no
children after a filter
+ : ''
//If this is not a parent, just give an empty
string
+ });
+ }
if (column.click)
nodeName.select('span').on('click', column.click);
});
-
node
.order()
.on('click', function(d) {
@@ -3031,6 +3429,12 @@ nv.models.indentedTree = function() {
return chart;
};
+ chart.filterZero = function(_) {
+ if (!arguments.length) return filterZero;
+ filterZero = _;
+ return chart;
+ };
+
chart.columns = function(_) {
if (!arguments.length) return columns;
columns = _;
@@ -3059,8 +3463,7 @@ nv.models.indentedTree = function() {
return chart;
-}
-nv.models.legend = function() {
+};nv.models.legend = function() {
//============================================================
// Public Variables with Default Settings
@@ -3270,24 +3673,24 @@ nv.models.line = function() {
// Public Variables with Default Settings
//------------------------------------------------------------
+ var scatter = nv.models.scatter()
+ ;
+
var margin = {top: 0, right: 0, bottom: 0, left: 0}
, width = 960
, height = 500
, color = nv.utils.defaultColor() // a function that returns a color
- , id = Math.floor(Math.random() * 10000) //Create semi-unique ID incase user
doesn't select one
, getX = function(d) { return d.x } // accessor to get the x value from a data point
, getY = function(d) { return d.y } // accessor to get the y value from a data point
- , defined = function(d,i) { return !isNaN(getY(d,i)) && getY(d,i) !== null }
// allows a line to be not continous when it is not defined
+ , defined = function(d,i) { return !isNaN(getY(d,i)) && getY(d,i) !== null }
// allows a line to be not continuous when it is not defined
, isArea = function(d) { return d.area } // decides if a line is an area or just a
line
, clipEdge = false // if true, masks lines within x and y scale
, x //can be accessed via chart.xScale()
, y //can be accessed via chart.yScale()
, interpolate = "linear" // controls the line interpolation
- , scatter = nv.models.scatter()
;
scatter
- .id(id)
.size(16) // default size
.sizeDomain([16,256]) //set to speed up calculation, needs to be unset if there is a
custom size accessor
;
@@ -3354,16 +3757,16 @@ nv.models.line = function() {
defsEnter.append('clipPath')
- .attr('id', 'nv-edge-clip-' + id)
+ .attr('id', 'nv-edge-clip-' + scatter.id())
.append('rect');
- wrap.select('#nv-edge-clip-' + id + ' rect')
+ wrap.select('#nv-edge-clip-' + scatter.id() + ' rect')
.attr('width', availableWidth)
.attr('height', availableHeight);
- g .attr('clip-path', clipEdge ? 'url(#nv-edge-clip-' + id +
')' : '');
+ g .attr('clip-path', clipEdge ? 'url(#nv-edge-clip-' +
scatter.id() + ')' : '');
scatterWrap
- .attr('clip-path', clipEdge ? 'url(#nv-edge-clip-' + id +
')' : '');
+ .attr('clip-path', clipEdge ? 'url(#nv-edge-clip-' +
scatter.id() + ')' : '');
@@ -3474,7 +3877,7 @@ nv.models.line = function() {
chart.dispatch = scatter.dispatch;
chart.scatter = scatter;
- d3.rebind(chart, scatter, 'interactive', 'size', 'xScale',
'yScale', 'zScale', 'xDomain', 'yDomain',
'sizeDomain', 'forceX', 'forceY', 'forceSize',
'clipVoronoi', 'clipRadius');
+ d3.rebind(chart, scatter, 'id', 'interactive', 'size',
'xScale', 'yScale', 'zScale', 'xDomain',
'yDomain', 'sizeDomain', 'forceX', 'forceY',
'forceSize', 'clipVoronoi', 'clipRadius', 'padData');
chart.margin = function(_) {
if (!arguments.length) return margin;
@@ -3524,12 +3927,6 @@ nv.models.line = function() {
return chart;
};
- chart.id = function(_) {
- if (!arguments.length) return id;
- id = _;
- return chart;
- };
-
chart.interpolate = function(_) {
if (!arguments.length) return interpolate;
interpolate = _;
@@ -3566,6 +3963,7 @@ nv.models.lineChart = function() {
, legend = nv.models.legend()
;
+//set margin.right to 23 to fit dates on the x-axis within the chart
var margin = {top: 30, right: 20, bottom: 50, left: 60}
, color = nv.utils.defaultColor()
, width = null
@@ -3578,13 +3976,15 @@ nv.models.lineChart = function() {
}
, x
, y
+ , state = {}
+ , defaultState = null
, noData = 'No Data Available.'
- , dispatch = d3.dispatch('tooltipShow', 'tooltipHide')
+ , dispatch = d3.dispatch('tooltipShow', 'tooltipHide',
'stateChange', 'changeState')
;
xAxis
.orient('bottom')
- .tickPadding(5)
+ .tickPadding(7)
;
yAxis
.orient('left')
@@ -3637,6 +4037,19 @@ nv.models.lineChart = function() {
chart.update = function() { chart(selection) };
chart.container = this;
+ //set state.disabled
+ state.disabled = data.map(function(d) { return !!d.disabled });
+
+ if (!defaultState) {
+ var key;
+ defaultState = {};
+ for (key in state) {
+ if (state[key] instanceof Array)
+ defaultState[key] = state[key].slice(0);
+ else
+ defaultState[key] = state[key];
+ }
+ }
//------------------------------------------------------------
// Display noData message if there's nothing to show.
@@ -3770,6 +4183,9 @@ nv.models.lineChart = function() {
});
}
+ state.disabled = data.map(function(d) { return !!d.disabled });
+ dispatch.stateChange(state);
+
selection.transition().call(chart);
});
@@ -3789,6 +4205,20 @@ nv.models.lineChart = function() {
if (tooltips) showTooltip(e, that.parentNode);
});
+
+ dispatch.on('changeState', function(e) {
+
+ if (typeof e.disabled !== 'undefined') {
+ data.forEach(function(series,i) {
+ series.disabled = e.disabled[i];
+ });
+
+ state.disabled = e.disabled;
+ }
+
+ selection.call(chart);
+ });
+
//============================================================
});
@@ -3876,6 +4306,18 @@ nv.models.lineChart = function() {
return chart;
};
+ chart.state = function(_) {
+ if (!arguments.length) return state;
+ state = _;
+ return chart;
+ };
+
+ chart.defaultState = function(_) {
+ if (!arguments.length) return defaultState;
+ defaultState = _;
+ return chart;
+ };
+
chart.noData = function(_) {
if (!arguments.length) return noData;
noData = _;
@@ -3917,16 +4359,23 @@ nv.models.linePlusBarChart = function() {
, x
, y1
, y2
+ , state = {}
+ , defaultState = null
, noData = "No Data Available."
- , dispatch = d3.dispatch('tooltipShow', 'tooltipHide')
+ , dispatch = d3.dispatch('tooltipShow', 'tooltipHide',
'stateChange', 'changeState')
;
+ bars
+ .padData(true)
+ ;
lines
.clipEdge(false)
+ .padData(true)
;
xAxis
.orient('bottom')
- .tickPadding(5)
+ .tickPadding(7)
+ .highlightZero(false)
;
y1Axis
.orient('left')
@@ -3943,14 +4392,15 @@ nv.models.linePlusBarChart = function() {
//------------------------------------------------------------
var showTooltip = function(e, offsetElement) {
- var left = e.pos[0] + ( offsetElement.offsetLeft || 0 ),
- top = e.pos[1] + ( offsetElement.offsetTop || 0),
- x = xAxis.tickFormat()(lines.x()(e.point, e.pointIndex)),
- y = (e.series.bar ? y1Axis : y2Axis).tickFormat()(lines.y()(e.point,
e.pointIndex)),
- content = tooltip(e.series.key, x, y, e, chart);
+ var left = e.pos[0] + ( offsetElement.offsetLeft || 0 ),
+ top = e.pos[1] + ( offsetElement.offsetTop || 0),
+ x = xAxis.tickFormat()(lines.x()(e.point, e.pointIndex)),
+ y = (e.series.bar ? y1Axis : y2Axis).tickFormat()(lines.y()(e.point,
e.pointIndex)),
+ content = tooltip(e.series.key, x, y, e, chart);
- nv.tooltip.show([left, top], content, e.value < 0 ? 'n' : 's',
null, offsetElement);
- };
+ nv.tooltip.show([left, top], content, e.value < 0 ? 'n' : 's',
null, offsetElement);
+ }
+ ;
//------------------------------------------------------------
@@ -3969,6 +4419,19 @@ nv.models.linePlusBarChart = function() {
chart.update = function() { chart(selection) };
chart.container = this;
+ //set state.disabled
+ state.disabled = data.map(function(d) { return !!d.disabled });
+
+ if (!defaultState) {
+ var key;
+ defaultState = {};
+ for (key in state) {
+ if (state[key] instanceof Array)
+ defaultState[key] = state[key].slice(0);
+ else
+ defaultState[key] = state[key];
+ }
+ }
//------------------------------------------------------------
// Display No Data message if there's nothing to show.
@@ -3997,51 +4460,19 @@ nv.models.linePlusBarChart = function() {
//------------------------------------------------------------
// Setup Scales
- x = xAxis.scale();
- y1 = bars.yScale();
- y2 = lines.yScale();
-
var dataBars = data.filter(function(d) { return !d.disabled && d.bar });
var dataLines = data.filter(function(d) { return !d.bar }); // removed the
!d.disabled clause here to fix Issue #240
+ //x = xAxis.scale();
+ x = dataLines.filter(function(d) { return !d.disabled; }).length &&
dataLines.filter(function(d) { return !d.disabled; })[0].values.length ? lines.xScale() :
bars.xScale();
+ //x = dataLines.filter(function(d) { return !d.disabled; }).length ? lines.xScale()
: bars.xScale(); //old code before change above
+ y1 = bars.yScale();
+ y2 = lines.yScale();
- //TODO: try to remove x scale computation from this layer
-
- var series1 = data.filter(function(d) { return !d.disabled && d.bar })
- .map(function(d) {
- return d.values.map(function(d,i) {
- return { x: getX(d,i), y: getY(d,i) }
- })
- });
+ //------------------------------------------------------------
- var series2 = data.filter(function(d) { return !d.disabled && !d.bar })
- .map(function(d) {
- return d.values.map(function(d,i) {
- return { x: getX(d,i), y: getY(d,i) }
- })
- });
-
- x .domain(d3.extent(d3.merge(series1.concat(series2)), function(d) { return d.x }
))
- .range([0, availableWidth]);
-
-
-
- /*
- x .domain(d3.extent(d3.merge(data.map(function(d) { return d.values })), getX ))
- .range([0, availableWidth]);
-
- y1 .domain(d3.extent(d3.merge(dataBars), function(d) { return d.y } ))
- .range([availableHeight, 0]);
-
- y2 .domain(d3.extent(d3.merge(dataLines), function(d) { return d.y } ))
- .range([availableHeight, 0]);
- */
-
- //------------------------------------------------------------
-
-
- //------------------------------------------------------------
- // Setup containers and skeleton of chart
+ //------------------------------------------------------------
+ // Setup containers and skeleton of chart
var wrap =
d3.select(this).selectAll('g.nv-wrap.nv-linePlusBar').data([data]);
var gEnter = wrap.enter().append('g').attr('class', 'nvd3
nv-wrap nv-linePlusBar').append('g');
@@ -4111,7 +4542,7 @@ nv.models.linePlusBarChart = function() {
.datum(dataBars.length ? dataBars : [{values:[]}])
var linesWrap = g.select('.nv-linesWrap')
- .datum(!dataLines[0].disabled ? dataLines : [{values:[]}] );
+ .datum(dataLines[0] && !dataLines[0].disabled ? dataLines :
[{values:[]}] );
//.datum(!dataLines[0].disabled ? dataLines :
[{values:dataLines[0].values.map(function(d) { return [d[0], null] }) }] );
d3.transition(barsWrap).call(bars);
@@ -4124,6 +4555,7 @@ nv.models.linePlusBarChart = function() {
// Setup Axes
xAxis
+ .scale(x)
.ticks( availableWidth / 100 )
.tickSize(-availableHeight, 0);
@@ -4150,7 +4582,8 @@ nv.models.linePlusBarChart = function() {
g.select('.nv-y2.nv-axis')
.style('opacity', dataLines.length ? 1 : 0)
- .attr('transform', 'translate(' + x.range()[1] +
',0)');
+ .attr('transform', 'translate(' + availableWidth +
',0)');
+ //.attr('transform', 'translate(' + x.range()[1] +
',0)');
d3.transition(g.select('.nv-y2.nv-axis'))
.call(y2Axis);
@@ -4173,6 +4606,9 @@ nv.models.linePlusBarChart = function() {
});
}
+ state.disabled = data.map(function(d) { return !!d.disabled });
+ dispatch.stateChange(state);
+
selection.transition().call(chart);
});
@@ -4180,6 +4616,21 @@ nv.models.linePlusBarChart = function() {
if (tooltips) showTooltip(e, that.parentNode);
});
+
+ // Update chart from a state object passed to event handler
+ dispatch.on('changeState', function(e) {
+
+ if (typeof e.disabled !== 'undefined') {
+ data.forEach(function(series,i) {
+ series.disabled = e.disabled[i];
+ });
+
+ state.disabled = e.disabled;
+ }
+
+ selection.call(chart);
+ });
+
//============================================================
@@ -4297,6 +4748,18 @@ nv.models.linePlusBarChart = function() {
return chart;
};
+ chart.state = function(_) {
+ if (!arguments.length) return state;
+ state = _;
+ return chart;
+ };
+
+ chart.defaultState = function(_) {
+ if (!arguments.length) return defaultState;
+ defaultState = _;
+ return chart;
+ };
+
chart.noData = function(_) {
if (!arguments.length) return noData;
noData = _;
@@ -4527,33 +4990,614 @@ nv.models.lineWithFocusChart = function() {
//------------------------------------------------------------
- /*
- var focusLinesWrap = g.select('.nv-focus .nv-linesWrap')
- .datum(data.filter(function(d) { return !d.disabled }))
+ /*
+ var focusLinesWrap = g.select('.nv-focus .nv-linesWrap')
+ .datum(data.filter(function(d) { return !d.disabled }))
+
+ d3.transition(focusLinesWrap).call(lines);
+ */
+
+
+ //------------------------------------------------------------
+ // Setup Main (Focus) Axes
+
+ xAxis
+ .scale(x)
+ .ticks( availableWidth / 100 )
+ .tickSize(-availableHeight1, 0);
+
+ yAxis
+ .scale(y)
+ .ticks( availableHeight1 / 36 )
+ .tickSize( -availableWidth, 0);
+
+ g.select('.nv-focus .nv-x.nv-axis')
+ .attr('transform', 'translate(0,' + availableHeight1 +
')');
+
+ //------------------------------------------------------------
+
+
+ //------------------------------------------------------------
+ // Setup Brush
+
+ brush
+ .x(x2)
+ .on('brush', onBrush);
+
+ if (brushExtent) brush.extent(brushExtent);
+
+ var brushBG = g.select('.nv-brushBackground').selectAll('g')
+ .data([brushExtent || brush.extent()])
+
+ var brushBGenter = brushBG.enter()
+ .append('g');
+
+ brushBGenter.append('rect')
+ .attr('class', 'left')
+ .attr('x', 0)
+ .attr('y', 0)
+ .attr('height', availableHeight2);
+
+ brushBGenter.append('rect')
+ .attr('class', 'right')
+ .attr('x', 0)
+ .attr('y', 0)
+ .attr('height', availableHeight2);
+
+ gBrush = g.select('.nv-x.nv-brush')
+ .call(brush);
+ gBrush.selectAll('rect')
+ //.attr('y', -5)
+ .attr('height', availableHeight2);
+ gBrush.selectAll('.resize').append('path').attr('d',
resizePath);
+
+ onBrush();
+
+ //------------------------------------------------------------
+
+
+ //------------------------------------------------------------
+ // Setup Secondary (Context) Axes
+
+ x2Axis
+ .scale(x2)
+ .ticks( availableWidth / 100 )
+ .tickSize(-availableHeight2, 0);
+
+ g.select('.nv-context .nv-x.nv-axis')
+ .attr('transform', 'translate(0,' + y2.range()[0] +
')');
+ d3.transition(g.select('.nv-context .nv-x.nv-axis'))
+ .call(x2Axis);
+
+
+ y2Axis
+ .scale(y2)
+ .ticks( availableHeight2 / 36 )
+ .tickSize( -availableWidth, 0);
+
+ d3.transition(g.select('.nv-context .nv-y.nv-axis'))
+ .call(y2Axis);
+
+ g.select('.nv-context .nv-x.nv-axis')
+ .attr('transform', 'translate(0,' + y2.range()[0] +
')');
+
+ //------------------------------------------------------------
+
+
+ //============================================================
+ // Event Handling/Dispatching (in chart's scope)
+ //------------------------------------------------------------
+
+ legend.dispatch.on('legendClick', function(d,i) {
+ d.disabled = !d.disabled;
+
+ if (!data.filter(function(d) { return !d.disabled }).length) {
+ data.map(function(d) {
+ d.disabled = false;
+ wrap.selectAll('.nv-series').classed('disabled', false);
+ return d;
+ });
+ }
+
+ selection.transition().call(chart);
+ });
+
+ dispatch.on('tooltipShow', function(e) {
+ if (tooltips) showTooltip(e, that.parentNode);
+ });
+
+ //============================================================
+
+
+ //============================================================
+ // Functions
+ //------------------------------------------------------------
+
+ // Taken from crossfilter (
http://square.github.com/crossfilter/)
+ function resizePath(d) {
+ var e = +(d == 'e'),
+ x = e ? 1 : -1,
+ y = availableHeight2 / 3;
+ return 'M' + (.5 * x) + ',' + y
+ + 'A6,6 0 0 ' + e + ' ' + (6.5 * x) + ',' + (y + 6)
+ + 'V' + (2 * y - 6)
+ + 'A6,6 0 0 ' + e + ' ' + (.5 * x) + ',' + (2 * y)
+ + 'Z'
+ + 'M' + (2.5 * x) + ',' + (y + 8)
+ + 'V' + (2 * y - 8)
+ + 'M' + (4.5 * x) + ',' + (y + 8)
+ + 'V' + (2 * y - 8);
+ }
+
+
+ function updateBrushBG() {
+ if (!brush.empty()) brush.extent(brushExtent);
+ brushBG
+ .data([brush.empty() ? x2.domain() : brushExtent])
+ .each(function(d,i) {
+ var leftWidth = x2(d[0]) - x.range()[0],
+ rightWidth = x.range()[1] - x2(d[1]);
+ d3.select(this).select('.left')
+ .attr('width', leftWidth < 0 ? 0 : leftWidth);
+
+ d3.select(this).select('.right')
+ .attr('x', x2(d[1]))
+ .attr('width', rightWidth < 0 ? 0 : rightWidth);
+ });
+ }
+
+
+ function onBrush() {
+ brushExtent = brush.empty() ? null : brush.extent();
+ extent = brush.empty() ? x2.domain() : brush.extent();
+
+
+ dispatch.brush({extent: extent, brush: brush});
+
+
+ updateBrushBG();
+
+ // Update Main (Focus)
+ var focusLinesWrap = g.select('.nv-focus .nv-linesWrap')
+ .datum(
+ data
+ .filter(function(d) { return !d.disabled })
+ .map(function(d,i) {
+ return {
+ key: d.key,
+ values: d.values.filter(function(d,i) {
+ return lines.x()(d,i) >= extent[0] && lines.x()(d,i)
<= extent[1];
+ })
+ }
+ })
+ );
+ d3.transition(focusLinesWrap).call(lines);
+
+
+ // Update Main (Focus) Axes
+ d3.transition(g.select('.nv-focus .nv-x.nv-axis'))
+ .call(xAxis);
+ d3.transition(g.select('.nv-focus .nv-y.nv-axis'))
+ .call(yAxis);
+ }
+
+ //============================================================
+
+
+ });
+
+ return chart;
+ }
+
+
+ //============================================================
+ // Event Handling/Dispatching (out of chart's scope)
+ //------------------------------------------------------------
+
+ lines.dispatch.on('elementMouseover.tooltip', function(e) {
+ e.pos = [e.pos[0] + margin.left, e.pos[1] + margin.top];
+ dispatch.tooltipShow(e);
+ });
+
+ lines.dispatch.on('elementMouseout.tooltip', function(e) {
+ dispatch.tooltipHide(e);
+ });
+
+ dispatch.on('tooltipHide', function() {
+ if (tooltips) nv.tooltip.cleanup();
+ });
+
+ //============================================================
+
+
+ //============================================================
+ // Expose Public Variables
+ //------------------------------------------------------------
+
+ // expose chart's sub-components
+ chart.dispatch = dispatch;
+ chart.legend = legend;
+ chart.lines = lines;
+ chart.lines2 = lines2;
+ chart.xAxis = xAxis;
+ chart.yAxis = yAxis;
+ chart.x2Axis = x2Axis;
+ chart.y2Axis = y2Axis;
+
+ d3.rebind(chart, lines, 'defined', 'isArea', 'size',
'xDomain', 'yDomain', 'forceX', 'forceY',
'interactive', 'clipEdge', 'clipVoronoi', 'id');
+
+ chart.x = function(_) {
+ if (!arguments.length) return lines.x;
+ lines.x(_);
+ lines2.x(_);
+ return chart;
+ };
+
+ chart.y = function(_) {
+ if (!arguments.length) return lines.y;
+ lines.y(_);
+ lines2.y(_);
+ return chart;
+ };
+
+ chart.margin = function(_) {
+ if (!arguments.length) return margin;
+ margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
+ margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
+ margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
+ margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
+ return chart;
+ };
+
+ chart.margin2 = function(_) {
+ if (!arguments.length) return margin2;
+ margin2 = _;
+ return chart;
+ };
+
+ chart.width = function(_) {
+ if (!arguments.length) return width;
+ width = _;
+ return chart;
+ };
+
+ chart.height = function(_) {
+ if (!arguments.length) return height;
+ height = _;
+ return chart;
+ };
+
+ chart.height2 = function(_) {
+ if (!arguments.length) return height2;
+ height2 = _;
+ return chart;
+ };
+
+ chart.color = function(_) {
+ if (!arguments.length) return color;
+ color =nv.utils.getColor(_);
+ legend.color(color);
+ return chart;
+ };
+
+ chart.showLegend = function(_) {
+ if (!arguments.length) return showLegend;
+ showLegend = _;
+ return chart;
+ };
+
+ chart.tooltips = function(_) {
+ if (!arguments.length) return tooltips;
+ tooltips = _;
+ return chart;
+ };
+
+ chart.tooltipContent = function(_) {
+ if (!arguments.length) return tooltip;
+ tooltip = _;
+ return chart;
+ };
+
+ chart.interpolate = function(_) {
+ if (!arguments.length) return lines.interpolate();
+ lines.interpolate(_);
+ lines2.interpolate(_);
+ return chart;
+ };
+
+ chart.noData = function(_) {
+ if (!arguments.length) return noData;
+ noData = _;
+ return chart;
+ };
+
+ // Chart has multiple similar Axes, to prevent code duplication, probably need to link
all axis functions manually like below
+ chart.xTickFormat = function(_) {
+ if (!arguments.length) return xAxis.tickFormat();
+ xAxis.tickFormat(_);
+ x2Axis.tickFormat(_);
+ return chart;
+ };
+
+ chart.yTickFormat = function(_) {
+ if (!arguments.length) return yAxis.tickFormat();
+ yAxis.tickFormat(_);
+ y2Axis.tickFormat(_);
+ return chart;
+ };
+
+ //============================================================
+
+
+ return chart;
+}
+
+nv.models.linePlusBarWithFocusChart = function() {
+
+ //============================================================
+ // Public Variables with Default Settings
+ //------------------------------------------------------------
+
+ var lines = nv.models.line()
+ , lines2 = nv.models.line()
+ , bars = nv.models.historicalBar()
+ , bars2 = nv.models.historicalBar()
+ , xAxis = nv.models.axis()
+ , x2Axis = nv.models.axis()
+ , y1Axis = nv.models.axis()
+ , y2Axis = nv.models.axis()
+ , y3Axis = nv.models.axis()
+ , y4Axis = nv.models.axis()
+ , legend = nv.models.legend()
+ , brush = d3.svg.brush()
+ ;
+
+ var margin = {top: 30, right: 30, bottom: 30, left: 60}
+ , margin2 = {top: 0, right: 30, bottom: 20, left: 60}
+ , width = null
+ , height = null
+ , height2 = 100
+ , getX = function(d) { return d.x }
+ , getY = function(d) { return d.y }
+ , color = nv.utils.defaultColor()
+ , showLegend = true
+ , extent
+ , brushExtent = null
+ , tooltips = true
+ , tooltip = function(key, x, y, e, graph) {
+ return '<h3>' + key + '</h3>' +
+ '<p>' + y + ' at ' + x + '</p>';
+ }
+ , x
+ , x2
+ , y1
+ , y2
+ , y3
+ , y4
+ , noData = "No Data Available."
+ , dispatch = d3.dispatch('tooltipShow', 'tooltipHide',
'brush')
+ ;
+
+ lines
+ .clipEdge(true)
+ ;
+ lines2
+ .interactive(false)
+ ;
+ xAxis
+ .orient('bottom')
+ .tickPadding(5)
+ ;
+ y1Axis
+ .orient('left')
+ ;
+ y2Axis
+ .orient('right')
+ ;
+ x2Axis
+ .orient('bottom')
+ .tickPadding(5)
+ ;
+ y3Axis
+ .orient('left')
+ ;
+ y4Axis
+ .orient('right')
+ ;
+
+ //============================================================
+
+
+ //============================================================
+ // Private Variables
+ //------------------------------------------------------------
+
+ var showTooltip = function(e, offsetElement) {
+ if (extent) {
+ e.pointIndex += Math.ceil(extent[0]);
+ }
+ var left = e.pos[0] + ( offsetElement.offsetLeft || 0 ),
+ top = e.pos[1] + ( offsetElement.offsetTop || 0),
+ x = xAxis.tickFormat()(lines.x()(e.point, e.pointIndex)),
+ y = (e.series.bar ? y1Axis : y2Axis).tickFormat()(lines.y()(e.point,
e.pointIndex)),
+ content = tooltip(e.series.key, x, y, e, chart);
+
+ nv.tooltip.show([left, top], content, e.value < 0 ? 'n' : 's',
null, offsetElement);
+ };
+
+ //------------------------------------------------------------
+
+
+
+ function chart(selection) {
+ selection.each(function(data) {
+ var container = d3.select(this),
+ that = this;
+
+ var availableWidth = (width || parseInt(container.style('width')) || 960)
+ - margin.left - margin.right,
+ availableHeight1 = (height || parseInt(container.style('height')) ||
400)
+ - margin.top - margin.bottom - height2,
+ availableHeight2 = height2 - margin2.top - margin2.bottom;
+
+ chart.update = function() { chart(selection) };
+ chart.container = this;
+
+
+ //------------------------------------------------------------
+ // Display No Data message if there's nothing to show.
+
+ if (!data || !data.length || !data.filter(function(d) { return d.values.length
}).length) {
+ var noDataText = container.selectAll('.nv-noData').data([noData]);
+
+ noDataText.enter().append('text')
+ .attr('class', 'nvd3 nv-noData')
+ .attr('dy', '-.7em')
+ .style('text-anchor', 'middle');
+
+ noDataText
+ .attr('x', margin.left + availableWidth / 2)
+ .attr('y', margin.top + availableHeight1 / 2)
+ .text(function(d) { return d });
+
+ return chart;
+ } else {
+ container.selectAll('.nv-noData').remove();
+ }
+
+ //------------------------------------------------------------
+
+
+ //------------------------------------------------------------
+ // Setup Scales
+
+ var dataBars = data.filter(function(d) { return !d.disabled && d.bar });
+ var dataLines = data.filter(function(d) { return !d.bar }); // removed the
!d.disabled clause here to fix Issue #240
+
+ x = bars.xScale();
+ x2 = x2Axis.scale();
+ y1 = bars.yScale();
+ y2 = lines.yScale();
+ y3 = bars2.yScale();
+ y4 = lines2.yScale();
+
+ var series1 = data
+ .filter(function(d) { return !d.disabled && d.bar })
+ .map(function(d) {
+ return d.values.map(function(d,i) {
+ return { x: getX(d,i), y: getY(d,i) }
+ })
+ });
+
+ var series2 = data
+ .filter(function(d) { return !d.disabled && !d.bar })
+ .map(function(d) {
+ return d.values.map(function(d,i) {
+ return { x: getX(d,i), y: getY(d,i) }
+ })
+ });
+
+ x .range([0, availableWidth]);
+
+ x2 .domain(d3.extent(d3.merge(series1.concat(series2)), function(d) { return d.x }
))
+ .range([0, availableWidth]);
+
+
+ //------------------------------------------------------------
+
+
+ //------------------------------------------------------------
+ // Setup containers and skeleton of chart
+
+ var wrap = container.selectAll('g.nv-wrap.nv-linePlusBar').data([data]);
+ var gEnter = wrap.enter().append('g').attr('class', 'nvd3
nv-wrap nv-linePlusBar').append('g');
+ var g = wrap.select('g');
+
+ gEnter.append('g').attr('class', 'nv-legendWrap');
+
+ var focusEnter = gEnter.append('g').attr('class',
'nv-focus');
+ focusEnter.append('g').attr('class', 'nv-x nv-axis');
+ focusEnter.append('g').attr('class', 'nv-y1 nv-axis');
+ focusEnter.append('g').attr('class', 'nv-y2 nv-axis');
+ focusEnter.append('g').attr('class', 'nv-barsWrap');
+ focusEnter.append('g').attr('class', 'nv-linesWrap');
+
+ var contextEnter = gEnter.append('g').attr('class',
'nv-context');
+ contextEnter.append('g').attr('class', 'nv-x nv-axis');
+ contextEnter.append('g').attr('class', 'nv-y1 nv-axis');
+ contextEnter.append('g').attr('class', 'nv-y2 nv-axis');
+ contextEnter.append('g').attr('class', 'nv-barsWrap');
+ contextEnter.append('g').attr('class', 'nv-linesWrap');
+ contextEnter.append('g').attr('class',
'nv-brushBackground');
+ contextEnter.append('g').attr('class', 'nv-x nv-brush');
+
+
+ //------------------------------------------------------------
+
+
+ //------------------------------------------------------------
+ // Legend
+
+ if (showLegend) {
+ legend.width( availableWidth / 2 );
+
+ g.select('.nv-legendWrap')
+ .datum(data.map(function(series) {
+ series.originalKey = series.originalKey === undefined ? series.key :
series.originalKey;
+ series.key = series.originalKey + (series.bar ? ' (left axis)' :
' (right axis)');
+ return series;
+ }))
+ .call(legend);
+
+ if ( margin.top != legend.height()) {
+ margin.top = legend.height();
+ availableHeight1 = (height || parseInt(container.style('height')) ||
400)
+ - margin.top - margin.bottom - height2;
+ }
+
+ g.select('.nv-legendWrap')
+ .attr('transform', 'translate(' + ( availableWidth / 2 ) +
',' + (-margin.top) +')');
+ }
+
+ //------------------------------------------------------------
+
- d3.transition(focusLinesWrap).call(lines);
- */
+ wrap.attr('transform', 'translate(' + margin.left + ',' +
margin.top + ')');
//------------------------------------------------------------
- // Setup Main (Focus) Axes
+ // Context Components
- xAxis
- .scale(x)
- .ticks( availableWidth / 100 )
- .tickSize(-availableHeight1, 0);
+ bars2
+ .width(availableWidth)
+ .height(availableHeight2)
+ .color(data.map(function(d,i) {
+ return d.color || color(d, i);
+ }).filter(function(d,i) { return !data[i].disabled && data[i].bar }));
- yAxis
- .scale(y)
- .ticks( availableHeight1 / 36 )
- .tickSize( -availableWidth, 0);
+ lines2
+ .width(availableWidth)
+ .height(availableHeight2)
+ .color(data.map(function(d,i) {
+ return d.color || color(d, i);
+ }).filter(function(d,i) { return !data[i].disabled && !data[i].bar }));
+
+ var bars2Wrap = g.select('.nv-context .nv-barsWrap')
+ .datum(dataBars.length ? dataBars : [{values:[]}]);
+
+ var lines2Wrap = g.select('.nv-context .nv-linesWrap')
+ .datum(!dataLines[0].disabled ? dataLines : [{values:[]}]);
+
+ g.select('.nv-context')
+ .attr('transform', 'translate(0,' + ( availableHeight1 +
margin.bottom + margin2.top) + ')')
- g.select('.nv-focus .nv-x.nv-axis')
- .attr('transform', 'translate(0,' + availableHeight1 +
')');
+ d3.transition(bars2Wrap).call(bars2);
+ d3.transition(lines2Wrap).call(lines2);
//------------------------------------------------------------
+
//------------------------------------------------------------
// Setup Brush
@@ -4581,51 +5625,60 @@ nv.models.lineWithFocusChart = function() {
.attr('y', 0)
.attr('height', availableHeight2);
- gBrush = g.select('.nv-x.nv-brush')
+ var gBrush = g.select('.nv-x.nv-brush')
.call(brush);
gBrush.selectAll('rect')
//.attr('y', -5)
.attr('height', availableHeight2);
gBrush.selectAll('.resize').append('path').attr('d',
resizePath);
- onBrush();
-
//------------------------------------------------------------
-
//------------------------------------------------------------
// Setup Secondary (Context) Axes
x2Axis
- .scale(x2)
.ticks( availableWidth / 100 )
.tickSize(-availableHeight2, 0);
g.select('.nv-context .nv-x.nv-axis')
- .attr('transform', 'translate(0,' + y2.range()[0] +
')');
+ .attr('transform', 'translate(0,' + y3.range()[0] +
')');
d3.transition(g.select('.nv-context .nv-x.nv-axis'))
.call(x2Axis);
- y2Axis
- .scale(y2)
+ y3Axis
+ .scale(y3)
.ticks( availableHeight2 / 36 )
.tickSize( -availableWidth, 0);
- d3.transition(g.select('.nv-context .nv-y.nv-axis'))
- .call(y2Axis);
+ g.select('.nv-context .nv-y1.nv-axis')
+ .style('opacity', dataBars.length ? 1 : 0)
+ .attr('transform', 'translate(0,' + x2.range()[0] +
')');
+
+ d3.transition(g.select('.nv-context .nv-y1.nv-axis'))
+ .call(y3Axis);
+
+
+ y4Axis
+ .scale(y4)
+ .ticks( availableHeight2 / 36 )
+ .tickSize(dataBars.length ? 0 : -availableWidth, 0); // Show the y2 rules only if
y1 has none
- g.select('.nv-context .nv-x.nv-axis')
- .attr('transform', 'translate(0,' + y2.range()[0] +
')');
+ g.select('.nv-context .nv-y2.nv-axis')
+ .style('opacity', dataLines.length ? 1 : 0)
+ .attr('transform', 'translate(' + x2.range()[1] +
',0)');
+ d3.transition(g.select('.nv-context .nv-y2.nv-axis'))
+ .call(y4Axis);
+
//------------------------------------------------------------
-
//============================================================
// Event Handling/Dispatching (in chart's scope)
//------------------------------------------------------------
- legend.dispatch.on('legendClick', function(d,i) {
+ legend.dispatch.on('legendClick', function(d,i) {
d.disabled = !d.disabled;
if (!data.filter(function(d) { return !d.disabled }).length) {
@@ -4636,7 +5689,7 @@ nv.models.lineWithFocusChart = function() {
});
}
- selection.transition().call(chart);
+ selection.call(chart);
});
dispatch.on('tooltipShow', function(e) {
@@ -4672,8 +5725,8 @@ nv.models.lineWithFocusChart = function() {
brushBG
.data([brush.empty() ? x2.domain() : brushExtent])
.each(function(d,i) {
- var leftWidth = x2(d[0]) - x.range()[0],
- rightWidth = x.range()[1] - x2(d[1]);
+ var leftWidth = x2(d[0]) - x2.range()[0],
+ rightWidth = x2.range()[1] - x2(d[1]);
d3.select(this).select('.left')
.attr('width', leftWidth < 0 ? 0 : leftWidth);
@@ -4691,14 +5744,43 @@ nv.models.lineWithFocusChart = function() {
dispatch.brush({extent: extent, brush: brush});
-
updateBrushBG();
- // Update Main (Focus)
+
+ //------------------------------------------------------------
+ // Prepare Main (Focus) Bars and Lines
+
+ bars
+ .width(availableWidth)
+ .height(availableHeight1)
+ .color(data.map(function(d,i) {
+ return d.color || color(d, i);
+ }).filter(function(d,i) { return !data[i].disabled && data[i].bar }));
+
+
+ lines
+ .width(availableWidth)
+ .height(availableHeight1)
+ .color(data.map(function(d,i) {
+ return d.color || color(d, i);
+ }).filter(function(d,i) { return !data[i].disabled && !data[i].bar }));
+
+ var focusBarsWrap = g.select('.nv-focus .nv-barsWrap')
+ .datum(!dataBars.length ? [{values:[]}] :
+ dataBars
+ .map(function(d,i) {
+ return {
+ key: d.key,
+ values: d.values.filter(function(d,i) {
+ return bars.x()(d,i) >= extent[0] && bars.x()(d,i) <=
extent[1];
+ })
+ }
+ })
+ );
+
var focusLinesWrap = g.select('.nv-focus .nv-linesWrap')
- .datum(
- data
- .filter(function(d) { return !d.disabled })
+ .datum(dataLines[0].disabled ? [{values:[]}] :
+ dataLines
.map(function(d,i) {
return {
key: d.key,
@@ -4707,19 +5789,75 @@ nv.models.lineWithFocusChart = function() {
})
}
})
- );
+ );
+
+ //------------------------------------------------------------
+
+
+ //------------------------------------------------------------
+ // Update Main (Focus) X Axis
+
+ if (dataBars.length) {
+ x = bars.xScale();
+ } else {
+ x = lines.xScale();
+ }
+
+ xAxis
+ .scale(x)
+ .ticks( availableWidth / 100 )
+ .tickSize(-availableHeight1, 0);
+
+ xAxis.domain([Math.ceil(extent[0]), Math.floor(extent[1])]);
+
+ d3.transition(g.select('.nv-x.nv-axis'))
+ .call(xAxis);
+ //------------------------------------------------------------
+
+
+ //------------------------------------------------------------
+ // Update Main (Focus) Bars and Lines
+
+ d3.transition(focusBarsWrap).call(bars);
d3.transition(focusLinesWrap).call(lines);
+
+ //------------------------------------------------------------
+
+
+ //------------------------------------------------------------
+ // Setup and Update Main (Focus) Y Axes
+
+ g.select('.nv-focus .nv-x.nv-axis')
+ .attr('transform', 'translate(0,' + y1.range()[0] +
')');
- // Update Main (Focus) Axes
- d3.transition(g.select('.nv-focus .nv-x.nv-axis'))
- .call(xAxis);
- d3.transition(g.select('.nv-focus .nv-y.nv-axis'))
- .call(yAxis);
+ y1Axis
+ .scale(y1)
+ .ticks( availableHeight1 / 36 )
+ .tickSize(-availableWidth, 0);
+
+ g.select('.nv-focus .nv-y1.nv-axis')
+ .style('opacity', dataBars.length ? 1 : 0);
+
+
+ y2Axis
+ .scale(y2)
+ .ticks( availableHeight1 / 36 )
+ .tickSize(dataBars.length ? 0 : -availableWidth, 0); // Show the y2 rules only if
y1 has none
+
+ g.select('.nv-focus .nv-y2.nv-axis')
+ .style('opacity', dataLines.length ? 1 : 0)
+ .attr('transform', 'translate(' + x.range()[1] +
',0)');
+
+ d3.transition(g.select('.nv-focus .nv-y1.nv-axis'))
+ .call(y1Axis);
+ d3.transition(g.select('.nv-focus .nv-y2.nv-axis'))
+ .call(y2Axis);
}
//============================================================
+ onBrush();
});
@@ -4740,6 +5878,15 @@ nv.models.lineWithFocusChart = function() {
dispatch.tooltipHide(e);
});
+ bars.dispatch.on('elementMouseover.tooltip', function(e) {
+ e.pos = [e.pos[0] + margin.left, e.pos[1] + margin.top];
+ dispatch.tooltipShow(e);
+ });
+
+ bars.dispatch.on('elementMouseout.tooltip', function(e) {
+ dispatch.tooltipHide(e);
+ });
+
dispatch.on('tooltipHide', function() {
if (tooltips) nv.tooltip.cleanup();
});
@@ -4756,24 +5903,32 @@ nv.models.lineWithFocusChart = function() {
chart.legend = legend;
chart.lines = lines;
chart.lines2 = lines2;
+ chart.bars = bars;
+ chart.bars2 = bars2;
chart.xAxis = xAxis;
- chart.yAxis = yAxis;
chart.x2Axis = x2Axis;
+ chart.y1Axis = y1Axis;
chart.y2Axis = y2Axis;
+ chart.y3Axis = y3Axis;
+ chart.y4Axis = y4Axis;
- d3.rebind(chart, lines, 'defined', 'isArea', 'size',
'xDomain', 'yDomain', 'forceX', 'forceY',
'interactive', 'clipEdge', 'clipVoronoi', 'id');
+ d3.rebind(chart, lines, 'defined', 'size', 'clipVoronoi',
'interpolate');
+ //TODO: consider rebinding x, y and some other stuff, and simply do soemthign lile
bars.x(lines.x()), etc.
+ //d3.rebind(chart, lines, 'x', 'y', 'size', 'xDomain',
'yDomain', 'forceX', 'forceY', 'interactive',
'clipEdge', 'clipVoronoi', 'id');
chart.x = function(_) {
- if (!arguments.length) return lines.x;
+ if (!arguments.length) return getX;
+ getX = _;
lines.x(_);
- lines2.x(_);
+ bars.x(_);
return chart;
};
chart.y = function(_) {
- if (!arguments.length) return lines.y;
+ if (!arguments.length) return getY;
+ getY = _;
lines.y(_);
- lines2.y(_);
+ bars.y(_);
return chart;
};
@@ -4786,12 +5941,6 @@ nv.models.lineWithFocusChart = function() {
return chart;
};
- chart.margin2 = function(_) {
- if (!arguments.length) return margin2;
- margin2 = _;
- return chart;
- };
-
chart.width = function(_) {
if (!arguments.length) return width;
width = _;
@@ -4806,7 +5955,7 @@ nv.models.lineWithFocusChart = function() {
chart.color = function(_) {
if (!arguments.length) return color;
- color =nv.utils.getColor(_);
+ color = nv.utils.getColor(_);
legend.color(color);
return chart;
};
@@ -4829,33 +5978,18 @@ nv.models.lineWithFocusChart = function() {
return chart;
};
- chart.interpolate = function(_) {
- if (!arguments.length) return lines.interpolate();
- lines.interpolate(_);
- lines2.interpolate(_);
- return chart;
- };
-
chart.noData = function(_) {
if (!arguments.length) return noData;
noData = _;
return chart;
};
- // Chart has multiple similar Axes, to prevent code duplication, probably need to link
all axis functions manually like below
- chart.xTickFormat = function(_) {
- if (!arguments.length) return xAxis.tickFormat();
- xAxis.tickFormat(_);
- x2Axis.tickFormat(_);
+ chart.brushExtent = function(_) {
+ if (!arguments.length) return brushExtent;
+ brushExtent = _;
return chart;
};
- chart.yTickFormat = function(_) {
- if (!arguments.length) return yAxis.tickFormat();
- yAxis.tickFormat(_);
- y2Axis.tickFormat(_);
- return chart;
- };
//============================================================
@@ -4881,6 +6015,9 @@ nv.models.multiBar = function() {
, clipEdge = true
, stacked = false
, color = nv.utils.defaultColor()
+ , hideable = false
+ , barColor = null // adding the ability to set the color for each rather than the
whole group
+ , disabled // used in conjunction with barColor to communicate from
multiBarHorizontalChart what series are disabled
, delay = 1200
, xDomain
, yDomain
@@ -4906,12 +6043,22 @@ nv.models.multiBar = function() {
availableHeight = height - margin.top - margin.bottom,
container = d3.select(this);
+ if(hideable && data.length) hideable = [{
+ values: data[0].values.map(function(d) {
+ return {
+ x: d.x,
+ y: 0,
+ series: d.series,
+ size: 0.01
+ };}
+ )}];
+
if (stacked)
data = d3.layout.stack()
.offset('zero')
.values(function(d){ return d.values })
.y(getY)
- (data);
+ (!data.length && hideable ? hideable : data);
//add series index to each data point for reference
@@ -4925,23 +6072,42 @@ nv.models.multiBar = function() {
//------------------------------------------------------------
+ // HACK for negative value stacking
+ if (stacked)
+ data[0].values.map(function(d,i) {
+ var posBase = 0, negBase = 0;
+ data.map(function(d) {
+ var f = d.values[i]
+ f.size = Math.abs(f.y);
+ if (f.y<0) {
+ f.y1 = negBase;
+ negBase = negBase - f.size;
+ } else
+ {
+ f.y1 = f.size + posBase;
+ posBase = posBase + f.size;
+ }
+ });
+ });
+
+ //------------------------------------------------------------
// Setup Scales
// remap and flatten the data for use in calculating the scales' domains
var seriesData = (xDomain && yDomain) ? [] : // if we know xDomain and
yDomain, no need to calculate
data.map(function(d) {
return d.values.map(function(d,i) {
- return { x: getX(d,i), y: getY(d,i), y0: d.y0 }
+ return { x: getX(d,i), y: getY(d,i), y0: d.y0, y1: d.y1 }
})
});
x .domain(d3.merge(seriesData).map(function(d) { return d.x }))
.rangeBands([0, availableWidth], .1);
- y .domain(yDomain || d3.extent(d3.merge(seriesData).map(function(d) { return d.y
+ (stacked ? d.y0 : 0) }).concat(forceY)))
+ //y .domain(yDomain || d3.extent(d3.merge(seriesData).map(function(d) { return
d.y + (stacked ? d.y1 : 0) }).concat(forceY)))
+ y .domain(yDomain || d3.extent(d3.merge(seriesData).map(function(d) { return
stacked ? (d.y > 0 ? d.y1 : d.y1 + d.y ) : d.y }).concat(forceY)))
.range([availableHeight, 0]);
-
// If scale's domain don't have a range, slightly adjust to make one... so
a chart can show a single data point
if (x.domain()[0] === x.domain()[1] || y.domain()[0] === y.domain()[1]) singlePoint
= true;
if (x.domain()[0] === x.domain()[1])
@@ -5013,7 +6179,7 @@ nv.models.multiBar = function() {
var bars = groups.selectAll('rect.nv-bar')
- .data(function(d) { return d.values });
+ .data(function(d) { return (hideable && !data.length) ? hideable.values
: d.values });
bars.exit().remove();
@@ -5079,14 +6245,28 @@ nv.models.multiBar = function() {
bars
.attr('class', function(d,i) { return getY(d,i) < 0 ? 'nv-bar
negative' : 'nv-bar positive'})
.attr('transform', function(d,i) { return 'translate(' +
x(getX(d,i)) + ',0)'; })
+
+ if (barColor) {
+ if (!disabled) disabled = data.map(function() { return true });
+ bars
+ //.style('fill', barColor)
+ //.style('stroke', barColor)
+ //.style('fill', function(d,i,j) { return
d3.rgb(barColor(d,i)).darker(j).toString(); })
+ //.style('stroke', function(d,i,j) { return
d3.rgb(barColor(d,i)).darker(j).toString(); })
+ .style('fill', function(d,i,j) { return d3.rgb(barColor(d,i)).darker(
disabled.map(function(d,i) { return i }).filter(function(d,i){ return !disabled[i] })[j]
).toString(); })
+ .style('stroke', function(d,i,j) { return d3.rgb(barColor(d,i)).darker(
disabled.map(function(d,i) { return i }).filter(function(d,i){ return !disabled[i] })[j]
).toString(); });
+ }
+
+
if (stacked)
d3.transition(bars)
.delay(function(d,i) { return i * delay / data[0].values.length })
.attr('y', function(d,i) {
- return y(getY(d,i) + (stacked ? d.y0 : 0));
+
+ return y((stacked ? d.y1 : 0));
})
.attr('height', function(d,i) {
- return Math.abs(y(d.y + (stacked ? d.y0 : 0)) - y((stacked ? d.y0 : 0)))
+ return Math.max(Math.abs(y(d.y + (stacked ? d.y0 : 0)) - y((stacked ? d.y0
: 0))),1);
})
.each('end', function() {
d3.transition(d3.select(this))
@@ -5106,11 +6286,13 @@ nv.models.multiBar = function() {
d3.transition(d3.select(this))
.attr('y', function(d,i) {
return getY(d,i) < 0 ?
- y(0) :
- y(getY(d,i))
- })
- .attr('height', function(d,i) {
- return Math.abs(y(getY(d,i)) - y(0))
+ y(0) :
+ y(0) - y(getY(d,i)) < 1 ?
+ y(0) - 1 :
+ y(getY(d,i)) || 0;
+ })
+ .attr('height', function(d,i) {
+ return Math.max(Math.abs(y(getY(d,i)) - y(0)),1) || 0;
});
})
@@ -5212,12 +6394,30 @@ nv.models.multiBar = function() {
return chart;
};
+ chart.barColor = function(_) {
+ if (!arguments.length) return barColor;
+ barColor = nv.utils.getColor(_);
+ return chart;
+ };
+
+ chart.disabled = function(_) {
+ if (!arguments.length) return disabled;
+ disabled = _;
+ return chart;
+ };
+
chart.id = function(_) {
if (!arguments.length) return id;
id = _;
return chart;
};
+ chart.hideable = function(_) {
+ if (!arguments.length) return hideable;
+ hideable = _;
+ return chart;
+ };
+
chart.delay = function(_) {
if (!arguments.length) return delay;
delay = _;
@@ -5258,8 +6458,11 @@ nv.models.multiBarChart = function() {
}
, x //can be accessed via chart.xScale()
, y //can be accessed via chart.yScale()
+ , state = { stacked: false }
+ , defaultState = null
, noData = "No Data Available."
- , dispatch = d3.dispatch('tooltipShow', 'tooltipHide')
+ , dispatch = d3.dispatch('tooltipShow', 'tooltipHide',
'stateChange', 'changeState')
+ , controlWidth = function() { return showControls ? 180 : 0 }
;
multibar
@@ -5267,7 +6470,7 @@ nv.models.multiBarChart = function() {
;
xAxis
.orient('bottom')
- .tickPadding(5)
+ .tickPadding(7)
.highlightZero(false)
.showMaxMin(false)
.tickFormat(function(d) { return d })
@@ -5310,7 +6513,19 @@ nv.models.multiBarChart = function() {
chart.update = function() { selection.transition().call(chart) };
chart.container = this;
-
+ //set state.disabled
+ state.disabled = data.map(function(d) { return !!d.disabled });
+
+ if (!defaultState) {
+ var key;
+ defaultState = {};
+ for (key in state) {
+ if (state[key] instanceof Array)
+ defaultState[key] = state[key].slice(0);
+ else
+ defaultState[key] = state[key];
+ }
+ }
//------------------------------------------------------------
// Display noData message if there's nothing to show.
@@ -5364,7 +6579,12 @@ nv.models.multiBarChart = function() {
// Legend
if (showLegend) {
- legend.width(availableWidth / 2);
+ legend.width(availableWidth - controlWidth());
+
+ if (multibar.barColor())
+ data.forEach(function(series,i) {
+ series.color = d3.rgb('#ccc').darker(i * 1.5).toString();
+ })
g.select('.nv-legendWrap')
.datum(data)
@@ -5377,7 +6597,7 @@ nv.models.multiBarChart = function() {
}
g.select('.nv-legendWrap')
- .attr('transform', 'translate(' + (availableWidth / 2) +
',' + (-margin.top) +')');
+ .attr('transform', 'translate(' + controlWidth() +
',' + (-margin.top) +')');
}
//------------------------------------------------------------
@@ -5392,7 +6612,7 @@ nv.models.multiBarChart = function() {
{ key: 'Stacked', disabled: !multibar.stacked() }
];
- controls.width(180).color(['#444', '#444', '#444']);
+ controls.width(controlWidth()).color(['#444', '#444',
'#444']);
g.select('.nv-controlsWrap')
.datum(controlsData)
.attr('transform', 'translate(0,' + (-margin.top)
+')')
@@ -5409,6 +6629,7 @@ nv.models.multiBarChart = function() {
// Main Chart Component(s)
multibar
+ .disabled(data.map(function(series) { return series.disabled }))
.width(availableWidth)
.height(availableHeight)
.color(data.map(function(d,i) {
@@ -5453,9 +6674,12 @@ nv.models.multiBarChart = function() {
if(rotateLabels)
xTicks
- .selectAll('text')
- .attr('transform', function(d,i,j) { return
'rotate('+rotateLabels+' 0,0)' })
- .attr('text-transform', rotateLabels > 0 ? 'start' :
'end');
+ .selectAll('text')
+ .attr('transform', 'rotate(' + rotateLabels + ' 0,0)')
+ .attr('text-anchor', rotateLabels > 0 ? 'start' :
'end');
+
+ g.select('.nv-x.nv-axis').selectAll('g.nv-axisMaxMin text')
+ .style('opacity', 1);
yAxis
.scale(y)
@@ -5484,6 +6708,9 @@ nv.models.multiBarChart = function() {
});
}
+ state.disabled = data.map(function(d) { return !!d.disabled });
+ dispatch.stateChange(state);
+
selection.transition().call(chart);
});
@@ -5504,6 +6731,9 @@ nv.models.multiBarChart = function() {
break;
}
+ state.stacked = multibar.stacked();
+ dispatch.stateChange(state);
+
selection.transition().call(chart);
});
@@ -5511,6 +6741,25 @@ nv.models.multiBarChart = function() {
if (tooltips) showTooltip(e, that.parentNode)
});
+ // Update chart from a state object passed to event handler
+ dispatch.on('changeState', function(e) {
+
+ if (typeof e.disabled !== 'undefined') {
+ data.forEach(function(series,i) {
+ series.disabled = e.disabled[i];
+ });
+
+ state.disabled = e.disabled;
+ }
+
+ if (typeof e.stacked !== 'undefined') {
+ multibar.stacked(e.stacked);
+ state.stacked = e.stacked;
+ }
+
+ selection.call(chart);
+ });
+
//============================================================
@@ -5550,7 +6799,7 @@ nv.models.multiBarChart = function() {
chart.xAxis = xAxis;
chart.yAxis = yAxis;
- d3.rebind(chart, multibar, 'x', 'y', 'xDomain',
'yDomain', 'forceX', 'forceY', 'clipEdge', 'id',
'stacked', 'delay');
+ d3.rebind(chart, multibar, 'x', 'y', 'xDomain',
'yDomain', 'forceX', 'forceY', 'clipEdge', 'id',
'stacked', 'delay', 'barColor');
chart.margin = function(_) {
if (!arguments.length) return margin;
@@ -5622,6 +6871,18 @@ nv.models.multiBarChart = function() {
return chart;
};
+ chart.state = function(_) {
+ if (!arguments.length) return state;
+ state = _;
+ return chart;
+ };
+
+ chart.defaultState = function(_) {
+ if (!arguments.length) return defaultState;
+ defaultState = _;
+ return chart;
+ };
+
chart.noData = function(_) {
if (!arguments.length) return noData;
noData = _;
@@ -5650,6 +6911,8 @@ nv.models.multiBarHorizontal = function() {
, getY = function(d) { return d.y }
, forceY = [0] // 0 is forced by default.. this makes sense for the majority of bar
graphs... user can always do chart.forceY([]) to remove
, color = nv.utils.defaultColor()
+ , barColor = null // adding the ability to set the color for each rather than the
whole group
+ , disabled // used in conjunction with barColor to communicate from
multiBarHorizontalChart what series are disabled
, stacked = false
, showValues = false
, valuePadding = 60
@@ -5698,6 +6961,28 @@ nv.models.multiBarHorizontal = function() {
});
+
+ //------------------------------------------------------------
+ // HACK for negative value stacking
+ if (stacked)
+ data[0].values.map(function(d,i) {
+ var posBase = 0, negBase = 0;
+ data.map(function(d) {
+ var f = d.values[i]
+ f.size = Math.abs(f.y);
+ if (f.y<0) {
+ f.y1 = negBase - f.size;
+ negBase = negBase - f.size;
+ } else
+ {
+ f.y1 = posBase;
+ posBase = posBase + f.size;
+ }
+ });
+ });
+
+
+
//------------------------------------------------------------
// Setup Scales
@@ -5705,14 +6990,15 @@ nv.models.multiBarHorizontal = function() {
var seriesData = (xDomain && yDomain) ? [] : // if we know xDomain and
yDomain, no need to calculate
data.map(function(d) {
return d.values.map(function(d,i) {
- return { x: getX(d,i), y: getY(d,i), y0: d.y0 }
+ return { x: getX(d,i), y: getY(d,i), y0: d.y0, y1: d.y1 }
})
});
x .domain(xDomain || d3.merge(seriesData).map(function(d) { return d.x }))
.rangeBands([0, availableHeight], .1);
- y .domain(yDomain || d3.extent(d3.merge(seriesData).map(function(d) { return d.y
+ (stacked ? d.y0 : 0) }).concat(forceY)))
+ //y .domain(yDomain || d3.extent(d3.merge(seriesData).map(function(d) { return
d.y + (stacked ? d.y0 : 0) }).concat(forceY)))
+ y .domain(yDomain || d3.extent(d3.merge(seriesData).map(function(d) { return
stacked ? (d.y > 0 ? d.y1 + d.y : d.y1 ) : d.y }).concat(forceY)))
if (showValues && !stacked)
y.range([(y.domain()[0] < 0 ? valuePadding : 0), availableWidth -
(y.domain()[1] > 0 ? valuePadding : 0) ]);
@@ -5825,32 +7111,45 @@ nv.models.multiBarHorizontal = function() {
d3.event.stopPropagation();
});
+
+ barsEnter.append('text');
+
if (showValues && !stacked) {
- barsEnter.append('text')
- .attr('text-anchor', function(d,i) { return getY(d,i) < 0 ?
'end' : 'start' })
bars.select('text')
- .attr('y', x.rangeBand() / 2)
- .attr('dy', '-.32em')
+ .attr('text-anchor', function(d,i) { return getY(d,i) < 0 ?
'end' : 'start' })
+ .attr('y', x.rangeBand() / (data.length * 2))
+ .attr('dy', '.32em')
.text(function(d,i) { return valueFormat(getY(d,i)) })
d3.transition(bars)
//.delay(function(d,i) { return i * delay / data[0].values.length })
.select('text')
.attr('x', function(d,i) { return getY(d,i) < 0 ? -4 :
y(getY(d,i)) - y(0) + 4 })
} else {
- bars.selectAll('text').remove();
+ //bars.selectAll('text').remove();
+ bars.selectAll('text').text('');
}
bars
.attr('class', function(d,i) { return getY(d,i) < 0 ? 'nv-bar
negative' : 'nv-bar positive'})
- //.attr('transform', function(d,i,j) {
- //return 'translate(' + y0(stacked ? d.y0 : 0) + ',' +
x(getX(d,i)) + ')'
- //})
+
+ if (barColor) {
+ if (!disabled) disabled = data.map(function() { return true });
+ bars
+ //.style('fill', barColor)
+ //.style('stroke', barColor)
+ //.style('fill', function(d,i,j) { return
d3.rgb(barColor(d,i)).darker(j).toString(); })
+ //.style('stroke', function(d,i,j) { return
d3.rgb(barColor(d,i)).darker(j).toString(); })
+ .style('fill', function(d,i,j) { return d3.rgb(barColor(d,i)).darker(
disabled.map(function(d,i) { return i }).filter(function(d,i){ return !disabled[i] })[j]
).toString(); })
+ .style('stroke', function(d,i,j) { return d3.rgb(barColor(d,i)).darker(
disabled.map(function(d,i) { return i }).filter(function(d,i){ return !disabled[i] })[j]
).toString(); });
+ }
+
if (stacked)
d3.transition(bars)
//.delay(function(d,i) { return i * delay / data[0].values.length })
.attr('transform', function(d,i) {
//return 'translate(' + y(d.y0) + ',0)'
- return 'translate(' + y(d.y0) + ',' + x(getX(d,i)) +
')'
+ //return 'translate(' + y(d.y0) + ',' + x(getX(d,i)) +
')'
+ return 'translate(' + y(d.y1) + ',' + x(getX(d,i)) +
')'
})
.select('rect')
.attr('width', function(d,i) {
@@ -5873,7 +7172,7 @@ nv.models.multiBarHorizontal = function() {
.select('rect')
.attr('height', x.rangeBand() / data.length )
.attr('width', function(d,i) {
- return Math.abs(y(getY(d,i)) - y(0))
+ return Math.max(Math.abs(y(getY(d,i)) - y(0)),1)
});
@@ -5968,6 +7267,18 @@ nv.models.multiBarHorizontal = function() {
return chart;
};
+ chart.barColor = function(_) {
+ if (!arguments.length) return barColor;
+ barColor = nv.utils.getColor(_);
+ return chart;
+ };
+
+ chart.disabled = function(_) {
+ if (!arguments.length) return disabled;
+ disabled = _;
+ return chart;
+ };
+
chart.id = function(_) {
if (!arguments.length) return id;
id = _;
@@ -6031,8 +7342,11 @@ nv.models.multiBarHorizontalChart = function() {
}
, x //can be accessed via chart.xScale()
, y //can be accessed via chart.yScale()
+ , state = { stacked: stacked }
+ , defaultState = null
, noData = 'No Data Available.'
- , dispatch = d3.dispatch('tooltipShow', 'tooltipHide')
+ , dispatch = d3.dispatch('tooltipShow', 'tooltipHide',
'stateChange', 'changeState')
+ , controlWidth = function() { return showControls ? 180 : 0 }
;
multibar
@@ -6083,6 +7397,19 @@ nv.models.multiBarHorizontalChart = function() {
chart.update = function() { selection.transition().call(chart) };
chart.container = this;
+ //set state.disabled
+ state.disabled = data.map(function(d) { return !!d.disabled });
+
+ if (!defaultState) {
+ var key;
+ defaultState = {};
+ for (key in state) {
+ if (state[key] instanceof Array)
+ defaultState[key] = state[key].slice(0);
+ else
+ defaultState[key] = state[key];
+ }
+ }
//------------------------------------------------------------
// Display No Data message if there's nothing to show.
@@ -6137,7 +7464,12 @@ nv.models.multiBarHorizontalChart = function() {
// Legend
if (showLegend) {
- legend.width(availableWidth / 2);
+ legend.width(availableWidth - controlWidth());
+
+ if (multibar.barColor())
+ data.forEach(function(series,i) {
+ series.color = d3.rgb('#ccc').darker(i * 1.5).toString();
+ })
g.select('.nv-legendWrap')
.datum(data)
@@ -6150,7 +7482,7 @@ nv.models.multiBarHorizontalChart = function() {
}
g.select('.nv-legendWrap')
- .attr('transform', 'translate(' + (availableWidth / 2) +
',' + (-margin.top) +')');
+ .attr('transform', 'translate(' + controlWidth() +
',' + (-margin.top) +')');
}
//------------------------------------------------------------
@@ -6165,7 +7497,7 @@ nv.models.multiBarHorizontalChart = function() {
{ key: 'Stacked', disabled: !multibar.stacked() }
];
- controls.width(180).color(['#444', '#444', '#444']);
+ controls.width(controlWidth()).color(['#444', '#444',
'#444']);
g.select('.nv-controlsWrap')
.datum(controlsData)
.attr('transform', 'translate(0,' + (-margin.top)
+')')
@@ -6182,6 +7514,7 @@ nv.models.multiBarHorizontalChart = function() {
// Main Chart Component(s)
multibar
+ .disabled(data.map(function(series) { return series.disabled }))
.width(availableWidth)
.height(availableHeight)
.color(data.map(function(d,i) {
@@ -6244,6 +7577,9 @@ nv.models.multiBarHorizontalChart = function() {
});
}
+ state.disabled = data.map(function(d) { return !!d.disabled });
+ dispatch.stateChange(state);
+
selection.transition().call(chart);
});
@@ -6264,6 +7600,9 @@ nv.models.multiBarHorizontalChart = function() {
break;
}
+ state.stacked = multibar.stacked();
+ dispatch.stateChange(state);
+
selection.transition().call(chart);
});
@@ -6271,6 +7610,24 @@ nv.models.multiBarHorizontalChart = function() {
if (tooltips) showTooltip(e, that.parentNode);
});
+ // Update chart from a state object passed to event handler
+ dispatch.on('changeState', function(e) {
+
+ if (typeof e.disabled !== 'undefined') {
+ data.forEach(function(series,i) {
+ series.disabled = e.disabled[i];
+ });
+
+ state.disabled = e.disabled;
+ }
+
+ if (typeof e.stacked !== 'undefined') {
+ multibar.stacked(e.stacked);
+ state.stacked = e.stacked;
+ }
+
+ selection.call(chart);
+ });
//============================================================
@@ -6310,7 +7667,7 @@ nv.models.multiBarHorizontalChart = function() {
chart.xAxis = xAxis;
chart.yAxis = yAxis;
- d3.rebind(chart, multibar, 'x', 'y', 'xDomain',
'yDomain', 'forceX', 'forceY', 'clipEdge', 'id',
'delay', 'showValues', 'valueFormat', 'stacked');
+ d3.rebind(chart, multibar, 'x', 'y', 'xDomain',
'yDomain', 'forceX', 'forceY', 'clipEdge', 'id',
'delay', 'showValues', 'valueFormat', 'stacked',
'barColor');
chart.margin = function(_) {
if (!arguments.length) return margin;
@@ -6370,6 +7727,18 @@ nv.models.multiBarHorizontalChart = function() {
return chart;
};
+ chart.state = function(_) {
+ if (!arguments.length) return state;
+ state = _;
+ return chart;
+ };
+
+ chart.defaultState = function(_) {
+ if (!arguments.length) return defaultState;
+ defaultState = _;
+ return chart;
+ };
+
chart.noData = function(_) {
if (!arguments.length) return noData;
noData = _;
@@ -6427,7 +7796,7 @@ nv.models.multiChart = function() {
var left = e.pos[0] + ( offsetElement.offsetLeft || 0 ),
top = e.pos[1] + ( offsetElement.offsetTop || 0),
x = xAxis.tickFormat()(lines1.x()(e.point, e.pointIndex)),
- y = (e.series.bar ? yAxis1 : yAxis2).tickFormat()(lines1.y()(e.point,
e.pointIndex)),
+ y = ((e.series.yAxis == 2) ? yAxis2 : yAxis1).tickFormat()(lines1.y()(e.point,
e.pointIndex)),
content = tooltip(e.series.key, x, y, e, chart);
nv.tooltip.show([left, top], content, undefined, undefined,
offsetElement.offsetParent);
@@ -6846,6 +8215,7 @@ nv.models.ohlcBar = function() {
, getLow = function(d) { return d.low }
, forceX = []
, forceY = []
+ , padData = false // If true, adds half a data points width to front and back,
for lining up a line chart with a bar chart
, clipEdge = true
, color = nv.utils.defaultColor()
, xDomain
@@ -6874,8 +8244,12 @@ nv.models.ohlcBar = function() {
//------------------------------------------------------------
// Setup Scales
- x .domain(xDomain || d3.extent(data[0].values.map(getX).concat(forceX) ))
- .range([0, availableWidth]);
+ x .domain(xDomain || d3.extent(data[0].values.map(getX).concat(forceX) ));
+
+ if (padData)
+ x.range([availableWidth * .5 / data[0].values.length, availableWidth *
(data[0].values.length - .5) / data[0].values.length ]);
+ else
+ x.range([0, availableWidth]);
y .domain(yDomain || [
d3.min(data[0].values.map(getLow).concat(forceY)),
@@ -7156,6 +8530,12 @@ nv.models.ohlcBar = function() {
return chart;
};
+ chart.padData = function(_) {
+ if (!arguments.length) return padData;
+ padData = _;
+ return chart;
+ };
+
chart.clipEdge = function(_) {
if (!arguments.length) return clipEdge;
clipEdge = _;
@@ -7179,7 +8559,6 @@ nv.models.ohlcBar = function() {
return chart;
}
-
nv.models.pie = function() {
//============================================================
@@ -7192,13 +8571,19 @@ nv.models.pie = function() {
, getValues = function(d) { return d.values }
, getX = function(d) { return d.x }
, getY = function(d) { return d.y }
+ , getDescription = function(d) { return d.description }
, id = Math.floor(Math.random() * 10000) //Create semi-unique ID in case user
doesn't select one
, color = nv.utils.defaultColor()
, valueFormat = d3.format(',.2f')
, showLabels = true
+ , pieLabelsOutside = true
, donutLabelsOutside = false
, labelThreshold = .02 //if slice percentage is under this, don't show label
, donut = false
+ , labelSunbeamLayout = false
+ , startAngle = false
+ , endAngle = false
+ , donutRatio = 0.5
, dispatch = d3.dispatch('chartClick', 'elementClick',
'elementDblClick', 'elementMouseover', 'elementMouseout')
;
@@ -7210,6 +8595,7 @@ nv.models.pie = function() {
var availableWidth = width - margin.left - margin.right,
availableHeight = height - margin.top - margin.bottom,
radius = Math.min(availableWidth, availableHeight) / 2,
+ arcRadius = radius-(radius / 5),
container = d3.select(this);
@@ -7242,10 +8628,11 @@ nv.models.pie = function() {
var arc = d3.svg.arc()
- .outerRadius((radius-(radius / 5)));
-
- if (donut) arc.innerRadius(radius / 2);
+ .outerRadius(arcRadius);
+ if (startAngle) arc.startAngle(startAngle)
+ if (endAngle) arc.endAngle(endAngle);
+ if (donut) arc.innerRadius(radius * donutRatio);
// Setup the Pie chart and choose the data element
var pie = d3.layout.pie()
@@ -7317,10 +8704,11 @@ nv.models.pie = function() {
if (showLabels) {
// This does the normal label
- var labelsArc = arc;
- if (donutLabelsOutside) {
- labelsArc = d3.svg.arc().outerRadius(arc.outerRadius())
- }
+ var labelsArc = d3.svg.arc().innerRadius(0);
+
+ if (pieLabelsOutside){ labelsArc = arc; }
+
+ if (donutLabelsOutside) { labelsArc =
d3.svg.arc().outerRadius(arc.outerRadius()); }
ae.append("g").classed("nv-label", true)
.each(function(d, i) {
@@ -7328,9 +8716,21 @@ nv.models.pie = function() {
group
.attr('transform', function(d) {
- d.outerRadius = radius + 10; // Set Outer Coordinate
- d.innerRadius = radius + 15; // Set Inner Coordinate
- return 'translate(' + labelsArc.centroid(d) + ')'
+ if (labelSunbeamLayout) {
+ d.outerRadius = arcRadius + 10; // Set Outer Coordinate
+ d.innerRadius = arcRadius + 15; // Set Inner Coordinate
+ var rotateAngle = (d.startAngle + d.endAngle) / 2 * (180 /
Math.PI);
+ if ((d.startAngle+d.endAngle)/2 < Math.PI) {
+ rotateAngle -= 90;
+ } else {
+ rotateAngle += 90;
+ }
+ return 'translate(' + labelsArc.centroid(d) + ')
rotate(' + rotateAngle + ')';
+ } else {
+ d.outerRadius = radius + 10; // Set Outer Coordinate
+ d.innerRadius = radius + 15; // Set Inner Coordinate
+ return 'translate(' + labelsArc.centroid(d) + ')'
+ }
});
group.append('rect')
@@ -7340,7 +8740,7 @@ nv.models.pie = function() {
.attr("ry", 3);
group.append('text')
- .style('text-anchor', 'middle') //center the text on
it's origin
+ .style('text-anchor', labelSunbeamLayout ? ((d.startAngle +
d.endAngle) / 2 < Math.PI ? 'start' : 'end') : 'middle')
//center the text on it's origin or begin/end if orthogonal aligned
.style('fill', '#000')
@@ -7348,9 +8748,21 @@ nv.models.pie = function() {
slices.select(".nv-label").transition()
.attr('transform', function(d) {
- d.outerRadius = radius + 10; // Set Outer Coordinate
- d.innerRadius = radius + 15; // Set Inner Coordinate
- return 'translate(' + labelsArc.centroid(d) + ')';
+ if (labelSunbeamLayout) {
+ d.outerRadius = arcRadius + 10; // Set Outer Coordinate
+ d.innerRadius = arcRadius + 15; // Set Inner Coordinate
+ var rotateAngle = (d.startAngle + d.endAngle) / 2 * (180 / Math.PI);
+ if ((d.startAngle+d.endAngle)/2 < Math.PI) {
+ rotateAngle -= 90;
+ } else {
+ rotateAngle += 90;
+ }
+ return 'translate(' + labelsArc.centroid(d) + ')
rotate(' + rotateAngle + ')';
+ } else {
+ d.outerRadius = radius + 10; // Set Outer Coordinate
+ d.innerRadius = radius + 15; // Set Inner Coordinate
+ return 'translate(' + labelsArc.centroid(d) + ')'
+ }
});
slices.each(function(d, i) {
@@ -7358,6 +8770,7 @@ nv.models.pie = function() {
slice
.select(".nv-label text")
+ .style('text-anchor', labelSunbeamLayout ? ((d.startAngle +
d.endAngle) / 2 < Math.PI ? 'start' : 'end') : 'middle')
//center the text on it's origin or begin/end if orthogonal aligned
.text(function(d, i) {
var percent = (d.endAngle - d.startAngle) / (2 * Math.PI);
return (d.value && percent > labelThreshold) ? getX(d.data)
: '';
@@ -7447,24 +8860,60 @@ nv.models.pie = function() {
getY = d3.functor(_);
return chart;
};
+
+ chart.description = function(_) {
+ if (!arguments.length) return getDescription;
+ getDescription = _;
+ return chart;
+ };
chart.showLabels = function(_) {
if (!arguments.length) return showLabels;
showLabels = _;
return chart;
};
+
+ chart.labelSunbeamLayout = function(_) {
+ if (!arguments.length) return labelSunbeamLayout;
+ labelSunbeamLayout = _;
+ return chart;
+ };
chart.donutLabelsOutside = function(_) {
if (!arguments.length) return donutLabelsOutside;
donutLabelsOutside = _;
return chart;
};
+
+ chart.pieLabelsOutside = function(_) {
+ if (!arguments.length) return pieLabelsOutside;
+ pieLabelsOutside = _;
+ return chart;
+ };
chart.donut = function(_) {
if (!arguments.length) return donut;
donut = _;
return chart;
};
+
+ chart.donutRatio = function(_) {
+ if (!arguments.length) return donutRatio;
+ donutRatio = _;
+ return chart;
+ };
+
+ chart.startAngle = function(_) {
+ if (!arguments.length) return startAngle;
+ startAngle = _;
+ return chart;
+ };
+
+ chart.endAngle = function(_) {
+ if (!arguments.length) return endAngle;
+ endAngle = _;
+ return chart;
+ };
chart.id = function(_) {
if (!arguments.length) return id;
@@ -7489,13 +8938,11 @@ nv.models.pie = function() {
labelThreshold = _;
return chart;
};
-
//============================================================
return chart;
}
-
nv.models.pieChart = function() {
//============================================================
@@ -7516,8 +8963,10 @@ nv.models.pieChart = function() {
return '<h3>' + key + '</h3>' +
'<p>' + y + '</p>'
}
+ , state = {}
+ , defaultState = null
, noData = "No Data Available."
- , dispatch = d3.dispatch('tooltipShow', 'tooltipHide')
+ , dispatch = d3.dispatch('tooltipShow', 'tooltipHide',
'stateChange', 'changeState')
;
//============================================================
@@ -7528,10 +8977,11 @@ nv.models.pieChart = function() {
//------------------------------------------------------------
var showTooltip = function(e, offsetElement) {
+ var tooltipLabel = pie.description()(e.point) || pie.x()(e.point)
var left = e.pos[0] + ( (offsetElement && offsetElement.offsetLeft) || 0 ),
top = e.pos[1] + ( (offsetElement && offsetElement.offsetTop) || 0),
y = pie.valueFormat()(pie.y()(e.point)),
- content = tooltip(pie.x()(e.point), y, e, chart);
+ content = tooltip(tooltipLabel, y, e, chart);
nv.tooltip.show([left, top], content, e.value < 0 ? 'n' : 's',
null, offsetElement);
};
@@ -7544,7 +8994,7 @@ nv.models.pieChart = function() {
var container = d3.select(this),
that = this;
- var availableWidth = (width || parseInt(container.style('width')) || 960)
+ var availableWidth = (width || parseInt(container.style('width')) || 960)
- margin.left - margin.right,
availableHeight = (height || parseInt(container.style('height')) ||
400)
- margin.top - margin.bottom;
@@ -7552,11 +9002,24 @@ nv.models.pieChart = function() {
chart.update = function() { chart(selection); };
chart.container = this;
+ //set state.disabled
+ state.disabled = data[0].map(function(d) { return !!d.disabled });
+
+ if (!defaultState) {
+ var key;
+ defaultState = {};
+ for (key in state) {
+ if (state[key] instanceof Array)
+ defaultState[key] = state[key].slice(0);
+ else
+ defaultState[key] = state[key];
+ }
+ }
//------------------------------------------------------------
// Display No Data message if there's nothing to show.
- if (!data || !data.length) {
+ if (!data[0] || !data[0].length) {
var noDataText = container.selectAll('.nv-noData').data([noData]);
noDataText.enter().append('text')
@@ -7649,6 +9112,9 @@ nv.models.pieChart = function() {
});
}
+ state.disabled = data[0].map(function(d) { return !!d.disabled });
+ dispatch.stateChange(state);
+
selection.transition().call(chart)
});
@@ -7656,6 +9122,20 @@ nv.models.pieChart = function() {
dispatch.tooltipHide(e);
});
+ // Update chart from a state object passed to event handler
+ dispatch.on('changeState', function(e) {
+
+ if (typeof e.disabled !== 'undefined') {
+ data[0].forEach(function(series,i) {
+ series.disabled = e.disabled[i];
+ });
+
+ state.disabled = e.disabled;
+ }
+
+ selection.call(chart);
+ });
+
//============================================================
@@ -7689,10 +9169,11 @@ nv.models.pieChart = function() {
//------------------------------------------------------------
// expose chart's sub-components
+ chart.legend = legend;
chart.dispatch = dispatch;
chart.pie = pie;
- d3.rebind(chart, pie, 'valueFormat', 'values', 'x',
'y', 'id', 'showLabels', 'donutLabelsOutside',
'donut', 'labelThreshold');
+ d3.rebind(chart, pie, 'valueFormat', 'values', 'x',
'y', 'description', 'id', 'showLabels',
'donutLabelsOutside', 'pieLabelsOutside', 'donut',
'donutRatio', 'labelThreshold');
chart.margin = function(_) {
if (!arguments.length) return margin;
@@ -7741,6 +9222,18 @@ nv.models.pieChart = function() {
return chart;
};
+ chart.state = function(_) {
+ if (!arguments.length) return state;
+ state = _;
+ return chart;
+ };
+
+ chart.defaultState = function(_) {
+ if (!arguments.length) return defaultState;
+ defaultState = _;
+ return chart;
+ };
+
chart.noData = function(_) {
if (!arguments.length) return noData;
noData = _;
@@ -7759,33 +9252,36 @@ nv.models.scatter = function() {
// Public Variables with Default Settings
//------------------------------------------------------------
- var margin = {top: 0, right: 0, bottom: 0, left: 0}
- , width = 960
- , height = 500
- , color = nv.utils.defaultColor() // chooses color
- , id = Math.floor(Math.random() * 100000) //Create semi-unique ID incase
user doesn't selet one
- , x = d3.scale.linear()
- , y = d3.scale.linear()
- , z = d3.scale.linear() //linear because d3.svg.shape.size is treated as
area
- , getX = function(d) { return d.x } // accessor to get the x value
- , getY = function(d) { return d.y } // accessor to get the y value
- , getSize = function(d) { return d.size } // accessor to get the point size
- , getShape = function(d) { return d.shape || 'circle' } // accessor to get
point shape
- , forceX = [] // List of numbers to Force into the X scale (ie. 0, or a max /
min, etc.)
- , forceY = [] // List of numbers to Force into the Y scale
- , forceSize = [] // List of numbers to Force into the Size scale
- , interactive = true // If true, plots a voronoi overlay for advanced point
interection
- , pointActive = function(d) { return !d.notActive } // any points that return false
will be filtered out
- , clipEdge = false // if true, masks points within x and y scale
- , clipVoronoi = true // if true, masks each point with a circle... can turn off to
slightly increase performance
- , clipRadius = function() { return 25 } // function to get the radius for voronoi
point clips
- , xDomain = null // Override x domain (skips the calculation from data)
- , yDomain = null // Override y domain
- , sizeDomain = null // Override point size domain
- , sizeRange = null
- , singlePoint = false
- , dispatch = d3.dispatch('elementClick', 'elementMouseover',
'elementMouseout')
- , useVoronoi = true
+ var margin = {top: 0, right: 0, bottom: 0, left: 0}
+ , width = 960
+ , height = 500
+ , color = nv.utils.defaultColor() // chooses color
+ , id = Math.floor(Math.random() * 100000) //Create semi-unique ID incase
user doesn't select one
+ , x = d3.scale.linear()
+ , y = d3.scale.linear()
+ , z = d3.scale.linear() //linear because d3.svg.shape.size is treated as
area
+ , getX = function(d) { return d.x } // accessor to get the x value
+ , getY = function(d) { return d.y } // accessor to get the y value
+ , getSize = function(d) { return d.size || 1} // accessor to get the point size
+ , getShape = function(d) { return d.shape || 'circle' } // accessor to
get point shape
+ , onlyCircles = true // Set to false to use shapes
+ , forceX = [] // List of numbers to Force into the X scale (ie. 0, or a max /
min, etc.)
+ , forceY = [] // List of numbers to Force into the Y scale
+ , forceSize = [] // List of numbers to Force into the Size scale
+ , interactive = true // If true, plots a voronoi overlay for advanced point
intersection
+ , pointActive = function(d) { return !d.notActive } // any points that return false
will be filtered out
+ , padData = false // If true, adds half a data points width to front and back,
for lining up a line chart with a bar chart
+ , padDataOuter = .1 //outerPadding to imitate ordinal scale outer padding
+ , clipEdge = false // if true, masks points within x and y scale
+ , clipVoronoi = true // if true, masks each point with a circle... can turn off to
slightly increase performance
+ , clipRadius = function() { return 25 } // function to get the radius for voronoi
point clips
+ , xDomain = null // Override x domain (skips the calculation from data)
+ , yDomain = null // Override y domain
+ , sizeDomain = null // Override point size domain
+ , sizeRange = null
+ , singlePoint = false
+ , dispatch = d3.dispatch('elementClick', 'elementMouseover',
'elementMouseout')
+ , useVoronoi = true
;
//============================================================
@@ -7797,6 +9293,7 @@ nv.models.scatter = function() {
var x0, y0, z0 // used to store previous scales
, timeoutID
+ , needsUpdate = false // Flag for when the points are visually updating, but the
interactive layer is behind, to disable tooltips
;
//============================================================
@@ -7831,7 +9328,12 @@ nv.models.scatter = function() {
);
x .domain(xDomain || d3.extent(seriesData.map(function(d) { return d.x
}).concat(forceX)))
- .range([0, availableWidth]);
+
+ if (padData && data[0])
+ x.range([(availableWidth * padDataOuter + availableWidth) / (2
*data[0].values.length), availableWidth - availableWidth * (1 + padDataOuter) / (2 *
data[0].values.length) ]);
+ //x.range([availableWidth * .5 / data[0].values.length, availableWidth *
(data[0].values.length - .5) / data[0].values.length ]);
+ else
+ x.range([0, availableWidth]);
y .domain(yDomain || d3.extent(seriesData.map(function(d) { return d.y
}).concat(forceY)))
.range([availableHeight, 0]);
@@ -7907,45 +9409,109 @@ nv.models.scatter = function() {
);
- if (clipVoronoi) {
- defsEnter.append('clipPath').attr('id',
'nv-points-clip-' + id);
- var pointClips = wrap.select('#nv-points-clip-' +
id).selectAll('circle')
- .data(vertices);
- pointClips.enter().append('circle')
- .attr('r', clipRadius);
- pointClips.exit().remove();
- pointClips
- .attr('cx', function(d) { return d[0] })
- .attr('cy', function(d) { return d[1] });
+ //inject series and point index for reference into voronoi
+ if (useVoronoi === true) {
+
+ if (clipVoronoi) {
+ var pointClipsEnter =
wrap.select('defs').selectAll('.nv-point-clips')
+ .data([id])
+ .enter();
+
+ pointClipsEnter.append('clipPath')
+ .attr('class', 'nv-point-clips')
+ .attr('id', 'nv-points-clip-' + id);
+
+ var pointClips = wrap.select('#nv-points-clip-' +
id).selectAll('circle')
+ .data(vertices);
+ pointClips.enter().append('circle')
+ .attr('r', clipRadius);
+ pointClips.exit().remove();
+ pointClips
+ .attr('cx', function(d) { return d[0] })
+ .attr('cy', function(d) { return d[1] });
+
+ wrap.select('.nv-point-paths')
+ .attr('clip-path', 'url(#nv-points-clip-' + id +
')');
+ }
- wrap.select('.nv-point-paths')
- .attr('clip-path', 'url(#nv-points-clip-' + id +
')');
- }
+ // if(vertices.length < 3) {
+ // Issue #283 - Adding 2 dummy points to the voronoi b/c voronoi requires min
3 points to work
+ vertices.push([x.range()[0] - 20, y.range()[0] - 20, null, null]);
+ vertices.push([x.range()[1] + 20, y.range()[1] + 20, null, null]);
+ vertices.push([x.range()[0] - 20, y.range()[0] + 20, null, null]);
+ vertices.push([x.range()[1] + 20, y.range()[1] - 20, null, null]);
+ // }
+
+ var bounds = d3.geom.polygon([
+ [-10,-10],
+ [-10,height + 10],
+ [width + 10,height + 10],
+ [width + 10,-10]
+ ]);
- //inject series and point index for reference into voronoi
- if (useVoronoi === true) {
var voronoi = d3.geom.voronoi(vertices).map(function(d, i) {
return {
- 'data': d,
+ 'data': bounds.clip(d),
'series': vertices[i][2],
'point': vertices[i][3]
}
});
+
var pointPaths =
wrap.select('.nv-point-paths').selectAll('path')
.data(voronoi);
pointPaths.enter().append('path')
.attr('class', function(d,i) { return 'nv-path-'+i; });
pointPaths.exit().remove();
pointPaths
- .attr('d', function(d) { return 'M' +
d.data.join(',') + 'Z'; });
+ .attr('d', function(d) { return 'M' +
d.data.join('L') + 'Z'; });
+
+ pointPaths
+ .on('click', function(d) {
+ if (needsUpdate) return 0;
+ var series = data[d.series],
+ point = series.values[d.point];
+
+ dispatch.elementClick({
+ point: point,
+ series: series,
+ pos: [x(getX(point, d.point)) + margin.left, y(getY(point, d.point)) +
margin.top],
+ seriesIndex: d.series,
+ pointIndex: d.point
+ });
+ })
+ .on('mouseover', function(d) {
+ if (needsUpdate) return 0;
+ var series = data[d.series],
+ point = series.values[d.point];
+
+ dispatch.elementMouseover({
+ point: point,
+ series: series,
+ pos: [x(getX(point, d.point)) + margin.left, y(getY(point, d.point)) +
margin.top],
+ seriesIndex: d.series,
+ pointIndex: d.point
+ });
+ })
+ .on('mouseout', function(d, i) {
+ if (needsUpdate) return 0;
+ var series = data[d.series],
+ point = series.values[d.point];
+
+ dispatch.elementMouseout({
+ point: point,
+ series: series,
+ seriesIndex: d.series,
+ pointIndex: d.point
+ });
+ });
- eventElements = pointPaths;
} else {
+ /*
// bring data in form needed for click handlers
var dataWithPoints = vertices.map(function(d, i) {
return {
@@ -7954,54 +9520,58 @@ nv.models.scatter = function() {
'point': vertices[i][3]
}
});
+ */
// add event handlers to points instead voronoi paths
- eventElements =
wrap.select('.nv-groups').selectAll('.nv-group')
- .selectAll('path.nv-point')
- .data(dataWithPoints)
- .style('pointer-events', 'auto'); // recativate events,
disabled by css
- }
+ wrap.select('.nv-groups').selectAll('.nv-group')
+ .selectAll('.nv-point')
+ //.data(dataWithPoints)
+ //.style('pointer-events', 'auto') // recativate events,
disabled by css
+ .on('click', function(d,i) {
+ //nv.log('test', d, i);
+ if (needsUpdate || !data[d.series]) return 0; //check if this is a dummy
point
+ var series = data[d.series],
+ point = series.values[i];
- eventElements
- .on('click', function(d) {
- var series = data[d.series],
- point = series.values[d.point];
-
- dispatch.elementClick({
- point: point,
- series: series,
- pos: [x(getX(point, d.point)) + margin.left, y(getY(point, d.point)) +
margin.top],
- seriesIndex: d.series,
- pointIndex: d.point
- });
- })
- .on('mouseover', function(d) {
- var series = data[d.series],
- point = series.values[d.point];
+ dispatch.elementClick({
+ point: point,
+ series: series,
+ pos: [x(getX(point, i)) + margin.left, y(getY(point, i)) +
margin.top],
+ seriesIndex: d.series,
+ pointIndex: i
+ });
+ })
+ .on('mouseover', function(d,i) {
+ if (needsUpdate || !data[d.series]) return 0; //check if this is a dummy
point
+ var series = data[d.series],
+ point = series.values[i];
- dispatch.elementMouseover({
- point: point,
- series: series,
- pos: [x(getX(point, d.point)) + margin.left, y(getY(point, d.point)) +
margin.top],
- seriesIndex: d.series,
- pointIndex: d.point
- });
- })
- .on('mouseout', function(d, i) {
- var series = data[d.series],
- point = series.values[d.point];
+ dispatch.elementMouseover({
+ point: point,
+ series: series,
+ pos: [x(getX(point, i)) + margin.left, y(getY(point, i)) +
margin.top],
+ seriesIndex: d.series,
+ pointIndex: i
+ });
+ })
+ .on('mouseout', function(d,i) {
+ if (needsUpdate || !data[d.series]) return 0; //check if this is a dummy
point
+ var series = data[d.series],
+ point = series.values[i];
- dispatch.elementMouseout({
- point: point,
- series: series,
- seriesIndex: d.series,
- pointIndex: d.point
+ dispatch.elementMouseout({
+ point: point,
+ series: series,
+ seriesIndex: d.series,
+ pointIndex: i
+ });
});
- });
+ }
+ needsUpdate = false;
}
-
+ needsUpdate = true;
var groups = wrap.select('.nv-groups').selectAll('.nv-group')
.data(function(d) { return d }, function(d) { return d.key });
@@ -8022,38 +9592,62 @@ nv.models.scatter = function() {
.style('fill-opacity', .5);
- var points = groups.selectAll('path.nv-point')
- .data(function(d) { return d.values });
- points.enter().append('path')
- .attr('transform', function(d,i) {
- return 'translate(' + x0(getX(d,i)) + ',' + y0(getY(d,i)) +
')'
- })
- .attr('d',
- d3.svg.symbol()
- .type(getShape)
- .size(function(d,i) { return z(getSize(d,i)) })
- );
- points.exit().remove();
- d3.transition(groups.exit().selectAll('path.nv-point'))
- .attr('transform', function(d,i) {
- return 'translate(' + x(getX(d,i)) + ',' + y(getY(d,i)) +
')'
- })
- .remove();
- points.attr('class', function(d,i) { return 'nv-point nv-point-' +
i });
- d3.transition(points)
- .attr('transform', function(d,i) {
- return 'translate(' + x(getX(d,i)) + ',' + y(getY(d,i)) +
')'
- })
- .attr('d',
- d3.svg.symbol()
- .type(getShape)
- .size(function(d,i) { return z(getSize(d,i)) })
- );
+ if (onlyCircles) {
+
+ var points = groups.selectAll('circle.nv-point')
+ .data(function(d) { return d.values });
+ points.enter().append('circle')
+ .attr('cx', function(d,i) { return x0(getX(d,i)) })
+ .attr('cy', function(d,i) { return y0(getY(d,i)) })
+ .attr('r', function(d,i) { return Math.sqrt(z(getSize(d,i))/Math.PI)
});
+ points.exit().remove();
+ d3.transition(groups.exit().selectAll('path.nv-point'))
+ .attr('cx', function(d,i) { return x(getX(d,i)) })
+ .attr('cy', function(d,i) { return y(getY(d,i)) })
+ .remove();
+ points.attr('class', function(d,i) { return 'nv-point nv-point-'
+ i });
+ d3.transition(points)
+ .attr('cx', function(d,i) { return x(getX(d,i)) })
+ .attr('cy', function(d,i) { return y(getY(d,i)) })
+ .attr('r', function(d,i) { return Math.sqrt(z(getSize(d,i))/Math.PI)
});
+
+ } else {
+
+ var points = groups.selectAll('path.nv-point')
+ .data(function(d) { return d.values });
+ points.enter().append('path')
+ .attr('transform', function(d,i) {
+ return 'translate(' + x0(getX(d,i)) + ',' + y0(getY(d,i)) +
')'
+ })
+ .attr('d',
+ d3.svg.symbol()
+ .type(getShape)
+ .size(function(d,i) { return z(getSize(d,i)) })
+ );
+ points.exit().remove();
+ d3.transition(groups.exit().selectAll('path.nv-point'))
+ .attr('transform', function(d,i) {
+ return 'translate(' + x(getX(d,i)) + ',' + y(getY(d,i)) +
')'
+ })
+ .remove();
+ points.attr('class', function(d,i) { return 'nv-point nv-point-'
+ i });
+ d3.transition(points)
+ .attr('transform', function(d,i) {
+ //nv.log(d,i,getX(d,i), x(getX(d,i)));
+ return 'translate(' + x(getX(d,i)) + ',' + y(getY(d,i)) +
')'
+ })
+ .attr('d',
+ d3.svg.symbol()
+ .type(getShape)
+ .size(function(d,i) { return z(getSize(d,i)) })
+ );
+ }
// Delay updating the invisible interactive layer for smoother animation
clearTimeout(timeoutID); // stop repeat calls to updateInteractiveLayer
- timeoutID = setTimeout(updateInteractiveLayer, 1000);
+ timeoutID = setTimeout(updateInteractiveLayer, 300);
+ //updateInteractiveLayer();
//store old scales for use in transitions on update
x0 = x.copy();
@@ -8202,6 +9796,18 @@ nv.models.scatter = function() {
return chart;
};
+ chart.padData = function(_) {
+ if (!arguments.length) return padData;
+ padData = _;
+ return chart;
+ };
+
+ chart.padDataOuter = function(_) {
+ if (!arguments.length) return padDataOuter;
+ padDataOuter = _;
+ return chart;
+ };
+
chart.clipEdge = function(_) {
if (!arguments.length) return clipEdge;
clipEdge = _;
@@ -8241,6 +9847,12 @@ nv.models.scatter = function() {
return chart;
};
+ chart.onlyCircles = function(_) {
+ if (!arguments.length) return onlyCircles;
+ onlyCircles = _;
+ return chart;
+ };
+
chart.id = function(_) {
if (!arguments.length) return id;
id = _;
@@ -8274,7 +9886,7 @@ nv.models.scatterChart = function() {
, distY = nv.models.distribution()
;
- var margin = {top: 30, right: 20, bottom: 50, left: 60}
+ var margin = {top: 30, right: 20, bottom: 50, left: 75}
, width = null
, height = null
, color = nv.utils.defaultColor()
@@ -8293,7 +9905,9 @@ nv.models.scatterChart = function() {
, tooltipY = function(key, x, y) { return '<strong>' + y +
'</strong>' }
//, tooltip = function(key, x, y) { return '<h3>' + key +
'</h3>' }
, tooltip = null
- , dispatch = d3.dispatch('tooltipShow', 'tooltipHide')
+ , state = {}
+ , defaultState = null
+ , dispatch = d3.dispatch('tooltipShow', 'tooltipHide',
'stateChange', 'changeState')
, noData = "No Data Available."
;
@@ -8365,6 +9979,19 @@ nv.models.scatterChart = function() {
chart.update = function() { chart(selection) };
chart.container = this;
+ //set state.disabled
+ state.disabled = data.map(function(d) { return !!d.disabled });
+
+ if (!defaultState) {
+ var key;
+ defaultState = {};
+ for (key in state) {
+ if (state[key] instanceof Array)
+ defaultState[key] = state[key].slice(0);
+ else
+ defaultState[key] = state[key];
+ }
+ }
//------------------------------------------------------------
// Display noData message if there's nothing to show.
@@ -8405,10 +10032,10 @@ nv.models.scatterChart = function() {
var wrap = container.selectAll('g.nv-wrap.nv-scatterChart').data([data]);
var wrapEnter = wrap.enter().append('g').attr('class', 'nvd3
nv-wrap nv-scatterChart nv-chart-' + scatter.id());
var gEnter = wrapEnter.append('g');
- var g = wrap.select('g')
+ var g = wrap.select('g');
// background for pointer events
- gEnter.append('rect').attr('class', 'nvd3 nv-background')
+ gEnter.append('rect').attr('class', 'nvd3 nv-background');
gEnter.append('g').attr('class', 'nv-x nv-axis');
gEnter.append('g').attr('class', 'nv-y nv-axis');
@@ -8417,8 +10044,6 @@ nv.models.scatterChart = function() {
gEnter.append('g').attr('class', 'nv-legendWrap');
gEnter.append('g').attr('class', 'nv-controlsWrap');
- wrap.attr('transform', 'translate(' + margin.left + ',' +
margin.top + ')');
-
//------------------------------------------------------------
@@ -8459,6 +10084,9 @@ nv.models.scatterChart = function() {
//------------------------------------------------------------
+ wrap.attr('transform', 'translate(' + margin.left + ',' +
margin.top + ')');
+
+
//------------------------------------------------------------
// Main Chart Component(s)
@@ -8493,7 +10121,7 @@ nv.models.scatterChart = function() {
xAxis
.scale(x)
- .ticks( xAxis.ticks() ? xAxis.ticks() : availableWidth / 100 )
+ .ticks( xAxis.ticks() && xAxis.ticks().length ? xAxis.ticks() :
availableWidth / 100 )
.tickSize( -availableHeight , 0);
g.select('.nv-x.nv-axis')
@@ -8503,7 +10131,7 @@ nv.models.scatterChart = function() {
yAxis
.scale(y)
- .ticks( yAxis.ticks() ? yAxis.ticks() : availableHeight / 36 )
+ .ticks( yAxis.ticks() && yAxis.ticks().length ? yAxis.ticks() :
availableHeight / 36 )
.tickSize( -availableWidth, 0);
g.select('.nv-y.nv-axis')
@@ -8623,6 +10251,9 @@ nv.models.scatterChart = function() {
});
}
+ state.disabled = data.map(function(d) { return !!d.disabled });
+ dispatch.stateChange(state);
+
chart(selection);
});
@@ -8652,6 +10283,20 @@ nv.models.scatterChart = function() {
if (tooltips) showTooltip(e, that.parentNode);
});
+ // Update chart from a state object passed to event handler
+ dispatch.on('changeState', function(e) {
+
+ if (typeof e.disabled !== 'undefined') {
+ data.forEach(function(series,i) {
+ series.disabled = e.disabled[i];
+ });
+
+ state.disabled = e.disabled;
+ }
+
+ selection.call(chart);
+ });
+
//============================================================
@@ -8797,6 +10442,18 @@ nv.models.scatterChart = function() {
return chart;
};
+ chart.state = function(_) {
+ if (!arguments.length) return state;
+ state = _;
+ return chart;
+ };
+
+ chart.defaultState = function(_) {
+ if (!arguments.length) return defaultState;
+ defaultState = _;
+ return chart;
+ };
+
chart.noData = function(_) {
if (!arguments.length) return noData;
noData = _;
@@ -8824,7 +10481,7 @@ nv.models.scatterPlusLineChart = function() {
, distY = nv.models.distribution()
;
- var margin = {top: 30, right: 20, bottom: 50, left: 60}
+ var margin = {top: 30, right: 20, bottom: 50, left: 75}
, width = null
, height = null
, color = nv.utils.defaultColor()
@@ -8839,9 +10496,12 @@ nv.models.scatterPlusLineChart = function() {
, tooltips = true
, tooltipX = function(key, x, y) { return '<strong>' + x +
'</strong>' }
, tooltipY = function(key, x, y) { return '<strong>' + y +
'</strong>' }
- //, tooltip = function(key, x, y) { return '<h3>' + key +
'</h3>' }
- , tooltip = null
- , dispatch = d3.dispatch('tooltipShow', 'tooltipHide')
+ , tooltip = function(key, x, y, date) { return '<h3>' + key +
'</h3>'
+ + '<p>' + date +
'</p>' }
+ //, tooltip = null
+ , state = {}
+ , defaultState = null
+ , dispatch = d3.dispatch('tooltipShow', 'tooltipHide',
'stateChange', 'changeState')
, noData = "No Data Available."
;
@@ -8890,7 +10550,7 @@ nv.models.scatterPlusLineChart = function() {
if( tooltipY != null )
nv.tooltip.show([leftY, topY], tooltipY(e.series.key, xVal, yVal, e, chart),
'e', 1, offsetElement, 'y-nvtooltip');
if( tooltip != null )
- nv.tooltip.show([left, top], tooltip(e.series.key, xVal, yVal, e, chart),
e.value < 0 ? 'n' : 's', null, offsetElement);
+ nv.tooltip.show([left, top], tooltip(e.series.key, xVal, yVal, e.point.tooltip,
e, chart), e.value < 0 ? 'n' : 's', null, offsetElement);
};
var controlsData = [
@@ -8913,6 +10573,19 @@ nv.models.scatterPlusLineChart = function() {
chart.update = function() { chart(selection) };
chart.container = this;
+ //set state.disabled
+ state.disabled = data.map(function(d) { return !!d.disabled });
+
+ if (!defaultState) {
+ var key;
+ defaultState = {};
+ for (key in state) {
+ if (state[key] instanceof Array)
+ defaultState[key] = state[key].slice(0);
+ else
+ defaultState[key] = state[key];
+ }
+ }
//------------------------------------------------------------
// Display noData message if there's nothing to show.
@@ -9187,6 +10860,9 @@ nv.models.scatterPlusLineChart = function() {
});
}
+ state.disabled = data.map(function(d) { return !!d.disabled });
+ dispatch.stateChange(state);
+
chart(selection);
});
@@ -9216,6 +10892,20 @@ nv.models.scatterPlusLineChart = function() {
if (tooltips) showTooltip(e, that.parentNode);
});
+ // Update chart from a state object passed to event handler
+ dispatch.on('changeState', function(e) {
+
+ if (typeof e.disabled !== 'undefined') {
+ data.forEach(function(series,i) {
+ series.disabled = e.disabled[i];
+ });
+
+ state.disabled = e.disabled;
+ }
+
+ selection.call(chart);
+ });
+
//============================================================
@@ -9349,6 +11039,18 @@ nv.models.scatterPlusLineChart = function() {
return chart;
};
+ chart.state = function(_) {
+ if (!arguments.length) return state;
+ state = _;
+ return chart;
+ };
+
+ chart.defaultState = function(_) {
+ if (!arguments.length) return defaultState;
+ defaultState = _;
+ return chart;
+ };
+
chart.noData = function(_) {
if (!arguments.length) return noData;
noData = _;
@@ -9429,15 +11131,32 @@ nv.models.sparkline = function() {
// TODO: Add CURRENT data point (Need Min, Mac, Current / Most recent)
var points = wrap.selectAll('circle.nv-point')
- .data(function(d) { return d.filter(function(p,i) { return
y.domain().indexOf(getY(p,i)) != -1 || getX(p,i) == x.domain()[1] }) });
- points.enter().append('circle').attr('class', 'nv-point');
+ .data(function(data) {
+ var yValues = data.map(function(d, i) { return getY(d,i); });
+ function pointIndex(index) {
+ if (index != -1) {
+ var result = data[index];
+ result.pointIndex = index;
+ return result;
+ } else {
+ return null;
+ }
+ }
+ var maxPoint = pointIndex(yValues.lastIndexOf(y.domain()[1])),
+ minPoint = pointIndex(yValues.indexOf(y.domain()[0])),
+ currentPoint = pointIndex(yValues.length - 1);
+ return [minPoint, maxPoint, currentPoint].filter(function (d) {return d !=
null;});
+ });
+ points.enter().append('circle');
points.exit().remove();
points
- .attr('cx', function(d,i) { return x(getX(d,i)) })
- .attr('cy', function(d,i) { return y(getY(d,i)) })
+ .attr('cx', function(d,i) { return x(getX(d,d.pointIndex)) })
+ .attr('cy', function(d,i) { return y(getY(d,d.pointIndex)) })
.attr('r', 2)
- .style('stroke', function(d,i) { return d.x == x.domain()[1] ?
'#444' : d.y == y.domain()[0] ? '#d62728' : '#2ca02c' })
- .style('fill', function(d,i) { return d.x == x.domain()[1] ?
'#444' : d.y == y.domain()[0] ? '#d62728' : '#2ca02c' });
+ .attr('class', function(d,i) {
+ return getX(d, d.pointIndex) == x.domain()[1] ? 'nv-point
nv-currentValue' :
+ getY(d, d.pointIndex) == y.domain()[0] ? 'nv-point
nv-minValue' : 'nv-point nv-maxValue'
+ });
});
return chart;
@@ -9531,16 +11250,18 @@ nv.models.sparklinePlus = function() {
var sparkline = nv.models.sparkline();
- var margin = {top: 15, right: 40, bottom: 3, left: 40}
+ var margin = {top: 15, right: 100, bottom: 10, left: 50}
, width = null
, height = null
, x
, y
- , color = nv.utils.defaultColor()
- , index
+ , index = []
, paused = false
, xTickFormat = d3.format(',r')
, yTickFormat = d3.format(',.2f')
+ , showValue = true
+ , alignValue = true
+ , rightAlignValue = false
, noData = "No Data Available."
;
@@ -9556,6 +11277,7 @@ nv.models.sparklinePlus = function() {
availableHeight = (height || parseInt(container.style('height')) ||
400)
- margin.top - margin.bottom;
+ var currentValue = sparkline.y()(data[data.length-1], data.length-1);
chart.update = function() { chart(selection) };
chart.container = this;
@@ -9604,6 +11326,7 @@ nv.models.sparklinePlus = function() {
var g = wrap.select('g');
gEnter.append('g').attr('class', 'nv-sparklineWrap');
+ gEnter.append('g').attr('class', 'nv-valueWrap');
gEnter.append('g').attr('class', 'nv-hoverArea');
wrap.attr('transform', 'translate(' + margin.left + ',' +
margin.top + ')');
@@ -9621,81 +11344,99 @@ nv.models.sparklinePlus = function() {
.height(availableHeight);
sparklineWrap
- .style('stroke', function(d, i){ return d.color || color(d, i) })
.call(sparkline);
//------------------------------------------------------------
+ var valueWrap = g.select('.nv-valueWrap');
+
+ var value = valueWrap.selectAll('.nv-currentValue')
+ .data([currentValue]);
+
+ value.enter().append('text').attr('class',
'nv-currentValue')
+ .attr('dx', rightAlignValue ? -8 : 8)
+ .attr('dy', '.9em')
+ .style('text-anchor', rightAlignValue ? 'end' :
'start');
+
+ value
+ .attr('x', availableWidth + (rightAlignValue ? margin.right : 0))
+ .attr('y', alignValue ? function(d) { return y(d) } : 0)
+ .style('fill', sparkline.color()(data[data.length-1], data.length-1))
+ .text(yTickFormat(currentValue));
+
+
gEnter.select('.nv-hoverArea').append('rect')
.on('mousemove', sparklineHover)
.on('click', function() { paused = !paused })
- .on('mouseout', function() { index = null; updateValueLine(); });
+ .on('mouseout', function() { index = []; updateValueLine(); });
+ //.on('mouseout', function() { index = null; updateValueLine(); });
g.select('.nv-hoverArea rect')
.attr('transform', function(d) { return 'translate(' +
-margin.left + ',' + -margin.top + ')' })
.attr('width', availableWidth + margin.left + margin.right)
.attr('height', availableHeight + margin.top);
- // if index is not set, default to last point
- //index = typeof index == 'undefined' ? data.length - 1 : index;
- // if index is not set, default to null
- index = typeof index == 'undefined' ? null : index;
- var hoverValue = g.selectAll('.nv-hoverValue').data([index]);
- var hoverG = hoverValue.enter().append('g').attr('class',
'nv-hoverValue');
+ function updateValueLine() { //index is currently global (within the chart), may or
may not keep it that way
+ if (paused) return;
- var hoverLine = hoverG.append('line')
- .attr('x1', 0)
- .attr('y1', -margin.top)
- .attr('x2', 0)
- .attr('y2', availableHeight);
+ var hoverValue = g.selectAll('.nv-hoverValue').data(index)
- var hoverX = hoverG.append('text').attr('class',
'nv-xValue')
- .attr('x', -6)
- .attr('y', -margin.top)
- .attr('text-anchor', 'end')
- .attr('dy', '.9em');
+ var hoverEnter = hoverValue.enter()
+ .append('g').attr('class', 'nv-hoverValue')
+ .style('stroke-opacity', 0)
+ .style('fill-opacity', 0);
- var hoverY = hoverG.append('text').attr('class',
'nv-yValue')
- .attr('x', 6)
- .attr('y', -margin.top)
- .attr('text-anchor', 'start')
- .attr('dy', '.9em');
+ hoverValue.exit()
+ .transition().duration(250)
+ .style('stroke-opacity', 0)
+ .style('fill-opacity', 0)
+ .remove();
- updateValueLine();
+ hoverValue
+ .attr('transform', function(d) { return 'translate(' +
x(sparkline.x()(data[d],d)) + ',0)' })
+ .transition().duration(250)
+ .style('stroke-opacity', 1)
+ .style('fill-opacity', 1);
+ if (!index.length) return;
- function updateValueLine() { //index is currently global (within the chart), may or
may not keep it that way
- if (paused) return;
+ hoverEnter.append('line')
+ .attr('x1', 0)
+ .attr('y1', -margin.top)
+ .attr('x2', 0)
+ .attr('y2', availableHeight);
- hoverValue.data([index])
- //d3.transition(hoverValue)
- hoverValue
- .transition().duration(250)
- .style('stroke-opacity', function(d) { return d === null ? 0 : 1 })
- .style('fill-opacity', function(d) { return d === null ? 0 : 1 });
+ hoverEnter.append('text').attr('class', 'nv-xValue')
+ .attr('x', -6)
+ .attr('y', -margin.top)
+ .attr('text-anchor', 'end')
+ .attr('dy', '.9em')
- if (index == null) return;
- hoverValue
- .attr('transform', function(d) { return 'translate(' +
x(sparkline.x()(data[d],d)) + ',0)' })
+ g.select('.nv-hoverValue .nv-xValue')
+ .text(xTickFormat(sparkline.x()(data[index[0]], index[0])));
+
+ hoverEnter.append('text').attr('class', 'nv-yValue')
+ .attr('x', 6)
+ .attr('y', -margin.top)
+ .attr('text-anchor', 'start')
+ .attr('dy', '.9em')
- hoverValue.select('.nv-xValue')
- .text(xTickFormat(sparkline.x()(data[index], index)));
+ g.select('.nv-hoverValue .nv-yValue')
+ .text(yTickFormat(sparkline.y()(data[index[0]], index[0])));
- hoverValue.select('.nv-yValue')
- .text(yTickFormat(sparkline.y()(data[index], index)));
}
function sparklineHover() {
if (paused) return;
- var pos = d3.event.offsetX - margin.left;
+ var pos = d3.mouse(this)[0] - margin.left;
function getClosestIndex(data, x) {
var distance = Math.abs(sparkline.x()(data[0], 0) - x);
@@ -9709,7 +11450,7 @@ nv.models.sparklinePlus = function() {
return closestIndex;
}
- index = getClosestIndex(data, Math.round(x.invert(pos)));
+ index = [getClosestIndex(data, Math.round(x.invert(pos)))];
updateValueLine();
}
@@ -9727,7 +11468,7 @@ nv.models.sparklinePlus = function() {
// expose chart's sub-components
chart.sparkline = sparkline;
- d3.rebind(chart, sparkline, 'x', 'y', 'xScale',
'yScale');
+ d3.rebind(chart, sparkline, 'x', 'y', 'xScale',
'yScale', 'color');
chart.margin = function(_) {
if (!arguments.length) return margin;
@@ -9762,6 +11503,24 @@ nv.models.sparklinePlus = function() {
return chart;
};
+ chart.showValue = function(_) {
+ if (!arguments.length) return showValue;
+ showValue = _;
+ return chart;
+ };
+
+ chart.alignValue = function(_) {
+ if (!arguments.length) return alignValue;
+ alignValue = _;
+ return chart;
+ };
+
+ chart.rightAlignValue = function(_) {
+ if (!arguments.length) return rightAlignValue;
+ rightAlignValue = _;
+ return chart;
+ };
+
chart.noData = function(_) {
if (!arguments.length) return noData;
noData = _;
@@ -9800,7 +11559,7 @@ nv.models.stackedArea = function() {
scatter
.size(2.2) // default size
- .sizeDomain([2.2]) // all the same size by default
+ .sizeDomain([2.2,2.2]) // all the same size by default
;
/************************************
@@ -9891,7 +11650,8 @@ nv.models.stackedArea = function() {
var scatterWrap = g.select('.nv-scatterWrap')
.datum(data.filter(function(d) { return !d.disabled }))
- d3.transition(scatterWrap).call(scatter);
+ //d3.transition(scatterWrap).call(scatter);
+ scatterWrap.call(scatter);
@@ -9953,13 +11713,15 @@ nv.models.stackedArea = function() {
seriesIndex: i
});
})
- d3.transition(path.exit())
+ //d3.transition(path.exit())
+ path.exit()
.attr('d', function(d,i) { return zeroArea(d.values,i) })
.remove();
path
.style('fill', function(d,i){ return d.color || color(d, i) })
.style('stroke', function(d,i){ return d.color || color(d, i) });
- d3.transition(path)
+ //d3.transition(path)
+ path
.attr('d', function(d,i) { return area(d.values,i) })
@@ -10134,13 +11896,16 @@ nv.models.stackedAreaChart = function() {
, x //can be accessed via chart.xScale()
, y //can be accessed via chart.yScale()
, yAxisTickFormat = d3.format(',.2f')
+ , state = { style: stacked.style() }
+ , defaultState = null
, noData = 'No Data Available.'
- , dispatch = d3.dispatch('tooltipShow', 'tooltipHide')
+ , dispatch = d3.dispatch('tooltipShow', 'tooltipHide',
'stateChange', 'changeState')
+ , controlWidth = 250
;
xAxis
.orient('bottom')
- .tickPadding(5)
+ .tickPadding(7)
;
yAxis
.orient('left')
@@ -10185,6 +11950,20 @@ nv.models.stackedAreaChart = function() {
chart.update = function() { chart(selection) };
chart.container = this;
+ //set state.disabled
+ state.disabled = data.map(function(d) { return !!d.disabled });
+
+ if (!defaultState) {
+ var key;
+ defaultState = {};
+ for (key in state) {
+ if (state[key] instanceof Array)
+ defaultState[key] = state[key].slice(0);
+ else
+ defaultState[key] = state[key];
+ }
+ }
+
//------------------------------------------------------------
// Display No Data message if there's nothing to show.
@@ -10239,7 +12018,7 @@ nv.models.stackedAreaChart = function() {
if (showLegend) {
legend
- .width( availableWidth * 2 / 3 );
+ .width( availableWidth - controlWidth );
g.select('.nv-legendWrap')
.datum(data)
@@ -10252,7 +12031,7 @@ nv.models.stackedAreaChart = function() {
}
g.select('.nv-legendWrap')
- .attr('transform', 'translate(' + ( availableWidth * 1 / 3 )
+ ',' + (-margin.top) +')');
+ .attr('transform', 'translate(' + controlWidth + ','
+ (-margin.top) +')');
}
//------------------------------------------------------------
@@ -10269,7 +12048,7 @@ nv.models.stackedAreaChart = function() {
];
controls
- .width( Math.min(280, availableWidth * 1 / 3) )
+ .width( controlWidth )
.color(['#444', '#444', '#444']);
g.select('.nv-controlsWrap')
@@ -10303,7 +12082,8 @@ nv.models.stackedAreaChart = function() {
var stackedWrap = g.select('.nv-stackedWrap')
.datum(data);
- d3.transition(stackedWrap).call(stacked);
+ //d3.transition(stackedWrap).call(stacked);
+ stackedWrap.call(stacked);
//------------------------------------------------------------
@@ -10318,7 +12098,9 @@ nv.models.stackedAreaChart = function() {
g.select('.nv-x.nv-axis')
.attr('transform', 'translate(0,' + availableHeight +
')');
- d3.transition(g.select('.nv-x.nv-axis'))
+ //d3.transition(g.select('.nv-x.nv-axis'))
+ g.select('.nv-x.nv-axis')
+ .transition().duration(0)
.call(xAxis);
yAxis
@@ -10327,7 +12109,9 @@ nv.models.stackedAreaChart = function() {
.tickSize(-availableWidth, 0)
.setTickFormat(stacked.offset() == 'expand' ? d3.format('%') :
yAxisTickFormat);
- d3.transition(g.select('.nv-y.nv-axis'))
+ //d3.transition(g.select('.nv-y.nv-axis'))
+ g.select('.nv-y.nv-axis')
+ .transition().duration(0)
.call(yAxis);
//------------------------------------------------------------
@@ -10349,7 +12133,11 @@ nv.models.stackedAreaChart = function() {
return d
});
- selection.transition().call(chart);
+ state.disabled = data.map(function(d) { return !!d.disabled });
+ dispatch.stateChange(state);
+
+ //selection.transition().call(chart);
+ chart(selection);
});
legend.dispatch.on('legendClick', function(d,i) {
@@ -10362,7 +12150,11 @@ nv.models.stackedAreaChart = function() {
});
}
- selection.transition().call(chart);
+ state.disabled = data.map(function(d) { return !!d.disabled });
+ dispatch.stateChange(state);
+
+ //selection.transition().call(chart);
+ chart(selection);
});
controls.dispatch.on('legendClick', function(d,i) {
@@ -10386,13 +12178,35 @@ nv.models.stackedAreaChart = function() {
break;
}
- selection.transition().call(chart);
+ state.style = stacked.style();
+ dispatch.stateChange(state);
+
+ //selection.transition().call(chart);
+ chart(selection);
});
dispatch.on('tooltipShow', function(e) {
if (tooltips) showTooltip(e, that.parentNode);
});
+ // Update chart from a state object passed to event handler
+ dispatch.on('changeState', function(e) {
+
+ if (typeof e.disabled !== 'undefined') {
+ data.forEach(function(series,i) {
+ series.disabled = e.disabled[i];
+ });
+
+ state.disabled = e.disabled;
+ }
+
+ if (typeof e.style !== 'undefined') {
+ stacked.style(e.style);
+ }
+
+ selection.call(chart);
+ });
+
});
@@ -10502,6 +12316,18 @@ nv.models.stackedAreaChart = function() {
return chart;
};
+ chart.state = function(_) {
+ if (!arguments.length) return state;
+ state = _;
+ return chart;
+ };
+
+ chart.defaultState = function(_) {
+ if (!arguments.length) return defaultState;
+ defaultState = _;
+ return chart;
+ };
+
chart.noData = function(_) {
if (!arguments.length) return noData;
noData = _;
@@ -10509,6 +12335,7 @@ nv.models.stackedAreaChart = function() {
};
yAxis.setTickFormat = yAxis.tickFormat;
+
yAxis.tickFormat = function(_) {
if (!arguments.length) return yAxisTickFormat;
yAxisTickFormat = _;
commit d81ef0a6ec22ddc6ce32eeb2a47754a6f9abb01b
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Fri May 3 13:42:29 2013 -0700
[BZ 958938] - Dashboard graphs need refresh when switching View/Edit portlet modes.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
index 779c795..9c310ca 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
@@ -784,6 +784,7 @@ public class DashboardView extends EnhancedVLayout {
}
this.editForm.markForRedraw();
this.portalLayout.show();
+ redraw();
this.portalLayout.markForRedraw();
}
commit 8737595774416a54383483fdd1678a436226af05
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Fri May 3 16:38:56 2013 +0200
Bug 911321 - [EAP 6.1] Reload operation fails in standalone mode
EAP can close the management http connection when receiving a reload operation
request. In this case, we will set a specific error message in ASConnection which
BaseServerComponent code will be able to detect.
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
index 729201f..662d6ef 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
@@ -33,6 +33,7 @@ import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
+import org.apache.http.NoHttpResponseException;
import org.apache.http.StatusLine;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
@@ -82,6 +83,8 @@ public class ASConnection {
@Deprecated
public static final String MANAGEMENT = MANAGEMENT_URI;
+ static final String FAILURE_NO_RESPONSE = "The server closed the connection
before sending the response";
+
private static final Log LOG = LogFactory.getLog(ASConnection.class);
private static final int MAX_POOLED_CONNECTIONS = 10;
@@ -367,6 +370,16 @@ public class ASConnection {
return operationResult;
+ } catch (NoHttpResponseException e) {
+ // For some operations like reload or shutdown, the server closes the
connection before sending the
+ // response. We use a specific description here so that callers can write
code to decide what to do
+ // in this situation.
+ Result failure = new Result();
+ failure.setFailureDescription(FAILURE_NO_RESPONSE);
+ failure.setOutcome("failure");
+ failure.setRhqThrowable(e);
+ JsonNode ret = mapper.valueToTree(failure);
+ return ret;
} catch (IOException e) {
Result failure = new Result();
failure.setFailureDescription(e.getMessage());
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
index 6d889c5..b80a39a 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2012 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,13 +13,12 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.modules.plugins.jbossas7;
import java.io.File;
-import java.net.ConnectException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
@@ -54,6 +53,7 @@ import org.rhq.core.system.ProcessExecutionResults;
import org.rhq.core.system.ProcessInfo;
import org.rhq.core.system.SystemInfo;
import org.rhq.core.util.PropertiesFileUpdate;
+import org.rhq.core.util.StringUtil;
import org.rhq.modules.plugins.jbossas7.helper.HostConfiguration;
import org.rhq.modules.plugins.jbossas7.helper.HostPort;
import org.rhq.modules.plugins.jbossas7.helper.ServerPluginConfiguration;
@@ -492,26 +492,23 @@ public abstract class BaseServerComponent<T extends
ResourceComponent<?>> extend
return operationResult;
}
- if (name.equals("shutdown") || name.equals("restart")) {
+ if (name.equals("shutdown") || name.equals("restart") ||
name.equals("reload")) {
/*
- * Shutdown needs a special treatment, because after sending the operation,
if shutdown succeeds,
- * the server connection is closed and we can't read from it. So if we
get connection refused for
- * reading, this is a good sign.
+ * Shutdown, restart and reload need a special treatment, because after
sending the operation, event if
+ * it succeeds, the server connection is sometimes closed and we can't
read from it.
*/
if (!res.isSuccess()) {
- if (res.getRhqThrowable() != null
- && (res.getRhqThrowable() instanceof ConnectException ||
res.getRhqThrowable().getMessage()
- .equals("Connection refused"))) {
+ if (StringUtil.isNotBlank(res.getFailureDescription())
+ &&
res.getFailureDescription().startsWith(ASConnection.FAILURE_NO_RESPONSE)) {
operationResult.setSimpleResult("Success");
- log.debug("Got a ConnectionRefused for operation "
- + name
- + " this is considered ok, as the remote server sometimes
closes the communications channel before sending a reply");
- }
- if (res.getFailureDescription().contains("Socket closed")) { //
See
https://issues.jboss.org/browse/AS7-4192
- operationResult.setSimpleResult("Success");
- log.debug("Got a 'Socket closed' result from AS for
operation " + name);
- } else
+ if (log.isDebugEnabled()) {
+ log.debug("Got no response for operation '" + name
+ "'. "
+ + "This is considered ok, as the remote server
sometimes closes the communications "
+ + "channel before sending a reply");
+ }
+ } else {
operationResult.setErrorMessage(res.getFailureDescription());
+ }
} else {
operationResult.setSimpleResult("Success");
}
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/StandaloneASComponent.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/StandaloneASComponent.java
index 778d127..d399d1b 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/StandaloneASComponent.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/StandaloneASComponent.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2012 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.modules.plugins.jbossas7;
@@ -213,7 +213,9 @@ public class StandaloneASComponent<T extends
ResourceComponent<?>> extends BaseS
count++;
}
- log.debug("waitUntilReloaded: Used " + count + " delay round(s) to
reload. Reload=" + reloaded);
+ if (log.isDebugEnabled()) {
+ log.debug("waitUntilReloaded: Used " + count + " delay
round(s) to reload. Reload=" + reloaded);
+ }
return reloaded;
}
commit 1ad9d648c0c90774d4a3379d54802c7ecd771b97
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Fri May 3 10:44:30 2013 +0200
as7plugin: LD_LIBRARY_PATH is not necessarily discovered in Linux environment
diff --git
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractServerComponentTest.java
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractServerComponentTest.java
index 7aa92b6..f34a554 100644
---
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractServerComponentTest.java
+++
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractServerComponentTest.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2012 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.modules.plugins.jbossas7.itest;
@@ -205,14 +205,6 @@ public abstract class AbstractServerComponentTest extends
AbstractJBossAS7Plugin
String[] pathElements = path.split(File.pathSeparator);
Assert.assertTrue(pathElements.length >= 1);
Assert.assertTrue(new File(pathElements[0]).isDirectory());
-
- if (File.separatorChar == '/') {
- String ldLibraryPath = env.get("LD_LIBRARY_PATH");
- Assert.assertNotNull(ldLibraryPath);
- String[] ldLibraryPathElements = ldLibraryPath.split(File.pathSeparator);
- Assert.assertTrue(ldLibraryPathElements.length >= 1);
- Assert.assertTrue(new File(ldLibraryPathElements[0]).isDirectory());
- }
}
protected abstract String getBindAddressSystemPropertyName();
commit 059c8c96f82bf1c20863fde8ba334b95b5a98687
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Thu May 2 11:46:26 2013 -0700
[BZ 958734] - Add autogroup metric to dashboard fails for d3 graphs. Turned off the
autogroups right click menu to create dashboard graphs from resource tree as the full fix
for this is risky given we are releasing 4.7 straightaway.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupContextMenu.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupContextMenu.java
index 87c73c2..0fe3cd9 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupContextMenu.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupContextMenu.java
@@ -247,156 +247,161 @@ public class ResourceGroupContextMenu extends Menu {
addItem(operations);
// Metric graph addition menu
- addItem(buildMetricsMenu(resourceType));
+ addItem(buildMetricsMenu(resourceType, group));
}
- private MenuItem buildMetricsMenu(final ResourceType type) {
+ private MenuItem buildMetricsMenu(final ResourceType type, final ResourceGroup
resourceGroup) {
MenuItem measurements = new
MenuItem(MSG.view_tree_common_contextMenu_measurements());
final Menu measurementsSubMenu = new Menu();
DashboardCriteria criteria = new DashboardCriteria();
- GWTServiceLookup.getDashboardService().findDashboardsByCriteria(criteria,
- new AsyncCallback<PageList<Dashboard>>() {
- public void onFailure(Throwable caught) {
-
CoreGUI.getErrorHandler().handleError(MSG.view_tree_common_contextMenu_loadFail_dashboards(),
- caught);
- }
-
- public void onSuccess(PageList<Dashboard> result) {
-
- if (type.getMetricDefinitions() != null) {
- //sort the display items alphabetically
- TreeSet<String> ordered = new TreeSet<String>();
- Map<String, MeasurementDefinition> definitionMap = new
HashMap<String, MeasurementDefinition>();
- for (MeasurementDefinition m : type.getMetricDefinitions()) {
- ordered.add(m.getDisplayName());
- definitionMap.put(m.getDisplayName(), m);
- }
-
- for (String displayName : ordered) {
- final MeasurementDefinition def =
definitionMap.get(displayName);
- //only add menu items for Measurement
- if (def.getDataType().equals(DataType.MEASUREMENT)) {
- MenuItem defItem = new MenuItem(def.getDisplayName());
- measurementsSubMenu.addItem(defItem);
- Menu defSubItem = new Menu();
- defItem.setSubmenu(defSubItem);
-
- for (final Dashboard d : result) {
- MenuItem addToDBItem = new MenuItem(MSG
-
.view_tree_common_contextMenu_addChartToDashboard(d.getName()));
- defSubItem.addItem(addToDBItem);
-
- addToDBItem.addClickHandler(new ClickHandler() {
- public void onClick(MenuItemClickEvent
menuItemClickEvent) {
-
- DashboardPortlet p = new
DashboardPortlet(MSG
-
.view_tree_common_contextMenu_groupGraph(),
- ResourceGroupD3GraphPortlet.KEY, 250);
- p.getConfiguration().put(
- new
PropertySimple(ResourceGroupD3GraphPortlet.CFG_RESOURCE_GROUP_ID,
- group.getId()));
- p.getConfiguration().put(
- new
PropertySimple(ResourceGroupD3GraphPortlet.CFG_DEFINITION_ID, def
- .getId()));
-
- d.addPortlet(p);
-
-
GWTServiceLookup.getDashboardService().storeDashboard(d,
- new AsyncCallback<Dashboard>() {
- public void onFailure(Throwable
caught) {
- CoreGUI
- .getErrorHandler()
- .handleError(
-
MSG.view_tree_common_contextMenu_saveChartToDashboardFailure(),
- caught);
- }
-
- public void onSuccess(Dashboard
result) {
- String msg = MSG
-
.view_tree_common_contextMenu_saveChartToDashboardSuccessful(result
- .getName());
-
CoreGUI.getMessageCenter().notify(
- new Message(msg,
Message.Severity.Info));
- }
- });
-
- }
- });
-
- //add new menu item for adding current graphable
element to view if on Monitor/Graphs tab
- String currentViewPath = History.getToken();
- if
(currentViewPath.indexOf("Monitoring/NewGraphs") > -1) {
- MenuItem addGraphItem = new
MenuItem(MSG.common_title_add_graph_to_view());
- defSubItem.addItem(addGraphItem);
+ final EntityContext context = EntityContext.forGroup(resourceGroup);
+ if(!context.isAutoGroup()){
+
+ GWTServiceLookup.getDashboardService().findDashboardsByCriteria(criteria,
+ new AsyncCallback<PageList<Dashboard>>() {
+ public void onFailure(Throwable caught) {
+
CoreGUI.getErrorHandler().handleError(MSG.view_tree_common_contextMenu_loadFail_dashboards(),
+ caught);
+ }
- addGraphItem.addClickHandler(new ClickHandler()
{
+ public void onSuccess(PageList<Dashboard> result) {
+
+ if (type.getMetricDefinitions() != null) {
+ //sort the display items alphabetically
+ TreeSet<String> ordered = new TreeSet<String>();
+ Map<String, MeasurementDefinition> definitionMap = new
HashMap<String, MeasurementDefinition>();
+ for (MeasurementDefinition m : type.getMetricDefinitions())
{
+ ordered.add(m.getDisplayName());
+ definitionMap.put(m.getDisplayName(), m);
+ }
+
+ for (String displayName : ordered) {
+ final MeasurementDefinition def =
definitionMap.get(displayName);
+ //only add menu items for Measurement
+ if (def.getDataType().equals(DataType.MEASUREMENT)) {
+ MenuItem defItem = new
MenuItem(def.getDisplayName());
+ measurementsSubMenu.addItem(defItem);
+ Menu defSubItem = new Menu();
+ defItem.setSubmenu(defSubItem);
+
+ for (final Dashboard d : result) {
+
+ MenuItem addToDBItem = new MenuItem(MSG
+
.view_tree_common_contextMenu_addChartToDashboard(d.getName()));
+ defSubItem.addItem(addToDBItem);
+
+ addToDBItem.addClickHandler(new ClickHandler() {
public void onClick(MenuItemClickEvent
menuItemClickEvent) {
- //generate javascript to call out to.
- //Ex.
menuLayers.hide();addMetric('${metric.resourceId},${metric.scheduleId}')
- String grpGraphElements = "";
- if (isAutoGroup) {
- grpGraphElements += "ag,";
- } else {
- grpGraphElements += "cg,";
- }
- grpGraphElements += group.getId() +
"," + def.getId();
- if (isAutoGroup) {//need to postpend the
resource type as third element
- grpGraphElements += "," +
group.getResourceType().getId();
- }
- //construct portal.war url to access
- String baseUrl =
"/resource/common/monitor/visibility/IndicatorCharts.do";
- //No need to rebuild the autogroup url as
everything handled as a compatible group now
- //
if (isAutoGroup) {
- //
//Ex. ?parent=10001&ctype=1013&view=Default
- //
baseUrl += "?parent=" + group.getAutoGroupParentResource().getId()
- //
+ "&ctype="
- //
+ group.getResourceType().getId();
- //
jsCode = "ag," + group.getAutoGroupParentResource().getId() +
","
- //
+ def.getId() + ","
- //
+ group.getResourceType().getId();
- //
} else {
- //Ex. ?groupId=10001&view=Default
- baseUrl += "?groupId=" +
group.getId();
- baseUrl +=
"&view=Default";
- baseUrl +=
"&action=addChart&metric=" + grpGraphElements;
- baseUrl +=
"&view=Default";
- final String url = baseUrl;
- //initiate HTTP request
- final RequestBuilder b = new
RequestBuilder(RequestBuilder.GET, baseUrl);
-
- try {
- b.setCallback(new RequestCallback()
{
- public void
onResponseReceived(final Request request,
- final Response response) {
- Log.trace("Successfully
submitted request to add graph to view:"
- + url);
-
- //kick off a page reload.
- String currentViewPath =
History.getToken();
-
CoreGUI.goToView(currentViewPath, true);
+
+ DashboardPortlet p = new
DashboardPortlet(MSG
+
.view_tree_common_contextMenu_groupGraph(),
+ ResourceGroupD3GraphPortlet.KEY,
250);
+ p.getConfiguration().put(
+ new
PropertySimple(ResourceGroupD3GraphPortlet.CFG_RESOURCE_GROUP_ID,
+ group.getId()));
+ p.getConfiguration().put(
+ new
PropertySimple(ResourceGroupD3GraphPortlet.CFG_DEFINITION_ID, def
+ .getId()));
+
+ d.addPortlet(p);
+
+
GWTServiceLookup.getDashboardService().storeDashboard(d,
+ new AsyncCallback<Dashboard>()
{
+ public void onFailure(Throwable
caught) {
+ CoreGUI
+ .getErrorHandler()
+ .handleError(
+
MSG.view_tree_common_contextMenu_saveChartToDashboardFailure(),
+ caught);
}
- @Override
- public void onError(Request
request, Throwable t) {
- Log.trace("Error adding
Metric:" + url, t);
+ public void onSuccess(Dashboard
result) {
+ String msg = MSG
+
.view_tree_common_contextMenu_saveChartToDashboardSuccessful(result
+ .getName());
+
CoreGUI.getMessageCenter().notify(
+ new Message(msg,
Message.Severity.Info));
}
});
- b.send();
- } catch (RequestException e) {
- Log.trace("Error adding
Metric:" + url, e);
- }
- }//end of onClick definition
- });//end of onClick Handler definition
- }//end of Monitoring/Graphs view check
- }//end of dashabord iteration
- }//end of check for Measurement
- }//end of metric definition iteration
- }
- }
- });
+ }
+ });
+
+ //add new menu item for adding current graphable
element to view if on Monitor/Graphs tab
+ String currentViewPath = History.getToken();
+ if
(currentViewPath.contains("Monitoring/NewGraphs")) {
+ MenuItem addGraphItem = new
MenuItem(MSG.common_title_add_graph_to_view());
+ defSubItem.addItem(addGraphItem);
+
+ addGraphItem.addClickHandler(new
ClickHandler() {
+ public void onClick(MenuItemClickEvent
menuItemClickEvent) {
+ //generate javascript to call out
to.
+ //Ex.
menuLayers.hide();addMetric('${metric.resourceId},${metric.scheduleId}')
+ String grpGraphElements =
"";
+ if (isAutoGroup) {
+ grpGraphElements +=
"ag,";
+ } else {
+ grpGraphElements +=
"cg,";
+ }
+ grpGraphElements += group.getId() +
"," + def.getId();
+ if (isAutoGroup) {//need to postpend
the resource type as third element
+ grpGraphElements += ","
+ group.getResourceType().getId();
+ }
+ //construct portal.war url to access
+ String baseUrl =
"/resource/common/monitor/visibility/IndicatorCharts.do";
+ //No need to rebuild the autogroup
url as everything handled as a compatible group now
+ //
if (isAutoGroup) {
+ //
//Ex. ?parent=10001&ctype=1013&view=Default
+ //
baseUrl += "?parent=" +
group.getAutoGroupParentResource().getId()
+ //
+ "&ctype="
+ //
+ group.getResourceType().getId();
+ //
jsCode = "ag," + group.getAutoGroupParentResource().getId() +
","
+ //
+ def.getId() + ","
+ //
+ group.getResourceType().getId();
+ //
} else {
+ //Ex.
?groupId=10001&view=Default
+ baseUrl += "?groupId=" +
group.getId();
+ baseUrl +=
"&view=Default";
+ baseUrl +=
"&action=addChart&metric=" + grpGraphElements;
+ baseUrl +=
"&view=Default";
+ final String url = baseUrl;
+ //initiate HTTP request
+ final RequestBuilder b = new
RequestBuilder(RequestBuilder.GET, baseUrl);
+
+ try {
+ b.setCallback(new
RequestCallback() {
+ public void
onResponseReceived(final Request request,
+ final Response response)
{
+
Log.trace("Successfully submitted request to add graph to view:"
+ + url);
+
+ //kick off a page
reload.
+ String currentViewPath =
History.getToken();
+
CoreGUI.goToView(currentViewPath, true);
+ }
+
+ @Override
+ public void onError(Request
request, Throwable t) {
+ Log.trace("Error
adding Metric:" + url, t);
+ }
+ });
+ b.send();
+ } catch (RequestException e) {
+ Log.trace("Error adding
Metric:" + url, e);
+ }
+ }//end of onClick definition
+ });//end of onClick Handler definition
+ }//end of Monitoring/Graphs view check
+ }//end of dashabord iteration
+ }//end of check for Measurement
+ }//end of metric definition iteration
+ }
+
+ }
+ });
+ }
measurements.setSubmenu(measurementsSubMenu);
return measurements;
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
index 72a46a8..071f831 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
@@ -757,7 +757,7 @@ public class ResourceTreeView extends EnhancedVLayout {
defItem.setSubmenu(defSubItem);
for (final Dashboard d : result) {
- MenuItem addToDBItem = new MenuItem("d3-"+MSG
+ MenuItem addToDBItem = new MenuItem(MSG
.view_tree_common_contextMenu_addChartToDashboard(d.getName()));
defSubItem.addItem(addToDBItem);
@@ -802,7 +802,7 @@ public class ResourceTreeView extends EnhancedVLayout {
//add new menu item for adding current graphable element to
view if on Monitor/Graphs tab
String currentViewPath = History.getToken();
- if (currentViewPath.indexOf("Monitoring/Graphs")
> -1) {
+ if
(currentViewPath.contains("Monitoring/NewGraphs")) {
MenuItem addGraphItem = new
MenuItem(MSG.common_title_add_graph_to_view());
defSubItem.addItem(addGraphItem);
commit d6ff5eb184fb65c358c2af40e42d0156f69c1475
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Thu May 2 07:47:04 2013 -0700
[BZ 924300] - Time range start date and the date picker disappears on clicking
'Advanced' button on time range selector.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/measurement/AbstractMeasurementRangeEditor.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/measurement/AbstractMeasurementRangeEditor.java
index 406a4fe..328112f 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/measurement/AbstractMeasurementRangeEditor.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/measurement/AbstractMeasurementRangeEditor.java
@@ -257,7 +257,7 @@ public abstract class AbstractMeasurementRangeEditor extends
DynamicForm impleme
protected void update() {
if (advanced) {
advancedSimpleButton.setTitle(MSG.view_measureRange_simple());
- showItem(ADVANCED_END_ITEM);
+ showItem(ADVANCED_START_ITEM);
showItem(ADVANCED_END_ITEM);
hideItem(SIMPLE_VALUE_ITEM);
hideItem(SIMPLE_UNIT_ITEM);
commit 8e62d50b8edd576ca3b53ecb9c198d9df288b35d
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Thu May 2 12:55:57 2013 +0200
Bug 952652 - Unable to delete a user who has saved searches objects in the database
Now deleting saved searches prior to deleting the user.
Merged delete methods.
Fail fast if caller tries to delete a superuser.
Added itest for the BZ
diff --git
a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/auth/test/SubjectManagerBeanTest.java
b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/auth/test/SubjectManagerBeanTest.java
index 4b17dc5..9f204dd 100644
---
a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/auth/test/SubjectManagerBeanTest.java
+++
b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/auth/test/SubjectManagerBeanTest.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.server.auth.test;
@@ -41,6 +41,8 @@ import org.rhq.core.domain.authz.Role;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.criteria.SubjectCriteria;
+import org.rhq.core.domain.search.SavedSearch;
+import org.rhq.core.domain.search.SearchSubsystem;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.core.domain.util.PageOrdering;
@@ -50,6 +52,7 @@ import org.rhq.enterprise.server.auth.SubjectManagerLocal;
import org.rhq.enterprise.server.authz.AuthorizationManagerLocal;
import org.rhq.enterprise.server.authz.PermissionException;
import org.rhq.enterprise.server.authz.RoleManagerLocal;
+import org.rhq.enterprise.server.search.SavedSearchManagerLocal;
import org.rhq.enterprise.server.test.AbstractEJB3Test;
import org.rhq.enterprise.server.test.TransactionCallback;
import org.rhq.enterprise.server.util.LookupUtil;
@@ -70,12 +73,14 @@ public class SubjectManagerBeanTest extends AbstractEJB3Test {
private SubjectManagerLocal subjectManager;
private AuthorizationManagerLocal authorizationManager;
private RoleManagerLocal roleManager;
+ private SavedSearchManagerLocal savedSearchManager;
@Override
protected void beforeMethod() {
subjectManager = LookupUtil.getSubjectManager();
authorizationManager = LookupUtil.getAuthorizationManager();
roleManager = LookupUtil.getRoleManager();
+ savedSearchManager = LookupUtil.getSavedSearchManager();
createITestSubject();
}
@@ -756,4 +761,24 @@ public class SubjectManagerBeanTest extends AbstractEJB3Test {
}
});
}
-}
\ No newline at end of file
+
+ public void shouldBeAbleToDeleteASubjectWhoOwnsASavedSearch() {
+ // See
https://bugzilla.redhat.com/show_bug.cgi?id=952652
+ SavedSearch savedSearch = new SavedSearch(SearchSubsystem.GROUP, "fake saved
search", "pipo", subjectManager.getSubjectByName(ITEST_USER));
+ Integer savedSearchId =
savedSearchManager.createSavedSearch(subjectManager.getOverlord(), savedSearch);
+ boolean subjectDeleted = false;
+ try {
+ deleteITestSubject();
+ subjectDeleted = true;
+ } catch (Exception e) {
+ LOG.error("Failed to delete a subject who owns a saved search",
e);
+ fail("Failed to delete a subject who owns a saved search");
+ } finally {
+ // This is only necessary if we failed to delete subject
+ if (!subjectDeleted) {
+ savedSearchManager.deleteSavedSearch(subjectManager.getOverlord(),
savedSearchId);
+ }
+ }
+ }
+
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerBean.java
index c78a1bd..43d955f 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerBean.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2012 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.server.auth;
@@ -59,8 +59,10 @@ import org.rhq.core.domain.common.composite.SystemSettings;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.criteria.RoleCriteria;
+import org.rhq.core.domain.criteria.SavedSearchCriteria;
import org.rhq.core.domain.criteria.SubjectCriteria;
import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.core.domain.search.SavedSearch;
import org.rhq.core.domain.server.PersistenceUtility;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
@@ -75,6 +77,7 @@ import org.rhq.enterprise.server.core.CustomJaasDeploymentServiceMBean;
import org.rhq.enterprise.server.exception.LoginException;
import org.rhq.enterprise.server.resource.group.LdapGroupManagerLocal;
import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal;
+import org.rhq.enterprise.server.search.SavedSearchManagerLocal;
import org.rhq.enterprise.server.system.SystemManagerLocal;
import org.rhq.enterprise.server.util.CriteriaQueryGenerator;
import org.rhq.enterprise.server.util.CriteriaQueryRunner;
@@ -117,6 +120,9 @@ public class SubjectManagerBean implements SubjectManagerLocal,
SubjectManagerRe
//@IgnoreDependency
private RepoManagerLocal repoManager;
+ @EJB
+ private SavedSearchManagerLocal savedSearchManager;
+
@Resource
private TimerService timerService;
@@ -661,6 +667,10 @@ public class SubjectManagerBean implements SubjectManagerLocal,
SubjectManagerRe
throw new PermissionException("You cannot remove yourself: " +
doomedSubject.getName());
}
+ if (authorizationManager.isSystemSuperuser(doomedSubject)) {
+ throw new PermissionException("You cannot delete a system root user
- they must always exist");
+ }
+
Set<Role> roles = doomedSubject.getRoles();
doomedSubject.setRoles(new HashSet<Role>()); // clean out roles
@@ -694,7 +704,20 @@ public class SubjectManagerBean implements SubjectManagerLocal,
SubjectManagerRe
}
}
- deleteSubject(doomedSubject);
+ // Delete searches saved by this user
+ SavedSearchCriteria savedSearchCriteria = new SavedSearchCriteria();
+ savedSearchCriteria.addFilterSubjectId(doomedSubjectId);
+ savedSearchCriteria.clearPaging();
+ PageList<SavedSearch> savedSearches =
savedSearchManager.findSavedSearchesByCriteria(subject, savedSearchCriteria);
+ for (SavedSearch savedSearch : savedSearches) {
+ savedSearchManager.deleteSavedSearch(subject, savedSearch.getId());
+ }
+
+
alertNotificationManager.cleanseAlertNotificationBySubject(doomedSubject.getId());
+
+ repoManager.removeOwnershipOfSubject(doomedSubject.getId());
+
+ entityManager.remove(doomedSubject);
}
return;
@@ -709,27 +732,6 @@ public class SubjectManagerBean implements SubjectManagerLocal,
SubjectManagerRe
}
/**
- * Deletes the given {@link Subject} from the database.
- *
- *
- * @param doomedSubject identifies the subject to delete
- *
- * @throws PermissionException if caller tried to delete a system superuser
- */
- private void deleteSubject(Subject doomedSubject) throws PermissionException {
- if (authorizationManager.isSystemSuperuser(doomedSubject)) {
- throw new PermissionException("You cannot delete a system root user -
they must always exist");
- }
-
-
alertNotificationManager.cleanseAlertNotificationBySubject(doomedSubject.getId());
- repoManager.removeOwnershipOfSubject(doomedSubject.getId());
-
- entityManager.remove(doomedSubject);
-
- return;
- }
-
- /**
* Delete a user's principal from the internal database.
*
*
@@ -883,4 +885,4 @@ public class SubjectManagerBean implements SubjectManagerLocal,
SubjectManagerRe
return;
}
-}
\ No newline at end of file
+}
commit 248cb85b93eadfe328fc4f8e0ab708239a813610
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Wed May 1 16:50:11 2013 -0700
Javascript console object is not valid under IE8 removing console.log statement.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphIE8Impl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphIE8Impl.java
index 7390349..75ce6e3 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphIE8Impl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphIE8Impl.java
@@ -20,6 +20,7 @@ package
org.rhq.enterprise.gui.coregui.client.inventory.common.charttype;
/**
* Contains the javascript chart definition for an IE8 d3 Stacked Bar graph chart.
+ * Curr
*
* @author Mike Thompson
*/
@@ -39,8 +40,7 @@ public final class StackedBarMetricGraphIE8Impl extends
StackedBarMetricGraphImp
*/
@Override
public native void drawJsniChart() /*-{
- console.log("Using StackedBarMetricGraphIE8Impl for IE8.");
-
+ // no-op implementation for ie8
}-*/;
}
commit 339eb402b41277d45bb32b8b6da837cb02c2f38e
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Wed May 1 14:59:58 2013 -0700
Fix to keep IE9 from behaving like IE8 with respect to charting.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractD3GraphListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractD3GraphListView.java
index d682a24..d942b8c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractD3GraphListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractD3GraphListView.java
@@ -38,8 +38,8 @@ import
org.rhq.enterprise.gui.coregui.client.util.enhanced.EnhancedVLayout;
* and User Preferences pickers for the date range.
*/
public abstract class AbstractD3GraphListView extends EnhancedVLayout implements
AutoRefresh {
- protected static int SINGLE_CHART_HEIGHT = 225;
- protected static int MULTI_CHART_HEIGHT = 195;
+ protected final static int SINGLE_CHART_HEIGHT = 225;
+ protected final static int MULTI_CHART_HEIGHT = 195;
protected List<Availability> availabilityList;
protected List<ResourceGroupAvailability> groupAvailabilityList;
protected AvailabilityD3Graph availabilityGraph;
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
index f3c93be..d5ae804 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
@@ -36,6 +36,10 @@
</any>
</replace-with>
+ <replace-with
class="org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.StackedBarMetricGraphImpl">
+ <when-type-is
class="org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.StackedBarMetricGraphImpl"/>
+ </replace-with>
+
<replace-with
class="org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.StackedBarMetricGraphIE8Impl">
<when-type-is
class="org.rhq.enterprise.gui.coregui.client.inventory.common.charttype.StackedBarMetricGraphImpl"/>
<when-property-is name="user.agent" value="ie8"/>
commit 93a7c3264c30a6ea08d2c767fa6f087a3a86aa1d
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Wed May 1 07:54:40 2013 -0700
Fix IE issues with "Move jquery(1.7.2) library out of CoreGUI.gwt.xml now that we
don't have GFlot dependency (GFlot was removed with addition of d3 charts)."
This reverts commit 8c54ef01abaa6790f49f96c492fe6649a0245a6f.
Revert "UI Performance - Move non-essential javascripts (like charting) out of
CoreGUI.gwt.xml to CoreGUI.html and add the 'defer' script evaluation attribute
for faster page load time. Also moved stylesheets to load ahead of javascripts as they
load faster and provide less blocking time than the external javascripts. This shaved
about 0.5 sec on my box will probably save more on slower hardware/connection/mobile. The
*.gwt.xml prevents race conditions at the expense of speed so moving out increases startup
speed."
This commit has unintended consequences for IE9 browser. Javascript
libraries that are supposed to be loaded are not (although this works in
other browsers).
This reverts commit e4ac4b1b628ae5e577510045ead7967a603d4c1c.
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
index 7d50e87..f3c93be 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
@@ -46,6 +46,17 @@
<when-type-assignable
class="com.google.gwt.user.client.rpc.RemoteService"/>
</generate-with>
+ <!-- External javascript libraries -->
+ <!-- jquery.sparkline requires jquery. We don't explicitly provide jquery here
because it is already
+ embedded in the GFlot JAR (the charting lib used for GraphPortlet).
Furthermore, GFlot 2.4.2 requires
+ the version of jquery (1.7.2).
+ -->
+ <script src="/coregui/js/jquery-1.7.2.min.js"/>
+ <script src="/coregui/js/jquery.sparkline-2.1.min.js"/>
+ <script src="/coregui/js/d3.v3.js"/>
+ <script src="/coregui/js/nv.d3.js"/>
+ <script src="/coregui/js/jquery.tipsy.js"/>
+
<!--
Limit compilation to your preferred browser(s) to speed up compile time.
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
index 1b69b53..206b586 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
+++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
@@ -10,19 +10,7 @@
<!-- support internationalized characters -->
<meta http-equiv="Content-Type"
content="text/html;charset=UTF-8" />
- <link rel="stylesheet" href="CoreGUI.css">
- <link rel="stylesheet" href="css/nv.d3.css">
- <link rel="stylesheet" href="css/tipsy.css">
- <link rel="stylesheet" href="css/charts.css">
-
- <script defer="defer" type="text/javascript"
src="/coregui/js/rhq.js"></script>
- <script defer="defer" type="text/javascript"
src="/coregui/js/d3.v3.js"></script>
- <script defer="defer" type="text/javascript"
src="/coregui/js/nv.d3.js"></script>
- <!-- jquery dependent js libs -->
- <script defer="defer" type="text/javascript"
src="/coregui/js/jquery-1.7.2.min.js"></script>
- <script defer="defer" type="text/javascript"
src="/coregui/js/jquery.sparkline-2.1.min.js"></script>
- <script defer="defer" type="text/javascript"
src="/coregui/js/jquery.tipsy.js"></script>
-
+ <script type="text/javascript"
src="js/rhq.js"></script>
<script type="text/javascript">
var search = location.search;
// only do this if you have not specified locale as query param
@@ -42,6 +30,12 @@
var isomorphicDir = "org.rhq.enterprise.gui.coregui.CoreGUI/sc/";
</script>
+
+ <link rel="stylesheet" href="CoreGUI.css">
+ <link rel="stylesheet" href="css/nv.d3.css">
+ <link rel="stylesheet" href="css/tipsy.css">
+ <link rel="stylesheet" href="css/charts.css">
+
</head>
<body>
commit 4c50679d28c84c2d0057c2438bb985c562fc8ac5
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed May 1 12:14:40 2013 -0400
BZ 893609 - remove temp workaround code now that we are on a newer EAP that
doesn't have the bad issues anymore
diff --git
a/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
b/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
index 9a766f4..8cef6e1 100644
---
a/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
+++
b/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
@@ -46,6 +46,29 @@ public class CoreJBossASClient extends JBossASClient {
}
/**
+ * Given a string with possible ${x} expressions in it, this will resolve that
expression
+ * using system property values that are set within the AS JVM itself. If the string
+ * to resolve has no expressions, or has no expressions that are resolveable, the
expression
+ * string itself is returned as-is (this includes if
<code>expression</code> is <code>null</code>).
+ *
+ * @param expression string containing zero, one or more ${x} expressions to be
resolved
+ * @return the expression with the expressions resolved using system properties of
the AS JVM
+ * @throws Exception if failed to resolve the expression.
+ */
+ public String resolveExpression(String expression) throws Exception {
+ if (expression == null || expression.length() == 0) {
+ return expression;
+ }
+ final ModelNode request = createRequest("resolve-expression",
Address.root());
+ request.get("expression").set(expression);
+ final ModelNode response = execute(request);
+ if (!isSuccess(response)) {
+ throw new FailureException(response);
+ }
+ return getResults(response).asString();
+ }
+
+ /**
* This returns the system properties that are set in the AS JVM. This is not the
system properties
* in the JVM of this client object - it is actually the system properties in the
remote
* JVM of the AS instance that the client is talking to.
diff --git
a/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/LoggingJBossASClient.java
b/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/LoggingJBossASClient.java
index babe373..ee7466e 100644
---
a/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/LoggingJBossASClient.java
+++
b/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/LoggingJBossASClient.java
@@ -72,7 +72,7 @@ public class LoggingJBossASClient extends JBossASClient {
final ModelNode request;
if (isLogger(loggerName)) {
- request = createWriteAttributeRequest("level", level.toUpperCase(),
addr);
+ request = createWriteAttributeRequest("level", level, addr);
} else {
final String dmrTemplate = "" //
+ "{" //
@@ -80,7 +80,7 @@ public class LoggingJBossASClient extends JBossASClient {
+ ", \"level\" => \"%s\" " //
+ ", \"use-parent-handlers\" => \"true\"
" //
+ "}";
- final String dmr = String.format(dmrTemplate, loggerName,
level.toUpperCase());
+ final String dmr = String.format(dmrTemplate, loggerName, level);
request = ModelNode.fromString(dmr);
request.get(OPERATION).set(ADD);
diff --git
a/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/SecurityDomainJBossASClient.java
b/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/SecurityDomainJBossASClient.java
index f977f0a..5caa45e 100644
---
a/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/SecurityDomainJBossASClient.java
+++
b/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/SecurityDomainJBossASClient.java
@@ -26,6 +26,7 @@ import
javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag;
import org.jboss.as.controller.client.ModelControllerClient;
import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.ModelType;
/**
* Provides convenience methods associated with security domain management.
@@ -71,49 +72,6 @@ public class SecurityDomainJBossASClient extends JBossASClient {
* Create a new security domain using the SecureIdentity authentication method.
* This is used when you want to obfuscate a database password in the configuration.
*
- * @param securityDomainName the name of the new security domain
- * @param username the username associated with the security domain
- * @param password the value of the password to store in the configuration (e.g. the
obfuscated password itself)
- *
- * @throws Exception if failed to create security domain
- */
- public void createNewSecureIdentitySecurityDomain71(String securityDomainName, String
username, String password)
- throws Exception {
-
- Address addr = Address.root().add(SUBSYSTEM, SUBSYSTEM_SECURITY, SECURITY_DOMAIN,
securityDomainName);
- ModelNode addTopNode = createRequest(ADD, addr);
- addTopNode.get(CACHE_TYPE).set("default");
-
- ModelNode addAuthNode = createRequest(ADD, addr.clone().add(AUTHENTICATION,
CLASSIC));
- ModelNode loginModulesNode = addAuthNode.get(LOGIN_MODULES);
- ModelNode loginModule = new ModelNode();
- loginModule.get(CODE).set("SecureIdentity");
- loginModule.get(FLAG).set("required");
- ModelNode moduleOptions = loginModule.get(MODULE_OPTIONS);
- moduleOptions.setEmptyList();
- // TODO: we really want to use addExpression (e.g.
${rhq.server.database.user-name})
- // for username and password so rhq-server.properties can be used to set these.
- // However, AS7.1 doesn't support this yet - see
https://issues.jboss.org/browse/AS7-5177
- moduleOptions.add(USERNAME, username);
- moduleOptions.add(PASSWORD, password);
- loginModulesNode.add(loginModule);
-
- ModelNode batch = createBatchRequest(addTopNode, addAuthNode);
-
- System.err.println("== security domain ==> " +
batch.toJSONString(false));
-
- ModelNode results = execute(batch);
- if (!isSuccess(results)) {
- throw new FailureException(results, "Failed to create security domain
[" + securityDomainName + "]");
- }
-
- return;
- }
-
- /**
- * Create a new security domain using the SecureIdentity authentication method.
- * This is used when you want to obfuscate a database password in the configuration.
- *
* This is the version for as7.2+ (e.g. eap 6.1)
*
* @param securityDomainName the name of the new security domain
@@ -139,11 +97,8 @@ public class SecurityDomainJBossASClient extends JBossASClient {
loginModule.get(FLAG).set("required");
ModelNode moduleOptions = loginModule.get(MODULE_OPTIONS);
moduleOptions.setEmptyList();
- // TODO: we really want to use addExpression (e.g.
${rhq.server.database.user-name})
- // for username and password so rhq-server.properties can be used to set these.
- // However, AS7.1 doesn't support this yet - see
https://issues.jboss.org/browse/AS7-5177
- moduleOptions.add(USERNAME, username);
- moduleOptions.add(PASSWORD, password);
+ addPossibleExpression(moduleOptions, USERNAME, username);
+ addPossibleExpression(moduleOptions, PASSWORD, password);
ModelNode batch = createBatchRequest(addTopNode, addAuthNode, loginModule);
@@ -178,11 +133,8 @@ public class SecurityDomainJBossASClient extends JBossASClient {
loginModule.get(FLAG).set("required");
ModelNode moduleOptions = loginModule.get(MODULE_OPTIONS);
moduleOptions.setEmptyList();
- // TODO: we really want to use addExpression (e.g.
${rhq.server.database.user-name})
- // for username and password so rhq-server.properties can be used to set these.
- // However, AS7.1 doesn't support this yet - see
https://issues.jboss.org/browse/AS7-5177
- moduleOptions.add(USERNAME, username);
- moduleOptions.add(PASSWORD, password);
+ addPossibleExpression(moduleOptions, USERNAME, username);
+ addPossibleExpression(moduleOptions, PASSWORD, password);
// login modules attribute must be a list - we only have one item in it, the
loginModule
ModelNode loginModuleList = new ModelNode();
@@ -202,6 +154,14 @@ public class SecurityDomainJBossASClient extends JBossASClient {
return;
}
+ private void addPossibleExpression(ModelNode node, String name, String value) {
+ if (value != null && value.contains("${")) {
+ node.add(name, new ModelNode(ModelType.EXPRESSION).setExpression(value));
+ } else {
+ node.add(name, value);
+ }
+ }
+
/**
* Given the name of an existing security domain that uses the SecureIdentity
authentication method,
* this returns the module options for that security domain authentication method.
This includes
@@ -231,49 +191,6 @@ public class SecurityDomainJBossASClient extends JBossASClient {
/**
* Create a new security domain using the database server authentication method.
* This is used when you want to directly authenticate against a db entry.
- *
- * @param securityDomainName the name of the new security domain
- * @param dsJndiName the jndi name for the datasource to query against
- * @param principalsQuery the SQL query for selecting password info for a principal
- * @param rolesQuery the SQL query for selecting role info for a principal
- * @param hashAlgorithm if null defaults to "MD5"
- * @param hashEncoding if null defaults to "base64"
- * @throws Exception if failed to create security domain
- */
- public void createNewDatabaseServerSecurityDomain71(String securityDomainName, String
dsJndiName,
- String principalsQuery, String
rolesQuery, String hashAlgorithm,
- String hashEncoding) throws
Exception {
-
- Address addr = Address.root().add(SUBSYSTEM, SUBSYSTEM_SECURITY, SECURITY_DOMAIN,
securityDomainName);
- ModelNode addTopNode = createRequest(ADD, addr);
- addTopNode.get(CACHE_TYPE).set("default");
-
- ModelNode addAuthNode = createRequest(ADD, addr.clone().add(AUTHENTICATION,
CLASSIC));
- ModelNode loginModulesNode = addAuthNode.get(LOGIN_MODULES);
- ModelNode loginModule = new ModelNode();
- loginModule.get(CODE).set("Database");
- loginModule.get(FLAG).set("required");
- ModelNode moduleOptions = loginModule.get(MODULE_OPTIONS);
- moduleOptions.setEmptyList();
- moduleOptions.add(DS_JNDI_NAME, dsJndiName);
- moduleOptions.add(PRINCIPALS_QUERY, principalsQuery);
- moduleOptions.add(ROLES_QUERY, rolesQuery);
- moduleOptions.add(HASH_ALGORITHM, (null == hashAlgorithm ? "MD5" :
hashAlgorithm));
- moduleOptions.add(HASH_ENCODING, (null == hashEncoding ? "base64" :
hashEncoding));
- loginModulesNode.add(loginModule);
-
- ModelNode batch = createBatchRequest(addTopNode, addAuthNode);
- ModelNode results = execute(batch);
- if (!isSuccess(results)) {
- throw new FailureException(results, "Failed to create security domain
[" + securityDomainName + "]");
- }
-
- return;
- }
-
- /**
- * Create a new security domain using the database server authentication method.
- * This is used when you want to directly authenticate against a db entry.
* This is for AS 7.2+ (e.g. EAP 6.1) and works around
https://issues.jboss.org/browse/AS7-6527
*
* @param securityDomainName the name of the new security domain
diff --git
a/modules/enterprise/server/appserver/src/main/dev-resources/bin/rhq-autoinstall.sh
b/modules/enterprise/server/appserver/src/main/dev-resources/bin/rhq-autoinstall.sh
index fbbc397..5369ab2 100755
--- a/modules/enterprise/server/appserver/src/main/dev-resources/bin/rhq-autoinstall.sh
+++ b/modules/enterprise/server/appserver/src/main/dev-resources/bin/rhq-autoinstall.sh
@@ -18,8 +18,6 @@ do
eval ${_INSTALLER_SCRIPT}
if [ "$?" -eq "0" ]; then
echo Installer finished
- # most times, the installation was already done, but see if changes to
rhq-server.properties requires a reconfiguration
- eval ${_INSTALLER_SCRIPT} --reconfig
break;
elif [ "$?" -eq "1" ]; then
echo The installer has been disabled - please fix rhq-server.properties
diff --git a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
index 20ff84b..05619cb 100644
--- a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
+++ b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
@@ -495,16 +495,17 @@ rhq.communications.multicast-detector.port=16162
# Server-side SSL Security Configuration for HTTPS thru Tomcat
# These are used for browser https access and
# for incoming messages from agents over sslservlet transport.
-# Relative filenames are relative to jboss.server.config.dir.
-# [you cannot use ${x} variables in these rhq.server.tomcat settings]
+# [Due to issue
https://issues.jboss.org/browse/WFLY-1177, you cannot change
+# rhq.server.tomcat.security.keystore.file or rhq.server.tomcat.security.truststore.file
+# after you install RHQ. If you need to change those again, you must manually do so in
standalone-full.xml.]
rhq.server.tomcat.security.client-auth-mode=false
rhq.server.tomcat.security.secure-socket-protocol=TLS
rhq.server.tomcat.security.algorithm=SunX509
rhq.server.tomcat.security.keystore.alias=RHQ
-rhq.server.tomcat.security.keystore.file=rhq.keystore
+rhq.server.tomcat.security.keystore.file=${jboss.server.config.dir}/rhq.keystore
rhq.server.tomcat.security.keystore.password=RHQManagement
rhq.server.tomcat.security.keystore.type=JKS
-rhq.server.tomcat.security.truststore.file=rhq.truststore
+rhq.server.tomcat.security.truststore.file=${jboss.server.config.dir}/rhq.truststore
rhq.server.tomcat.security.truststore.password=RHQManagement
rhq.server.tomcat.security.truststore.type=JKS
@@ -637,32 +638,11 @@ rhq.sync.endpoint-address=false
</replace>
</target>
- <!-- This is so we can work around all the issues due to
https://issues.jboss.org/browse/AS7-6120
- so once that is fixed, we don't have to run the installer
"reconfig" automatically on startup of the server.
- Note that if we predeploy (i.e. are doing a dev build), rather than jump through
more hoops for this,
- just assume the developer knows that if they change rhq-server.properties, they
have to reconfig the server.
- We don't do anything in this target if we are building a dev build. -->
- <target name="add-auto-reconfig" unless="predeploy">
- <echo>Add auto-reconfig to rhq-server scripts so users don't have to
when changing rhq-server.properties</echo>
- <replace
file="${project.build.outputDirectory}/bin/rhq-server.sh">
- <replacefilter>
- <replacetoken># START SERVER</replacetoken>
- <replacevalue><![CDATA[export RHQ_SERVER_HOME;
${RHQ_SERVER_HOME}/bin/rhq-installer.sh --reconfig &]]></replacevalue>
- </replacefilter>
- </replace>
- <replace
file="${project.build.outputDirectory}/bin/rhq-server.bat">
- <replacefilter>
- <replacetoken>rem START SERVER</replacetoken>
- <replacevalue><![CDATA[start /B
%RHQ_SERVER_HOME%\bin\rhq-installer.bat --reconfig < nul >
nul]]></replacevalue>
- </replacefilter>
- </replace>
- </target>
<target name="prepare-release"
description="If this is a release build, make sure it is properly
prepared."
depends="initialize,
developer-release-message,
copy-dev-resources,
- add-auto-reconfig,
fix-perms,
deploy-postgres-ds,
deploy-oracle-ds">
diff --git
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/Installer.java
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/Installer.java
index 26bc2f6..36da859 100644
---
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/Installer.java
+++
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/Installer.java
@@ -47,7 +47,7 @@ public class Installer {
private InstallerConfiguration installerConfig;
private enum WhatToDo {
- DISPLAY_USAGE, DO_NOTHING, RECONFIGURE, TEST, SETUPDB, LIST_SERVERS, INSTALL
+ DISPLAY_USAGE, DO_NOTHING, TEST, SETUPDB, LIST_SERVERS, INSTALL
}
public static void main(String[] args) {
@@ -108,20 +108,6 @@ public class Installer {
}
continue;
}
- case RECONFIGURE: {
- try {
- final InstallerService installerService = new
InstallerServiceImpl(installerConfig);
- final HashMap<String, String> serverProperties =
installerService.getServerProperties();
- final boolean reconfigured =
installerService.reconfigure(serverProperties);
- if (reconfigured) {
- LOG.info("Reconfiguration is complete.");
- }
- } catch (Exception e) {
- LOG.error(ThrowableUtil.getAllMessages(e));
- System.exit(EXIT_CODE_INSTALLATION_ERROR);
- }
- continue;
- }
case INSTALL: {
try {
final InstallerService installerService = new
InstallerServiceImpl(installerConfig);
@@ -159,28 +145,25 @@ public class Installer {
usage.append("\t--force, -f: force the installer to try to install
everything").append("\n");
usage.append("\t--listservers, -l: show list of known installed servers
(install not performed)").append("\n");
usage.append("\t--setupdb, -b: only perform database schema creation or
update").append("\n");
- usage.append("\t--reconfig, -r: resets some configuration settings in an
installed server").append("\n");
usage.append("\t--dbpassword, -d: encodes a DB password for
rhq-server.properties (install not performed)")
.append("\n");
LOG.info(usage);
}
private WhatToDo[] processArguments(String[] args) throws Exception {
- String sopts = "-:HD:h:p:d:bflrt";
+ String sopts = "-:HD:h:p:d:bflt";
LongOpt[] lopts = { new LongOpt("help", LongOpt.NO_ARGUMENT, null,
'H'),
new LongOpt("host", LongOpt.REQUIRED_ARGUMENT, null, 'h'),
new LongOpt("port", LongOpt.REQUIRED_ARGUMENT, null, 'p'),
new LongOpt("dbpassword", LongOpt.REQUIRED_ARGUMENT, null,
'd'),
new LongOpt("setupdb", LongOpt.NO_ARGUMENT, null, 'b'),
new LongOpt("listservers", LongOpt.NO_ARGUMENT, null,
'l'),
- new LongOpt("reconfig", LongOpt.NO_ARGUMENT, null, 'r'),
new LongOpt("force", LongOpt.NO_ARGUMENT, null, 'f'),
new LongOpt("test", LongOpt.NO_ARGUMENT, null, 't') };
boolean test = false;
boolean listservers = false;
boolean setupdb = false;
- boolean reconfig = false;
String dbpassword = null;
Getopt getopt = new Getopt("installer", args, sopts, lopts);
@@ -267,11 +250,6 @@ public class Installer {
break; // don't return, we need to allow more args to be processed,
like -p or -h
}
- case 'r': {
- reconfig = true;
- break; // don't return, we need to allow more args to be processed,
like -p or -h
- }
-
case 't': {
test = true;
break; // don't return, we need to allow more args to be processed,
like -p or -h
@@ -286,10 +264,6 @@ public class Installer {
return new WhatToDo[] { WhatToDo.DO_NOTHING };
}
- if (reconfig) {
- return new WhatToDo[] { WhatToDo.RECONFIGURE };
- }
-
if (test || setupdb || listservers) {
ArrayList<WhatToDo> whatToDo = new ArrayList<WhatToDo>();
if (test) {
diff --git
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerService.java
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerService.java
index c1ffa48..6eff4b7 100644
---
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerService.java
+++
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerService.java
@@ -121,23 +121,6 @@ public interface InstallerService {
String existingSchemaOption) throws Exception;
/**
- * This will take server properties and reconfigure an already-installed server
- * with those values if the settings were previously hardcoded to old values (as
opposed to being
- * set to expressions that allow them to be overridden with system property
settings).
- * Note that is function is here only to workaround various bugs in AS7
- * that force us to not be able to use expressions in certain app server subsystem
attribute
- * settings - see
https://issues.jboss.org/browse/AS7-6120. Once this issues are
fixed, this
- * method will go away.
- *
- * @param serverProperties the new server properties
- * @return true if the reconfigure was at least attempted; false if the server
isn't ready to be reconfigured
- * such as when it hasn't been fully installed yet
- * @throws Exception
- */
- @Deprecated
- boolean reconfigure(HashMap<String, String> serverProperties) throws
Exception;
-
- /**
* Returns a list of all registered servers in the database.
*
* @param connectionUrl
diff --git
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
index 95b4bc3..8173e68 100644
---
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
+++
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
@@ -563,81 +563,6 @@ public class InstallerServiceImpl implements InstallerService {
return map;
}
- // This is here only to help users workaround
https://issues.jboss.org/browse/AS7-6120.
- // It will go away once all the issues with expression support in AS7 are fixed.
- // Notice in this method we only reconfigure some things - only the
subsystems/services
- // that didn't support expressions in their attributes are reconfigured here
since it
- // is those whose values are hardcoded and we must alter to pick up changes to
- // rhq-server.properties. All other services can pick up the property value changes
- // make to rhq-server.properties on restart (since rhq-server.properties are system
- // properties set in the AS7 instance via -P option to AS7).
- @Override
- public boolean reconfigure(HashMap<String, String> serverProperties) throws
Exception {
-
- // make sure we can connect using our configuration
- testModelControllerClient(serverProperties, 30);
-
- if (null == getInstallationResults()) {
- log("Run the installer on this server.");
- return false;
- }
-
- String appServerConfigDir = getAppServerConfigDir();
- ModelControllerClient mcc = null;
-
- try {
- mcc = getModelControllerClient();
-
- // Before we do anything, let's first make sure we really do need to
reconfigure something.
- // Check to see if everything that didn't use expressions is still the
same. If so,
- // just skip everything else and return immediate since there is nothing to
do. We don't
- // even need to reload/restart the server in this case.
- try {
- if (ServerInstallUtil.isSameDatasourceSecurityDomainExisting(mcc,
serverProperties)) {
- if (ServerInstallUtil.isSameMailServiceExisting(mcc,
serverProperties)) {
- if (ServerInstallUtil.isSameWebConnectorsExisting(mcc,
appServerConfigDir, serverProperties)) {
- if (ServerInstallUtil.isSameLoggingExisting(mcc,
serverProperties)) {
- log("Nothing in the configuration changed that
requires a reconfig - everything looks OK");
- return true; // nothing to do, return immediately
- }
- }
- }
- }
- } catch (Exception e) {
- log("Cannot determine if the config is the same, will reconfigure
just in case", e);
- }
-
- // first, put the server in admin-only mode so we can start changing things
around
- CoreJBossASClient coreClient = new CoreJBossASClient(mcc);
- coreClient.reload(true);
-
- // not sure if we have to, but see if we need to wait for the reload to
finish
- testModelControllerClient(30);
-
- mcc = getModelControllerClient(); // get a new controller
-
- // create the security domain needed by the datasources
- ServerInstallUtil.createDatasourceSecurityDomain(mcc, serverProperties);
-
- // setup the email service
- ServerInstallUtil.setupMailService(mcc, serverProperties);
-
- // setup the secure Tomcat web connectors
- ServerInstallUtil.setupWebConnectors(mcc, appServerConfigDir,
serverProperties);
-
- // setup the logging level
- ServerInstallUtil.configureLogging(mcc, serverProperties);
-
- // now restart - don't just reload, some of our stuff won't restart
properly if we just reload
- coreClient = new CoreJBossASClient(mcc);
- coreClient.restart();
- } finally {
- safeClose(mcc);
- }
-
- return true;
- }
-
/**
* Makes sure the data is at least in the correct format (booleans are true/false,
integers are valid numbers).
*
diff --git
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java
index 687e496..d6e0d10 100644
---
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java
+++
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java
@@ -167,7 +167,7 @@ public class ServerInstallUtil {
LoggingJBossASClient client = new LoggingJBossASClient(mcc);
// we want to create our own category
- String val = buildExpression(ServerProperties.PROP_LOG_LEVEL, serverProperties,
false); // enable when AS7-5321 is fixed
+ String val = buildExpression(ServerProperties.PROP_LOG_LEVEL, serverProperties,
true);
client.setLoggerLevel("org.rhq", val);
LOG.info("Logging category org.rhq set to [" + val + "]");
}
@@ -209,7 +209,7 @@ public class ServerInstallUtil {
throws Exception {
String fromAddressExpr =
buildExpression(ServerProperties.PROP_EMAIL_FROM_ADDRESS, serverProperties, true);
- String smtpHostExpr = buildExpression(ServerProperties.PROP_EMAIL_SMTP_HOST,
serverProperties, false); // enable when AS7-5321 is fixed
+ String smtpHostExpr = buildExpression(ServerProperties.PROP_EMAIL_SMTP_HOST,
serverProperties, true);
String smtpPortExpr = buildExpression(ServerProperties.PROP_EMAIL_SMTP_PORT,
serverProperties, true);
// Tweek the mail configuration that comes out of box. Setup a batch request to
write the proper attributes.
@@ -283,19 +283,13 @@ public class ServerInstallUtil {
public static void createDatasourceSecurityDomain(ModelControllerClient mcc,
HashMap<String, String> serverProperties) throws Exception {
- final String dbUsername =
serverProperties.get(ServerProperties.PROP_DATABASE_USERNAME);
- final String obfuscatedPassword =
serverProperties.get(ServerProperties.PROP_DATABASE_PASSWORD);
+ final String dbUsername =
buildExpression(ServerProperties.PROP_DATABASE_USERNAME, serverProperties, true);
+ final String obfuscatedPassword =
buildExpression(ServerProperties.PROP_DATABASE_PASSWORD, serverProperties,
+ true);
final SecurityDomainJBossASClient client = new SecurityDomainJBossASClient(mcc);
- final CoreJBossASClient coreClient = new CoreJBossASClient(mcc);
- String asVersion = coreClient.getAppServerVersion();
final String securityDomain = RHQ_DS_SECURITY_DOMAIN;
if (!client.isSecurityDomain(securityDomain)) {
- if (asVersion.startsWith("7.2")) {
- client.createNewSecureIdentitySecurityDomain72(securityDomain,
dbUsername, obfuscatedPassword);
- }
- else {
- client.createNewSecureIdentitySecurityDomain71(securityDomain,
dbUsername, obfuscatedPassword);
- }
+ client.createNewSecureIdentitySecurityDomain72(securityDomain, dbUsername,
obfuscatedPassword);
LOG.info("Security domain [" + securityDomain + "]
created");
} else {
LOG.info("Security domain [" + securityDomain + "] already
exists, skipping the creation request");
@@ -384,21 +378,12 @@ public class ServerInstallUtil {
throws Exception {
final SecurityDomainJBossASClient client = new SecurityDomainJBossASClient(mcc);
- final CoreJBossASClient coreClient = new CoreJBossASClient(mcc);
- String asRelase = coreClient.getAppServerVersion();
final String securityDomain = RHQ_REST_SECURITY_DOMAIN;
if (!client.isSecurityDomain(securityDomain)) {
String dsJndiName = "java:jboss/datasources/" +
RHQ_DATASOURCE_NAME_XA;
- if (asRelase.startsWith("7.2")) {
- client.createNewDatabaseServerSecurityDomain72(securityDomain,
dsJndiName,
- "SELECT PASSWORD FROM RHQ_PRINCIPAL WHERE principal=?",
- "SELECT 'all', 'Roles' FROM RHQ_PRINCIPAL WHERE
principal=?", null, null);
- }
- else {
- client.createNewDatabaseServerSecurityDomain71(securityDomain,
dsJndiName,
- "SELECT PASSWORD FROM RHQ_PRINCIPAL WHERE principal=?",
- "SELECT 'all', 'Roles' FROM RHQ_PRINCIPAL WHERE
principal=?", null, null);
- }
+ client.createNewDatabaseServerSecurityDomain72(securityDomain, dsJndiName,
+ "SELECT PASSWORD FROM RHQ_PRINCIPAL WHERE principal=?",
+ "SELECT 'all', 'Roles' FROM RHQ_PRINCIPAL WHERE
principal=?", null, null);
LOG.info("Security domain [" + securityDomain + "]
created");
} else {
LOG.info("Security domain [" + securityDomain + "] already
exists, skipping the creation request");
@@ -1256,15 +1241,24 @@ public class ServerInstallUtil {
LOG.info("Creating https connector...");
ConnectorConfiguration connector =
buildSecureConnectorConfiguration(configDirStr, serverProperties);
- // verify that we have a truststore file - if user is relying on our self-signed
certs, we'll have to create one for them
+ //
https://issues.jboss.org/browse/WFLY-1177 - we need to resolve the paths right
now. the user won't be able
+ // to change these again in the future unless they go directly into
standalone.xml and change it manually
String truststoreFileString =
connector.getSslConfiguration().getCaCertificateFile();
+ truststoreFileString = resolveExpression(mcc, truststoreFileString);
+ connector.getSslConfiguration().setCaCertificateFile(truststoreFileString);
+
+ String keystoreFileString =
connector.getSslConfiguration().getCertificateKeyFile();
+ keystoreFileString = resolveExpression(mcc, keystoreFileString);
+ connector.getSslConfiguration().setCertificateKeyFile(keystoreFileString);
+
+ // verify that we have a truststore file - if user is relying on our self-signed
certs, we'll have to create one for them
if (truststoreFileString == null) {
LOG.warn("Missing a valid truststore location - you must specify a valid
truststore location!");
} else {
File truststoreFile = new File(truststoreFileString);
if (!truststoreFile.exists()) {
// user didn't provide a truststore file, copy the keystore and use
it as the truststore; tell the user about this
- File keystoreFile = new
File(connector.getSslConfiguration().getCertificateKeyFile());
+ File keystoreFile = new File(keystoreFileString);
if (!keystoreFile.isFile()) {
LOG.warn("Missing both keystore [" + keystoreFile + "]
and truststore [" + truststoreFile + "]");
} else {
@@ -1283,41 +1277,64 @@ public class ServerInstallUtil {
LOG.info("https connector created.");
if (client.isConnector(connectorName)) {
+ client.changeConnector(connectorName, "max-connections",
+ buildExpression("rhq.server.startup.web.max-connections",
serverProperties, true));
client.changeConnector(connectorName, "redirect-port",
- buildExpression("rhq.server.socket.binding.port.https",
serverProperties, false));
+ buildExpression("rhq.server.socket.binding.port.https",
serverProperties, true));
} else {
LOG.warn("There doesn't appear to be a http connector configured
already - this is strange.");
}
}
+ private static String resolveExpression(ModelControllerClient mcc, String expression)
{
+ if (expression == null) {
+ return null;
+ }
+
+ CoreJBossASClient client = new CoreJBossASClient(mcc);
+ String resolvedExpression;
+ try {
+ resolvedExpression = client.resolveExpression(expression);
+
+ //
https://issues.jboss.org/browse/WFLY-1177 - app server doesn't do
recursive resolving, we have to do it here
+ while (resolvedExpression != null &&
resolvedExpression.contains("${")
+ && !resolvedExpression.equals(expression)) {
+ expression = resolvedExpression;
+ resolvedExpression = client.resolveExpression(expression);
+ }
+ } catch (Exception e) {
+ LOG.warn("Cannot resolve expression [" + expression + "]; will
use it as-is but errors may occur later.");
+ resolvedExpression = expression;
+ }
+ return resolvedExpression;
+ }
+
private static ConnectorConfiguration buildSecureConnectorConfiguration(String
configDirStr,
HashMap<String, String> serverProperties) {
SSLConfiguration ssl = new SSLConfiguration();
// truststore
-
ssl.setCaCertificateFile(getAbsoluteFileLocation("rhq.server.tomcat.security.truststore.file",
- serverProperties, configDirStr)); // this cannot be an expression - AS7
doesn't support that now
+
ssl.setCaCertificateFile(buildExpression("rhq.server.tomcat.security.truststore.file",
serverProperties, true));
ssl.setCaCertificationPassword(buildExpression("rhq.server.tomcat.security.truststore.password",
- serverProperties, false));
-
ssl.setTruststoreType(buildExpression("rhq.server.tomcat.security.truststore.type",
serverProperties, false));
+ serverProperties, true));
+
ssl.setTruststoreType(buildExpression("rhq.server.tomcat.security.truststore.type",
serverProperties, true));
// keystore
-
ssl.setCertificateKeyFile(getAbsoluteFileLocation("rhq.server.tomcat.security.keystore.file",
serverProperties,
- configDirStr)); // this cannot be an expression - AS7 doesn't support
that now
-
ssl.setPassword(buildExpression("rhq.server.tomcat.security.keystore.password",
serverProperties, false));
-
ssl.setKeyAlias(buildExpression("rhq.server.tomcat.security.keystore.alias",
serverProperties, false));
-
ssl.setKeystoreType(buildExpression("rhq.server.tomcat.security.keystore.type",
serverProperties, false));
+
ssl.setCertificateKeyFile(buildExpression("rhq.server.tomcat.security.keystore.file",
serverProperties, true));
+
ssl.setPassword(buildExpression("rhq.server.tomcat.security.keystore.password",
serverProperties, true));
+
ssl.setKeyAlias(buildExpression("rhq.server.tomcat.security.keystore.alias",
serverProperties, true));
+
ssl.setKeystoreType(buildExpression("rhq.server.tomcat.security.keystore.type",
serverProperties, true));
// SSL protocol config
-
ssl.setProtocol(buildExpression("rhq.server.tomcat.security.secure-socket-protocol",
serverProperties, false));
-
ssl.setVerifyClient(buildExpression("rhq.server.tomcat.security.client-auth-mode",
serverProperties, false));
+
ssl.setProtocol(buildExpression("rhq.server.tomcat.security.secure-socket-protocol",
serverProperties, true));
+
ssl.setVerifyClient(buildExpression("rhq.server.tomcat.security.client-auth-mode",
serverProperties, true));
// note: there doesn't appear to be a way for AS7 to support algorithm, like
SunX509 or IbmX509
// so I think it just uses the JVM's default. This means
"rhq.server.tomcat.security.algorithm" is unused
ConnectorConfiguration connector = new ConnectorConfiguration();
-
connector.setMaxConnections(buildExpression("rhq.server.startup.web.max-connections",
serverProperties, false));
+
connector.setMaxConnections(buildExpression("rhq.server.startup.web.max-connections",
serverProperties, true));
connector.setScheme("https");
connector.setSocketBinding("https");
connector.setSslConfiguration(ssl);
@@ -1502,159 +1519,4 @@ public class ServerInstallUtil {
}
}
}
-
- /**
- * This checks to see if the logging settings have the same values as those found in
the given properties.
- *
- * THIS IS ONLY HERE TO SUPPORT INSTALLER --reconfig OPTION WHICH SHOULD
- * GO AWAY ONCE AS7 SUPPORTS EXPRESSIONS WHERE WE NEED THEM - JIRA AS7-5321.
- * ONCE AS7 DOES THIS, THIS METHOD CAN GO AWAY.
- *
- * @param mcc the JBossAS management client
- * @param serverProperties contains the logging settings
- * @return true if the logging settings have the same values
- * @throws Exception
- */
- public static boolean isSameLoggingExisting(ModelControllerClient mcc,
HashMap<String, String> serverProperties) {
- try {
- LoggingJBossASClient client = new LoggingJBossASClient(mcc);
- String currentLevel = client.getLoggerLevel("org.rhq");
- String newLevel = serverProperties.get(ServerProperties.PROP_LOG_LEVEL);
- return !isEmpty(currentLevel) &&
currentLevel.equalsIgnoreCase(newLevel);
- } catch (Exception e) {
- return false; // assume they aren't the same - this may be due to the
category org.rhq just missing
- }
- }
-
- /**
- * This checks to see if the mail service already exists
- * and has the same settings as those found in the given properties.
- *
- * THIS IS ONLY HERE TO SUPPORT INSTALLER --reconfig OPTION WHICH SHOULD
- * GO AWAY ONCE AS7 SUPPORTS EXPRESSIONS WHERE WE NEED THEM - JIRA AS7-5321.
- * ONCE AS7 DOES THIS, THIS METHOD CAN GO AWAY.
- *
- * @param mcc the JBossAS management client
- * @param serverProperties contains the mail service settings
- * @return true if the mail service exists with the same settings
- * @throws Exception
- */
- public static boolean isSameMailServiceExisting(ModelControllerClient mcc,
HashMap<String, String> serverProperties)
- throws Exception {
- // we know the only problem attribute we care about is the smtp host - that's
the only
- // one we use that doesn't support expressions. So we only need to check this
one
- Address addr = Address.root().add("socket-binding-group",
"standard-sockets",
- "remote-destination-outbound-socket-binding",
"mail-smtp");
- JBossASClient client = new JBossASClient(mcc);
- String currentHost = client.getStringAttribute("host", addr);
- String host = serverProperties.get(ServerProperties.PROP_EMAIL_SMTP_HOST);
- return !isEmpty(currentHost) && currentHost.equals(host);
- }
-
- /**
- * This checks to see if the security domain for the datasources already exists
- * and has the same username/password as those found in the given properties
- *
- * THIS IS ONLY HERE TO SUPPORT INSTALLER --reconfig OPTION WHICH SHOULD
- * GO AWAY ONCE AS7 SUPPORTS EXPRESSIONS WHERE WE NEED THEM - JIRA AS7-5321.
- * ONCE AS7 DOES THIS, THIS METHOD CAN GO AWAY.
- *
- * @param mcc the JBossAS management client
- * @param serverProperties contains the obfuscated password and username to compare
- * @return true if the domain exists with the same username and password
- * @throws Exception
- */
- public static boolean isSameDatasourceSecurityDomainExisting(ModelControllerClient
mcc,
- HashMap<String, String> serverProperties) throws Exception {
-
- final String dbUsername =
serverProperties.get(ServerProperties.PROP_DATABASE_USERNAME);
- final String obfuscatedPassword =
serverProperties.get(ServerProperties.PROP_DATABASE_PASSWORD);
- final SecurityDomainJBossASClient client = new SecurityDomainJBossASClient(mcc);
- final String securityDomain = RHQ_DS_SECURITY_DOMAIN;
- boolean sameUsernamePassword = false;
- if (client.isSecurityDomain(securityDomain)) {
- boolean sameUsername = false;
- boolean samePassword = false;
- ModelNode opts;
- opts = client.getSecureIdentitySecurityDomainModuleOptions(securityDomain);
- if (opts != null) {
- List<ModelNode> optsList = opts.asList();
- for (ModelNode opt : optsList) {
- if (opt.has(SecurityDomainJBossASClient.USERNAME)) {
- sameUsername =
dbUsername.equals(opt.get(SecurityDomainJBossASClient.USERNAME).asString());
- }
- if (opt.has(SecurityDomainJBossASClient.PASSWORD)) {
- samePassword =
obfuscatedPassword.equals(opt.get(SecurityDomainJBossASClient.PASSWORD)
- .asString());
- }
- }
- }
- sameUsernamePassword = sameUsername & samePassword;
- }
- return sameUsernamePassword;
- }
-
- /**
- * This checks to see if the web connectors already exist
- * and have the same settings as those found in the given properties
- *
- * THIS IS ONLY HERE TO SUPPORT INSTALLER --reconfig OPTION WHICH SHOULD
- * GO AWAY ONCE AS7 SUPPORTS EXPRESSIONS WHERE WE NEED THEM - JIRA AS7-5321.
- * ONCE AS7 DOES THIS, THIS METHOD CAN GO AWAY.
- *
- * @param mcc the JBossAS management client
- * @param configDirStr location of a configuration directory where the keystore is to
be stored
- * @param serverProperties contains the obfuscated password and username to compare
- * @return true if the domain exists with the same username and password
- * @throws Exception
- */
- public static boolean isSameWebConnectorsExisting(ModelControllerClient mcc, String
appServerConfigDir,
- HashMap<String, String> serverProperties) throws Exception {
-
- HashMap<String, String> settingsToCheck = new HashMap<String,
String>();
- WebJBossASClient client = new WebJBossASClient(mcc);
-
- // FIRST check the https connector
- ModelNode httpsNode = client.getConnector("https");
-
- ConnectorConfiguration connectorConfig =
buildSecureConnectorConfiguration(appServerConfigDir, serverProperties);
- SSLConfiguration sslConfig = connectorConfig.getSslConfiguration();
-
- // check the https connector's main config
- settingsToCheck.clear();
- settingsToCheck.put("max-connections",
connectorConfig.getMaxConnections());
- for (Map.Entry<String, String> propToCheck : settingsToCheck.entrySet()) {
- if
(!httpsNode.get(propToCheck.getKey()).asString().equals(propToCheck.getValue())) {
- return false; // something is different, no need to check further, return
false to say we are different
- }
- }
-
- // now check the https connector's ssl config
- ModelNode sslNode =
httpsNode.get("ssl").get("configuration");
- settingsToCheck.clear();
- settingsToCheck.put("ca-certificate-file",
sslConfig.getCaCertificateFile());
- settingsToCheck.put("ca-certificate-password",
sslConfig.getCaCertificatePassword());
- settingsToCheck.put("certificate-key-file",
sslConfig.getCertificateKeyFile());
- settingsToCheck.put("key-alias", sslConfig.getKeyAlias());
- settingsToCheck.put("keystore-type", sslConfig.getKeystoreType());
- settingsToCheck.put("password", sslConfig.getPassword());
- settingsToCheck.put("protocol", sslConfig.getProtocol());
- settingsToCheck.put("truststore-type", sslConfig.getTruststoreType());
- settingsToCheck.put("verify-client", sslConfig.getVerifyClient());
- for (Map.Entry<String, String> propToCheck : settingsToCheck.entrySet()) {
- if
(!sslNode.get(propToCheck.getKey()).asString().equals(propToCheck.getValue())) {
- return false; // something is different, no need to check further, return
false to say we are different
- }
- }
-
- // SECOND check the http connector
- ModelNode httpNode = client.getConnector("http");
- String nodeString = httpNode.get("redirect-port").asString();
- String propString =
serverProperties.get("rhq.server.socket.binding.port.https");
- if (!nodeString.equals(propString)) {
- return false; // something is different, no need to check further, return
false to say we are different
- }
-
- return true;
- }
}
commit c430d28ff07adb87cccc8823a3b24d598867c462
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Tue Apr 30 14:47:27 2013 -0700
[BZ 950701] Fix SVG text fonts in d3 graphs so that they dont look fuzzy.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphImpl.java
index 2693772..d9a4205 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/charttype/StackedBarMetricGraphImpl.java
@@ -31,13 +31,6 @@ public class StackedBarMetricGraphImpl extends AbstractGraph {
public StackedBarMetricGraphImpl() {
super();
}
- /**
- * General constructor for stacked bar graph when you have all the data needed to
produce the graph. (This is true
- * for all cases but the dashboard portlet).
- */
-// public StackedBarMetricGraphImpl(MetricGraphData metricGraphData) {
-// setMetricGraphData(metricGraphData);
-// }
/**
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/css/charts.css
b/modules/enterprise/gui/coregui/src/main/webapp/css/charts.css
index 099f23a..8728026 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/css/charts.css
+++ b/modules/enterprise/gui/coregui/src/main/webapp/css/charts.css
@@ -27,11 +27,11 @@
}
.y.axis text, .x.axis text {
- font-family: 'Liberation Sans', Arial, Helvetica, sans-serif;
+ font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
font-style: normal;
- stroke: #50505a;
+ fill: #50505a;
text-rendering: optimize-legibility;
}
@@ -47,8 +47,8 @@
.minLabel, .avgLabel, .highLabel {
font-family: Arial, Verdana, sans-serif;
font-size: 12px;
+ font-weight: bold;
text-anchor: start;
- stroke: #003168;
fill: #003168;
text-rendering: optimize-legibility;
}
@@ -57,7 +57,6 @@
font-family: Arial, Verdana, sans-serif;
font-size: 12px;
text-anchor: start;
- stroke: #003168;
fill: #003168;
text-rendering: optimize-legibility;
}
commit 813c49855969171406f638a9d32112b722b99d19
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Tue Apr 30 13:37:35 2013 -0700
[BZ 955760] Syntax fix for gzip compression enablement.
diff --git a/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-server.sh
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-server.sh
index 29a6d76..4e90c62 100755
--- a/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-server.sh
+++ b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-server.sh
@@ -348,7 +348,7 @@ fi
# Add the JVM opts that we always want to specify, whether or not the user set
RHQ_SERVER_JAVA_OPTS.
# Note that the double equals for the policy file specification IS INTENTIONAL
-_HTTP_COMPRESSION="-Dorg.apache.coyote.http11.Http11Protocol.COMPRESSION=on
org.apache.coyote.http11.Http11Protocol.COMPRESSION_MIME_TYPES=text/javascript,text/css,text/html"
+_HTTP_COMPRESSION="-Dorg.apache.coyote.http11.Http11Protocol.COMPRESSION=on
-Dorg.apache.coyote.http11.Http11Protocol.COMPRESSION_MIME_TYPES=text/javascript,text/css,text/html"
RHQ_SERVER_JAVA_OPTS="-Dapp.name=rhq-server ${RHQ_SERVER_JAVA_OPTS}
-Drhq.server.home=${RHQ_SERVER_HOME} -Djboss.server.log.dir=${_LOG_DIR_PATH}
-Djava.awt.headless=true -Dsun.lang.ClassLoader.allowArraySyntax=true
-Djboss.server.default.config=standalone-full.xml
-Djboss.modules.system.pkgs=org.jboss.byteman -Djava.security.manager
-Djava.security.policy==${RHQ_SERVER_HOME}/bin/rhq-server.security-policy
${_HTTP_COMPRESSION} ${_JBOSS_DEBUG_LOGGING}"
debug_msg "RHQ_SERVER_JAVA_OPTS: $RHQ_SERVER_JAVA_OPTS"
commit 8c54ef01abaa6790f49f96c492fe6649a0245a6f
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Tue Apr 30 09:06:23 2013 -0700
Move jquery(1.7.2) library out of CoreGUI.gwt.xml now that we don't have GFlot
dependency (GFlot was removed with addition of d3 charts).
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
index 3d5ae84..7d50e87 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
@@ -46,14 +46,6 @@
<when-type-assignable
class="com.google.gwt.user.client.rpc.RemoteService"/>
</generate-with>
- <!-- External javascript libraries -->
- <!-- jquery.sparkline requires jquery. We don't explicitly provide jquery here
because it is already
- embedded in the GFlot JAR (the charting lib used for GraphPortlet).
Furthermore, GFlot 2.4.2 requires
- the version of jquery (1.7.2).
- -->
- <script src="/coregui/js/jquery-1.7.2.min.js"/>
-
-
<!--
Limit compilation to your preferred browser(s) to speed up compile time.
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
index 8722614..1b69b53 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
+++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
@@ -15,10 +15,12 @@
<link rel="stylesheet" href="css/tipsy.css">
<link rel="stylesheet" href="css/charts.css">
- <script defer="defer" type="text/javascript"
src="/coregui/js/jquery.sparkline-2.1.min.js"></script>
<script defer="defer" type="text/javascript"
src="/coregui/js/rhq.js"></script>
<script defer="defer" type="text/javascript"
src="/coregui/js/d3.v3.js"></script>
<script defer="defer" type="text/javascript"
src="/coregui/js/nv.d3.js"></script>
+ <!-- jquery dependent js libs -->
+ <script defer="defer" type="text/javascript"
src="/coregui/js/jquery-1.7.2.min.js"></script>
+ <script defer="defer" type="text/javascript"
src="/coregui/js/jquery.sparkline-2.1.min.js"></script>
<script defer="defer" type="text/javascript"
src="/coregui/js/jquery.tipsy.js"></script>
<script type="text/javascript">
commit bcda4cd317f159f335aa544604ed9a0b0b3842a8
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Apr 30 15:41:46 2013 -0400
BZ 955760 - pass in the http compression sysprops to the RHQ Server at startup
diff --git a/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-server.sh
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-server.sh
index 42c8e45..29a6d76 100755
--- a/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-server.sh
+++ b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-server.sh
@@ -348,7 +348,8 @@ fi
# Add the JVM opts that we always want to specify, whether or not the user set
RHQ_SERVER_JAVA_OPTS.
# Note that the double equals for the policy file specification IS INTENTIONAL
-RHQ_SERVER_JAVA_OPTS="-Dapp.name=rhq-server ${RHQ_SERVER_JAVA_OPTS}
-Drhq.server.home=${RHQ_SERVER_HOME} -Djboss.server.log.dir=${_LOG_DIR_PATH}
-Djava.awt.headless=true -Dsun.lang.ClassLoader.allowArraySyntax=true
-Djboss.server.default.config=standalone-full.xml
-Djboss.modules.system.pkgs=org.jboss.byteman -Djava.security.manager
-Djava.security.policy==${RHQ_SERVER_HOME}/bin/rhq-server.security-policy
${_JBOSS_DEBUG_LOGGING}"
+_HTTP_COMPRESSION="-Dorg.apache.coyote.http11.Http11Protocol.COMPRESSION=on
org.apache.coyote.http11.Http11Protocol.COMPRESSION_MIME_TYPES=text/javascript,text/css,text/html"
+RHQ_SERVER_JAVA_OPTS="-Dapp.name=rhq-server ${RHQ_SERVER_JAVA_OPTS}
-Drhq.server.home=${RHQ_SERVER_HOME} -Djboss.server.log.dir=${_LOG_DIR_PATH}
-Djava.awt.headless=true -Dsun.lang.ClassLoader.allowArraySyntax=true
-Djboss.server.default.config=standalone-full.xml
-Djboss.modules.system.pkgs=org.jboss.byteman -Djava.security.manager
-Djava.security.policy==${RHQ_SERVER_HOME}/bin/rhq-server.security-policy
${_HTTP_COMPRESSION} ${_JBOSS_DEBUG_LOGGING}"
debug_msg "RHQ_SERVER_JAVA_OPTS: $RHQ_SERVER_JAVA_OPTS"
debug_msg "RHQ_SERVER_ADDITIONAL_JAVA_OPTS: $RHQ_SERVER_ADDITIONAL_JAVA_OPTS"
diff --git
a/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-server-wrapper.conf
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-server-wrapper.conf
index 3780f90..c5afd1b 100644
---
a/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-server-wrapper.conf
+++
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-server-wrapper.conf
@@ -82,11 +82,14 @@
wrapper.java.additional.18=-Dsun.lang.ClassLoader.allowArraySyntax=true
wrapper.java.additional.19=-Djava.security.manager
# the double equals for the policy file specification IS INTENTIONAL
wrapper.java.additional.20="-Djava.security.policy==%RHQ_SERVER_HOME%/bin/rhq-server.security-policy"
+wrapper.java.additional.21="-Dorg.apache.coyote.http11.Http11Protocol.COMPRESSION=on"
+wrapper.java.additional.22="-Dorg.apache.coyote.http11.Http11Protocol.COMPRESSION_MIME_TYPES=text/javascript,text/css,text/html"
+
# use these if your JVM supports it
-#wrapper.java.additional.21=-XX:+TieredCompilation
-#wrapper.java.additional.22=-XX:+UseCompressedOops
+#wrapper.java.additional.23=-XX:+TieredCompilation
+#wrapper.java.additional.24=-XX:+UseCompressedOops
# Don't need these now, but this is commented out in case we need to add an endorsed
dir in the future
-#wrapper.java.additional.23="-Djava.endorsed.dirs=%RHQ_SERVER_HOME%/jbossas/lib/endorsed"
+#wrapper.java.additional.25="-Djava.endorsed.dirs=%RHQ_SERVER_HOME%/jbossas/lib/endorsed"
# We want to make sure the Server starts in the JBossAS bin directory
wrapper.working.dir=%RHQ_SERVER_HOME%/jbossas/bin
diff --git
a/modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-server-wrapper.inc
b/modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-server-wrapper.inc
index b76cd2f..8094241 100644
---
a/modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-server-wrapper.inc
+++
b/modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-server-wrapper.inc
@@ -4,12 +4,12 @@
#
# enable remote debugging
-wrapper.java.additional.9=-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n
+wrapper.java.additional.23=-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n
# enable jprofiler
#set.PATH=%PATH%;<jprofiler-install-dir>\bin\windows
-#wrapper.java.additional.10=-agentlib:jprofilerti=port=8849
-#wrapper.java.additional.11=-Xbootclasspath/a:<jprofiler-install-dir>\bin\agent.jar
+#wrapper.java.additional.23=-agentlib:jprofilerti=port=8849
+#wrapper.java.additional.24=-Xbootclasspath/a:<jprofiler-install-dir>\bin\agent.jar
# disable JVM startup timeout
wrapper.startup.timeout=0
commit 9a4c406425741f4dc3ecc546c27aec5d558fa37b
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Apr 30 14:25:36 2013 -0400
BZ 917085 fix test to hopefully run on windows
diff --git
a/modules/plugins/ant-bundle/src/test/java/org/rhq/plugins/ant/AntBundlePluginComponentTest.java
b/modules/plugins/ant-bundle/src/test/java/org/rhq/plugins/ant/AntBundlePluginComponentTest.java
index f0605a2..76742e8 100644
---
a/modules/plugins/ant-bundle/src/test/java/org/rhq/plugins/ant/AntBundlePluginComponentTest.java
+++
b/modules/plugins/ant-bundle/src/test/java/org/rhq/plugins/ant/AntBundlePluginComponentTest.java
@@ -530,8 +530,21 @@ public class AntBundlePluginComponentTest {
assert winDirs.size() == 1 : "should only have 1 ext backup dir on
windows: " + winDirs;
backupDir = winDirs.values().iterator().next().getAbsoluteFile();
}
- File file3Backup = new File(backupDir, file3Dest.getAbsolutePath());
- File file4Backup = new File(backupDir, file4Dest.getAbsolutePath());
+
+ File file3Backup;
+ File file4Backup;
+ boolean isWindows = (File.separatorChar == '\\');
+ if (isWindows) {
+ StringBuilder file3AbsPath = new StringBuilder(file3Dest.getAbsolutePath());
+ StringBuilder file4AbsPath = new StringBuilder(file4Dest.getAbsolutePath());
+ FileUtil.stripDriveLetter(file3AbsPath);
+ FileUtil.stripDriveLetter(file4AbsPath);
+ file3Backup = new File(backupDir, file3AbsPath.toString());
+ file4Backup = new File(backupDir, file4AbsPath.toString());
+ } else {
+ file3Backup = new File(backupDir, file3Dest.getAbsolutePath());
+ file4Backup = new File(backupDir, file4Dest.getAbsolutePath());
+ }
assert file3Backup.isFile() : "should have been backed up: " +
file3Backup;
assert file4Backup.isFile() : "should have been backed up: " +
file4Backup;
assert (TEST3 + "modified").equals(readFile(file3Backup)) : "bad
backup file: " + file3Backup;
commit 03caa3d61d59d2e041750b0581a31098acf61f10
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Apr 30 09:47:25 2013 -0400
these methods' @TranAttrib annotations are unused. Also, spoke to lukas, he said
these methods should be made private
diff --git
a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/StrippedDownStartupBean.java
b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/StrippedDownStartupBean.java
index bfe9f32..6689de5 100644
---
a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/StrippedDownStartupBean.java
+++
b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/StrippedDownStartupBean.java
@@ -21,8 +21,6 @@
package org.rhq.enterprise.server.test;
import javax.ejb.Singleton;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
import org.rhq.enterprise.server.core.StartupBean;
import org.rhq.enterprise.server.naming.NamingHack;
@@ -34,8 +32,7 @@ import org.rhq.enterprise.server.naming.NamingHack;
@Singleton
public class StrippedDownStartupBean {
- @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
- public void secureNaming() {
+ private void secureNaming() {
NamingHack.bruteForceInitialContextFactoryBuilder();
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
index 5b5aa8c..90ffbaf 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
@@ -146,11 +146,8 @@ public class StartupBean implements StartupLocal {
/**
* Modifies the naming subsystem to be able to check for Java security permissions on
JNDI lookup.
- * <p>
- * Made public so that this can be reused in tests.
*/
- @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
- public void secureNaming() {
+ private void secureNaming() {
NamingHack.bruteForceInitialContextFactoryBuilder();
}
commit c923c9a9951f9ee1bc352c65a6178f64225c14b3
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Mon Apr 29 14:06:22 2013 -0700
[BZ 956875] - Remove old charts now that they have been validated with new d3 charts.
Eliminates the confusing second set of charts. Also removed GFlot charting library from
codebase as it is no longer needed.
diff --git a/.classpath b/.classpath
index 9ff8db2..aa4c157 100644
--- a/.classpath
+++ b/.classpath
@@ -279,7 +279,6 @@
<classpathentry exported="true" kind="var"
path="M2_REPO/com/google/gwt/gwt-user/2.5.0/gwt-user-2.5.0.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/com/google/gwt/gwt-dev/2.5.0/gwt-dev-2.5.0.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/com/smartgwt/smartgwt/3.0/smartgwt-3.0.jar"/>
- <classpathentry exported="true" kind="var"
path="M2_REPO/com/googlecode/gflot/gflot/2.4.2/gflot-2.4.2.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/com/jcraft/jsch/0.1.29/jsch-0.1.29.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/commons-jxpath/commons-jxpath/1.3/commons-jxpath-1.3.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/dbunit/dbunit/2.4.8/dbunit-2.4.8.jar"/>
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
index cea3bc0..f7dd822 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
@@ -39,11 +39,9 @@ import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupOobs
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupOperationsPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupPkgHistoryPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.groups.graph.ResourceGroupD3GraphPortlet;
-import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.groups.graph.ResourceGroupGraphPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.queue.AutodiscoveryPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.resource.FavoriteResourcesPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.resource.graph.ResourceD3GraphPortlet;
-import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.resource.graph.ResourceGraphPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.platform.PlatformSummaryPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.alerts.RecentAlertsPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.imported.RecentlyAddedResourcesPortlet;
@@ -100,9 +98,7 @@ public class PortletFactory {
globalPortletFactoryMap.put(PlatformSummaryPortlet.KEY,
PlatformSummaryPortlet.Factory.INSTANCE);
globalPortletFactoryMap.put(AutodiscoveryPortlet.KEY,
AutodiscoveryPortlet.Factory.INSTANCE);
globalPortletFactoryMap.put(RecentAlertsPortlet.KEY,
RecentAlertsPortlet.Factory.INSTANCE);
- globalPortletFactoryMap.put(ResourceGraphPortlet.KEY,
ResourceGraphPortlet.Factory.INSTANCE);
globalPortletFactoryMap.put(ResourceD3GraphPortlet.KEY,
ResourceD3GraphPortlet.Factory.INSTANCE);
- globalPortletFactoryMap.put(ResourceGroupGraphPortlet.KEY,
ResourceGroupGraphPortlet.Factory.INSTANCE);
globalPortletFactoryMap.put(ResourceGroupD3GraphPortlet.KEY,
ResourceGroupD3GraphPortlet.Factory.INSTANCE);
//conditionally add tags. Defaults to true, not available in JON builds.
if (CoreGUI.isTagsEnabledForUI()) {
@@ -123,9 +119,7 @@ public class PortletFactory {
globalPortletNameMap.put(PlatformSummaryPortlet.NAME,
PlatformSummaryPortlet.KEY);
globalPortletNameMap.put(AutodiscoveryPortlet.NAME, AutodiscoveryPortlet.KEY);
globalPortletNameMap.put(RecentAlertsPortlet.NAME, RecentAlertsPortlet.KEY);
- globalPortletNameMap.put(ResourceGraphPortlet.NAME, ResourceGraphPortlet.KEY);
globalPortletNameMap.put(ResourceD3GraphPortlet.NAME,
ResourceD3GraphPortlet.KEY);
- globalPortletNameMap.put(ResourceGroupGraphPortlet.NAME,
ResourceGroupGraphPortlet.KEY);
globalPortletNameMap.put(ResourceGroupD3GraphPortlet.NAME,
ResourceGroupD3GraphPortlet.KEY);
//conditionally add tags. Defaults to true, not available in JON builds.
if (CoreGUI.isTagsEnabledForUI()) {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
index 013332c..ed59f8b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
@@ -371,8 +371,8 @@ public class GroupMetricsPortlet extends EnhancedVLayout implements
CustomSettin
}
}
DynamicForm row = new
DynamicForm();
- row.setNumCols(4);
- row.setColWidths(65,
"*", 20, 100);
+ row.setNumCols(3);
+ row.setColWidths(65,
"*", 100);
row.setWidth100();
row.setAutoHeight();
row.setOverflow(Overflow.VISIBLE);
@@ -418,31 +418,7 @@ public class GroupMetricsPortlet extends EnhancedVLayout implements
CustomSettin
link.disable();
}
- //@todo: this goes away once we
have validated the new d3 charts
- final String destination =
"/resource/common/monitor/Visibility.do?mode=chartSingleMetricMultiResource&groupId="
- + groupId +
"&m=" + md.getId();
- LinkItem oldLink =
AbstractActivityView.newLinkItem("*",
- destination);
- oldLink.setTooltip("Link to
Old Charts");
-
oldLink.setTitleVAlign(VerticalAlignment.TOP);
-
oldLink.setAlign(Alignment.LEFT);
- oldLink.setClipValue(true);
- oldLink.setWrap(true);
- oldLink.setHeight(26);
-
oldLink.setWidth("100%");
-
- oldLink.addClickHandler(new
ClickHandler() {
- @Override
- public void
onClick(ClickEvent event) {
- ChartViewWindow window =
new ChartViewWindow(title);
- //generate and include
iframed content
- FullHTMLPane iframe = new
FullHTMLPane(destination);
- //
.extendLocatorId("View"),
- //
AbstractActivityView.iframeLink(destination));
- window.addItem(iframe);
- window.show();
- }
- });
+
//Value
String convertedValue =
AbstractActivityView
.convertLastValueForDisplay(lastValue, md);
@@ -452,7 +428,7 @@ public class GroupMetricsPortlet extends EnhancedVLayout implements
CustomSettin
value.setAlign(Alignment.RIGHT);
value.setWidth("100%");
- row.setItems(graphContainer,
link, oldLink, value);
+ row.setItems(graphContainer,
link, value);
row.setWidth100();
//if graph content returned
if
((!md.getName().trim().contains("Trait."))
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/groups/graph/ResourceGroupD3GraphPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/groups/graph/ResourceGroupD3GraphPortlet.java
index 856a177..1416b9d 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/groups/graph/ResourceGroupD3GraphPortlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/groups/graph/ResourceGroupD3GraphPortlet.java
@@ -80,7 +80,7 @@ public class ResourceGroupD3GraphPortlet extends MetricD3GraphView
implements Au
// A non-displayed, persisted identifier for the portlet
public static final String KEY = "ResourceGroupMetricD3";
// A default displayed, persisted name for the portlet
- public static final String NAME = "d3-" +
MSG.view_portlet_defaultName_groupMetric();
+ public static final String NAME = MSG.view_portlet_defaultName_groupMetric();
// set on initial configuration, the window for this portlet view.
private PortletWindow portletWindow;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/groups/graph/ResourceGroupGraphPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/groups/graph/ResourceGroupGraphPortlet.java
deleted file mode 100644
index 6a728c7..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/groups/graph/ResourceGroupGraphPortlet.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.groups.graph;
-
-import com.smartgwt.client.data.Criteria;
-import com.smartgwt.client.types.Overflow;
-import com.smartgwt.client.types.TitleOrientation;
-import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.HTMLFlow;
-import com.smartgwt.client.widgets.Label;
-import com.smartgwt.client.widgets.form.DynamicForm;
-import com.smartgwt.client.widgets.form.events.SubmitValuesEvent;
-import com.smartgwt.client.widgets.form.events.SubmitValuesHandler;
-import com.smartgwt.client.widgets.form.fields.CanvasItem;
-import com.smartgwt.client.widgets.form.fields.SelectItem;
-import com.smartgwt.client.widgets.form.fields.SpacerItem;
-
-import org.rhq.core.domain.common.EntityContext;
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.domain.dashboard.DashboardPortlet;
-import org.rhq.core.domain.resource.group.GroupCategory;
-import org.rhq.enterprise.gui.coregui.client.components.form.SortedSelectItem;
-import
org.rhq.enterprise.gui.coregui.client.components.selector.AssignedItemsChangedEvent;
-import
org.rhq.enterprise.gui.coregui.client.components.selector.AssignedItemsChangedHandler;
-import org.rhq.enterprise.gui.coregui.client.dashboard.CustomSettingsPortlet;
-import org.rhq.enterprise.gui.coregui.client.dashboard.Portlet;
-import org.rhq.enterprise.gui.coregui.client.dashboard.PortletViewFactory;
-import org.rhq.enterprise.gui.coregui.client.dashboard.PortletWindow;
-import
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.ResourceGroupMetricGraphView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.ResourceScheduledMetricDatasource;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.SingleResourceGroupSelector;
-
-/**
- * @author Greg Hinkle
- * @author Jay Shaughnessy
- * @deprecated see ResourceGroupD3GraphPortlet
- */
-@Deprecated
-public class ResourceGroupGraphPortlet extends ResourceGroupMetricGraphView implements
CustomSettingsPortlet {
-
- // A non-displayed, persisted identifier for the portlet
- public static final String KEY = "ResourceGroupMetric";
- // A default displayed, persisted name for the portlet
- public static final String NAME = MSG.view_portlet_defaultName_groupMetric();
-
- // set on initial configuration, the window for this portlet view.
- private PortletWindow portletWindow;
-
- public static final String CFG_RESOURCE_GROUP_ID = "resourceGroupId";
- public static final String CFG_DEFINITION_ID = "definitionId";
-
- public ResourceGroupGraphPortlet() {
- super();
- setOverflow(Overflow.HIDDEN);
- }
-
- public void configure(PortletWindow portletWindow, DashboardPortlet storedPortlet) {
-
- if (null == this.portletWindow && null != portletWindow) {
- this.portletWindow = portletWindow;
- }
-
- if ((null == storedPortlet) || (null == storedPortlet.getConfiguration())) {
- return;
- }
-
- if (storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_GROUP_ID) != null) {
- Integer integerValue =
storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_GROUP_ID).getIntegerValue();
- if (integerValue != null)
- setEntityId(integerValue);
-
- PropertySimple propertySimple =
storedPortlet.getConfiguration().getSimple(CFG_DEFINITION_ID);
- if (propertySimple != null && propertySimple.getIntegerValue() !=
null)
- setDefinitionId(propertySimple.getIntegerValue());
- }
- }
-
- public Canvas getHelpCanvas() {
- return new HTMLFlow(MSG.view_portlet_help_graph());
- }
-
- @Override
- protected void onDraw() {
- DashboardPortlet storedPortlet = portletWindow.getStoredPortlet();
-
- PropertySimple simple =
storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_GROUP_ID);
- if (simple == null || simple.getIntegerValue() == null) {
- removeMembers(getMembers());
- addMember(new Label("<i>" +
MSG.view_portlet_configure_needed() + "</i>"));
- } else {
- super.onDraw();
- }
- }
-
- public DynamicForm getCustomSettingsForm() {
- final DynamicForm form = new DynamicForm();
- form.setWidth(750);
- form.setNumCols(1);
-
- final CanvasItem selectorItem = new CanvasItem();
- selectorItem.setTitleOrientation(TitleOrientation.TOP);
- selectorItem.setShowTitle(false);
-
- final SingleResourceGroupSelector resourceGroupSelector = new
SingleResourceGroupSelector(
- GroupCategory.COMPATIBLE, false);
- resourceGroupSelector.setWidth(700);
- resourceGroupSelector.setHeight(300);
- //TODO, would probaby be nice to find a way to seed assigned with the current
group
- //ListGridRecord rec = new ListGridRecord();
- //rec.setAttribute("id", getEntityId());
- //rec.setAttribute("name", "current");
- //resourceGroupSelector.setAssigned(new ListGridRecord[] { rec });
-
- final SelectItem metric = new SortedSelectItem(CFG_DEFINITION_ID,
MSG.common_title_metric()) {
- @Override
- protected Criteria getPickListFilterCriteria() {
- Criteria criteria = new Criteria();
-
- if (resourceGroupSelector.getSelectedItems().size() == 1) {
- int groupId =
resourceGroupSelector.getSelectedItems().iterator().next().getId();
- criteria.addCriteria(CFG_RESOURCE_GROUP_ID, groupId);
- form.setValue(CFG_RESOURCE_GROUP_ID, groupId);
- }
- return criteria;
- }
- };
- metric.setWidth(300);
- metric.setTitleOrientation(TitleOrientation.TOP);
- metric.setValueField("id");
- metric.setDisplayField("displayName");
- metric.setOptionDataSource(new ResourceScheduledMetricDatasource());
-
- resourceGroupSelector.addAssignedItemsChangedHandler(new
AssignedItemsChangedHandler() {
-
- public void onSelectionChanged(AssignedItemsChangedEvent event) {
-
- if (resourceGroupSelector.getSelectedItems().size() == 1) {
- metric.fetchData();
- form.clearValue(CFG_DEFINITION_ID);
- }
- }
- });
-
- final DashboardPortlet storedPortlet = portletWindow.getStoredPortlet();
-
- if (storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_GROUP_ID) != null) {
- Integer integerValue =
storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_GROUP_ID).getIntegerValue();
- if (integerValue != null)
- form.setValue(CFG_RESOURCE_GROUP_ID, integerValue);
-
- PropertySimple propertySimple =
storedPortlet.getConfiguration().getSimple(CFG_DEFINITION_ID);
- if (propertySimple != null && propertySimple.getIntegerValue() !=
null)
- form.setValue(CFG_DEFINITION_ID, propertySimple.getIntegerValue());
- }
-
- selectorItem.setCanvas(resourceGroupSelector);
- form.setFields(selectorItem, metric, new SpacerItem());
-
- form.addSubmitValuesHandler(new SubmitValuesHandler() {
- public void onSubmitValues(SubmitValuesEvent submitValuesEvent) {
- storedPortlet.getConfiguration().put(
- new PropertySimple(CFG_RESOURCE_GROUP_ID,
form.getValue(CFG_RESOURCE_GROUP_ID)));
- storedPortlet.getConfiguration().put(
- new PropertySimple(CFG_DEFINITION_ID,
form.getValue(CFG_DEFINITION_ID)));
-
- configure(portletWindow, storedPortlet);
-
- redraw();
- }
- });
-
- return form;
- }
-
- @Override
- public void redraw() {
- super.redraw();
-
- removeMembers(getMembers());
-
- DashboardPortlet storedPortlet = portletWindow.getStoredPortlet();
- PropertySimple simple =
storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_GROUP_ID);
- if (simple == null | simple.getIntegerValue() == null) {
- addMember(new Label("<i>" +
MSG.view_portlet_configure_needed() + "</i>"));
- } else {
- renderGraph();
- }
- }
-
- public static final class Factory implements PortletViewFactory {
- public static PortletViewFactory INSTANCE = new Factory();
-
- public final Portlet getInstance(EntityContext context) {
-
- return new ResourceGroupGraphPortlet();
- }
- }
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/ResourceD3GraphPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/ResourceD3GraphPortlet.java
index d706da9..0d6bcfd 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/ResourceD3GraphPortlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/ResourceD3GraphPortlet.java
@@ -75,7 +75,7 @@ public class ResourceD3GraphPortlet extends MetricD3GraphView implements
AutoRef
// A non-displayed, persisted identifier for the portlet
public static final String KEY = "ResourceMetricD3";
// A default displayed, persisted name for the portlet
- public static final String NAME = "d3-" +
MSG.view_portlet_defaultName_resourceMetric();
+ public static final String NAME = MSG.view_portlet_defaultName_resourceMetric();
public static final String CFG_RESOURCE_ID = "resourceId";
public static final String CFG_DEFINITION_ID = "definitionId";
// set on initial configuration, the window for this portlet view.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/ResourceGraphPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/ResourceGraphPortlet.java
deleted file mode 100644
index 5f38301..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/ResourceGraphPortlet.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.resource.graph;
-
-import com.smartgwt.client.data.Criteria;
-import com.smartgwt.client.types.Overflow;
-import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.HTMLFlow;
-import com.smartgwt.client.widgets.Label;
-import com.smartgwt.client.widgets.form.DynamicForm;
-import com.smartgwt.client.widgets.form.events.SubmitValuesEvent;
-import com.smartgwt.client.widgets.form.events.SubmitValuesHandler;
-import com.smartgwt.client.widgets.form.fields.SelectItem;
-import com.smartgwt.client.widgets.form.fields.events.ChangedEvent;
-
-import org.rhq.core.domain.common.EntityContext;
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.domain.dashboard.DashboardPortlet;
-import
org.rhq.enterprise.gui.coregui.client.components.lookup.ResourceLookupComboBoxItem;
-import org.rhq.enterprise.gui.coregui.client.dashboard.CustomSettingsPortlet;
-import org.rhq.enterprise.gui.coregui.client.dashboard.Portlet;
-import org.rhq.enterprise.gui.coregui.client.dashboard.PortletViewFactory;
-import org.rhq.enterprise.gui.coregui.client.dashboard.PortletWindow;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.ResourceMetricGraphView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.ResourceScheduledMetricDatasource;
-
-/**
- * @author Greg Hinkle
- * @author Jay Shaughnessy
- * @deprecated see ResourceD3GraphPortlet
- */
-@Deprecated
-public class ResourceGraphPortlet extends ResourceMetricGraphView implements
CustomSettingsPortlet {
-
- // A non-displayed, persisted identifier for the portlet
- public static final String KEY = "ResourceMetric";
- // A default displayed, persisted name for the portlet
- public static final String NAME = MSG.view_portlet_defaultName_resourceMetric();
-
- // set on initial configuration, the window for this portlet view.
- private PortletWindow portletWindow;
-
- public static final String CFG_RESOURCE_ID = "resourceId";
- public static final String CFG_DEFINITION_ID = "definitionId";
-
- public ResourceGraphPortlet() {
- super();
- setOverflow(Overflow.HIDDEN);
- }
-
- public void configure(PortletWindow portletWindow, DashboardPortlet storedPortlet) {
-
- if (null == this.portletWindow && null != portletWindow) {
- this.portletWindow = portletWindow;
- }
-
- if ((null == storedPortlet) || (null == storedPortlet.getConfiguration())) {
- return;
- }
-
- if (storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_ID) != null) {
- PropertySimple propertySimple =
storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_ID);
- if (propertySimple != null) {
- Integer integerValue = propertySimple.getIntegerValue();
- if (integerValue != null)
- setEntityId(integerValue);
- }
- propertySimple =
storedPortlet.getConfiguration().getSimple(CFG_DEFINITION_ID);
- if (propertySimple != null) {
-
- Integer integerValue = propertySimple.getIntegerValue();
- if (integerValue != null)
- setDefinitionId(integerValue);
- }
- }
- }
-
- public Canvas getHelpCanvas() {
- return new HTMLFlow(MSG.view_portlet_help_graph());
- }
-
- @Override
- protected void onDraw() {
- DashboardPortlet storedPortlet = portletWindow.getStoredPortlet();
-
- PropertySimple simple =
storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_ID);
- if (simple == null || simple.getIntegerValue() == null) {
- removeMembers(getMembers());
- addMember(new Label("<i>" +
MSG.view_portlet_configure_needed() + "</i>"));
- } else {
- super.onDraw();
- }
- }
-
- public DynamicForm getCustomSettingsForm() {
- final DynamicForm form = new DynamicForm();
-
- final ResourceLookupComboBoxItem resourceLookupComboBoxItem = new
ResourceLookupComboBoxItem(CFG_RESOURCE_ID,
- MSG.common_title_resource());
- resourceLookupComboBoxItem.setWidth(300);
-
- final SelectItem metric = new SelectItem(CFG_DEFINITION_ID,
MSG.common_title_metric()) {
- @Override
- protected Criteria getPickListFilterCriteria() {
- Criteria criteria = new Criteria();
-
- if (resourceLookupComboBoxItem.getValue() != null) {
- int resourceId = (Integer) resourceLookupComboBoxItem.getValue();
- criteria.addCriteria(CFG_RESOURCE_ID, resourceId);
- }
- return criteria;
- }
- };
-
- final DashboardPortlet storedPortlet = portletWindow.getStoredPortlet();
-
- metric.setWidth(300);
- metric.setValueField("id");
- metric.setDisplayField("displayName");
- metric.setOptionDataSource(new ResourceScheduledMetricDatasource());
-
- resourceLookupComboBoxItem
- .addChangedHandler(new
com.smartgwt.client.widgets.form.fields.events.ChangedHandler() {
- public void onChanged(ChangedEvent event) {
-
- if (form.getValue(CFG_RESOURCE_ID) instanceof Integer) {
- metric.fetchData();
- form.clearValue(CFG_DEFINITION_ID);
- }
- }
- });
-
- if (storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_ID) != null) {
- Integer integerValue =
storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_ID).getIntegerValue();
- if (integerValue != null) {
- form.setValue(CFG_RESOURCE_ID, integerValue);
- }
-
- PropertySimple propertySimple =
storedPortlet.getConfiguration().getSimple(CFG_DEFINITION_ID);
- if (propertySimple != null && propertySimple.getIntegerValue() !=
null) {
- form.setValue(CFG_DEFINITION_ID, propertySimple.getIntegerValue());
- }
- }
-
- form.setFields(resourceLookupComboBoxItem, metric);
-
- form.addSubmitValuesHandler(new SubmitValuesHandler() {
- public void onSubmitValues(SubmitValuesEvent submitValuesEvent) {
- storedPortlet.getConfiguration().put(
- new PropertySimple(CFG_RESOURCE_ID,
form.getValue(CFG_RESOURCE_ID)));
- storedPortlet.getConfiguration().put(
- new PropertySimple(CFG_DEFINITION_ID,
form.getValue(CFG_DEFINITION_ID)));
-
- configure(portletWindow, storedPortlet);
-
- redraw();
- }
- });
-
- return form;
- }
-
- @Override
- public void redraw() {
- super.redraw();
-
- removeMembers(getMembers());
-
- DashboardPortlet storedPortlet = portletWindow.getStoredPortlet();
- PropertySimple simple =
storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_ID);
- if (simple == null || simple.getIntegerValue() == null) {
- addMember(new Label("<i>" +
MSG.view_portlet_configure_needed() + "</i>"));
- } else {
- renderGraph();
- }
- }
-
- public static final class Factory implements PortletViewFactory {
- public static PortletViewFactory INSTANCE = new Factory();
-
- @Override
- public final Portlet getInstance(EntityContext context) {
-
- return new ResourceGraphPortlet();
- }
- }
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java
index 62afc42..39ce5bd 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java
@@ -243,8 +243,8 @@ public class ResourceMetricsPortlet extends GroupMetricsPortlet {
}
}
DynamicForm row = new DynamicForm();
- row.setNumCols(4);
- row.setColWidths(65, "*",
20, 100);
+ row.setNumCols(3);
+ row.setColWidths(65, "*",
100);
row.setWidth100();
row.setAutoHeight();
row.setOverflow(Overflow.VISIBLE);
@@ -297,31 +297,6 @@ public class ResourceMetricsPortlet extends GroupMetricsPortlet {
link.disable();
}
- //@todo: this goes away once we have
validated charts
- final String chartTitle =
md.getDisplayName();
- final String destination =
"/resource/common/monitor/Visibility.do?mode=chartSingleMetricSingleResource&id="
- + resourceId +
"&m=" + md.getId();
-
- //have link launch modal window on
click
- LinkItem oldLink =
AbstractActivityView.newLinkItem("*",
- destination);
- oldLink.setTooltip("Link to test
Old Chart");
-
oldLink.setTitleVAlign(VerticalAlignment.TOP);
- oldLink.setAlign(Alignment.LEFT);
- oldLink.setClipValue(true);
- oldLink.setWrap(true);
- oldLink.setHeight(26);
- oldLink.setWidth("100%");
- oldLink.addClickHandler(new
ClickHandler() {
- @Override
- public void onClick(ClickEvent
event) {
- ChartViewWindow window = new
ChartViewWindow(chartTitle);
- //generate and include
iframed content
- FullHTMLPane iframe = new
FullHTMLPane(destination);
- window.addItem(iframe);
- window.show();
- }
- });
//Value
String convertedValue;
@@ -332,7 +307,7 @@ public class ResourceMetricsPortlet extends GroupMetricsPortlet {
value.setVAlign(VerticalAlignment.TOP);
value.setAlign(Alignment.RIGHT);
- row.setItems(sparklineContainer,
link, oldLink, value);
+ row.setItems(sparklineContainer,
link, value);
row.setWidth100();
//if graph content returned
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMetricGraphView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMetricGraphView.java
deleted file mode 100644
index c921acf..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMetricGraphView.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.rhq.enterprise.gui.coregui.client.inventory.common;
-
-import java.util.Date;
-import java.util.List;
-
-import ca.nanometrics.gflot.client.Axis;
-import ca.nanometrics.gflot.client.DataPoint;
-import ca.nanometrics.gflot.client.PlotModel;
-import ca.nanometrics.gflot.client.SeriesHandler;
-import ca.nanometrics.gflot.client.SimplePlot;
-import ca.nanometrics.gflot.client.event.PlotHoverListener;
-import ca.nanometrics.gflot.client.event.PlotItem;
-import ca.nanometrics.gflot.client.event.PlotPosition;
-import ca.nanometrics.gflot.client.jsni.Plot;
-import ca.nanometrics.gflot.client.options.AxisOptions;
-import ca.nanometrics.gflot.client.options.GlobalSeriesOptions;
-import ca.nanometrics.gflot.client.options.GridOptions;
-import ca.nanometrics.gflot.client.options.LineSeriesOptions;
-import ca.nanometrics.gflot.client.options.PlotOptions;
-import ca.nanometrics.gflot.client.options.PointsSeriesOptions;
-import ca.nanometrics.gflot.client.options.TickFormatter;
-
-import com.google.gwt.i18n.client.DateTimeFormat;
-import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
-import com.smartgwt.client.types.AnimationEffect;
-import com.smartgwt.client.widgets.HTMLFlow;
-import com.smartgwt.client.widgets.Img;
-import com.smartgwt.client.widgets.Label;
-import com.smartgwt.client.widgets.WidgetCanvas;
-import com.smartgwt.client.widgets.Window;
-import com.smartgwt.client.widgets.events.ClickEvent;
-import com.smartgwt.client.widgets.events.ClickHandler;
-import com.smartgwt.client.widgets.events.MouseOutEvent;
-import com.smartgwt.client.widgets.events.MouseOutHandler;
-import com.smartgwt.client.widgets.layout.HLayout;
-
-import org.rhq.core.domain.measurement.MeasurementDefinition;
-import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
-import org.rhq.enterprise.gui.coregui.client.util.MeasurementConverterClient;
-import org.rhq.enterprise.gui.coregui.client.util.enhanced.EnhancedHLayout;
-import org.rhq.enterprise.gui.coregui.client.util.enhanced.EnhancedVLayout;
-
-/**
- * @author Greg Hinkle
- * @author Jay Shaughnessy
- * @deprecated this code will go away once D3 graphs have been validated.
- */
-@Deprecated
-public abstract class AbstractMetricGraphView extends EnhancedVLayout {
-
- private static final String INSTRUCTIONS =
MSG.view_resource_monitor_graph_instructions();
-
- /*
- private static final String[] MONTH_NAMES = { MSG.common_calendar_january_short(),
- MSG.common_calendar_february_short(), MSG.common_calendar_march_short(),
MSG.common_calendar_april_short(),
- MSG.common_calendar_may_short(), MSG.common_calendar_june_short(),
MSG.common_calendar_july_short(),
- MSG.common_calendar_august_short(), MSG.common_calendar_september_short(),
MSG.common_calendar_october_short(),
- MSG.common_calendar_november_short(), MSG.common_calendar_december_short() };
- */
-
- private final Label selectedPointLabel = new Label(INSTRUCTIONS);
- private final Label positionLabel = new Label();
- private final Label hoverLabel = new Label();
-
- private HTMLFlow resourceTitle;
-
- private int entityId;
- private int definitionId;
-
- private MeasurementDefinition definition;
- private List<MeasurementDataNumericHighLowComposite> data;
-
- public AbstractMetricGraphView() {
- super();
- }
-
- public AbstractMetricGraphView(int entityId, int definitionId) {
- this.entityId = entityId;
- this.definitionId = definitionId;
-
- // Should this not also set H+W=100?
- }
-
- public AbstractMetricGraphView(int entityId, MeasurementDefinition def,
- List<MeasurementDataNumericHighLowComposite> data) {
-
- this.entityId = entityId;
- this.definition = def;
- this.data = data;
- setHeight100();
- setWidth100();
- }
-
- public abstract AbstractMetricGraphView getInstance(int entityId,
MeasurementDefinition def,
- List<MeasurementDataNumericHighLowComposite> data);
-
- protected abstract void renderGraph();
-
- protected HTMLFlow getEntityTitle(){
- return resourceTitle;
- }
-
- public int getEntityId() {
- return this.entityId;
- }
-
- public void setEntityId(int entityId) {
- this.entityId = entityId;
- this.definition = null;
- }
-
- public int getDefinitionId() {
- return definitionId;
- }
-
- public void setDefinitionId(int definitionId) {
- this.definitionId = definitionId;
- this.definition = null;
- }
-
- public MeasurementDefinition getDefinition() {
- return definition;
- }
-
- public void setDefinition(MeasurementDefinition definition) {
- this.definition = definition;
- }
-
- public List<MeasurementDataNumericHighLowComposite> getData() {
- return data;
- }
-
- public void setData(List<MeasurementDataNumericHighLowComposite> data) {
- this.data = data;
- }
-
- @Override
- protected void onDraw() {
- super.onDraw();
- removeMembers(getMembers());
- renderGraph();
- }
-
- @Override
- public void parentResized() {
- super.parentResized();
- removeMembers(getMembers());
- renderGraph();
- }
-
- protected void drawGraph() {
-
- HLayout titleHLayout = new EnhancedHLayout();
-
- if (definition != null) {
- titleHLayout.setAutoHeight();
- titleHLayout.setWidth100();
-
- HTMLFlow entityTitle = getEntityTitle();
- if (null != entityTitle) {
- entityTitle.setWidth("*");
- titleHLayout.addMember(entityTitle);
- }
-
- if (supportsLiveGraphViewDialog()) {
- Img liveGraph = new Img("subsystems/monitor/Monitor_16.png",
16, 16);
- liveGraph.setTooltip(MSG.view_resource_monitor_graph_live_tooltip());
-
- liveGraph.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- displayLiveGraphViewDialog();
- }
- });
- titleHLayout.addMember(liveGraph);
- }
-
- addMember(titleHLayout);
-
- HTMLFlow title = new HTMLFlow("<b>" +
definition.getDisplayName() + "</b> " + definition.getDescription());
- title.setWidth100();
- title.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- displayAsDialog();
- }
- });
- addMember(title);
- }
-
- PlotModel model = new PlotModel();
- PlotOptions plotOptions = new PlotOptions();
- GlobalSeriesOptions globalSeriesOptions = new GlobalSeriesOptions();
- globalSeriesOptions.setLineSeriesOptions(new
LineSeriesOptions().setLineWidth(1).setShow(true));
- globalSeriesOptions.setPointsOptions(new
PointsSeriesOptions().setRadius(2).setShow(true));
- globalSeriesOptions.setShadowSize(0);
- plotOptions.setGlobalSeriesOptions(globalSeriesOptions);
-
- // You need make the grid hoverable <<<<<<<<<
- plotOptions
- .setGridOptions(new
GridOptions().setHoverable(true).setMouseActiveRadius(10).setAutoHighlight(true));
-
- // create a series
- if (definition != null && data != null) {
- loadData(model, plotOptions);
- }
-
- // create the plot
- SimplePlot plot = new SimplePlot(model, plotOptions);
- plot.setSize(String.valueOf(getInnerContentWidth()),
- String.valueOf(getInnerContentHeight() - titleHLayout.getHeight() - 50));
- // "80%","80%");
-
- // add hover listener
- plot.addHoverListener(new PlotHoverListener() {
- public void onPlotHover(Plot plot, PlotPosition position, PlotItem item) {
- if (position != null) {
- positionLabel.setContents("position: (" + position.getX() +
"," + position.getY() + ")");
- }
- if (item != null) {
- hoverLabel.setContents(getHover(item));
-
- hoverLabel.animateShow(AnimationEffect.FADE);
- if (hoverLabel.getLeft() > 0 || hoverLabel.getTop() > 0) {
- hoverLabel.animateMove(item.getPageX() + 10, item.getPageY() -
35);
- } else {
- hoverLabel.moveTo(item.getPageX() + 10, item.getPageY() - 35);
- }
- hoverLabel.redraw();
-
- selectedPointLabel.setContents("x: " +
item.getDataPoint().getX() + ", y: "
- + item.getDataPoint().getY());
- } else {
- hoverLabel.animateHide(AnimationEffect.FADE);
- selectedPointLabel.setContents(INSTRUCTIONS);
- }
- }
- }, false);
-
- addMouseOutHandler(new MouseOutHandler() {
- public void onMouseOut(MouseOutEvent mouseOutEvent) {
- hoverLabel.animateHide(AnimationEffect.FADE);
- }
- });
-
- hoverLabel.setOpacity(80);
- hoverLabel.setWrap(false);
- hoverLabel.setHeight(25);
- hoverLabel.setBackgroundColor("yellow");
- hoverLabel.setBorder("1px solid orange");
- hoverLabel.hide();
-
- if (hoverLabel.isDrawn())
- hoverLabel.redraw();
- else
- hoverLabel.draw();
-
- // put it on a panel
-
- addMember(new WidgetCanvas(plot));
-
- plot.setSize(String.valueOf(getInnerContentWidth()),
- String.valueOf(getInnerContentHeight() - titleHLayout.getHeight() - 50));
-
- }
-
- protected boolean supportsLiveGraphViewDialog() {
- return false;
- }
-
- protected void displayLiveGraphViewDialog() {
- return;
- }
-
- @Override
- public void destroy() {
- hoverLabel.destroy();
- super.destroy();
- }
-
- @Override
- public void hide() {
- super.hide();
- hoverLabel.hide();
- }
-
- protected String getHover(PlotItem item) {
- if (definition != null) {
- com.google.gwt.i18n.client.DateTimeFormat df =
DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_MEDIUM);
- return definition.getDisplayName() + ": "
- + MeasurementConverterClient.format(item.getDataPoint().getY(),
definition.getUnits(), true) + "<br/>"
- + df.format(new Date((long) item.getDataPoint().getX()));
- } else {
- return "x: " + item.getDataPoint().getX() + ", y: " +
item.getDataPoint().getY();
- }
- }
-
- protected void loadData(PlotModel model, PlotOptions plotOptions) {
- SeriesHandler handler = model.addSeries(definition.getDisplayName(),
"#007f00");
-
- for (MeasurementDataNumericHighLowComposite d : data) {
- if (!Double.isNaN(d.getValue())) {
- handler.add(new DataPoint(d.getTimestamp(), d.getValue()));
- }
- }
-
- plotOptions.addYAxisOptions(new AxisOptions().setTicks(5).setLabelWidth(70)
- .setTickFormatter(new TickFormatter() {
- public String formatTickValue(double v, Axis axis) {
- return MeasurementConverterClient.format(v, definition.getUnits(),
true);
- }
- }));
-
- int xTicks = getDefaultWidth() / 140;
-
- plotOptions.addXAxisOptions(new
AxisOptions().setTicks(xTicks).setTickFormatter(new TickFormatter() {
- public String formatTickValue(double tickValue, Axis axis) {
- com.google.gwt.i18n.client.DateTimeFormat dateFormat = DateTimeFormat
- .getFormat(PredefinedFormat.DATE_TIME_SHORT);
- return dateFormat.format(new Date((long) tickValue));
- // return String.valueOf(new Date((long) tickValue));
- // return MONTH_NAMES[(int) (tickValue - 1)];
- }
- }));
-
- }
-
- private void displayAsDialog() {
- AbstractMetricGraphView graph = getInstance(entityId, definition, data);
- Window graphPopup = new Window();
- graphPopup.setTitle(MSG.view_resource_monitor_detailed_graph_label());
- graphPopup.setWidth(800);
- graphPopup.setHeight(400);
- graphPopup.setIsModal(true);
- graphPopup.setShowModalMask(true);
- graphPopup.setCanDragResize(true);
- graphPopup.centerInPage();
- graphPopup.addItem(graph);
- graphPopup.show();
- }
-
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupContextMenu.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupContextMenu.java
index ca6d9f1..87c73c2 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupContextMenu.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupContextMenu.java
@@ -59,7 +59,7 @@ import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.Messages;
-import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.groups.graph.ResourceGroupGraphPortlet;
+import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.groups.graph.ResourceGroupD3GraphPortlet;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceDetailView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceTreeDatasource.AutoGroupTreeNode;
@@ -248,69 +248,8 @@ public class ResourceGroupContextMenu extends Menu {
// Metric graph addition menu
addItem(buildMetricsMenu(resourceType));
-
- /* TODO: We don't support group factory create
- // Create Menu
- MenuItem createChildMenu = new MenuItem("Create Child");
- Menu createChildSubMenu = new Menu();
- for (final ResourceType childType : resourceType.getChildResourceTypes()) {
- if (childType.isCreatable()) {
- MenuItem createItem = new MenuItem(childType.getName());
- createChildSubMenu.addItem(createItem);
- createItem.addClickHandler(new ClickHandler() {
- public void onClick(MenuItemClickEvent event) {
- ResourceFactoryCreateWizard.showCreateWizard(resource,
childType);
- }
- });
-
- }
- }
- createChildMenu.setSubmenu(createChildSubMenu);
- createChildMenu.setEnabled(createChildSubMenu.getItems().length > 0);
- contextMenu.addItem(createChildMenu);*/
-
- /*
- // TODO We don't group manual import
- // Manually Add Menu
- MenuItem importChildMenu = new MenuItem("Import");
- Menu importChildSubMenu = new Menu();
- for (ResourceType childType : resourceType.getChildResourceTypes()) {
- if (childType.isSupportsManualAdd()) {
- importChildSubMenu.addItem(new MenuItem(childType.getName()));
- }
- }
- if (resourceType.getCategory() == ResourceCategory.PLATFORM) {
- loadManuallyAddServersToPlatforms(importChildSubMenu);
- }
- importChildMenu.setSubmenu(importChildSubMenu);
- importChildMenu.setEnabled(importChildSubMenu.getItems().length > 0);
- addItem(importChildMenu);
- */
}
- /*
- private void loadManuallyAddServersToPlatforms(final Menu manuallyAddMenu) {
- ResourceTypeGWTServiceAsync rts = GWTServiceLookup.getResourceTypeGWTService();
-
- ResourceTypeCriteria criteria = new ResourceTypeCriteria();
- criteria.addFilterSupportsManualAdd(true);
- criteria.fetchParentResourceTypes(true);
- rts.findResourceTypesByCriteria(criteria, new
AsyncCallback<PageList<ResourceType>>() {
- public void onFailure(Throwable caught) {
-
CoreGUI.getErrorHandler().handleError(MSG.view_tree_common_contextMenu_loadFail_children(),
caught);
- }
-
- public void onSuccess(PageList<ResourceType> result) {
- for (ResourceType type : result) {
- if (type.getParentResourceTypes() == null ||
type.getParentResourceTypes().isEmpty()) {
- MenuItem item = new MenuItem(type.getName());
- manuallyAddMenu.addItem(item);
- }
- }
- }
- });
- }
- */
private MenuItem buildMetricsMenu(final ResourceType type) {
MenuItem measurements = new
MenuItem(MSG.view_tree_common_contextMenu_measurements());
@@ -354,12 +293,12 @@ public class ResourceGroupContextMenu extends Menu {
DashboardPortlet p = new
DashboardPortlet(MSG
.view_tree_common_contextMenu_groupGraph(),
- ResourceGroupGraphPortlet.KEY, 250);
+ ResourceGroupD3GraphPortlet.KEY, 250);
p.getConfiguration().put(
- new
PropertySimple(ResourceGroupGraphPortlet.CFG_RESOURCE_GROUP_ID,
+ new
PropertySimple(ResourceGroupD3GraphPortlet.CFG_RESOURCE_GROUP_ID,
group.getId()));
p.getConfiguration().put(
- new
PropertySimple(ResourceGroupGraphPortlet.CFG_DEFINITION_ID, def
+ new
PropertySimple(ResourceGroupD3GraphPortlet.CFG_DEFINITION_ID, def
.getId()));
d.addPortlet(p);
@@ -388,7 +327,7 @@ public class ResourceGroupContextMenu extends Menu {
//add new menu item for adding current graphable
element to view if on Monitor/Graphs tab
String currentViewPath = History.getToken();
- if
(currentViewPath.indexOf("Monitoring/Graphs") > -1) {
+ if
(currentViewPath.indexOf("Monitoring/NewGraphs") > -1) {
MenuItem addGraphItem = new
MenuItem(MSG.common_title_add_graph_to_view());
defSubItem.addItem(addGraphItem);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
index b695b4f..07622e3 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
@@ -55,7 +55,6 @@ 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.inventory.InventoryView;
import
org.rhq.enterprise.gui.coregui.client.inventory.common.detail.AbstractTwoLevelTabSetView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.common.detail.monitoring.IFrameWithMeasurementRangeEditorView;
import
org.rhq.enterprise.gui.coregui.client.inventory.common.event.EventCompositeHistoryView;
import
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.configuration.GroupResourceConfigurationEditView;
import
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.configuration.HistoryGroupResourceConfigurationView;
@@ -101,7 +100,6 @@ public class ResourceGroupDetailView extends
// subtabs
private SubTab summaryActivity;
private SubTab summaryTimeline;
- private SubTab monitorGraphs;
private SubTab monitorNewGraphs;
private SubTab monitorTables;
private SubTab monitorTraits;
@@ -193,14 +191,13 @@ public class ResourceGroupDetailView extends
monitoringTab = new TwoLevelTab(new ViewName("Monitoring",
MSG.view_tabs_common_monitoring()),
IconEnum.SUSPECT_METRICS);
- monitorGraphs = new SubTab(monitoringTab, new ViewName("Graphs",
MSG.view_tabs_common_graphs()), null);
- monitorNewGraphs = new SubTab(monitoringTab, new ViewName("NewGraphs",
"d3 Graphs"), null);
+ monitorNewGraphs = new SubTab(monitoringTab, new ViewName("NewGraphs",
MSG.view_tabs_common_graphs()), null);
monitorTables = new SubTab(monitoringTab, new ViewName("Tables",
MSG.view_tabs_common_tables()), null);
monitorTraits = new SubTab(monitoringTab, new ViewName("Traits",
MSG.view_tabs_common_traits()), null);
monitorSched = new SubTab(monitoringTab, new ViewName("Schedules",
MSG.view_tabs_common_schedules()), null);
monitorCallTime = new SubTab(monitoringTab, new ViewName("CallTime",
MSG.view_tabs_common_calltime()), null);
- monitoringTab.registerSubTabs(monitorGraphs, monitorNewGraphs, monitorTables,
monitorTraits, monitorSched,
+ monitoringTab.registerSubTabs( monitorNewGraphs, monitorTables, monitorTraits,
monitorSched,
monitorCallTime);
tabs.add(monitoringTab);
@@ -273,25 +270,19 @@ public class ResourceGroupDetailView extends
if (updateTab(this.monitoringTab, visible, true)) {
final EntityContext groupContext =
EntityContext.forGroup(groupComposite.getResourceGroup());
visible = hasMetricsOfType(this.groupComposite, DataType.MEASUREMENT);
- viewFactory = (!visible) ? null : new ViewFactory() {
- @Override
- public Canvas createView() {
- String url =
"/rhq/group/monitor/graphs-plain.xhtml?groupId=" + groupId;
-
- if (groupContext.isAutoGroup()) {
- url += "&parent=" + groupContext.parentResourceId +
"&type=" + groupContext.resourceTypeId
- + "&groupType=auto";
- } else if (groupContext.isAutoCluster()) {
- url += "&groupType=cluster";
- }
- return new IFrameWithMeasurementRangeEditorView(url);
+ boolean showOnPage;
+
+ if(BrowserUtility.isBrowserPreIE9()){
+ showOnPage = false;
+ }else{
+ if(visible) {
+ showOnPage = true;
+ }else {
+ showOnPage = false;
}
- };
- updateSubTab(this.monitoringTab, this.monitorGraphs, visible, true,
viewFactory);
-
- boolean visibleToIE8 = BrowserUtility.isBrowserPreIE9();
+ }
- viewFactory = (!visibleToIE8) ? null : new ViewFactory() {
+ viewFactory = (!showOnPage) ? null : new ViewFactory() {
@Override
public Canvas createView() {
return createD3GraphListView();
@@ -493,10 +484,8 @@ public class ResourceGroupDetailView extends
@Override
public void onSuccess(Subject result) {
- if (Log.isDebugEnabled()) {
- Log.debug("Updated recently viewed
resource groups for " + result
+ Log.debug("Updated recently viewed resource
groups for " + result
+ " with resourceGroupId [" +
groupId + "]");
- }
}
});
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/ResourceGroupMetricGraphView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/ResourceGroupMetricGraphView.java
deleted file mode 100644
index 4fa0164..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/ResourceGroupMetricGraphView.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring;
-
-import java.util.EnumSet;
-import java.util.List;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.widgets.HTMLFlow;
-
-import org.rhq.core.domain.criteria.ResourceGroupCriteria;
-import org.rhq.core.domain.measurement.MeasurementDefinition;
-import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
-import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.domain.resource.group.ResourceGroup;
-import org.rhq.core.domain.util.PageList;
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.LinkManager;
-import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTServiceAsync;
-import org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMetricGraphView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
-import org.rhq.enterprise.gui.coregui.client.util.Log;
-import org.rhq.enterprise.gui.coregui.client.util.MeasurementUtility;
-
-/**
- * @author Greg Hinkle
- * @author Jay Shaughnessy
- * @deprecated see ResourceGroupD3MetricGraphView
- */
-@Deprecated
-public class ResourceGroupMetricGraphView extends AbstractMetricGraphView {
-
- private HTMLFlow resourceGroupTitle;
-
- public ResourceGroupMetricGraphView() {
- super();
- }
-
- public ResourceGroupMetricGraphView(int groupId, MeasurementDefinition def,
- List<MeasurementDataNumericHighLowComposite> data) {
-
- super(groupId, def, data);
- }
-
- @Override
- protected HTMLFlow getEntityTitle() {
- return resourceGroupTitle;
- }
-
- @Override
- protected void renderGraph() {
- if (null == getDefinition()) {
- ResourceGroupGWTServiceAsync groupService =
GWTServiceLookup.getResourceGroupService();
-
- ResourceGroupCriteria criteria = new ResourceGroupCriteria();
- criteria.addFilterId(getEntityId());
- criteria.fetchResourceType(true);
- groupService.findResourceGroupsByCriteria(criteria, new
AsyncCallback<PageList<ResourceGroup>>() {
- @Override
- public void onFailure(Throwable caught) {
-
CoreGUI.getErrorHandler().handleError(MSG.view_resource_monitor_graphs_lookupFailed(),
caught);
- }
-
- @Override
- public void onSuccess(PageList<ResourceGroup> result) {
- if (result.isEmpty()) {
- return;
- }
-
- final ResourceGroup group = result.get(0);
- String url = LinkManager.getResourceGroupLink(group);
- resourceGroupTitle = new HTMLFlow(LinkManager.getHref(url,
group.getName()));
-
-
ResourceTypeRepository.Cache.getInstance().getResourceTypes(group.getResourceType().getId(),
- EnumSet.of(ResourceTypeRepository.MetadataType.measurements),
- new ResourceTypeRepository.TypeLoadedCallback() {
- public void onTypesLoaded(final ResourceType type) {
-
- for (MeasurementDefinition def :
type.getMetricDefinitions()) {
- if (def.getId() == getDefinitionId()) {
- setDefinition(def);
-
-
GWTServiceLookup.getMeasurementDataService().findDataForCompatibleGroupForLast(
- getEntityId(), new int[] { getDefinitionId()
}, 8,
- MeasurementUtility.UNIT_HOURS, 60,
- new
AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>>() {
- @Override
- public void onFailure(Throwable caught)
{
-
CoreGUI.getErrorHandler().handleError(
-
MSG.view_resource_monitor_graphs_loadFailed(), caught);
- }
-
- @Override
- public void onSuccess(
-
List<List<MeasurementDataNumericHighLowComposite>> result) {
- setData(result.get(0));
-
- drawGraph();
- }
- });
- }
- }
- }
- });
- }
- });
-
- } else {
-
- drawGraph();
- }
- }
-
- @Override
- public AbstractMetricGraphView getInstance(int entityId, MeasurementDefinition def,
- List<MeasurementDataNumericHighLowComposite> data) {
-
- return new ResourceGroupMetricGraphView(entityId, def, data);
- }
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupMultiLineGraphListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupMultiLineGraphListView.java
index 824e201..46e51c0 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupMultiLineGraphListView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/table/CompositeGroupMultiLineGraphListView.java
@@ -40,7 +40,6 @@ public final class CompositeGroupMultiLineGraphListView extends
CompositeGroupD3
var chartId =
this.@org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.table.CompositeGroupD3GraphListView::getChartId()(),
chartHandle = "#mChart-"+chartId,
chartSelection = chartHandle + " svg",
- // yAxisLabel =
this.@org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.table.CompositeGroupD3GraphListView::getYAxisTitle()(),
yAxisUnits =
this.@org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.table.CompositeGroupD3GraphListView::getYAxisUnits()(),
xAxisLabel =
this.@org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.table.CompositeGroupD3GraphListView::getXAxisTitle()(),
displayDayOfWeek =
this.@org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.table.CompositeGroupD3GraphListView::shouldDisplayDayOfWeekInXAxisLabel()(),
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index 0b67c63..a68170a 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -102,8 +102,6 @@ public class ResourceDetailView extends
}
public static class DriftSubTab {
- //public static final String HISTORY = "History";
- //public static final String SNAPSHOTS = "Snapshots";
public static final String DEFINITIONS = "Definitions";
}
@@ -130,7 +128,6 @@ public class ResourceDetailView extends
private SubTab summaryActivity;
private SubTab summaryTimeline;
- private SubTab monitorGraphs;
private SubTab monitorNewGraphs;
private SubTab monitorTables;
private SubTab monitorTraits;
@@ -150,7 +147,6 @@ public class ResourceDetailView extends
private SubTab configCurrent;
private SubTab configHistory;
private SubTab eventHistory;
- //private SubTab driftHistory;
private SubTab driftDefinitions;
private SubTab contentDeployed;
private SubTab contentNew;
@@ -198,9 +194,8 @@ public class ResourceDetailView extends
monitoringTab = new TwoLevelTab(new ViewName("Monitoring",
MSG.view_tabs_common_monitoring()),
IconEnum.SUSPECT_METRICS);
- monitorGraphs = new SubTab(monitoringTab, new ViewName("Graphs",
MSG.view_tabs_common_graphs()), null);
- monitorNewGraphs = new SubTab(monitoringTab, new ViewName("NewGraphs",
"d3 Graphs"), null);
+ monitorNewGraphs = new SubTab(monitoringTab, new ViewName("NewGraphs",
MSG.view_tabs_common_graphs()), null);
monitorTables = new SubTab(monitoringTab, new ViewName("Tables",
MSG.view_tabs_common_tables()), null);
monitorTraits = new SubTab(monitoringTab, new ViewName("Traits",
MSG.view_tabs_common_traits()), null);
@@ -208,7 +203,7 @@ public class ResourceDetailView extends
null);
monitorSched = new SubTab(monitoringTab, new ViewName("Schedules",
MSG.view_tabs_common_schedules()), null);
monitorCallTime = new SubTab(monitoringTab, new ViewName("CallTime",
MSG.view_tabs_common_calltime()), null);
- monitoringTab.registerSubTabs(monitorTables, monitorGraphs, monitorNewGraphs,
monitorTraits, monitorAvail,
+ monitoringTab.registerSubTabs(monitorTables, monitorNewGraphs, monitorTraits,
monitorAvail,
monitorSched, monitorCallTime);
tabs.add(monitoringTab);
@@ -393,16 +388,7 @@ public class ResourceDetailView extends
private void updateMonitoringTabContent(final Resource resource,
Set<ResourceTypeFacet> facets) {
boolean visible = hasMetricsOfType(this.resourceComposite,
DataType.MEASUREMENT);
-
- ViewFactory viewFactory = (!visible) ? null : new ViewFactory() {
- @Override
- public Canvas createView() {
- return new
IFrameWithMeasurementRangeEditorView("/rhq/resource/monitor/graphs-plain.xhtml?id="
- + resource.getId());
- }
-
- };
- updateSubTab(this.monitoringTab, this.monitorGraphs, visible, true,
viewFactory);
+ ViewFactory viewFactory;
boolean visibleToIE8 = !BrowserUtility.isBrowserPreIE9();
@@ -520,15 +506,6 @@ public class ResourceDetailView extends
private void updateDriftTabContent(final ResourceComposite resourceComposite,
Set<ResourceTypeFacet> facets) {
if (updateTab(this.driftTab, facets.contains(ResourceTypeFacet.DRIFT), true)) {
- // TODO: Experimenting with not shoing a drift history tab and having all
resource level drift viewing
- // go through the comprehensive drift carousel view. Leave it in, but
commented, in case we want it back.
- //updateSubTab(this.driftTab, this.driftHistory, true, true, new
ViewFactory() {
- // @Override
- // public Canvas createView() {
- // return ResourceDriftHistoryView.get(resourceComposite);
- // }
- //});
-
updateSubTab(this.driftTab, this.driftDefinitions, true, true, new
ViewFactory() {
@Override
public Canvas createView() {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
index fa5d904..72a46a8 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
@@ -87,7 +87,6 @@ import org.rhq.enterprise.gui.coregui.client.ViewId;
import org.rhq.enterprise.gui.coregui.client.ViewPath;
import org.rhq.enterprise.gui.coregui.client.components.tree.EnhancedTreeNode;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.resource.graph.ResourceD3GraphPortlet;
-import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.resource.graph.ResourceGraphPortlet;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTServiceAsync;
@@ -797,46 +796,7 @@ public class ResourceTreeView extends EnhancedVLayout {
}
});
- //@todo: Remove once we have verified the charts
- // now add the old menu items
- MenuItem addOldItemToDBItem = new MenuItem(MSG
-
.view_tree_common_contextMenu_addChartToDashboard(d.getName()));
- defSubItem.addItem(addOldItemToDBItem);
- addOldItemToDBItem.addClickHandler(new ClickHandler() {
-
- public void onClick(MenuItemClickEvent
menuItemClickEvent) {
- DashboardPortlet p = new DashboardPortlet(MSG
-
.view_tree_common_contextMenu_resourceGraph(), ResourceGraphPortlet.KEY,
- 250);
- p.getConfiguration().put(
- new
PropertySimple(ResourceGraphPortlet.CFG_RESOURCE_ID, resource.getId()));
- p.getConfiguration().put(
- new
PropertySimple(ResourceGraphPortlet.CFG_DEFINITION_ID, def.getId()));
-
- d.addPortlet(p);
-
-
GWTServiceLookup.getDashboardService().storeDashboard(d,
- new AsyncCallback<Dashboard>() {
-
- public void onFailure(Throwable
caught) {
-
CoreGUI.getErrorHandler().handleError(
-
MSG.view_tree_common_contextMenu_saveChartToDashboardFailure(),
- caught);
- }
-
- public void onSuccess(Dashboard
result) {
- CoreGUI
- .getMessageCenter()
- .notify(
- new Message(
-
MSG.view_tree_common_contextMenu_saveChartToDashboardSuccessful(result
-
.getName()), Message.Severity.Info));
- }
- });
-
- }
- });
}//end dashboard iteration
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java
deleted file mode 100644
index 9e93072..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.EnumSet;
-import java.util.List;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.types.Overflow;
-import com.smartgwt.client.widgets.Label;
-
-import org.rhq.core.domain.measurement.DataType;
-import org.rhq.core.domain.measurement.DisplayType;
-import org.rhq.core.domain.measurement.MeasurementDefinition;
-import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.domain.resource.composite.ResourceComposite;
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import
org.rhq.enterprise.gui.coregui.client.components.measurement.UserPreferencesMeasurementRangeEditor;
-import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.avail.AvailabilityBarView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
-import org.rhq.enterprise.gui.coregui.client.util.enhanced.EnhancedVLayout;
-import org.rhq.enterprise.server.measurement.util.MeasurementUtils;
-
-/**
- * @author Greg Hinkle
- */
-@Deprecated
-public class GraphListView extends EnhancedVLayout implements ResourceSelectListener {
-
- private Resource resource;
- private Label loadingLabel = new Label(MSG.common_msg_loading());
-
- public GraphListView(Resource resource) {
- super();
-
- this.resource = resource;
- setOverflow(Overflow.AUTO);
- }
-
- @Override
- protected void onDraw() {
- super.onDraw();
-
- destroyMembers();
-
- addMember(new AvailabilityBarView(resource));
-
- // addMember(loadingLabel);
-
- addMember(new UserPreferencesMeasurementRangeEditor());
-
- if (resource != null) {
- buildGraphs();
- }
- }
-
- private void buildGraphs() {
-
-
ResourceTypeRepository.Cache.getInstance().getResourceTypes(resource.getResourceType().getId(),
- EnumSet.of(ResourceTypeRepository.MetadataType.measurements),
- new ResourceTypeRepository.TypeLoadedCallback() {
- public void onTypesLoaded(final ResourceType type) {
-
- final ArrayList<MeasurementDefinition> measurementDefinitions =
new ArrayList<MeasurementDefinition>();
-
- for (MeasurementDefinition def : type.getMetricDefinitions()) {
- if (def.getDataType() == DataType.MEASUREMENT &&
def.getDisplayType() == DisplayType.SUMMARY) {
- measurementDefinitions.add(def);
- }
- }
-
- Collections.sort(measurementDefinitions, new
Comparator<MeasurementDefinition>() {
- public int compare(MeasurementDefinition o1,
MeasurementDefinition o2) {
- return new
Integer(o1.getDisplayOrder()).compareTo(o2.getDisplayOrder());
- }
- });
-
- int[] measDefIdArray = new int[measurementDefinitions.size()];
- for (int i = 0; i < measDefIdArray.length; i++) {
- measDefIdArray[i] = measurementDefinitions.get(i).getId();
- }
-
-
GWTServiceLookup.getMeasurementDataService().findDataForResourceForLast(resource.getId(),
- measDefIdArray, 8, MeasurementUtils.UNIT_HOURS, 60,
- new
AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>>() {
- public void onFailure(Throwable caught) {
-
CoreGUI.getErrorHandler().handleError(MSG.view_resource_monitor_graphs_loadFailed(),
- caught);
-
loadingLabel.setContents(MSG.view_resource_monitor_graphs_loadFailed());
- }
-
- public void
onSuccess(List<List<MeasurementDataNumericHighLowComposite>> result) {
- if (result.isEmpty()) {
-
loadingLabel.setContents(MSG.view_resource_monitor_graphs_noneAvailable());
- } else {
- loadingLabel.hide();
- int i = 0;
- for
(List<MeasurementDataNumericHighLowComposite> data : result) {
- buildGraph(measurementDefinitions.get(i++),
data);
- }
- }
- }
- });
-
- }
- });
- }
-
- private void buildGraph(MeasurementDefinition def,
List<MeasurementDataNumericHighLowComposite> data) {
- ResourceMetricGraphView graph = new ResourceMetricGraphView(resource.getId(),
def, data);
- graph.setWidth("95%");
- graph.setHeight(220);
-
- addMember(graph);
- }
-
- public void onResourceSelected(ResourceComposite resourceComposite) {
- this.resource = resourceComposite.getResource();
-
- buildGraphs();
- markForRedraw();
- }
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/LiveGraphView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/LiveGraphView.java
deleted file mode 100644
index f71e307..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/LiveGraphView.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring;
-
-import java.util.Date;
-import java.util.Iterator;
-import java.util.Set;
-
-import ca.nanometrics.gflot.client.Axis;
-import ca.nanometrics.gflot.client.DataPoint;
-import ca.nanometrics.gflot.client.PlotModel;
-import ca.nanometrics.gflot.client.PlotModelStrategy;
-import ca.nanometrics.gflot.client.SeriesHandler;
-import ca.nanometrics.gflot.client.SimplePlot;
-import ca.nanometrics.gflot.client.event.PlotHoverListener;
-import ca.nanometrics.gflot.client.event.PlotItem;
-import ca.nanometrics.gflot.client.event.PlotPosition;
-import ca.nanometrics.gflot.client.jsni.Plot;
-import ca.nanometrics.gflot.client.options.AxisOptions;
-import ca.nanometrics.gflot.client.options.GlobalSeriesOptions;
-import ca.nanometrics.gflot.client.options.GridOptions;
-import ca.nanometrics.gflot.client.options.LineSeriesOptions;
-import ca.nanometrics.gflot.client.options.PlotOptions;
-import ca.nanometrics.gflot.client.options.PointsSeriesOptions;
-import ca.nanometrics.gflot.client.options.TickFormatter;
-
-import com.google.gwt.i18n.client.DateTimeFormat;
-import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
-import com.google.gwt.user.client.Timer;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.types.AnimationEffect;
-import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.HTMLFlow;
-import com.smartgwt.client.widgets.Label;
-import com.smartgwt.client.widgets.WidgetCanvas;
-import com.smartgwt.client.widgets.Window;
-import com.smartgwt.client.widgets.events.ClickEvent;
-import com.smartgwt.client.widgets.events.ClickHandler;
-import com.smartgwt.client.widgets.events.CloseClickEvent;
-import com.smartgwt.client.widgets.events.CloseClickHandler;
-import com.smartgwt.client.widgets.events.MouseOutEvent;
-import com.smartgwt.client.widgets.events.MouseOutHandler;
-
-import org.rhq.core.domain.measurement.MeasurementData;
-import org.rhq.core.domain.measurement.MeasurementDataNumeric;
-import org.rhq.core.domain.measurement.MeasurementDefinition;
-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.MeasurementDataGWTServiceAsync;
-import org.rhq.enterprise.gui.coregui.client.util.MeasurementConverterClient;
-import org.rhq.enterprise.gui.coregui.client.util.enhanced.EnhancedVLayout;
-
-/**
- * @author Greg Hinkle
- */
-@Deprecated
-public class LiveGraphView extends EnhancedVLayout {
-
- private static final String INSTRUCTIONS =
MSG.view_resource_monitor_graph_instructions();
-
- private final Label selectedPointLabel = new Label(INSTRUCTIONS);
- private final Label positionLabel = new Label();
-
- private final Label hoverLabel = new Label();
-
- private int resourceId;
- private MeasurementDefinition definition;
-
- private SimplePlot plot;
- private Timer dataLoader;
- @SuppressWarnings("unused")
- private long min, max;
-
- public LiveGraphView() {
- super();
- }
-
- public LiveGraphView(int resourceId, MeasurementDefinition def) {
- super();
- this.resourceId = resourceId;
- this.definition = def;
- setHeight100();
- setWidth100();
- }
-
- public String getName() {
- return "PlotHoverListener";
- }
-
- @Override
- protected void onDraw() {
- super.onDraw();
-
- for (Canvas c : getChildren()) {
- c.destroy();
- }
-
- drawGraph();
- }
-
- @Override
- protected void onDetach() {
- super.onDetach(); // TODO: Implement this method.
- }
-
- @Override
- protected void onUnload() {
- super.onUnload(); // TODO: Implement this method.
- }
-
- @Override
- public void parentResized() {
- super.parentResized();
- onDraw();
- }
-
- private void drawGraph() {
-
- PlotModel model = new PlotModel();
- PlotOptions plotOptions = new PlotOptions();
- GlobalSeriesOptions globalSeriesOptions = new GlobalSeriesOptions();
- globalSeriesOptions.setLineSeriesOptions(new
LineSeriesOptions().setLineWidth(1).setShow(true));
- globalSeriesOptions.setPointsOptions(new
PointsSeriesOptions().setRadius(2).setShow(true));
- globalSeriesOptions.setShadowSize(0);
- plotOptions.setGlobalSeriesOptions(globalSeriesOptions);
-
- // You need make the grid hoverable <<<<<<<<<
- plotOptions
- .setGridOptions(new
GridOptions().setHoverable(true).setMouseActiveRadius(10).setAutoHighlight(true));
-
- // create a series
- loadData(model, plotOptions);
-
- // create the plot
- plot = new SimplePlot(model, plotOptions);
- plot.setSize(String.valueOf(getInnerContentWidth()),
String.valueOf(getInnerContentHeight() - 20));
-
- // add hover listener
- plot.addHoverListener(new PlotHoverListener() {
- public void onPlotHover(Plot plot, PlotPosition position, PlotItem item) {
- if (position != null) {
- positionLabel.setContents("position: (" + position.getX() +
"," + position.getY() + ")");
- }
- if (item != null) {
- hoverLabel.setContents(getHover(item));
-
- hoverLabel.animateShow(AnimationEffect.FADE);
- if (hoverLabel.getLeft() > 0 || hoverLabel.getTop() > 0) {
- hoverLabel.animateMove(item.getPageX() + 5, item.getPageY() +
5);
- } else {
- hoverLabel.moveTo(item.getPageX() + 5, item.getPageY() + 5);
- }
- hoverLabel.redraw();
-
- selectedPointLabel.setContents("x: " +
item.getDataPoint().getX() + ", y: "
- + item.getDataPoint().getY());
- } else {
- hoverLabel.animateHide(AnimationEffect.FADE);
- selectedPointLabel.setContents(INSTRUCTIONS);
- }
- }
- }, false);
-
- addMouseOutHandler(new MouseOutHandler() {
- public void onMouseOut(MouseOutEvent mouseOutEvent) {
- hoverLabel.animateHide(AnimationEffect.FADE);
- }
- });
-
- hoverLabel.setOpacity(80);
- hoverLabel.setWrap(false);
- hoverLabel.setHeight(25);
- hoverLabel.setBackgroundColor("yellow");
- hoverLabel.setBorder("1px solid orange");
- hoverLabel.hide();
-
- hoverLabel.draw();
-
- // put it on a panel
-
- if (definition != null) {
-
- HTMLFlow title = new HTMLFlow("<b>" +
definition.getDisplayName() + "</b> " + definition.getDescription());
- title.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent clickEvent) {
- // displayAsDialog();
- }
- });
-
- addMember(title);
- }
-
- addMember(new WidgetCanvas(plot));
- }
-
- private String getHover(PlotItem item) {
- if (definition != null) {
- DateTimeFormat df =
DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_MEDIUM);
- return definition.getDisplayName() + ": "
- + MeasurementConverterClient.format(item.getDataPoint().getY(),
definition.getUnits(), true) + "<br/>"
- + df.format(new Date((long) item.getDataPoint().getX()));
- } else {
- return "x: " + item.getDataPoint().getX() + ", y: " +
item.getDataPoint().getY();
- }
- }
-
- private void loadData(final PlotModel model, final PlotOptions plotOptions) {
- final SeriesHandler handler = model.addSeries(definition.getDisplayName(),
"#007f00");
-
- model.setStrategy(PlotModelStrategy.slidingWindowStrategy(60));
- final MeasurementDataGWTServiceAsync dataService =
GWTServiceLookup.getMeasurementDataService();
-
- dataLoader = new Timer() {
- @Override
- public void run() {
- dataService.findLiveData(resourceId, new int[] { definition.getId() },
- new AsyncCallback<Set<MeasurementData>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler()
-
.handleError(MSG.view_resource_monitor_graphs_loadFailed(), caught);
- }
-
- public void onSuccess(Set<MeasurementData> result) {
- Iterator<MeasurementData> i = result.iterator();
- if (!i.hasNext()) {
- return;
- }
-
- MeasurementDataNumeric d = (MeasurementDataNumeric)
i.next();
-
- handler.add(new DataPoint(d.getTimestamp(), d.getValue()));
- plot.redraw();
- }
- });
- }
- };
-
- dataLoader.scheduleRepeating(1000);
-
- plotOptions.addYAxisOptions(new AxisOptions().setLabelWidth(70).setTicks(5)
- .setTickFormatter(new TickFormatter() {
- public String formatTickValue(double v, Axis axis) {
- return MeasurementConverterClient.format(v, definition.getUnits(),
true);
- }
- }));
-
- plotOptions.addXAxisOptions(new AxisOptions().setTicks(8).setTickFormatter(new
TickFormatter() {
- public String formatTickValue(double tickValue, Axis axis) {
- DateTimeFormat dateFormat =
DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_MEDIUM);
- return dateFormat.format(new Date((long) tickValue));
- }
- }));
-
- }
-
- public static void displayAsDialog(int resourceId, MeasurementDefinition def) {
- final LiveGraphView graph = new LiveGraphView(resourceId, def);
- final Window graphPopup = new Window();
- graphPopup.setTitle(MSG.view_resource_monitor_detailed_graph_label());
- graphPopup.setWidth(800);
- graphPopup.setHeight(400);
- graphPopup.setIsModal(true);
- graphPopup.setShowModalMask(true);
- graphPopup.setCanDragResize(true);
- graphPopup.centerInPage();
- graphPopup.addItem(graph);
- graphPopup.show();
-
- graphPopup.addCloseClickHandler(new CloseClickHandler() {
- public void onCloseClick(CloseClickEvent closeClientEvent) {
- graph.stop();
- graphPopup.destroy();
- }
- });
- }
-
- protected void stop() {
- hoverLabel.destroy();
- dataLoader.cancel();
- }
-
- @Override
- protected void onDestroy() {
- stop();
- super.onDestroy();
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/ResourceMetricGraphView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/ResourceMetricGraphView.java
deleted file mode 100644
index 6db0d56..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/ResourceMetricGraphView.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring;
-
-import java.util.EnumSet;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.widgets.HTMLFlow;
-
-import org.rhq.core.domain.criteria.ResourceCriteria;
-import org.rhq.core.domain.measurement.MeasurementDefinition;
-import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.domain.util.PageList;
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.LinkManager;
-import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync;
-import org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMetricGraphView;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.AncestryUtil;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
-import org.rhq.enterprise.server.measurement.util.MeasurementUtils;
-
-/**
- * @deprecated should be replaced with new d3 graph views
- * @author Greg Hinkle
- * @author Jay Shaughnessy
- */
-@Deprecated
-public class ResourceMetricGraphView extends AbstractMetricGraphView {
-
- private HTMLFlow resourceTitle;
-
- public ResourceMetricGraphView() {
- super();
- }
-
- public ResourceMetricGraphView(int resourceId, MeasurementDefinition def,
- List<MeasurementDataNumericHighLowComposite> data) {
-
- super(resourceId, def, data);
- }
-
- @Override
- protected HTMLFlow getEntityTitle() {
- return resourceTitle;
- }
-
- @Override
- protected void renderGraph() {
- if (null == getDefinition()) {
-
- ResourceGWTServiceAsync resourceService =
GWTServiceLookup.getResourceService();
-
- ResourceCriteria resourceCriteria = new ResourceCriteria();
- resourceCriteria.addFilterId(getEntityId());
- resourceService.findResourcesByCriteria(resourceCriteria, new
AsyncCallback<PageList<Resource>>() {
- @Override
- public void onFailure(Throwable caught) {
-
CoreGUI.getErrorHandler().handleError(MSG.view_resource_monitor_graphs_lookupFailed(),
caught);
- }
-
- @Override
- public void onSuccess(PageList<Resource> result) {
- if (result.isEmpty()) {
- return;
- }
-
- final Resource resource = result.get(0);
- HashSet<Integer> typesSet = new HashSet<Integer>();
- typesSet.add(resource.getResourceType().getId());
- HashSet<String> ancestries = new HashSet<String>();
- ancestries.add(resource.getAncestry());
- // In addition to the types of the result resources, get the types of
their ancestry
- typesSet.addAll(AncestryUtil.getAncestryTypeIds(ancestries));
-
- ResourceTypeRepository.Cache.getInstance().getResourceTypes(
- typesSet.toArray(new Integer[typesSet.size()]),
- EnumSet.of(ResourceTypeRepository.MetadataType.measurements),
- new ResourceTypeRepository.TypesLoadedCallback() {
-
- public void onTypesLoaded(Map<Integer, ResourceType>
types) {
- String url =
LinkManager.getResourceLink(resource.getId());
- resourceTitle = new HTMLFlow(LinkManager.getHref(url,
resource.getName()));
-
resourceTitle.setTooltip(AncestryUtil.getAncestryHoverHTMLForResource(resource, types,
- 0));
-
- ResourceType type =
types.get(resource.getResourceType().getId());
- for (MeasurementDefinition def :
type.getMetricDefinitions()) {
- if (def.getId() == getDefinitionId()) {
- setDefinition(def);
-
-
GWTServiceLookup.getMeasurementDataService().findDataForResourceForLast(
- getEntityId(), new int[] { getDefinitionId()
}, 8,
- MeasurementUtils.UNIT_HOURS, 60,
- new
AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>>() {
- @Override
- public void onFailure(Throwable caught)
{
-
CoreGUI.getErrorHandler().handleError(
-
MSG.view_resource_monitor_graphs_loadFailed(), caught);
- }
-
- @Override
- public void onSuccess(
-
List<List<MeasurementDataNumericHighLowComposite>> result) {
- setData(result.get(0));
-
- drawGraph();
- }
- });
- }
- }
- }
- });
- }
- });
-
- } else {
- drawGraph();
- }
- }
-
- @Override
- protected boolean supportsLiveGraphViewDialog() {
- return true;
- }
-
- @Override
- protected void displayLiveGraphViewDialog() {
- LiveGraphView.displayAsDialog(getEntityId(), getDefinition());
- }
-
- @Override
- public AbstractMetricGraphView getInstance(int entityId, MeasurementDefinition def,
- List<MeasurementDataNumericHighLowComposite> data) {
-
- return new ResourceMetricGraphView(entityId, def, data);
- }
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityBarView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityBarView.java
deleted file mode 100644
index 5d40b1b..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityBarView.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.avail;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.widgets.Img;
-import com.smartgwt.client.widgets.events.MouseOutEvent;
-import com.smartgwt.client.widgets.events.MouseOutHandler;
-import com.smartgwt.client.widgets.events.MouseOverEvent;
-import com.smartgwt.client.widgets.events.MouseOverHandler;
-import com.smartgwt.client.widgets.layout.HLayout;
-
-import org.rhq.core.domain.criteria.AvailabilityCriteria;
-import org.rhq.core.domain.measurement.Availability;
-import org.rhq.core.domain.measurement.MeasurementUnits;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.util.PageList;
-import org.rhq.core.domain.util.PageOrdering;
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.ImageManager;
-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.Log;
-import org.rhq.enterprise.gui.coregui.client.util.MeasurementConverterClient;
-
-/**
- * This is a potential replacement to the JSF "Christmas Tree". Unused at the
moment but something to
- * consider when we replace JSF completely.
- *
- * @author Greg Hinkle
- */
-@Deprecated
-public class AvailabilityBarView extends HLayout {
-
- Messages MSG = CoreGUI.getMessages();
-
- private Resource resource;
-
- public AvailabilityBarView(Resource resource) {
- this.resource = resource;
- setHeight(28);
- setWidth100();
- setMargin(10);
- }
-
- @Override
- protected void onInit() {
- super.onInit();
-
- AvailabilityCriteria c = new AvailabilityCriteria();
- c.addFilterResourceId(resource.getId());
- c.addSortStartTime(PageOrdering.ASC);
- GWTServiceLookup.getAvailabilityService().findAvailabilityByCriteria(c,
- new AsyncCallback<PageList<Availability>>() {
- public void onFailure(Throwable caught) {
-
CoreGUI.getErrorHandler().handleError(MSG.view_resource_monitor_availability_loadFailed(),
caught);
- }
-
- public void onSuccess(PageList<Availability> result) {
- update(result);
- }
- });
- }
-
- private void update(PageList<Availability> result) {
-
- long start = result.get(0).getStartTime();
- long end = result.get(result.size() - 1).getEndTime() != null ?
result.get(result.size() - 1).getEndTime()
- : System.currentTimeMillis();
-
- long diff = end - start;
-
- Img leftCap = new Img("availBar/leftCap.png", 8, 28);
- addMember(leftCap);
-
- for (Availability a : result) {
-
- long endTime = a.getEndTime() != null ? a.getEndTime() :
System.currentTimeMillis();
-
- double width = (((double) (endTime - a.getStartTime()) / diff) * 100);
- String widthString = width + "%";
- if (width == 0) {
- widthString = "2px";
- }
-
- String imagePath =
ImageManager.getAvailBarImagePath(a.getAvailabilityType());
-
- final Img section = new Img(imagePath);
- section.setHeight(28);
- section.setOpacity(60);
- section.setWidth(widthString);
-
- section.addMouseOverHandler(new MouseOverHandler() {
- public void onMouseOver(MouseOverEvent mouseOverEvent) {
- section.animateFade(100);
- }
- });
- section.addMouseOutHandler(new MouseOutHandler() {
- public void onMouseOut(MouseOutEvent mouseOutEvent) {
- section.animateFade(60);
- }
- });
-
- long duration = endTime - a.getStartTime();
-
- String durationString = MeasurementConverterClient.format((double) duration,
MeasurementUnits.MILLISECONDS,
- true);
-
- section.setTooltip("<div style=\"white-space:
nowrap;\"><b>" + MSG.common_title_availability() + ":
</b>"
- + a.getAvailabilityType().name() + "<br/><b>" +
MSG.common_title_start() + ": </b>" + a.getStartTime()
- + "<br/><b>" + MSG.common_title_end() + ":
</b>" + a.getEndTime() + "<br/><b>"
- + MSG.common_title_duration() + ": </b>" +
durationString);
-
- addMember(section);
-
- }
- Img rightCap = new Img("availBar/rightCap.png", 8, 28);
- addMember(rightCap);
-
- }
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MeasurementTableView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MeasurementTableView.java
index 3a39c2e..c6ad891 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MeasurementTableView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MeasurementTableView.java
@@ -146,55 +146,8 @@ public class MeasurementTableView extends
Table<MeasurementTableDataSource> {
}
});
- //@todo: delete once satisfied with d3 chart verification
- //add chart selected metric action
- addTableAction(MSG.view_measureTable_chartMetricValues(), new TableAction() {
- @Override
- public boolean isEnabled(ListGridRecord[] selection) {
- return selection != null && selection.length > 0;
- }
-
- @Override
- public void executeAction(ListGridRecord[] selection, Object actionValue) {
- if (selection == null || selection.length == 0) {
- return;
- }
- // keyed on metric name - string[0] is the metric label, [1] is the
units
- final HashMap<String, String[]> scheduleNamesAndUnits = new
HashMap<String, String[]>();
- int[] definitionIds = new int[selection.length];
- int i = 0;
- for (ListGridRecord record : selection) {
- Integer defId =
record.getAttributeAsInt(MeasurementTableDataSource.FIELD_METRIC_DEF_ID);
- definitionIds[i++] = defId.intValue();
- String name =
record.getAttribute(MeasurementTableDataSource.FIELD_METRIC_NAME);
- String label =
record.getAttribute(MeasurementTableDataSource.FIELD_METRIC_LABEL);
- String units =
record.getAttribute(MeasurementTableDataSource.FIELD_METRIC_UNITS);
- if (units == null || units.length() < 1) {
- units = MeasurementUnits.NONE.name();
- }
-
- scheduleNamesAndUnits.put(name, new String[] { label, units });
- }
-
- //build portal.war chart page to iFrame
- String destination =
"/resource/common/monitor/Visibility.do?mode=chartMultiMetricSingleResource&id="
- + resourceId;
- for (int mId : definitionIds) {
- destination += "&m=" + mId;
- }
- ChartViewWindow window = new ChartViewWindow("");
- //generate and include iframed content
- FullHTMLPane iframe = new FullHTMLPane(destination);
- window.addItem(iframe);
- window.show();
- refreshTableInfo();
- }
- });
-
- // new d3 chart selection
- //@todo: i18n when we remove gflot graphs
- addTableAction("d3 Chart Selection", new TableAction() {
+ addTableAction(MSG.view_measureTable_chartMetricValues(), new TableAction() {
@Override
public boolean isEnabled(ListGridRecord[] selection) {
return selection != null && selection.length > 0;
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
index 0cd10cb..3d5ae84 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
@@ -11,11 +11,6 @@
<inherits name='com.smartgwt.SmartGwt' />
<inherits name="com.smartgwt.tools.SmartGwtTools"/>
-
- <!-- @todo: take out GFlot once we have d3 graphing in place -->
- <inherits name='ca.nanometrics.gflot.GFlot'/>
- <set-property name="gflot.load.jquery" value="EXTERNAL" />
-
<!-- ============================ gwt logging =============================
-->
<set-property name="gwt.logging.enabled" value="TRUE"/>
<!-- FINE ~= DEBUG in gwt-log -->
commit ca17805e57e131a9b1972987827d54a63d5b8fb0
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Apr 29 17:04:34 2013 -0400
BZ 951121 - tell the user the server is still starting if they attempt to login during
startup
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 46ea7f2..d896e63 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
@@ -67,11 +67,10 @@ import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
-import org.rhq.enterprise.gui.coregui.client.util.BrowserUtility;
import org.rhq.enterprise.gui.coregui.client.util.Log;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.enhanced.EnhancedIButton;
import org.rhq.enterprise.gui.coregui.client.util.enhanced.EnhancedVLayout;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
* @author Greg Hinkle
@@ -572,6 +571,8 @@ public class LoginView extends Canvas {
private void handleError(int statusCode) {
if (statusCode == 401) {
form.setFieldErrors("login", MSG.view_login_noUser(), true);
+ } else if (statusCode == 503) {
+ form.setFieldErrors("login", MSG.view_core_serverInitializing(),
true);
} else {
form.setFieldErrors("login", MSG.view_login_noBackend(), true);
}
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 f803b24..6995e4f 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
@@ -154,6 +154,12 @@ public class UserSessionManager {
Log.info("response text = " + response.getText());
String sessionIdString = response.getText();
+ if (sessionIdString.startsWith("booting")) {
+ // "booting" is the string we get back from
SessionAccessServlet if StartupBean hasn't finished
+ new
LoginView().showLoginDialog(MSG.view_core_serverInitializing());
+ return;
+ }
+
// If a session is active it will return valid session strings
if (sessionIdString != null && sessionIdString.length() >
0) {
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 0b75e4f..0c5af20 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
@@ -1357,6 +1357,7 @@ view_connectionSettingsDetails_somePropertiesInvalid = The following
connection
view_core_loggedOut = Logged out
view_core_noRecentAlerts = There are no recent alerts to report
view_core_recentAlerts = There are [{0}] recent alerts - click to go to the recent alerts
report
+view_core_serverInitializing = The server is currently starting up. Please wait for it to
fully initialize before attempting to log in.
view_core_serverUnreachable = The server is unreachable and may be down
view_core_uncaught = Globally uncaught exception
view_dashboardManager_deleteFail = Failed to delete dashboard.
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
index bd735d0..42405aa 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
@@ -1372,6 +1372,7 @@ view_connectionSettingsDetails_somePropertiesInvalid = Následující
položky m
view_core_loggedOut = Odhlášeno
view_core_noRecentAlerts = Nejsou žádné nedávné výstrahy k hlášení
view_core_recentAlerts = Je [{0}] nedávných výstrah - klikněte pro přechod na hlášení
+##view_core_serverInitializing = The server is currently starting up. Please wait for it
to fully initialize before attempting to log in.
view_core_serverUnreachable = Server je nedosažitelný, možná spadl
view_core_uncaught = Globálné nezachycená výjimka
view_dashboardManager_deleteFail = Nepodařilo se smazat dashboard.
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 0ad2504..8185e7f 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
@@ -1226,6 +1226,7 @@ view_configurationHistoryList_title = Konfigurationsänderungen
view_core_loggedOut = Ausgeloggt
view_core_noRecentAlerts = Es liegen keine frischen Alarme vor
view_core_recentAlerts = [{0}] frische Alarme
+##view_core_serverInitializing = The server is currently starting up. Please wait for it
to fully initialize before attempting to log in.
view_core_serverUnreachable = Kann den Server nicht erreichen. Er abgeschaltet sein.
view_core_uncaught = Es ist eine nicht abgefangene Ausnahme aufgetreten.
view_dashboardManager_deleteFail = Konnte das Dashboard nicht löschen.
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 ef42475..c15e129 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
@@ -1352,6 +1352,7 @@ view_core_loggedInAs = {0} としてログイン
view_core_loggedOut = ログアウト
view_core_noRecentAlerts = レポートすべき最近のアラートは存在しません
view_core_recentAlerts = [{0}] 個の最近のアラートがありました - 最近のアラートレポートへクリックしてください
+##view_core_serverInitializing = The server is currently starting up. Please wait for it
to fully initialize before attempting to log in.
view_core_serverUnreachable = サーバーに到達できません。ダウンしている可能性があります。
view_core_uncaught = グローバルにキャッチされない例外
view_dashboardManager_deleteFail = ダッシュボードの削除に失敗しました
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties
index 1d3530e..8105460 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties
@@ -1163,6 +1163,7 @@ view_connectionSettingsDetails_somePropertiesInvalid = 다음 연결 설정은
view_core_loggedOut = 로그 아웃
view_core_noRecentAlerts = 리포트에서 최근 알림이 없습니다
view_core_recentAlerts = [{0}] 최근 경고가 있습니다 - 최근 경고 리포트를 클릭하십시오
+##view_core_serverInitializing = The server is currently starting up. Please wait for it
to fully initialize before attempting to log in.
view_core_serverUnreachable = 서버에 접근할 수 없거나 다운되었을 수 있습니다
view_core_uncaught = 글로벌 캐치되지 않은 예외
view_dashboardManager_deleteFail = 대시 보드의 제거에 실패했습니다.
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 b7cab71..d50a54e 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
@@ -1363,6 +1363,7 @@ view_core_loggedInAs = Logado como {0}
view_core_loggedOut = Desconectado
view_core_noRecentAlerts = N�o existem alertas recentes
view_core_recentAlerts = [{0}] alertas recentes
+##view_core_serverInitializing = The server is currently starting up. Please wait for it
to fully initialize before attempting to log in.
##view_core_serverUnreachable = The server is unreachable and may be down
view_core_uncaught = Exce\u00E7\u00E3o n\u00E3o capturada
view_dashboardManager_deleteFail = Falha ao excluir o dashboard.
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
index 56cf3e6..fb45e35 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
@@ -2675,6 +2675,7 @@ view_admin_systemSettings_LDAPBindPW_name = Пароль
##view_configEdit_property = Vlastnost
##view_configEdit_unset = Unset?
##view_configEdit_value = Value
+##view_core_serverInitializing = The server is currently starting up. Please wait for it
to fully initialize before attempting to log in.
##view_dashboardsManager_message_title_details = <h1>Welcome to
{0}</h1>\n<p>This dashboard can be edited by clicking the (Edit Mode) button
above.</p>\n<p>What would you like to
do?</p>\n<p> <a href=\"{1}\">Import newly
discovered resources.</a></p>\n<p> <a
href=\"{2}\">Search for
resources.</a></p>\n<p> <a
href=\"{3}\">See help and documentation.</a></p>
##view_dynagroup_exprBuilder_groupBy = Group by
##view_dynagroup_exprBuilder_groupBy_tooltip = groupby will cause the system to pivot on
the values from the entered expressions creating a separate group for each value. For
example, groupby on the cluster name to create a group for each cluster with all cluster
members in it.
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 5e6afec..e929386 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
@@ -1345,6 +1345,7 @@ view_connectionSettingsDetails_somePropertiesInvalid =
\u4e0b\u9762\u7684\u8fde\
view_core_loggedOut = \u9000\u51fa\u767b\u5f55
view_core_noRecentAlerts = \u6ca1\u6709\u65b0\u4ea7\u751f\u7684\u544a\u8b66\u4fe1\u606f
view_core_recentAlerts = \u65b0\u4ea7\u751f [{0}] \u6761\u544a\u8b66 -
\u70b9\u51fb\u8df3\u8f6c\u5230\u65b0\u544a\u8b66\u62a5\u8868\u754c\u9762
+##view_core_serverInitializing = The server is currently starting up. Please wait for it
to fully initialize before attempting to log in.
##view_core_serverUnreachable = The server is unreachable and may be down
view_core_uncaught = \u5168\u5c40\u672a\u6355\u6349\u7684\u5f02\u5e38
view_dashboardManager_deleteFail = \u5220\u9664\u7edf\u8ba1\u8868\u76d8\u5931\u8d25.
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
index caf4ab5..f7cca42 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
@@ -38,6 +38,7 @@ import org.rhq.enterprise.gui.legacy.util.SessionUtils;
import org.rhq.enterprise.server.auth.SessionManager;
import org.rhq.enterprise.server.auth.SessionNotFoundException;
import org.rhq.enterprise.server.auth.SessionTimeoutException;
+import org.rhq.enterprise.server.util.LookupUtil;
/**
* @author Greg Hinkle
@@ -59,6 +60,20 @@ public class SessionAccessServlet extends HttpServlet {
// some date in the past
response.addHeader("Expires", "Mon, 8 Aug 2006 10:00:00
GMT");
+ // do not go any further unless we know the server has been fully initialized
+ boolean serverInitialized;
+ try {
+ serverInitialized = LookupUtil.getStartupLocal().isInitialized();
+ } catch (Throwable t) {
+ serverInitialized = false; // this probably means we are still starting up
and app server hasn't made EJBs available yet
+ }
+
+ if (!serverInitialized) {
+ response.setHeader("Retry-After", "30");
+ response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE, "Server
is not ready - still booting up");
+ return;
+ }
+
//if a session does not already exist this call will create one
HttpSession session = request.getSession();
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AuthenticationFilter.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AuthenticationFilter.java
index 8743a33..c80e517 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AuthenticationFilter.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AuthenticationFilter.java
@@ -38,6 +38,7 @@ import org.rhq.enterprise.gui.legacy.util.SessionUtils;
import org.rhq.enterprise.server.auth.SessionManager;
import org.rhq.enterprise.server.auth.SessionNotFoundException;
import org.rhq.enterprise.server.auth.SessionTimeoutException;
+import org.rhq.enterprise.server.util.LookupUtil;
public final class AuthenticationFilter extends BaseFilter {
@@ -49,6 +50,20 @@ public final class AuthenticationFilter extends BaseFilter {
HttpServletResponse response = (HttpServletResponse) res;
HttpServletRequest request = (HttpServletRequest) req;
+ // do not go any further unless we know the server has been fully initialized
+ boolean serverInitialized;
+ try {
+ serverInitialized = LookupUtil.getStartupLocal().isInitialized();
+ } catch (Throwable t) {
+ serverInitialized = false; // this probably means we are still starting up
and app server hasn't made EJBs available yet
+ }
+
+ if (!serverInitialized) {
+ response.setHeader("Retry-After", "30");
+ response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE, "Server
is not ready - still booting up");
+ return;
+ }
+
//if a session does not already exist this call will create one
HttpSession session = request.getSession();
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
index de4f6fe..5b5aa8c 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
@@ -100,7 +100,7 @@ import
org.rhq.enterprise.server.util.concurrent.AvailabilityReportSerializer;
*/
@Singleton
//@Startup // when AS7-5530 is fixed, uncomment this and remove class
StartupBeanToWorkaroundAS7_5530
-public class StartupBean {
+public class StartupBean implements StartupLocal {
private Log log = LogFactory.getLog(this.getClass());
private boolean initialized = false;
@@ -138,6 +138,12 @@ public class StartupBean {
@Resource(name = "RHQ_DS", mappedName = RHQConstants.DATASOURCE_JNDI_NAME)
private DataSource dataSource;
+ @Override
+ @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
+ public boolean isInitialized() {
+ return this.initialized;
+ }
+
/**
* Modifies the naming subsystem to be able to check for Java security permissions on
JNDI lookup.
* <p>
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBeanPreparation.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBeanPreparation.java
index 88790d5..c66d328 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBeanPreparation.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBeanPreparation.java
@@ -43,7 +43,7 @@ public class StartupBeanPreparation {
private Log log = LogFactory.getLog(this.getClass());
@EJB
- private StartupBean startupBean;
+ private StartupLocal startupBean;
@Resource
private TimerService timerService; // needed to schedule our startup bean init call
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupLocal.java
new file mode 100644
index 0000000..bc98bbf
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupLocal.java
@@ -0,0 +1,39 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.core;
+
+import javax.ejb.Local;
+
+@Local
+public interface StartupLocal {
+ /**
+ * When false is returned, it means the startup bean has not finished initializing
the server.
+ * Only when true is returned can we be assured that the server has been fully
started and initialized, ready to accept
+ * agent requests and user requests from browser/remote clients.
+ *
+ * @return true if the startup bean has fully initialized the server
+ */
+ boolean isInitialized();
+
+ /**
+ * Tells the startup bean to do its work. This will finish the initialization of the
server.
+ */
+ void init();
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
index 112a590..698ec85 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
@@ -103,6 +103,8 @@ import org.rhq.enterprise.server.core.EmailManagerBean;
import org.rhq.enterprise.server.core.EmailManagerLocal;
import org.rhq.enterprise.server.core.RemoteClientManagerBean;
import org.rhq.enterprise.server.core.RemoteClientManagerLocal;
+import org.rhq.enterprise.server.core.StartupBean;
+import org.rhq.enterprise.server.core.StartupLocal;
import org.rhq.enterprise.server.core.plugin.PluginDeploymentScannerMBean;
import org.rhq.enterprise.server.dashboard.DashboardManagerBean;
import org.rhq.enterprise.server.dashboard.DashboardManagerLocal;
@@ -589,6 +591,10 @@ public final class LookupUtil {
return lookupLocal(SubjectPreferencesCacheBean.class);
}
+ public static StartupLocal getStartupLocal() {
+ return lookupLocal(StartupBean.class);
+ }
+
public static CoreServerMBean getCoreServer() {
MBeanServer mbs = getJBossMBeanServer();
CoreServerMBean rhqServer = (CoreServerMBean)
MBeanProxyExt.create(CoreServerMBean.class,
commit 58e3a41e18d47c955129d97c68a4149bea01a983
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Apr 29 13:14:10 2013 -0400
BZ 951382 - in agent-configuration.xml, use "conf" instead to make it clear
the user should probably put their certs in the conf/ directory.
diff --git a/modules/enterprise/agent/src/main/resources/agent-configuration.xml
b/modules/enterprise/agent/src/main/resources/agent-configuration.xml
index 61339fe..d59fe71 100644
--- a/modules/enterprise/agent/src/main/resources/agent-configuration.xml
+++ b/modules/enterprise/agent/src/main/resources/agent-configuration.xml
@@ -1014,36 +1014,35 @@ commands named "config", "setconfig" and
"setup" and the command line options
rhq.agent.client.security.server-auth-mode-enabled
These are the settings that are used if SSL is to be used for
- either the server or client communications. These can be left
- unset since the defaults will normally suffice. These
- properties are here just in case some use case occurs that
- require one or more of these settings to be customized.
+ either the server-side or client-side communications (that is,
+ for incoming messages into the agent and for outgoing messages
+ getting sent by the agent).
Note that if client-auth-mode is specified, it must be one of:
"none", "want", "need".
-->
<!--
<entry
key="rhq.communications.connector.security.secure-socket-protocol"
value="TLS" />
- <entry
key="rhq.communications.connector.security.keystore.file"
value="data/keystore.dat" />
+ <entry
key="rhq.communications.connector.security.keystore.file"
value="conf/keystore.dat" />
<entry
key="rhq.communications.connector.security.keystore.algorithm"
value="SunX509" />
<entry
key="rhq.communications.connector.security.keystore.type"
value="JKS" />
<entry
key="rhq.communications.connector.security.keystore.password"
value="rhqpwd" />
<entry
key="rhq.communications.connector.security.keystore.key-password"
value="rhqpwd" />
<entry
key="rhq.communications.connector.security.keystore.alias"
value="rhq" />
- <entry
key="rhq.communications.connector.security.truststore.file"
value="data/truststore.dat" />
+ <entry
key="rhq.communications.connector.security.truststore.file"
value="conf/truststore.dat" />
<entry
key="rhq.communications.connector.security.truststore.algorithm"
value="SunX509" />
<entry
key="rhq.communications.connector.security.truststore.type"
value="JKS" />
<entry
key="rhq.communications.connector.security.truststore.password"
value="" />
<entry
key="rhq.communications.connector.security.client-auth-mode"
value="none" />
<entry key="rhq.agent.client.security.secure-socket-protocol"
value="TLS" />
- <entry key="rhq.agent.client.security.keystore.file"
value="data/keystore.dat" />
+ <entry key="rhq.agent.client.security.keystore.file"
value="conf/keystore.dat" />
<entry key="rhq.agent.client.security.keystore.algorithm"
value="SunX509" />
<entry key="rhq.agent.client.security.keystore.type"
value="JKS" />
<entry key="rhq.agent.client.security.keystore.password"
value="rhqpwd" />
<entry key="rhq.agent.client.security.keystore.key-password"
value="rhqpwd" />
<entry key="rhq.agent.client.security.keystore.alias"
value="rhq" />
- <entry key="rhq.agent.client.security.truststore.file"
value="data/truststore.dat" />
+ <entry key="rhq.agent.client.security.truststore.file"
value="conf/truststore.dat" />
<entry key="rhq.agent.client.security.truststore.algorithm"
value="SunX509" />
<entry key="rhq.agent.client.security.truststore.type"
value="JKS" />
<entry key="rhq.agent.client.security.truststore.password"
value="" />
commit 00be4f6ba09fd8f6a1cf55a99a4fd1f6f25130d6
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Tue Apr 16 22:04:50 2013 +0200
Bug 593932 - (PRODMGT-355) Allow Trap OID for SNMP notification to be overridden
per-alert definition
Snmp trap OID is set on v2c and v3 traps as the second variable binding.
In the past, users had been confused by the name of the SNMP notification parameter
'oid'. This parameter actually defines a variable binding prefix for the RHQ alert
bindings.
Added tests for this server plugin
Added documentation to the plugin descriptor
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml
b/modules/enterprise/server/plugins/alert-snmp/pom.xml
index 909053a..b09ed2a 100644
--- a/modules/enterprise/server/plugins/alert-snmp/pom.xml
+++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml
@@ -13,12 +13,32 @@
<name>RHQ Enterprise Server SNMP Alert Plugin</name>
+ <properties>
+ <alert.snmp.test.port>35162</alert.snmp.test.port>
+ </properties>
+
<dependencies>
<dependency>
<groupId>org.snmp4j</groupId>
<artifactId>snmp4j</artifactId>
<version>1.8.2</version>
</dependency>
+
+ <!-- Test dependencies -->
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>test-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ <version>1.9.5</version>
+ </dependency>
+
</dependencies>
<build>
@@ -27,10 +47,14 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
-
<excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
- <!--
- <argLine>${jacoco.unit-test.args} -Xdebug -Xnoagent
-Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y</argLine>
- -->
+ <properties>
+ <property>
+ <name>listener</name>
+ <value>org.rhq.test.testng.StdoutReporter</value>
+ </property>
+ </properties>
+ <useSystemClassLoader>false</useSystemClassLoader>
+ <argLine>${jacoco.unit-test.args}</argLine>
</configuration>
</plugin>
diff --git
a/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfo.java
b/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfo.java
index 082e706..c92daae 100644
---
a/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfo.java
+++
b/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfo.java
@@ -1,19 +1,55 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
package org.rhq.enterprise.server.plugins.alertSnmp;
import org.rhq.core.domain.configuration.Configuration;
+/**
+ * Utility class giving a view of SNMP alert notification parameters.
+ *
+ * @deprecated as of 4.7. It's an internal utility class and should not have been
made public.
+ */
+@Deprecated
public class SnmpInfo {
+ // SNMP Alert Notification parameter names
+ static final String PARAM_HOST = "host";
+ static final String PARAM_PORT = "port";
+ static final String PARAM_VARIABLE_BINDING_PREFIX = "oid";
+ static final String PARAM_TRAP_OID = "trapOid";
+
+ // Default remote port for SNMP trap
+ static final String DEFAULT_PORT = "162";
+
final public String host;
final public String port;
final public String oid;
+ final public String trapOid;
final public String error;
- private SnmpInfo(String host, String port, String oid) {
+ private SnmpInfo(String host, String port, String oid, String trapOid) {
this.host = host;
this.port = port;
this.oid = oid;
+ this.trapOid = trapOid;
String error = null;
if (oid == null) {
@@ -29,17 +65,26 @@ public class SnmpInfo {
this.error = error;
}
+ /**
+ * Creates an instance of {@link SnmpInfo} from alert definition parameters.
+ *
+ * @param configuration SNMP notification parameters in a {@link Configuration}
object
+ * @return instance of {@link SnmpInfo}
+ */
public static SnmpInfo load(Configuration configuration) {
- String host = configuration.getSimpleValue("host", null); // required
- String port = configuration.getSimpleValue("port", "162");
- String oid = configuration.getSimpleValue("oid", null); // required
-
- return new SnmpInfo(host, port, oid);
+ String host = configuration.getSimpleValue(PARAM_HOST, null); // required
+ String port = configuration.getSimpleValue(PARAM_PORT, DEFAULT_PORT);
+ String oid = configuration.getSimpleValue(PARAM_VARIABLE_BINDING_PREFIX, null);
// required
+ String trapOid = configuration.getSimpleValue(PARAM_TRAP_OID, null);
+ return new SnmpInfo(host, port, oid, trapOid);
}
+ @Override
public String toString() {
String hostString = (host == null ? "UnknownHost" : host);
String oidString = (oid == null ? "UnknownOID" : oid);
- return hostString + ":" + port + " (" + oidString +
")";
+ String trapOidString = (trapOid == null ? "DefaultTrapOID" : trapOid);
+ return hostString + ":" + port + " (" + oidString + ")
(" + trapOidString + ")";
}
+
}
diff --git
a/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSender.java
b/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSender.java
index 1ea5e0b..5c6d1e7 100644
---
a/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSender.java
+++
b/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSender.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2009 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.server.plugins.alertSnmp;
@@ -38,7 +38,23 @@ import org.rhq.enterprise.server.util.LookupUtil;
*/
public class SnmpSender extends AlertSender {
- private final Log log = LogFactory.getLog(SnmpSender.class);
+ private static final Log LOG = LogFactory.getLog(SnmpSender.class);
+
+ private ResourceManagerLocal resourceManager;
+
+ private AlertManagerLocal alertManager;
+
+ /**
+ * Default constructor needed for instanciation by server plugin container
+ */
+ public SnmpSender() {
+ this(LookupUtil.getResourceManager(), LookupUtil.getAlertManager());
+ }
+
+ public SnmpSender(ResourceManagerLocal resourceManager, AlertManagerLocal
alertManager) {
+ this.resourceManager = resourceManager;
+ this.alertManager = alertManager;
+ }
@Override
public SenderResult send(Alert alert) {
@@ -47,12 +63,11 @@ public class SnmpSender extends AlertSender {
if (info.error != null) {
return SenderResult.getSimpleFailure(info.error);
}
- log.debug("Sending SNMP trap to: " + info);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Sending SNMP trap to: " + info);
+ }
try {
- AlertManagerLocal alertManager = LookupUtil.getAlertManager();
- ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
-
SnmpTrapSender snmpTrapSender = new SnmpTrapSender(preferences);
List<Resource> lineage =
resourceManager.getResourceLineage(alert.getAlertDefinition().getResource()
@@ -69,6 +84,7 @@ public class SnmpSender extends AlertSender {
alertUrl, hierarchy);
return SenderResult.getSimpleSuccess(result);
} catch (Throwable t) {
+ LOG.error("Could not send SNMP trap to " + info, t);
return SenderResult.getSimpleFailure("failed - cause: " + t);
}
}
diff --git
a/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpTrapSender.java
b/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpTrapSender.java
index 92fc838..2556b38 100644
---
a/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpTrapSender.java
+++
b/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpTrapSender.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.server.plugins.alertSnmp;
@@ -72,6 +72,7 @@ import org.snmp4j.util.PDUFactory;
import org.rhq.core.domain.alert.Alert;
import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.util.StringUtil;
/**
* @author Ian Springer
@@ -135,12 +136,13 @@ public class SnmpTrapSender implements PDUFactory {
}
private void checkTrapVariables(List<VariableBinding> vbs) {
-
+ // Only on SNMP v2c or v3 trap
if ((pduType == PDU.INFORM) || (pduType == PDU.TRAP)) {
+ // Insert sysUpTime OID if not already present
if ((vbs.size() == 0) || ((vbs.size() >= 1) &&
(!(vbs.get(0)).getOid().equals(SnmpConstants.sysUpTime)))) {
vbs.add(0, new VariableBinding(SnmpConstants.sysUpTime, sysUpTime));
}
-
+ // Insert trap OID if not already present
if ((vbs.size() == 1) || ((vbs.size() >= 2) &&
(!(vbs.get(1)).getOid().equals(SnmpConstants.snmpTrapOID)))) {
vbs.add(1, new VariableBinding(SnmpConstants.snmpTrapOID, trapOID));
}
@@ -469,27 +471,28 @@ public class SnmpTrapSender implements PDUFactory {
return "SNMP is not enabled.";
}
- String baseOid = alertParameters.getSimpleValue("oid",null);
+ String variableBindingPrefix =
alertParameters.getSimpleValue(SnmpInfo.PARAM_VARIABLE_BINDING_PREFIX, null);
// TODO add a request id and a timestamp
this.address = createAddress(alertParameters);
// bind the alert definitions name on the oid set in the alert
- getVariableBindings(baseOid + ".1" + "={s}" +
alert.getAlertDefinition().getName());
+ getVariableBindings(variableBindingPrefix + ".1" + "={s}" +
alert.getAlertDefinition().getName());
// the resource the alert was defined on
- getVariableBindings(baseOid + ".2" + "={s}" +
alert.getAlertDefinition().getResource().getName());
+ getVariableBindings(variableBindingPrefix + ".2" + "={s}" +
alert.getAlertDefinition().getResource().getName());
// the platform this resource is on
- getVariableBindings(baseOid + ".3" + "={s}" + platformName);
+ getVariableBindings(variableBindingPrefix + ".3" + "={s}" +
platformName);
// the conditions of this alert
- getVariableBindings(baseOid + ".4" + "={s}" + conditions);
+ getVariableBindings(variableBindingPrefix + ".4" + "={s}" +
conditions);
// severity of the alert
- getVariableBindings(baseOid + ".5" + "={s}" +
alert.getAlertDefinition().getPriority().toString().toLowerCase());
+ getVariableBindings(variableBindingPrefix + ".5" + "={s}" +
alert.getAlertDefinition().getPriority().toString().toLowerCase());
// url of the alert detail
- getVariableBindings(baseOid + ".6" + "={s}" + alertUrl);
+ getVariableBindings(variableBindingPrefix + ".6" + "={s}" +
alertUrl);
// hierarchy of the resource on alert
- getVariableBindings(baseOid + ".7" + "={s}" + hierarchy);
+ getVariableBindings(variableBindingPrefix + ".7" + "={s}" +
hierarchy);
setSysUpTimeFromBootTime(bootTime); // needs to be called before
checkTrapVariables();
+ setTrapOIDFromAlertParameters(alertParameters); // needs to be called before
checkTrapVariables();
checkTrapVariables(this.vbs);
try {
PDU response = send();
@@ -533,6 +536,13 @@ public class SnmpTrapSender implements PDUFactory {
}
+ private void setTrapOIDFromAlertParameters(Configuration alertParameters) {
+ String trapOid = alertParameters.getSimpleValue(SnmpInfo.PARAM_TRAP_OID, null);
+ if (StringUtil.isNotBlank(trapOid)) {
+ setTrapOID(new OID(trapOid));
+ }
+ }
+
private boolean init() {
String snmpVersion = systemConfig.getSimpleValue("snmpVersion",null);
@@ -795,4 +805,4 @@ public class SnmpTrapSender implements PDUFactory {
public void setPduType(int pduType) {
this.pduType = pduType;
}
-}
\ No newline at end of file
+}
diff --git
a/modules/enterprise/server/plugins/alert-snmp/src/main/resources/META-INF/rhq-serverplugin.xml
b/modules/enterprise/server/plugins/alert-snmp/src/main/resources/META-INF/rhq-serverplugin.xml
index 32ec521..83a55e9 100644
---
a/modules/enterprise/server/plugins/alert-snmp/src/main/resources/META-INF/rhq-serverplugin.xml
+++
b/modules/enterprise/server/plugins/alert-snmp/src/main/resources/META-INF/rhq-serverplugin.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<alert-plugin
+<a:alert-plugin
name="alert-snmp"
displayName="Alert:SNMP"
- xmlns="urn:xmlns:rhq-serverplugin.alert"
+ xmlns:a="urn:xmlns:rhq-serverplugin.alert"
xmlns:c="urn:xmlns:rhq-configuration"
xmlns:serverplugin="urn:xmlns:rhq-serverplugin"
package="org.rhq.enterprise.server.plugins.alertSnmp"
@@ -65,15 +65,33 @@
</serverplugin:plugin-configuration>
<!-- How does this sender show up in drop downs etc -->
- <short-name>SNMP Traps</short-name>
+ <a:short-name>SNMP Traps</a:short-name>
<!-- Class that does the actual sending -->
- <plugin-class>SnmpSender</plugin-class>
+ <a:plugin-class>SnmpSender</a:plugin-class>
- <alert-configuration>
+ <a:alert-configuration>
<c:simple-property name="host" type="string"
required="true" description="Trap target host"/>
<c:simple-property name="port" type="integer"
required="false" default="162" description="Trap target
port"/>
- <c:simple-property name="oid" type="string"
required="true" description="OID of the trap sent"/>
-
- </alert-configuration>
-</alert-plugin>
+ <c:simple-property name="oid" displayName="Variable bindings
prefix" type="string" required="true">
+ <c:description>
+ <![CDATA[
+ <p>RHQ will send alert notification details as a list of variable
bindings in the
+ SNMP trap PDU.</p>
+ <p><strong>Do not confuse this paramater with 'Trap
Oid'.</strong></p>
+ ]]>
+ </c:description>
+ </c:simple-property>
+ <c:simple-property name="trapOid" required="false">
+ <c:description>
+ <![CDATA[
+ <p>If set, the value of this paramater will override the value of the
Trap Oid parameter defined globally
+ in the server plugin configuration. The Trap OID is sent as the second
variable binding in the SNMP trap
+ PDU.</p>
+ <p><strong>Only applicable to v2c and v3
traps.</strong></p>
+ <p><strong>Do not confuse this paramater with 'Variable
bindings prefix'.</strong></p>
+ ]]>
+ </c:description>
+ </c:simple-property>
+ </a:alert-configuration>
+</a:alert-plugin>
diff --git
a/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfoTest.java
b/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfoTest.java
new file mode 100644
index 0000000..c46c8b6
--- /dev/null
+++
b/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfoTest.java
@@ -0,0 +1,106 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+package org.rhq.enterprise.server.plugins.alertSnmp;
+
+import static org.rhq.enterprise.server.plugins.alertSnmp.SnmpInfo.DEFAULT_PORT;
+import static org.rhq.enterprise.server.plugins.alertSnmp.SnmpInfo.PARAM_HOST;
+import static org.rhq.enterprise.server.plugins.alertSnmp.SnmpInfo.PARAM_PORT;
+import static org.rhq.enterprise.server.plugins.alertSnmp.SnmpInfo.PARAM_TRAP_OID;
+import static
org.rhq.enterprise.server.plugins.alertSnmp.SnmpInfo.PARAM_VARIABLE_BINDING_PREFIX;
+import static org.testng.Assert.*;
+
+import org.testng.annotations.Test;
+
+import org.rhq.core.domain.configuration.Configuration;
+
+/**
+ * @author Thomas Segismont
+ */
+public class SnmpInfoTest {
+
+ @Test
+ public void shouldDetectMissingParams() throws Exception {
+ Configuration configuration = new Configuration();
+
+ SnmpInfo snmpInfo = SnmpInfo.load(configuration);
+ assertNotNull(snmpInfo.error, "SnmpInfo#load should have detected an
error");
+ assertEquals(snmpInfo.error, "Missing: OID, host");
+
+ configuration.setSimpleValue(PARAM_HOST, "pipo");
+ snmpInfo = SnmpInfo.load(configuration);
+ assertNotNull(snmpInfo.error, "SnmpInfo#load should have detected an
error");
+ assertEquals(snmpInfo.error, "Missing: OID");
+
+ configuration.remove(PARAM_HOST);
+ configuration.setSimpleValue(PARAM_VARIABLE_BINDING_PREFIX, "molo");
+ snmpInfo = SnmpInfo.load(configuration);
+ assertNotNull(snmpInfo.error, "SnmpInfo#load should have detected an
error");
+ assertEquals(snmpInfo.error, "Missing: host");
+ }
+
+ @Test
+ public void shouldAssumeDefaultValues() throws Exception {
+ Configuration configuration = new Configuration();
+ configuration.setSimpleValue(PARAM_HOST, "pipo");
+ configuration.setSimpleValue(PARAM_VARIABLE_BINDING_PREFIX, "molo");
+
+ SnmpInfo snmpInfo = SnmpInfo.load(configuration);
+ assertNull(snmpInfo.error, "SnmpInfo#load should not have detected an
error");
+ assertEquals(snmpInfo.host, "pipo");
+ assertEquals(snmpInfo.oid, "molo");
+ assertEquals(snmpInfo.port, SnmpInfo.DEFAULT_PORT);
+ }
+
+ @Test
+ public void shouldExposeAllParams() throws Exception {
+ Configuration configuration = new Configuration();
+ configuration.setSimpleValue(PARAM_HOST, "pipo");
+ configuration.setSimpleValue(PARAM_VARIABLE_BINDING_PREFIX, "molo");
+ configuration.setSimpleValue(PARAM_PORT, "123");
+ configuration.setSimpleValue(PARAM_TRAP_OID, "logo");
+
+ SnmpInfo snmpInfo = SnmpInfo.load(configuration);
+ assertNull(snmpInfo.error, "SnmpInfo#load should not have detected an
error");
+ assertEquals(snmpInfo.host, "pipo");
+ assertEquals(snmpInfo.port, "123");
+ assertEquals(snmpInfo.oid, "molo");
+ assertEquals(snmpInfo.trapOid, "logo");
+ }
+
+ @Test
+ public void testStringRepresentation() {
+ // We are not testing something really tricky here...
+ // But the String representation of an SnmpInfo instance is used in the UI as a
description in the alert
+ // definition notification list. So this test is here to remind us in the future
that the format of the
+ // String representation is constrained (even not strongly).
+ Configuration configuration = new Configuration();
+ assertEquals(SnmpInfo.load(configuration).toString(), "UnknownHost:" +
DEFAULT_PORT
+ + " (UnknownOID) (DefaultTrapOID)");
+ configuration.setSimpleValue(PARAM_HOST, "pipo");
+ assertEquals(SnmpInfo.load(configuration).toString(), "pipo:" +
DEFAULT_PORT + " (UnknownOID) (DefaultTrapOID)");
+ configuration.setSimpleValue(PARAM_PORT, "35162");
+ assertEquals(SnmpInfo.load(configuration).toString(), "pipo:35162
(UnknownOID) (DefaultTrapOID)");
+ configuration.setSimpleValue(PARAM_VARIABLE_BINDING_PREFIX, "molo");
+ assertEquals(SnmpInfo.load(configuration).toString(), "pipo:35162 (molo)
(DefaultTrapOID)");
+ configuration.setSimpleValue(PARAM_TRAP_OID, "logo");
+ assertEquals(SnmpInfo.load(configuration).toString(), "pipo:35162 (molo)
(logo)");
+ }
+
+}
diff --git
a/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSenderTest.java
b/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSenderTest.java
new file mode 100644
index 0000000..38b36d7
--- /dev/null
+++
b/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSenderTest.java
@@ -0,0 +1,378 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+package org.rhq.enterprise.server.plugins.alertSnmp;
+
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.*;
+import static org.rhq.core.domain.alert.AlertPriority.HIGH;
+import static org.rhq.core.domain.alert.notification.ResultState.FAILURE;
+import static org.rhq.core.domain.alert.notification.ResultState.SUCCESS;
+import static org.rhq.enterprise.server.plugins.alertSnmp.SnmpInfo.PARAM_HOST;
+import static org.rhq.enterprise.server.plugins.alertSnmp.SnmpInfo.PARAM_PORT;
+import static org.rhq.enterprise.server.plugins.alertSnmp.SnmpInfo.PARAM_TRAP_OID;
+import static
org.rhq.enterprise.server.plugins.alertSnmp.SnmpInfo.PARAM_VARIABLE_BINDING_PREFIX;
+import static org.testng.Assert.*;
+
+import java.util.Arrays;
+import java.util.ListIterator;
+import java.util.Vector;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.snmp4j.CommandResponder;
+import org.snmp4j.CommandResponderEvent;
+import org.snmp4j.PDU;
+import org.snmp4j.Snmp;
+import org.snmp4j.mp.SnmpConstants;
+import org.snmp4j.smi.Address;
+import org.snmp4j.smi.OID;
+import org.snmp4j.smi.OctetString;
+import org.snmp4j.smi.SMIConstants;
+import org.snmp4j.smi.UdpAddress;
+import org.snmp4j.smi.VariableBinding;
+import org.snmp4j.transport.DefaultUdpTransportMapping;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import org.rhq.core.domain.alert.Alert;
+import org.rhq.core.domain.alert.AlertDefinition;
+import org.rhq.core.domain.alert.AlertPriority;
+import org.rhq.core.domain.alert.notification.SenderResult;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.util.StringUtil;
+import org.rhq.enterprise.server.alert.AlertManagerLocal;
+import org.rhq.enterprise.server.resource.ResourceManagerLocal;
+
+/**
+ * @author Thomas Segismont
+ */
+public class SnmpSenderTest {
+
+ private static final Log LOG = LogFactory.getLog(SnmpSenderTest.class);
+
+ private static final String TEST_TRAP_OID_PLUGIN_CONFIG =
"1.3.6.1.4.1.18017";
+
+ private static final String TEST_TRAP_OID_ALERT_PARAM =
"1.3.6.1.4.1.18018";
+
+ private static final String TEST_VARIABLE_BINDING_PREFIX =
"1.3.6.1.4.1.18019";
+
+ private static final String TEST_HOST = "127.0.0.1";
+
+ private static final int TEST_PORT = 35162;
+
+ private static final String TEST_PORT_VARIABLE = "alert.snmp.test.port";
+
+ private ConcurrentLinkedQueue<PDU> receivedTraps;
+
+ private Snmp snmp;
+
+ @Mock
+ private ResourceManagerLocal resourceManager;
+
+ @Mock
+ private AlertManagerLocal alertManager;
+
+ private TestSnmpSender snmpSender;
+
+ @BeforeMethod
+ public void setUp() throws Exception {
+ receivedTraps = new ConcurrentLinkedQueue<PDU>();
+
+ snmp = new Snmp(new DefaultUdpTransportMapping());
+ Address targetAddress = new UdpAddress(getTestPort());
+ boolean installedTrapListener = snmp.addNotificationListener(targetAddress, new
CommandResponder() {
+ @Override
+ public void processPdu(CommandResponderEvent event) {
+ receivedTraps.offer(event.getPDU());
+ }
+ });
+ if (!installedTrapListener) {
+ throw new RuntimeException("Could not install trap listener");
+ }
+
+ MockitoAnnotations.initMocks(this);
+
+ Configuration pluginConfiguration = new Configuration();
+ pluginConfiguration.setSimpleValue("snmpVersion", "2c");
+ pluginConfiguration.setSimpleValue("trapOid",
TEST_TRAP_OID_PLUGIN_CONFIG);
+ pluginConfiguration.setSimpleValue("community", "public");
+ snmpSender = new TestSnmpSender(resourceManager, alertManager,
pluginConfiguration);
+ }
+
+ private static int getTestPort() {
+ String testPortVariable = System.getProperty(TEST_PORT_VARIABLE);
+ if (StringUtil.isNotBlank(testPortVariable)) {
+ try {
+ int port = Integer.parseInt(testPortVariable);
+ LOG.info("Using port " + testPortVariable + " for SNMP
traps");
+ return port;
+ } catch (NumberFormatException e) {
+ LOG.warn("Invalid port variable: " + testPortVariable);
+ }
+ }
+ LOG.info("Using default port " + TEST_PORT + " for SNMP
traps");
+ return TEST_PORT;
+ }
+
+ @AfterMethod
+ public void tearDown() throws Exception {
+ if (snmp != null) {
+ snmp.close();
+ }
+ }
+
+ @Test
+ public void shouldReturnSimpleFailureForInvalidNotificationParameters() {
+ Configuration alertParameters = new Configuration();
+ snmpSender.setAlertParameters(alertParameters);
+
+ SenderResult result = snmpSender.send(createAlertForResourceWithId(13004,
"", "", HIGH));
+
+ assertNotNull(result);
+ assertEquals(result.getState(), FAILURE);
+ assertEquals(result.getFailureMessages().size(), 1);
+ String expectedError = SnmpInfo.load(alertParameters).error;
+ assertNotNull(expectedError);
+ assertEquals(result.getFailureMessages().get(0), expectedError);
+ }
+
+ @Test
+ public void shouldReturnSimpleFailureWhenErrorOccurs() {
+ Configuration alertParameters = new Configuration();
+ alertParameters.setSimpleValue(PARAM_HOST, TEST_HOST);
+ alertParameters.setSimpleValue(PARAM_VARIABLE_BINDING_PREFIX,
TEST_VARIABLE_BINDING_PREFIX);
+ alertParameters.setSimpleValue(PARAM_PORT, String.valueOf(getTestPort()));
+ snmpSender.setAlertParameters(alertParameters);
+
+ int resourceId = 13004;
+ Alert alert = createAlertForResourceWithId(resourceId, "",
"", HIGH);
+ String exceptionMessage = "Test Error";
+ when(resourceManager.getResourceLineage(eq(resourceId))).thenThrow(new
RuntimeException(exceptionMessage));
+
+ SenderResult result = snmpSender.send(alert);
+
+ assertNotNull(result);
+ assertEquals(result.getState(), FAILURE);
+ assertEquals(result.getFailureMessages().size(), 1);
+ String actualErrorMessage = result.getFailureMessages().get(0);
+ assertTrue(actualErrorMessage.endsWith(exceptionMessage), "Unexpected error
message: " + actualErrorMessage);
+ }
+
+ @Test(timeOut = 1000 * 60)
+ public void testSendWithDefaultSnmpTrapOid() throws Exception {
+ Configuration alertParameters = new Configuration();
+ alertParameters.setSimpleValue(PARAM_HOST, TEST_HOST);
+ alertParameters.setSimpleValue(PARAM_VARIABLE_BINDING_PREFIX,
TEST_VARIABLE_BINDING_PREFIX);
+ alertParameters.setSimpleValue(PARAM_PORT, String.valueOf(getTestPort()));
+ snmpSender.setAlertParameters(alertParameters);
+
+ testSendWithSnmpTrapOid(new OID(TEST_TRAP_OID_PLUGIN_CONFIG));
+ }
+
+ @Test(timeOut = 1000 * 60)
+ public void testSendWithSpecificSnmpTrapOid() throws Exception {
+ Configuration alertParameters = new Configuration();
+ alertParameters.setSimpleValue(PARAM_HOST, TEST_HOST);
+ alertParameters.setSimpleValue(PARAM_VARIABLE_BINDING_PREFIX,
TEST_VARIABLE_BINDING_PREFIX);
+ alertParameters.setSimpleValue(PARAM_PORT, String.valueOf(getTestPort()));
+ alertParameters.setSimpleValue(PARAM_TRAP_OID, TEST_TRAP_OID_ALERT_PARAM);
+ snmpSender.setAlertParameters(alertParameters);
+
+ testSendWithSnmpTrapOid(new OID(TEST_TRAP_OID_ALERT_PARAM));
+ }
+
+ private void testSendWithSnmpTrapOid(OID snmpTrapOid) throws InterruptedException {
+ int resourceId = 13004;
+ String resourceName = "Resource " + resourceId;
+ String alertDefinitionName = "Alert Definition " + resourceId;
+ AlertPriority alertPriority = HIGH;
+ Alert alert = createAlertForResourceWithId(resourceId, resourceName,
alertDefinitionName, alertPriority);
+ Resource platformResouce = new Resource();
+ String platformName = "Platform Resource " + resourceId;
+ platformResouce.setName(platformName);
+
+ when(resourceManager.getResourceLineage(eq(resourceId))).thenReturn(
+ Arrays.asList(platformResouce, alert.getAlertDefinition().getResource()));
+ String alertConditions = "Alert Conditions " + resourceId;
+ when(alertManager.prettyPrintAlertConditions(eq(alert),
eq(false))).thenReturn(alertConditions);
+ String alertUrl = "https://www.rhq.com/alert/" + resourceId;
+ when(alertManager.prettyPrintAlertURL(eq(alert))).thenReturn(alertUrl);
+
+ assertNull(receivedTraps.peek(), "Something sent a trap before on our test
port");
+
+ SenderResult result = snmpSender.send(alert);
+
+ assertEquals(result.getState(), SUCCESS,
result.getFailureMessages().toString());
+ while (receivedTraps.peek() == null) {
+ Thread.sleep(1000);
+ }
+ PDU pdu = receivedTraps.poll();
+ assertNull(receivedTraps.peek(), "Only one trap should have been
received");
+
+ assertExpectedPdu(pdu, new PduExpectedValues(snmpTrapOid, resourceName,
alertDefinitionName, alertPriority,
+ platformName, alertConditions, alertUrl));
+ }
+
+ private void assertExpectedPdu(PDU pdu, PduExpectedValues expectedValues) {
+ Vector variableBindings = pdu.getVariableBindings();
+
+ assertTrue(variableBindings.size() == 9, "Variable bindings should contain 9
variable bindings and not "
+ + variableBindings.size() + ": " + variableBindings);
+
+ @SuppressWarnings("unchecked")
+ ListIterator<VariableBinding> variableBindingsIterator =
variableBindings.listIterator();
+
+ VariableBinding variableBinding = variableBindingsIterator.next();
+ assertEquals(variableBinding.getOid(), SnmpConstants.sysUpTime);
+
+ variableBinding = variableBindingsIterator.next();
+ assertEquals(variableBinding.getOid(), SnmpConstants.snmpTrapOID);
+ assertEquals(variableBinding.getVariable(), expectedValues.getSnmpTrapOid());
+
+ OID oidPrefix = new OID(TEST_VARIABLE_BINDING_PREFIX);
+ while (variableBindingsIterator.hasNext()) {
+ variableBinding = variableBindingsIterator.next();
+
+ assertVariableBindingIsPrefixed(variableBinding, oidPrefix);
+ assertVariableBindingHasStringValue(variableBinding);
+
+ switch (variableBindingsIterator.previousIndex()) {
+ case 2:
+ assertEquals(variableBinding.getVariable(), new
OctetString(expectedValues.getAlertDefinitionName()));
+ break;
+ case 3:
+ assertEquals(variableBinding.getVariable(), new
OctetString(expectedValues.getResourceName()));
+ break;
+ case 4:
+ assertEquals(variableBinding.getVariable(), new
OctetString(expectedValues.getPlatformName()));
+ break;
+ case 5:
+ assertEquals(variableBinding.getVariable(), new
OctetString(expectedValues.getAlertConditions()));
+ break;
+ case 6:
+ assertEquals(variableBinding.getVariable(), new
OctetString(expectedValues.getAlertPriority()
+ .toString().toLowerCase()));
+ break;
+ case 7:
+ assertEquals(variableBinding.getVariable(), new
OctetString(expectedValues.getAlertUrl()));
+ break;
+ case 8:
+ assertEquals(variableBinding.getVariable(), new
OctetString(expectedValues.getPlatformName() + "::"
+ + expectedValues.getResourceName() + "::"));
+ break;
+ default:
+ throw new RuntimeException("Unexpected index: " +
variableBindingsIterator.previousIndex());
+ }
+ }
+ }
+
+ private void assertVariableBindingHasStringValue(VariableBinding variableBinding) {
+ assertEquals(variableBinding.getVariable().getSyntax(),
SMIConstants.SYNTAX_OCTET_STRING,
+ "Variable binding value [" + variableBinding.getVariable() +
"] has wrong type");
+ }
+
+ private void assertVariableBindingIsPrefixed(VariableBinding variableBinding, OID
oidPrefix) {
+ assertTrue(variableBinding.getOid().startsWith(oidPrefix), "Variable binding
OID [" + variableBinding.getOid()
+ + "] has wrong prefix");
+ }
+
+ private Alert createAlertForResourceWithId(int resourceId, String resourceName,
String alertDefinitionName,
+ AlertPriority alertPriority) {
+ Resource resource = new Resource();
+ resource.setId(resourceId);
+ resource.setName(resourceName);
+ AlertDefinition alertDefinition = new AlertDefinition();
+ alertDefinition.setName(alertDefinitionName);
+ alertDefinition.setResource(resource);
+ alertDefinition.setPriority(alertPriority);
+ Alert alert = new Alert();
+ alert.setAlertDefinition(alertDefinition);
+ return alert;
+ }
+
+ private static final class TestSnmpSender extends SnmpSender {
+
+ TestSnmpSender(ResourceManagerLocal resourceManager, AlertManagerLocal
alertManager,
+ Configuration pluginConfiguration) {
+ super(resourceManager, alertManager);
+ this.preferences = pluginConfiguration;
+ }
+
+ void setAlertParameters(Configuration alertParameters) {
+ this.alertParameters = alertParameters;
+ }
+
+ }
+
+ private static final class PduExpectedValues {
+
+ private final OID snmpTrapOid;
+ private final String resourceName;
+ private final String alertDefinitionName;
+ private final AlertPriority alertPriority;
+ private final String platformName;
+ private final String alertConditions;
+ private final String alertUrl;
+
+ private PduExpectedValues(OID snmpTrapOid, String resourceName, String
alertDefinitionName,
+ AlertPriority alertPriority, String platformName, String alertConditions,
String alertUrl) {
+ this.snmpTrapOid = snmpTrapOid;
+ this.resourceName = resourceName;
+ this.alertDefinitionName = alertDefinitionName;
+ this.alertPriority = alertPriority;
+ this.platformName = platformName;
+ this.alertConditions = alertConditions;
+ this.alertUrl = alertUrl;
+ }
+
+ public OID getSnmpTrapOid() {
+ return snmpTrapOid;
+ }
+
+ public String getResourceName() {
+ return resourceName;
+ }
+
+ public String getAlertDefinitionName() {
+ return alertDefinitionName;
+ }
+
+ public AlertPriority getAlertPriority() {
+ return alertPriority;
+ }
+
+ public String getPlatformName() {
+ return platformName;
+ }
+
+ public String getAlertConditions() {
+ return alertConditions;
+ }
+
+ public String getAlertUrl() {
+ return alertUrl;
+ }
+ }
+}
diff --git a/modules/enterprise/server/plugins/alert-snmp/src/test/resources/log4j.xml
b/modules/enterprise/server/plugins/alert-snmp/src/test/resources/log4j.xml
new file mode 100644
index 0000000..73b2ae5
--- /dev/null
+++ b/modules/enterprise/server/plugins/alert-snmp/src/test/resources/log4j.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- | For more configuration information and examples, see the Jakarta Log4j |
website:
http://jakarta.apache.org/log4j -->
+
+<log4j:configuration
xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+ <appender name="CONSOLE"
class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="ERROR"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%-5p %d{dd-MM
HH:mm:ss,SSS} (%F:%M:%L) - %m%n"/>
+ </layout>
+ </appender>
+
+ <appender name="FILE"
class="org.apache.log4j.RollingFileAppender">
+ <param name="File" value="target/test.log"/>
+ <param name="Append" value="false"/>
+ <param name="Threshold" value="DEBUG"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%-5p %d{dd-MM
HH:mm:ss,SSS} (%F:%M:%L) - %m%n"/>
+ </layout>
+ </appender>
+
+ <root>
+ <level value="DEBUG"/>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
commit fabce7666b08f73ea113807ec42b47a3d3eb5929
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Apr 29 11:15:34 2013 -0400
BZ 957282 957288 add bundle target of "Install Directory"
diff --git a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
index 5a30ec3..45f4e05 100644
--- a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
@@ -1333,6 +1333,10 @@
</drift-definition>
<bundle-target>
+ <destination-base-dir name="Install Directory" description="The
top directory where the application server is installed. (i.e. the value found in the
'Home Directory' connection property)">
+ <value-context>pluginConfiguration</value-context>
+ <value-name>homeDir</value-name>
+ </destination-base-dir>
<destination-base-dir name="Deploy Directory" description="The
deployment directory for a standalone server">
<value-context>measurementTrait</value-context>
<value-name>deployDir</value-name>
commit 8ae20bd510aa660e94f70cad95fc680fd0dedd47
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Apr 26 14:41:02 2013 -0400
BZ 917085 - allow for relative and absolute raw file paths to include ".."
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentData.java
b/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentData.java
index e81fbaa..c55c1bc 100644
--- a/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentData.java
+++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentData.java
@@ -30,6 +30,7 @@ import java.util.Set;
import java.util.regex.Pattern;
import org.rhq.core.template.TemplateEngine;
+import org.rhq.core.util.file.FileUtil;
/**
* Data that describes a particular deployment. In effect, this provides the
@@ -114,7 +115,7 @@ public class DeploymentData {
this.deploymentProps = deploymentProps;
this.zipFiles = zipFiles;
this.rawFiles = rawFiles;
- this.destinationDir = destinationDir;
+ this.destinationDir = getCanonicalFile(destinationDir);
this.sourceDir = sourceDir;
this.ignoreRegex = ignoreRegex;
this.manageRootDir = manageRootDir;
@@ -131,6 +132,69 @@ public class DeploymentData {
this.templateEngine = templateEngine;
}
+ // We need to "normalize" all raw file paths that have ".."
in them to ensure everything works properly.
+ // Any raw file pathname (the values in this.rawFiles) that needs to be
normalized will be converted to
+ // a canonical path. Note that any pathname that is relative but have
".." paths that end up taking the file
+ // above the destination directory needs to be normalized and will end up being
an absolute path
+ // (so all log messages will indicate the full absolute path and if the file
+ // needs to be backed up it will be backed up as if it was an external file that
was specified with an absolute path).
+ // If the relative path has ".." but does not take the file above the
destination directory will simply have its ".."
+ // normalized out but will still be a relative path (relative to destination
directory) (we can't make it absolute
+ // otherwise Deployer's update will run into errors while backing up and
scanning for deleted files).
+ // See BZ 917085.
+ for (Map.Entry<File, File> entry : this.rawFiles.entrySet()) {
+ File rawFile = entry.getValue();
+ String rawFilePath = rawFile.getPath();
+
+ boolean doubledot = rawFilePath.replace('\\',
'/').matches(".*((/\\.\\.)|(\\.\\./)).*"); // finds "/.." or
"../" in the string
+
+ if (doubledot) {
+ File fileToCanonicalize;
+
+ if (rawFile.isAbsolute()) {
+ fileToCanonicalize = rawFile;
+ } else {
+ boolean isWindows = (File.separatorChar == '\\');
+ if (isWindows) {
+ // of course, Windows has to make it enormously difficult to do
this right...
+
+ // determine if the windows rawFile relative path specified a
drive (e.g. C:foobar.txt)
+ StringBuilder rawFilePathBuilder = new
StringBuilder(rawFilePath);
+ String rawFileDriveLetter =
FileUtil.stripDriveLetter(rawFilePathBuilder); // rawFilePathBuilder now has drive letter
stripped
+
+ // determine what, if any, drive letter is specified in the
destination directory
+ StringBuilder destDirAbsPathBuilder = new
StringBuilder(this.destinationDir.getAbsolutePath());
+ String destDirDriveLetter =
FileUtil.stripDriveLetter(destDirAbsPathBuilder);
+
+ // figure out what the absolute, normalized path is for the raw
file
+ if ((destDirDriveLetter == null || rawFileDriveLetter == null)
+ || rawFileDriveLetter.equals(destDirDriveLetter)) {
+ fileToCanonicalize = new File(this.destinationDir,
rawFilePathBuilder.toString());
+ } else {
+ throw new IllegalArgumentException("Cannot normalize
relative path [" + rawFilePath
+ + "]; its drive letter is different than the
destination directory ["
+ + this.destinationDir.getAbsolutePath() +
"]");
+ }
+ } else {
+ fileToCanonicalize = new File(this.destinationDir, rawFilePath);
+ }
+ }
+
+ fileToCanonicalize = getCanonicalFile(fileToCanonicalize);
+
+ if (isPathUnderBaseDir(this.destinationDir, fileToCanonicalize)) {
+ // we can keep rawFile path relative, but we need to normalize out
the ".." paths
+ String baseDir = this.destinationDir.getAbsolutePath();
+ String absRawFilePath = fileToCanonicalize.getAbsolutePath();
+ String canonicalRelativePath =
absRawFilePath.substring(baseDir.length() + 1); // should always return a valid path; if
not, let it throw exception (which likely means there is a bug here)
+ entry.setValue(new File(canonicalRelativePath));
+ } else {
+ // raw file path has ".." such that the file is really
above destination dir - use an absolute, canonical path
+ entry.setValue(fileToCanonicalize);
+ }
+ }
+ }
+
return;
}
@@ -177,4 +241,30 @@ public class DeploymentData {
public Map<File, Boolean> getZipsExploded() {
return zipsExploded;
}
+
+ private File getCanonicalFile(File file) {
+ try {
+ file = file.getCanonicalFile();
+ } catch (Exception e) {
+ // ignore this - this really should never happen, but if it does,
+ // we want to continue and hope using the non-normalized file is ok;
+ file = file.getAbsoluteFile();
+ }
+ return file;
+ }
+
+ private boolean isPathUnderBaseDir(File base, File path) {
+ // this method assumes base and path are absolute and canonical
+ if (base == null) {
+ return false;
+ }
+
+ while (path != null) {
+ if (base.equals(path)) {
+ return true;
+ }
+ path = path.getParentFile();
+ }
+ return false;
+ }
}
diff --git
a/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerCanonicalPathTest.java
b/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerCanonicalPathTest.java
new file mode 100644
index 0000000..7a62bf0
--- /dev/null
+++
b/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerCanonicalPathTest.java
@@ -0,0 +1,275 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.rhq.core.util.updater;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import org.rhq.core.template.TemplateEngine;
+import org.rhq.core.util.MessageDigestGenerator;
+import org.rhq.core.util.file.FileUtil;
+import org.rhq.core.util.stream.StreamUtil;
+
+/**
+ * Tests deploying raw files to deployment locations specified with ".." in the
path.
+ * This will require the deployer code to transform the paths to canonical paths.
+ *
+ * @author John Mazzitelli
+ */
+@Test
+public class DeployerCanonicalPathTest {
+ private TemplateEngine templateEngine;
+
+ @BeforeClass
+ public void beforeClass() {
+ Map<String, String> tokens = new HashMap<String, String>();
+ tokens.put("rhq.system.hostname", "localhost");
+ tokens.put("rhq.system.sysprop.java.version",
System.getProperty("java.version"));
+
+ templateEngine = new TemplateEngine(tokens);
+ }
+
+ @BeforeMethod
+ public void beforeMethod() {
+ System.out.println("\n\n=============== START OF NEW TEST
===============\n");
+ }
+
+ // any raw file path (absolute or relative) that contains ".." will be
converted to an absolute, canonical path - this is what we test
+ public void testInitialDeployRawFilesWithCanonicalPaths() throws Exception {
+ File tmpDirDest =
FileUtil.createTempDirectory("DeployerCanonicalPathTest", ".dest",
null);
+ File tmpDirSrc =
FileUtil.createTempDirectory("DeployerCanonicalPathTest", ".src",
null);
+ File rawFileRelativeDest = new File("dir-does-not-existA/../rawA.txt");
// relative to "tmpDirDest" that we just created above
+ File rawFileRelativeDest2 = new
File("dir-does-not-existA/../../rawA.txt"); // relative to
"tmpDirDest" but it takes us above it
+ File rawFileAbsoluteDest = new
File(System.getProperty("java.io.tmpdir"),
"dir-does-not-existB/../rawB.txt");
+
+ try {
+ // put some source files in our tmpDirSrc location
+ File testRawFileA = new File(tmpDirSrc, "updater-testA.txt");
+ File testRawFileA2 = new File(tmpDirSrc, "updater-testA2.txt");
+ File testRawFileB = new File(tmpDirSrc, "updater-testB.txt");
+ FileUtil.copyFile(new
File("target/test-classes/updater-testA.txt"), testRawFileA);
+ FileUtil.copyFile(new
File("target/test-classes/updater-testA.txt"), testRawFileA2);
+ FileUtil.copyFile(new
File("target/test-classes/updater-testB.txt"), testRawFileB);
+
+ DeploymentProperties deploymentProps = new DeploymentProperties(0,
"testbundle", "1.0.test", null);
+ Set<File> zipFiles = null;
+ Map<File, File> rawFiles = new HashMap<File, File>(3);
+ rawFiles.put(testRawFileA, rawFileRelativeDest); // we will realize this one
...
+ rawFiles.put(testRawFileA2, rawFileRelativeDest2); // and this one ...
+ rawFiles.put(testRawFileB, rawFileAbsoluteDest); // and we will realize this
one, too
+ File destDir = tmpDirDest;
+ Pattern ignoreRegex = null;
+ Set<File> realizeRawFiles = new HashSet<File>(3);
+ realizeRawFiles.add(testRawFileA);
+ realizeRawFiles.add(testRawFileA2);
+ realizeRawFiles.add(testRawFileB);
+ DeploymentData dd = new DeploymentData(deploymentProps, zipFiles, rawFiles,
tmpDirSrc, destDir, null,
+ realizeRawFiles, templateEngine, ignoreRegex, true, null);
+ Deployer deployer = new Deployer(dd);
+ DeployDifferences diff = new DeployDifferences();
+ FileHashcodeMap map = deployer.deploy(diff);
+ System.out.println("map-->\n" + map);
+ System.out.println("diff->\n" + diff);
+
+ String rawFileRelativeDestCanonical = new File(tmpDirDest,
rawFileRelativeDest.getPath()).getCanonicalPath();
+ String rawFileRelativeDestCanonical2 = new File(tmpDirDest,
rawFileRelativeDest2.getPath())
+ .getCanonicalPath();
+ String rawFileAbsoluteDestCanonical =
rawFileAbsoluteDest.getCanonicalPath();
+
+ assert map.size() == 3 : map;
+
+ assert map.containsKey("rawA.txt") : map;
+ assert new File(rawFileRelativeDestCanonical).exists();
+ assert new File(rawFileRelativeDestCanonical2).exists();
+ assert MessageDigestGenerator.getDigestString(new
File(rawFileRelativeDestCanonical)).equals(
+ map.get("rawA.txt"));
+
+ // rawFileRelativeDestCanonical2 should be treated just like an absolute,
external file
+ assert MessageDigestGenerator.getDigestString(new
File(rawFileRelativeDestCanonical2)).equals(
+ map.get(rawFileRelativeDestCanonical2));
+ assert
!MessageDigestGenerator.getDigestString(testRawFileA).equals(map.get("rawA.txt"))
: "should have different hash, we realize this one!";
+
+ assert map.containsKey(rawFileAbsoluteDestCanonical) : map;
+ assert new File(rawFileAbsoluteDestCanonical).exists();
+ assert MessageDigestGenerator.getDigestString(new
File(rawFileAbsoluteDestCanonical)).equals(
+ map.get(rawFileAbsoluteDestCanonical));
+ assert
!MessageDigestGenerator.getDigestString(testRawFileB).equals(map.get(rawFileAbsoluteDestCanonical))
: "should have different hash, we realized this one";
+
+ assert diff.getAddedFiles().size() == 3 : diff;
+ assert diff.getAddedFiles().contains(diff.convertPath("rawA.txt"))
: diff;
+ assert
diff.getAddedFiles().contains(diff.convertPath(rawFileRelativeDestCanonical2)) : diff;
+ assert
diff.getAddedFiles().contains(diff.convertPath(rawFileAbsoluteDestCanonical)) : diff;
+ assert diff.getRealizedFiles().size() == 3 : diff;
+ assert
diff.getRealizedFiles().keySet().contains(diff.convertPath("rawA.txt")) : diff;
+ assert
diff.getRealizedFiles().keySet().contains(diff.convertPath(rawFileRelativeDestCanonical2))
: diff;
+ assert
diff.getRealizedFiles().keySet().contains(diff.convertPath(rawFileAbsoluteDestCanonical))
: diff;
+ } finally {
+ FileUtil.purge(tmpDirDest, true);
+ FileUtil.purge(tmpDirSrc, true);
+ rawFileAbsoluteDest.getCanonicalFile().delete();
+ }
+ }
+
+ public void testUpdateDeployRawFileWithRelativePath() throws Exception {
+ File tmpDirDest =
FileUtil.createTempDirectory("DeployerCanonicalPathTest", ".dest",
null);
+ File tmpDirSrc =
FileUtil.createTempDirectory("DeployerCanonicalPathTest", ".src",
null);
+ File rawFileRelativeDest = new File("dir-does-not-existA/../rawA.txt");
// relative to "tmpDirDest" that we just created above
+ File rawFileRelativeDest2 = new
File("dir-does-not-existA/../../rawA.txt"); // relative to
"tmpDirDest" but it takes us above it
+ File rawFileAbsoluteDest = new
File(System.getProperty("java.io.tmpdir"),
"dir-does-not-existB/../rawB.txt");
+
+ try {
+ // put some source files in our tmpDirSrc location
+ File testRawFileA = new File(tmpDirSrc, "updater-testA.txt");
+ File testRawFileA2 = new File(tmpDirSrc, "updater-testA2.txt");
+ File testRawFileB = new File(tmpDirSrc, "updater-testB.txt");
+ FileUtil.copyFile(new
File("target/test-classes/updater-testA.txt"), testRawFileA);
+ FileUtil.copyFile(new
File("target/test-classes/updater-testA.txt"), testRawFileA2);
+ FileUtil.copyFile(new
File("target/test-classes/updater-testB.txt"), testRawFileB);
+
+ DeploymentProperties deploymentProps = new DeploymentProperties(0,
"testbundle", "1.0.test", null);
+ Set<File> zipFiles = null;
+ Map<File, File> rawFiles = new HashMap<File, File>(3);
+ rawFiles.put(testRawFileA, rawFileRelativeDest);
+ rawFiles.put(testRawFileA2, rawFileRelativeDest2);
+ rawFiles.put(testRawFileB, rawFileAbsoluteDest);
+ File destDir = tmpDirDest;
+ Pattern ignoreRegex = null;
+ DeploymentData dd = new DeploymentData(deploymentProps, zipFiles, rawFiles,
tmpDirSrc, destDir, null, null,
+ templateEngine, ignoreRegex, true, null);
+ Deployer deployer = new Deployer(dd);
+ DeployDifferences diff = new DeployDifferences();
+ FileHashcodeMap map = deployer.deploy(diff);
+ System.out.println("map-->\n" + map);
+ System.out.println("diff->\n" + diff);
+ assert map.size() == 3 : map;
+
+ // make sure the first raw file is in the dest dir
+ String f = rawFileRelativeDest.getPath();
+ File destFile = new File(tmpDirDest, f).getCanonicalFile(); // notice f is
assumed relative to tmpDirDest, must convert to canonical path
+ assert destFile.exists() : destFile;
+ FileUtil.writeFile(new
ByteArrayInputStream("modifiedR".getBytes()), destFile); // change the file so
we back it up during update
+
+ // make sure the second raw file, though specified originally as a relative
file, is in the external location
+ f = rawFileRelativeDest2.getPath();
+ destFile = new File(tmpDirDest, f).getCanonicalFile(); // must convert to
canonical path
+ assert destFile.exists() : destFile;
+ FileUtil.writeFile(new
ByteArrayInputStream("modifiedR2".getBytes()), destFile); // change the file so
we back it up during update
+
+ // make sure the third raw file is in the external location
+ destFile = rawFileAbsoluteDest.getCanonicalFile(); // must convert to
canonical path
+ assert destFile.exists() : destFile;
+ FileUtil.writeFile(new
ByteArrayInputStream("modifiedA".getBytes()), destFile); // change the file so
we back it up during update
+
+ // UPDATE
+ // alter the src files so we backup our changed files
+ FileUtil.writeFile(new
ByteArrayInputStream("src.modifiedR".getBytes()), testRawFileA);
+ FileUtil.writeFile(new
ByteArrayInputStream("src.modifiedR2".getBytes()), testRawFileA2);
+ FileUtil.writeFile(new
ByteArrayInputStream("src.modifiedA".getBytes()), testRawFileB);
+
+ deploymentProps = new DeploymentProperties(1, "testbundle",
"2.0.test", null);
+ dd = new DeploymentData(deploymentProps, zipFiles, rawFiles, tmpDirSrc,
destDir, null, null,
+ templateEngine, ignoreRegex, true, null);
+ deployer = new Deployer(dd);
+ diff = new DeployDifferences();
+ map = deployer.deploy(diff);
+ System.out.println("map-->\n" + map);
+ System.out.println("diff->\n" + diff);
+
+ String rawFileRelativeDestCanonical = new File(tmpDirDest,
rawFileRelativeDest.getPath())
+ .getCanonicalPath();
+ String rawFileRelativeDestCanonical2 = new File(tmpDirDest,
rawFileRelativeDest2.getPath())
+ .getCanonicalPath();
+ String rawFileAbsoluteDestCanonical =
rawFileAbsoluteDest.getCanonicalPath();
+
+ assert new String(StreamUtil.slurp(new FileInputStream(new
File(rawFileRelativeDestCanonical))))
+ .equals("src.modifiedR");
+ assert new String(StreamUtil.slurp(new FileInputStream(new
File(rawFileRelativeDestCanonical2))))
+ .equals("src.modifiedR2");
+ assert new String(StreamUtil.slurp(new FileInputStream(new
File(rawFileAbsoluteDestCanonical))))
+ .equals("src.modifiedA");
+
+ boolean isWindows = File.separatorChar == '\\';
+ final File metadir = new File(tmpDirDest, ".rhqdeployments");
+ File backupRel = new File(metadir, "1/backup/rawA.txt");
+ File backupRel2;
+ // test the second raw file, the one that was specified originally as a
relative file but took us out of the dest dir
+ if (!isWindows) {
+ backupRel2 = new File(metadir, "1/ext-backup/" +
rawFileRelativeDestCanonical2);
+ } else {
+ StringBuilder str = new StringBuilder(rawFileRelativeDestCanonical2);
+ String driveLetter = FileUtil.stripDriveLetter(str);
+ if (driveLetter != null) {
+ driveLetter = "_" + driveLetter + '/';
+ } else {
+ driveLetter = "";
+ }
+ backupRel2 = new File(metadir, "1/ext-backup/" + driveLetter +
str.toString());
+ }
+ // test the third raw file, the one that was specified originally as an
absolute, external file
+ File backupAbs;
+ if (!isWindows) {
+ backupAbs = new File(metadir, "1/ext-backup/" +
rawFileAbsoluteDestCanonical);
+ } else {
+ StringBuilder str = new StringBuilder(rawFileAbsoluteDestCanonical);
+ String driveLetter = FileUtil.stripDriveLetter(str);
+ if (driveLetter != null) {
+ driveLetter = "_" + driveLetter + '/';
+ } else {
+ driveLetter = "";
+ }
+ backupAbs = new File(metadir, "1/ext-backup/" + driveLetter +
str.toString());
+ }
+
+ // the backup files should exist
+ assert backupRel.exists() : backupRel;
+ assert backupRel2.exists() : backupRel2;
+ assert backupAbs.exists() : backupAbs;
+
+ assert map.size() == 3 : map;
+ assert diff.getChangedFiles().size() == 3 : diff;
+ assert
diff.getChangedFiles().contains(diff.convertPath("rawA.txt")) : diff;
+ assert
diff.getChangedFiles().contains(diff.convertPath(rawFileRelativeDestCanonical2)) : diff;
+ assert
diff.getChangedFiles().contains(diff.convertPath(rawFileAbsoluteDestCanonical)) : diff;
+ assert diff.getDeletedFiles().isEmpty() : diff;
+ assert diff.getBackedUpFiles().size() == 3 : diff;
+ assert
diff.getBackedUpFiles().keySet().contains(diff.convertPath("rawA.txt")) : diff;
+ assert
diff.getBackedUpFiles().keySet().contains(diff.convertPath(rawFileRelativeDestCanonical2))
: diff;
+ assert
diff.getBackedUpFiles().keySet().contains(diff.convertPath(rawFileAbsoluteDestCanonical))
: diff;
+ } finally {
+ FileUtil.purge(tmpDirDest, true);
+ FileUtil.purge(tmpDirSrc, true);
+ rawFileAbsoluteDest.getCanonicalFile().delete();
+ }
+ }
+}
\ No newline at end of file
diff --git
a/modules/plugins/ant-bundle/src/test/java/org/rhq/plugins/ant/AntBundlePluginComponentTest.java
b/modules/plugins/ant-bundle/src/test/java/org/rhq/plugins/ant/AntBundlePluginComponentTest.java
index daf5463..f0605a2 100644
---
a/modules/plugins/ant-bundle/src/test/java/org/rhq/plugins/ant/AntBundlePluginComponentTest.java
+++
b/modules/plugins/ant-bundle/src/test/java/org/rhq/plugins/ant/AntBundlePluginComponentTest.java
@@ -26,10 +26,12 @@ import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
+import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.UUID;
@@ -70,20 +72,25 @@ import org.rhq.core.util.updater.DeploymentsMetadata;
@Test
public class AntBundlePluginComponentTest {
+ private static final boolean ENABLE_TESTS = true;
+
private static final String DEST_BASE_DIR_NAME = "Root File System"; //
just mimics the real platform plugin types' name
private AntBundlePluginComponent plugin;
+ private File testFilesBaseDir; // under here will go all our test files: tmpDir,
bundleFilesDir and destDir
private File tmpDir;
private File bundleFilesDir;
private File destDir;
@BeforeClass
public void initDirs() throws Exception {
- this.tmpDir = new File("target/antbundletest/tmp");
+ this.testFilesBaseDir = new File("target/antbundletest");
+
+ this.tmpDir = new File(this.testFilesBaseDir, "tmp");
FileUtil.purge(this.tmpDir, true);
- this.bundleFilesDir = new File("target/antbundletest/bundlefiles");
+ this.bundleFilesDir = new File(this.testFilesBaseDir, "bundlefiles");
FileUtil.purge(this.bundleFilesDir, true);
- this.destDir = new File("target/antbundletest/destination");
+ this.destDir = new File(this.testFilesBaseDir, "destination");
FileUtil.purge(this.destDir, true);
}
@@ -117,7 +124,7 @@ public class AntBundlePluginComponentTest {
FileUtil.purge(this.destDir, true);
}
- @Test(enabled = true)
+ @Test(enabled = ENABLE_TESTS)
public void testAntBundleRevert() throws Exception {
// install then upgrade a bundle first
testAntBundleUpgrade();
@@ -227,17 +234,17 @@ public class AntBundlePluginComponentTest {
assert previousProps.getBundleVersion().equals("3.0"); //
testAntBundleUpgrade deployed version 3.0
}
- @Test(enabled = true)
+ @Test(enabled = ENABLE_TESTS)
public void testAntBundleUpgrade() throws Exception {
upgrade(false);
}
- @Test(enabled = true)
+ @Test(enabled = ENABLE_TESTS)
public void testAntBundleCleanUpgrade() throws Exception {
upgrade(true);
}
- @Test(enabled = true)
+ @Test(enabled = ENABLE_TESTS)
public void testAntBundleInitialInstall() throws Exception {
doAntBundleInitialInstall(true);
}
@@ -348,7 +355,7 @@ public class AntBundlePluginComponentTest {
/**
* Test deployment of an RHQ bundle recipe.
*/
- @Test(enabled = true)
+ @Test(enabled = ENABLE_TESTS)
public void testAntBundle() throws Exception {
ResourceType resourceType = new ResourceType("testSimpleBundle",
"plugin", ResourceCategory.SERVER, null);
BundleType bundleType = new BundleType("testSimpleBundle",
resourceType);
@@ -412,9 +419,149 @@ public class AntBundlePluginComponentTest {
}
/**
+ * Test raw files whose destination locations have ".." in their paths.
+ */
+ @Test(enabled = ENABLE_TESTS)
+ public void testRawFilesWithDotDotPaths() throws Exception {
+ // our test bundle's relative raw file paths that resolve above dest dir will
resolve to here
+ final File externalDir = new File(this.testFilesBaseDir, "ext");
+
+ ResourceType resourceType = new ResourceType("testSimpleBundle",
"plugin", ResourceCategory.SERVER, null);
+ BundleType bundleType = new BundleType("testSimpleBundle",
resourceType);
+ Repo repo = new Repo("testSimpleBundle");
+ PackageType packageType = new PackageType("testSimpleBundle",
resourceType);
+ Bundle bundle = new Bundle("testSimpleBundle", bundleType, repo,
packageType);
+ BundleVersion bundleVersion = new BundleVersion("testSimpleBundle",
"1.0", bundle,
+ getRecipeFromFile("test-bundle-dotdot.xml"));
+ BundleDestination destination = new BundleDestination(bundle,
"testSimpleBundle", new ResourceGroup(
+ "testSimpleBundle"), DEST_BASE_DIR_NAME,
this.destDir.getAbsolutePath());
+ Configuration config = new Configuration();
+
+ BundleDeployment deployment = new BundleDeployment();
+ deployment.setId(0);
+ deployment.setName("test bundle deployment name");
+ deployment.setBundleVersion(bundleVersion);
+ deployment.setConfiguration(config);
+ deployment.setDestination(destination);
+
+ // create test files (see bundle recipe for why these files are created)
+ final String TEST1 = "test1.txt";
+ File file1 = new File(this.bundleFilesDir, TEST1);
+ writeFile(TEST1, file1);
+
+ final String TEST2 = "test2.txt";
+ File file2 = new File(this.bundleFilesDir, TEST2);
+ writeFile(TEST2, file2);
+
+ final String TEST3 = "test3.txt";
+ File file3 = new File(this.bundleFilesDir, TEST3);
+ writeFile(TEST3, file3);
+
+ final String TEST4 = "test4.txt";
+ File file4 = new File(this.bundleFilesDir, TEST4);
+ writeFile(TEST4, file4);
+
+ // ----- initial deployment -----
+ BundleDeployRequest request = new BundleDeployRequest();
+ request.setBundleFilesLocation(this.bundleFilesDir);
+ request.setResourceDeployment(createNewBundleDeployment(deployment));
+ request.setBundleManagerProvider(new MockBundleManagerProvider());
+ request.setAbsoluteDestinationDirectory(this.destDir);
+ BundleDeployResult results = plugin.deployBundle(request);
+ assertResultsSuccess(results);
+
+ // test that the files were put where we expected them to be
+ File file1Dest = new File(this.destDir, "subdir/" + TEST1);
+ File file2Dest = new File(this.destDir, TEST2);
+ File file3Dest = new File(externalDir, TEST3);
+ File file4Dest = new File(externalDir, TEST4);
+ assert TEST1.equals(readFile(file1Dest)); // inside dest dir
+ assert TEST2.equals(readFile(file2Dest)); // inside dest dir
+ assert TEST3.equals(readFile(file3Dest)); // outside dest dir
+ assert TEST4.equals(readFile(file4Dest)); // outside dest dir
+
+ // ----- prepare to update the bundle ----
+ cleanPluginDirs(); // clean everything but the dest dir - we want to keep the
metadata (this should not purge ext/ dir)
+ prepareBeforeTestMethod(); // prepare for our new test
+ // our src files will have different content for this bundle deployment compared
to the initial deployment
+ writeFile(TEST1 + "update", file1);
+ writeFile(TEST2 + "update", file2);
+ writeFile(TEST3 + "update", file3);
+ writeFile(TEST4 + "update", file4);
+ // change our initial deployment files, RHQ should see the changes and back these
files up
+ writeFile(TEST1 + "modified", file1Dest);
+ writeFile(TEST2 + "modified", file2Dest);
+ writeFile(TEST3 + "modified", file3Dest);
+ writeFile(TEST4 + "modified", file4Dest);
+
+ // ----- update deployment -----
+ deployment.setId(1);
+ request = new BundleDeployRequest();
+ request.setBundleFilesLocation(this.bundleFilesDir);
+ request.setResourceDeployment(createNewBundleDeployment(deployment));
+ request.setBundleManagerProvider(new MockBundleManagerProvider());
+ request.setAbsoluteDestinationDirectory(this.destDir);
+ results = plugin.deployBundle(request);
+ assertResultsSuccess(results);
+
+ // test that all files were updated
+ assert (TEST1 + "update").equals(readFile(file1Dest)); // inside dest
dir
+ assert (TEST2 + "update").equals(readFile(file2Dest)); // inside dest
dir
+ assert (TEST3 + "update").equals(readFile(file3Dest)); // outside dest
dir
+ assert (TEST4 + "update").equals(readFile(file4Dest)); // outside dest
dir
+
+ // test that our changed files that were under dest dir were properly backed up
+ DeploymentsMetadata metadata = new DeploymentsMetadata(this.destDir);
+ File backupDir = metadata.getDeploymentBackupDirectory(deployment.getId());
+ File file1Backup = new File(backupDir, "subdir/" + TEST1);
+ File file2Backup = new File(backupDir, TEST2);
+ assert file1Backup.isFile() : "should have been backed up: " +
file1Backup;
+ assert file2Backup.isFile() : "should have been backed up: " +
file2Backup;
+ assert (TEST1 + "modified").equals(readFile(file1Backup)) : "bad
backup file: " + file1Backup;
+ assert (TEST2 + "modified").equals(readFile(file2Backup)) : "bad
backup file: " + file2Backup;
+
+ // test that our changed files that were above dest dir were properly backed up
+ Map<String, File> winDirs =
metadata.getDeploymentExternalBackupDirectoriesForWindows(deployment.getId());
+ if (winDirs == null) {
+ // we are running on non-windows platform
+ backupDir =
metadata.getDeploymentExternalBackupDirectory(deployment.getId());
+ } else {
+ // we are on windows, our test only uses a single drive root, so we can grab
the only item in the map
+ assert winDirs.size() == 1 : "should only have 1 ext backup dir on
windows: " + winDirs;
+ backupDir = winDirs.values().iterator().next().getAbsoluteFile();
+ }
+ File file3Backup = new File(backupDir, file3Dest.getAbsolutePath());
+ File file4Backup = new File(backupDir, file4Dest.getAbsolutePath());
+ assert file3Backup.isFile() : "should have been backed up: " +
file3Backup;
+ assert file4Backup.isFile() : "should have been backed up: " +
file4Backup;
+ assert (TEST3 + "modified").equals(readFile(file3Backup)) : "bad
backup file: " + file3Backup;
+ assert (TEST4 + "modified").equals(readFile(file4Backup)) : "bad
backup file: " + file4Backup;
+
+ // ----- revert to last deployment, restoring backed up files
+ deployment.setId(2);
+ request = new BundleDeployRequest();
+ request.setBundleFilesLocation(this.bundleFilesDir);
+ request.setResourceDeployment(createNewBundleDeployment(deployment));
+ request.setBundleManagerProvider(new MockBundleManagerProvider());
+ request.setAbsoluteDestinationDirectory(this.destDir);
+ request.setRevert(true);
+ results = plugin.deployBundle(request);
+ assertResultsSuccess(results);
+
+ // make sure our files were reverted, giving us back the files that were backed
up
+ assert readFile(file1Backup).equals(readFile(file1Dest)); // inside dest dir
+ assert readFile(file2Backup).equals(readFile(file2Dest)); // inside dest dir
+ assert readFile(file3Backup).equals(readFile(file3Dest)); // outside dest dir
+ assert readFile(file4Backup).equals(readFile(file4Dest)); // outside dest dir
+
+ // ----- clean up our test -----
+ FileUtil.purge(externalDir, true);
+ }
+
+ /**
* Test realizing of replacement tokens of resource tags.
*/
- @Test(enabled = true)
+ @Test(enabled = ENABLE_TESTS)
public void testTags() throws Exception {
ResourceType resourceType = new ResourceType("testSimpleBundle",
"plugin", ResourceCategory.SERVER, null);
BundleType bundleType = new BundleType("testSimpleBundle",
resourceType);
@@ -484,7 +631,7 @@ public class AntBundlePluginComponentTest {
/**
* Test deployment of an RHQ bundle recipe where the deploy directory is not to be
fully managed.
*/
- @Test(enabled = true)
+ @Test(enabled = ENABLE_TESTS)
public void testAntBundleNoManageRootDir() throws Exception {
ResourceType resourceType = new
ResourceType("testNoManageRootDirBundle", "plugin",
ResourceCategory.SERVER,
null);
@@ -618,7 +765,7 @@ public class AntBundlePluginComponentTest {
* Test deployment of an RHQ bundle recipe where the deploy directory is to be fully
managed.
* This is the typical use-case and the default behavior.
*/
- @Test(enabled = true)
+ @Test(enabled = ENABLE_TESTS)
public void testAntBundleManageRootDir() throws Exception {
ResourceType resourceType = new ResourceType("testManageRootDirBundle",
"plugin", ResourceCategory.SERVER, null);
BundleType bundleType = new BundleType("testManageRootDirBundle",
resourceType);
@@ -878,6 +1025,10 @@ public class AntBundlePluginComponentTest {
return new String(StreamUtil.slurp(new FileInputStream(file)));
}
+ private void writeFile(final String content, final File file) throws IOException {
+ FileUtil.writeFile(new ByteArrayInputStream(content.getBytes()), file);
+ }
+
private void loadProperties(Properties realizedProps, FileInputStream
fileInputStream) throws Exception {
try {
realizedProps.load(fileInputStream);
diff --git a/modules/plugins/ant-bundle/src/test/resources/test-bundle-dotdot.xml
b/modules/plugins/ant-bundle/src/test/resources/test-bundle-dotdot.xml
new file mode 100644
index 0000000..f96b241
--- /dev/null
+++ b/modules/plugins/ant-bundle/src/test/resources/test-bundle-dotdot.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+
+<project name="bundle-dotdot" default="main"
xmlns:rhq="antlib:org.rhq.bundle">
+
+ <rhq:bundle name="bundle-dotdot" version="1.0"
+ description="testing raw files with .. in their destination
paths">
+
+ <rhq:deployment-unit name="bundle">
+ <rhq:file name="test1.txt"
destinationFile="nothere/../phantom/../subdir/test1.txt" /> <!-- still
under dest dir -->
+ <rhq:file name="test2.txt"
destinationDir="nothere/../" /> <!-- still under dest dir -->
+ <rhq:file name="test3.txt"
destinationFile="../ext/test3.txt" /> <!-- external location outside dest
dir-->
+ <rhq:file name="test4.txt" destinationDir="../ext"
/> <!-- external location outside dest dir-->
+ </rhq:deployment-unit>
+
+ </rhq:bundle>
+
+ <target name="main"/>
+
+</project>
\ No newline at end of file
commit 06da5f05ae6b970dd16db61226626c45530655f5
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Apr 26 10:39:32 2013 +0200
Don't test the TagManager if it is not enabled.
diff --git
a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/client/security/test/ScriptingAPIServerTest.java
b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/client/security/test/ScriptingAPIServerTest.java
index 0195603..aa0ebd4 100644
---
a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/client/security/test/ScriptingAPIServerTest.java
+++
b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/client/security/test/ScriptingAPIServerTest.java
@@ -88,6 +88,10 @@ public class ScriptingAPIServerTest extends ScriptableAbstractEJB3Test
{
for (RhqManager m : RhqManager.values()) {
String name = m.name();
+ // Only check for the TagManager if it is enabled at all
+ if (name.contains("TagManager") &&
!RhqManager.TagManager.enabled()) {
+ continue;
+ }
Object scriptedManager = engine.eval(name);
assertNotNull(scriptedManager);
commit 24ca08b47b9c9b9f23b5c993ec1f04b158c9be43
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Apr 26 10:17:45 2013 +0200
Get the jndi-access test to work with JBoss EAP 6.1alpha1
diff --git a/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
b/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
index 03dfcc9..f83573d 100644
--- a/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
+++ b/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
@@ -15,7 +15,7 @@
<properties>
<jboss.zip>${settings.localRepository}/org/jboss/as/jboss-as-dist/${jboss.version}/jboss-as-dist-${jboss.version}.zip</jboss.zip>
-
<jboss.unzip.location>${basedir}/target/jboss-as-${jboss.version}</jboss.unzip.location>
+
<jboss.unzip.location>${basedir}/target/${jboss.eap.version}</jboss.unzip.location>
<jnp.port>54987</jnp.port>
<jnp.rmiPort>54988</jnp.rmiPort>
</properties>
@@ -26,21 +26,21 @@
<artifactId>log4j</artifactId>
<scope>runtime</scope>
</dependency>
-
+
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-dist</artifactId>
<type>zip</type>
<scope>provided</scope>
</dependency>
-
+
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-ejb3</artifactId>
<version>${jboss.version}</version>
<scope>test</scope>
</dependency>
-
+
<dependency>
<groupId>org.rhq</groupId>
<artifactId>rhq-scripting-api</artifactId>
@@ -54,7 +54,7 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
-
+
<dependency>
<groupId>org.rhq</groupId>
<artifactId>rhq-scripting-python</artifactId>
@@ -69,7 +69,7 @@
<scope>test</scope>
</dependency>
- <!-- We need to pull some classes from the server jar and itests-2 - namely
the naming hack to be able to test
+ <!-- We need to pull some classes from the server jar and itests-2 - namely
the naming hack to be able to test
that it actually works -->
<dependency>
<groupId>org.rhq</groupId>
@@ -84,20 +84,20 @@
<artifactId>arquillian-testng-container</artifactId>
<scope>test</scope>
</dependency>
-
+
<dependency>
<groupId>org.jboss.arquillian.protocol</groupId>
<artifactId>arquillian-protocol-servlet</artifactId>
<scope>provided</scope>
</dependency>
-
+
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-depchain</artifactId>
<type>pom</type>
<scope>test</scope>
</dependency>
-
+
<!-- We'll try remote connections using JNP -->
<dependency>
<groupId>jboss</groupId>
@@ -105,7 +105,7 @@
<version>4.2.2.GA</version>
<scope>test</scope>
</dependency>
-
+
<!-- This is here only to ensure the build order and HAS TO COME AS LAST to
avoid any classpath
collisions. -->
<dependency>
@@ -148,6 +148,12 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.jboss.xnio</groupId>
+ <artifactId>xnio-api</artifactId>
+ <version>${xnio.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</profile>
@@ -158,13 +164,13 @@
<name>!remote-test-server</name>
</property>
</activation>
-
+
<dependencies>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-arquillian-container-managed</artifactId>
<scope>test</scope>
- </dependency>
+ </dependency>
</dependencies>
</profile>
@@ -175,7 +181,7 @@
<name>remote-test-server</name>
</property>
</activation>
-
+
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
@@ -187,13 +193,12 @@
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-arquillian-container-remote</artifactId>
- <version>${jboss.version}</version>
<scope>test</scope>
- </dependency>
+ </dependency>
</dependencies>
</profile>
</profiles>
-
+
<build>
<testResources>
<testResource>
@@ -211,8 +216,8 @@
<phase>process-test-resources</phase>
<configuration>
<target>
- <unzip src="${jboss.zip}"
dest="${jboss.unzip.location}/.." />
- <copy
file="src/test/resources/security.policy"
toDir="${jboss.unzip.location}"/>
+ <unzip src="${jboss.zip}"
dest="${jboss.unzip.location}/.." />
+ <copy
file="src/test/resources/security.policy"
toDir="${jboss.unzip.location}"/>
</target>
</configuration>
<goals>
@@ -221,10 +226,10 @@
</execution>
</executions>
</plugin>
-
+
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
- <!-- Everything but the web service tests, this is the standard
+ <!-- Everything but the web service tests, this is the standard
test execution -->
<configuration>
<excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
@@ -237,7 +242,7 @@
</systemPropertyVariables>
<argLine>${jacoco.unit-test.args} -Djava.security.manager
-Djava.security.policy==${basedir}/target/test-classes/security.policy</argLine>
<additionalClasspathElements>
- <!-- The below is required for tests to run against
+ <!-- The below is required for tests to run against
Oracle. -->
<additionalClasspathElement>${settings.localRepository}/com/oracle/ojdbc6/${ojdbc6.version}/ojdbc6-${ojdbc6.version}.jar</additionalClasspathElement>
</additionalClasspathElements>
diff --git
a/modules/integration-tests/jndi-access/jndi-access-test/src/test/resources/arquillian.xml
b/modules/integration-tests/jndi-access/jndi-access-test/src/test/resources/arquillian.xml
index 8bee491..1783f59 100644
---
a/modules/integration-tests/jndi-access/jndi-access-test/src/test/resources/arquillian.xml
+++
b/modules/integration-tests/jndi-access/jndi-access-test/src/test/resources/arquillian.xml
@@ -1,7 +1,7 @@
<arquillian
xmlns="http://jboss.org/schema/arquillian"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
-
+
<defaultProtocol type="Servlet 3.0" />
<container qualifier="as7" default="true">
<configuration>
diff --git a/pom.xml b/pom.xml
index d6489ef..da1506f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -153,6 +153,7 @@
<arquillian.version>1.0.3.Final</arquillian.version>
<arquillian.jboss.container.version>7.2.0.Final</arquillian.jboss.container.version>
<shrinkwrap-resolver.version>2.0.0-alpha-7</shrinkwrap-resolver.version>
+ <xnio.version>3.0.7.GA</xnio.version> <!-- needed in jndi-access tests
to talk to the managed AS -->
<xercesImpl.version>2.9.1-jbossas-2</xercesImpl.version> <!-- see
BZ-820629 and CVE-2009-2625 -->
<opencsv.version>1.8</opencsv.version>
<commons-httpclient.version>3.0.1</commons-httpclient.version>
@@ -725,6 +726,12 @@
</dependency>
<dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-arquillian-container-remote</artifactId>
+ <version>${arquillian.jboss.container.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.core</artifactId>
<version>${jacoco.version}</version>
commit 2f656dc37a45c5ccdb14dbb173f55dec830acb88
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Apr 25 12:20:55 2013 -0400
add API to get the data directory for the app server
diff --git
a/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
b/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
index 5078d08..9a766f4 100644
---
a/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
+++
b/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
@@ -126,6 +126,12 @@ public class CoreJBossASClient extends JBossASClient {
return dir;
}
+ public String getAppServerDataDir() throws Exception {
+ final String[] address = { CORE_SERVICE, SERVER_ENVIRONMENT };
+ final String dir = getStringAttribute(true, "data-dir",
Address.root().add(address));
+ return dir;
+ }
+
/**
* Enabled or disables the default deployment scanner.
* @param enabled the new status to be set
commit 06071e1f7f1562e86c364e0a03835a39fb241b22
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Apr 25 10:40:10 2013 -0400
BZ 956388 - opps. forgot to commit this
diff --git
a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/TestAgentClient.java
b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/TestAgentClient.java
index 7474b22..fe5dcf3 100644
---
a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/TestAgentClient.java
+++
b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/TestAgentClient.java
@@ -94,7 +94,7 @@ public class TestAgentClient implements AgentClient, BundleAgentService,
DriftAg
}
@Override
- public BundleAgentService getBundleAgentService(long timeout) {
+ public BundleAgentService getBundleAgentService(Long timeout) {
return getBundleAgentService();
}
@@ -104,7 +104,7 @@ public class TestAgentClient implements AgentClient,
BundleAgentService, DriftAg
}
@Override
- public ContentAgentService getContentAgentService(long timeout) {
+ public ContentAgentService getContentAgentService(Long timeout) {
return getContentAgentService();
}
@@ -114,7 +114,7 @@ public class TestAgentClient implements AgentClient,
BundleAgentService, DriftAg
}
@Override
- public ResourceFactoryAgentService getResourceFactoryAgentService(long timeout) {
+ public ResourceFactoryAgentService getResourceFactoryAgentService(Long timeout) {
return getResourceFactoryAgentService();
}
@@ -124,7 +124,7 @@ public class TestAgentClient implements AgentClient,
BundleAgentService, DriftAg
}
@Override
- public ConfigurationAgentService getConfigurationAgentService(long timeout) {
+ public ConfigurationAgentService getConfigurationAgentService(Long timeout) {
return getConfigurationAgentService();
}
@@ -134,7 +134,7 @@ public class TestAgentClient implements AgentClient,
BundleAgentService, DriftAg
}
@Override
- public DiscoveryAgentService getDiscoveryAgentService(long timeout) {
+ public DiscoveryAgentService getDiscoveryAgentService(Long timeout) {
return getDiscoveryAgentService();
}
@@ -144,7 +144,7 @@ public class TestAgentClient implements AgentClient,
BundleAgentService, DriftAg
}
@Override
- public MeasurementAgentService getMeasurementAgentService(long timeout) {
+ public MeasurementAgentService getMeasurementAgentService(Long timeout) {
return getMeasurementAgentService();
}
@@ -154,7 +154,7 @@ public class TestAgentClient implements AgentClient,
BundleAgentService, DriftAg
}
@Override
- public OperationAgentService getOperationAgentService(long timeout) {
+ public OperationAgentService getOperationAgentService(Long timeout) {
return getOperationAgentService();
}
@@ -164,7 +164,7 @@ public class TestAgentClient implements AgentClient,
BundleAgentService, DriftAg
}
@Override
- public SupportAgentService getSupportAgentService(long timeout) {
+ public SupportAgentService getSupportAgentService(Long timeout) {
return getSupportAgentService();
}
@@ -174,7 +174,7 @@ public class TestAgentClient implements AgentClient,
BundleAgentService, DriftAg
}
@Override
- public DriftAgentService getDriftAgentService(long timeout) {
+ public DriftAgentService getDriftAgentService(Long timeout) {
return getDriftAgentService();
}
commit 9159de1ad8c1055dfb05fe8cb1aed1f2d73d63a3
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Apr 25 10:20:45 2013 -0400
BZ 956388 - autboxing got us. the API should allow for Long (not long) to allow for
code to pass in long numbers or null to pick up the default
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/agentclient/AgentClient.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/agentclient/AgentClient.java
index c91c0a9..1f86df3 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/agentclient/AgentClient.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/agentclient/AgentClient.java
@@ -72,37 +72,37 @@ public interface AgentClient {
BundleAgentService getBundleAgentService();
- BundleAgentService getBundleAgentService(long timeout);
+ BundleAgentService getBundleAgentService(Long timeout);
ContentAgentService getContentAgentService();
- ContentAgentService getContentAgentService(long timeout);
+ ContentAgentService getContentAgentService(Long timeout);
ResourceFactoryAgentService getResourceFactoryAgentService();
- ResourceFactoryAgentService getResourceFactoryAgentService(long timeout);
+ ResourceFactoryAgentService getResourceFactoryAgentService(Long timeout);
DiscoveryAgentService getDiscoveryAgentService();
- DiscoveryAgentService getDiscoveryAgentService(long timeout);
+ DiscoveryAgentService getDiscoveryAgentService(Long timeout);
MeasurementAgentService getMeasurementAgentService();
- MeasurementAgentService getMeasurementAgentService(long timeout);
+ MeasurementAgentService getMeasurementAgentService(Long timeout);
OperationAgentService getOperationAgentService();
- OperationAgentService getOperationAgentService(long timeout);
+ OperationAgentService getOperationAgentService(Long timeout);
ConfigurationAgentService getConfigurationAgentService();
- ConfigurationAgentService getConfigurationAgentService(long timeout);
+ ConfigurationAgentService getConfigurationAgentService(Long timeout);
SupportAgentService getSupportAgentService();
- SupportAgentService getSupportAgentService(long timeout);
+ SupportAgentService getSupportAgentService(Long timeout);
DriftAgentService getDriftAgentService();
- DriftAgentService getDriftAgentService(long timeout);
+ DriftAgentService getDriftAgentService(Long timeout);
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/agentclient/impl/AgentClientImpl.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/agentclient/impl/AgentClientImpl.java
index 5ef22e6..c2d4049 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/agentclient/impl/AgentClientImpl.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/agentclient/impl/AgentClientImpl.java
@@ -137,7 +137,7 @@ public class AgentClientImpl implements AgentClient {
}
@Override
- public BundleAgentService getBundleAgentService(long timeout) {
+ public BundleAgentService getBundleAgentService(Long timeout) {
return clientRemotePojoFactory.getRemotePojo(BundleAgentService.class, timeout);
}
@@ -147,7 +147,7 @@ public class AgentClientImpl implements AgentClient {
}
@Override
- public ContentAgentService getContentAgentService(long timeout) {
+ public ContentAgentService getContentAgentService(Long timeout) {
return clientRemotePojoFactory.getRemotePojo(ContentAgentService.class,
timeout);
}
@@ -157,7 +157,7 @@ public class AgentClientImpl implements AgentClient {
}
@Override
- public ResourceFactoryAgentService getResourceFactoryAgentService(long timeout) {
+ public ResourceFactoryAgentService getResourceFactoryAgentService(Long timeout) {
return clientRemotePojoFactory.getRemotePojo(ResourceFactoryAgentService.class,
timeout);
}
@@ -167,7 +167,7 @@ public class AgentClientImpl implements AgentClient {
}
@Override
- public DiscoveryAgentService getDiscoveryAgentService(long timeout) {
+ public DiscoveryAgentService getDiscoveryAgentService(Long timeout) {
return clientRemotePojoFactory.getRemotePojo(DiscoveryAgentService.class,
timeout);
}
@@ -177,7 +177,7 @@ public class AgentClientImpl implements AgentClient {
}
@Override
- public MeasurementAgentService getMeasurementAgentService(long timeout) {
+ public MeasurementAgentService getMeasurementAgentService(Long timeout) {
return clientRemotePojoFactory.getRemotePojo(MeasurementAgentService.class,
timeout);
}
@@ -187,7 +187,7 @@ public class AgentClientImpl implements AgentClient {
}
@Override
- public OperationAgentService getOperationAgentService(long timeout) {
+ public OperationAgentService getOperationAgentService(Long timeout) {
return clientRemotePojoFactory.getRemotePojo(OperationAgentService.class,
timeout);
}
@@ -197,7 +197,7 @@ public class AgentClientImpl implements AgentClient {
}
@Override
- public ConfigurationAgentService getConfigurationAgentService(long timeout) {
+ public ConfigurationAgentService getConfigurationAgentService(Long timeout) {
return clientRemotePojoFactory.getRemotePojo(ConfigurationAgentService.class,
timeout);
}
@@ -207,7 +207,7 @@ public class AgentClientImpl implements AgentClient {
}
@Override
- public SupportAgentService getSupportAgentService(long timeout) {
+ public SupportAgentService getSupportAgentService(Long timeout) {
return clientRemotePojoFactory.getRemotePojo(SupportAgentService.class,
timeout);
}
@@ -217,7 +217,7 @@ public class AgentClientImpl implements AgentClient {
}
@Override
- public DriftAgentService getDriftAgentService(long timeout) {
+ public DriftAgentService getDriftAgentService(Long timeout) {
return clientRemotePojoFactory.getRemotePojo(DriftAgentService.class, timeout);
}
commit d2330a2d819b5ad2855fe1f32dc3005ab31f8543
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu Apr 25 14:52:06 2013 +0200
Discover WildFly servers as such.
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
index fb328a3..9a4d5bd 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
@@ -70,6 +70,7 @@ public abstract class BaseProcessDiscovery implements
ResourceDiscoveryComponent
private static final String JBOSS_AS_PREFIX = "jboss-as-";
private static final String JBOSS_EAP_PREFIX = "jboss-eap-";
+ private static final String WILDFLY_PREFIX = "wildfly-";
private static final String HOME_DIR_SYSPROP = "jboss.home.dir";
@@ -467,14 +468,14 @@ public abstract class BaseProcessDiscovery implements
ResourceDiscoveryComponent
return detail;
}
- private String getServerAttribute(ASConnection connection, String attributeName) {
+ private <T>T getServerAttribute(ASConnection connection, String attributeName)
{
Operation op = new ReadAttribute(null, attributeName);
Result res = connection.execute(op);
if (!res.isSuccess()) {
throw new InvalidPluginConfigurationException("Could not connect to
remote server ["
+ res.getFailureDescription() + "]. Did you enable
management?");
}
- return (String) res.getResult();
+ return (T) res.getResult();
}
// never returns null
@@ -563,7 +564,9 @@ public abstract class BaseProcessDiscovery implements
ResourceDiscoveryComponent
protected String determineServerVersionFromHomeDir(File homeDir) {
String version;
String homeDirName = homeDir.getName();
- if (homeDirName.startsWith(JBOSS_AS_PREFIX)) {
+ if (homeDirName.startsWith(WILDFLY_PREFIX)) {
+ version = homeDirName.substring(WILDFLY_PREFIX.length());
+ } else if (homeDirName.startsWith(JBOSS_AS_PREFIX)) {
version = homeDirName.substring(JBOSS_AS_PREFIX.length());
} else if (homeDirName.startsWith(JBOSS_EAP_PREFIX)) {
version = homeDirName.substring(JBOSS_EAP_PREFIX.length());
@@ -606,8 +609,17 @@ public abstract class BaseProcessDiscovery implements
ResourceDiscoveryComponent
ASConnection connection = new ASConnection(hostname, port, user, pass);
try {
String productName = getServerAttribute(connection,
"product-name");
- productType = ((productName != null) && !productName.isEmpty())
?
- JBossProductType.getValueByProductName(productName) :
JBossProductType.AS;
+ if ((productName != null) && !productName.isEmpty())
+ productType = JBossProductType.getValueByProductName(productName);
+ else {
+ Integer apiVersion =
getServerAttribute(connection,"management-major-version");
+ if (apiVersion==1) {
+ productType = JBossProductType.AS;
+ } else {
+ // In the future also check for other versions of WildFly via the
release-version
+ productType = JBossProductType.WILDFLY8;
+ }
+ }
releaseVersion = getServerAttribute(connection,
"release-version");
releaseCodeName = getServerAttribute(connection,
"release-codename");
serverName = getServerAttribute(connection, "name");
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JBossProductType.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JBossProductType.java
index eb86f0b..9edfb2f 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JBossProductType.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JBossProductType.java
@@ -36,7 +36,8 @@ public enum JBossProductType {
EPP("EPP", "JBoss EAP 6", "JBoss Enterprise Portal Platform
6", "Portal Platform"),
JPP("JPP", "JBoss EAP 6", "JBoss Portal Platform 6",
"Portal Platform"),
// EWP("EWP", "JBoss EWP 6", "JBoss Enterprise Web Platform
6", "EWP"),
- SOA("SOA-P", "JBoss SOA-P 6", "JBoss Enterprise SOA Platform
(ESB)", "SOAP");
+ SOA("SOA-P", "JBoss SOA-P 6", "JBoss Enterprise SOA Platform
(ESB)", "SOAP"),
+ WILDFLY8("WildFly","WildFly 8" ,"WildFly Appliction Server
8" , "WildFly");
public final String SHORT_NAME;
public final String NAME;
@@ -98,7 +99,7 @@ public enum JBossProductType {
productType = JBossProductType.EAP;
} else if (slot.equals("jdg")) {
productType = JBossProductType.JDG;
- } else if (slot.equals("epp")) {//old EPP
+ } else if (slot.equals("epp")) {//old EPP
productType = JBossProductType.EPP;
} else if (slot.equals("jpp")) {//new EPP->JPP plugin
productType = JBossProductType.JPP;
@@ -108,7 +109,9 @@ public enum JBossProductType {
throw new RuntimeException("Unknown product type: " + slot);
}
} else {
- productType = JBossProductType.AS;
+ // Wildfly and The Server Formerly Known AS JBossAS share the same absence of
a slot
+ // so we need another way to distinguish them
+ productType = determineJBossProductTypeViaHomeDirName(homeDir);
}
return productType;
@@ -119,6 +122,8 @@ public enum JBossProductType {
String homeDirName = homeDir.getName();
if (homeDirName.contains("-as-")) {
productType = JBossProductType.AS;
+ } else if (homeDirName.contains("wildfly")) {
+ productType = JBossProductType.WILDFLY8;
} else if (homeDirName.contains("-eap-")) {
productType = JBossProductType.EAP;
} else if
(homeDirName.contains("-jdg-")||(homeDirName.contains("datagrid-server")))
{