etc/eclipse-tools/maven/RHQ | 24 etc/m2/settings.xml | 174 - etc/modules/sample-bundle/src/main/rhq-bundle.xml | 63 etc/samples/custom-jmx-plugin/pom.xml | 3 etc/samples/custom-serverplugin/pom.xml | 26 etc/samples/perspectives/sample-perspective/pom.xml | 27 etc/samples/simplereport-serverplugin/pom.xml | 26 etc/samples/skeleton-plugin/pom.xml | 27 modules/cli-tests/src/test/resources/cli-test-bundle-zip.zip |binary modules/cli-tests/src/test/resources/cli-test-bundle.zip |binary modules/cli-tests/src/test/resources/test-upgrade-bundle-ant1.zip |binary modules/cli-tests/src/test/resources/test-upgrade-bundle-ant2.zip |binary modules/cli-tests/src/test/resources/test-upgrade-bundle1.zip |binary modules/cli-tests/src/test/resources/test-upgrade-bundle2.zip |binary modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManager.js | 43 modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerUpgrade.js | 116 modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerUpgradeAnt.js | 117 modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerZip.js | 79 modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java | 92 modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java | 31 modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/DeployPropertyNames.java | 28 modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/DeploymentPhase.java | 24 modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/LoggerAntBuildListener.java | 15 modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java | 119 - modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/DeployTask.java | 193 - modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/InputPropertyTask.java | 145 - modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/InstallSystemServiceTask.java | 333 -- modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/AbstractBundleType.java | 14 modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/AbstractFileType.java | 4 modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/DeploymentType.java | 268 ++ modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/FileSet.java | 2 modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/IgnoreType.java | 2 modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/InputPropertyType.java | 140 + modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/ReplaceType.java | 2 modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/SystemServiceType.java | 375 +++ modules/common/ant-bundle/src/main/resources/org/rhq/bundle/antlib.xml | 14 modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java | 9 modules/common/ant-bundle/src/test/resources/test-bundle-v1.xml | 39 modules/common/ant-bundle/src/test/resources/test-bundle-v2.xml | 43 modules/common/filetemplate-bundle/src/main/java/org/rhq/bundle/filetemplate/recipe/RecipeContext.java | 18 modules/common/filetemplate-bundle/src/main/java/org/rhq/bundle/filetemplate/recipe/RecipeParser.java | 26 modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/bundle/BundleScheduleRequest.java | 41 modules/core/client-api/src/main/java/org/rhq/core/clientapi/descriptor/PluginTransformer.java | 2 modules/core/dbutils/pom.xml | 2 modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java | 4 modules/core/dbutils/src/main/scripts/dbsetup/authz-data.xml | 68 modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml | 78 modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml | 2 modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 250 +- modules/core/domain/src/main/java/org/rhq/core/domain/authz/Permission.java | 50 modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java | 19 modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java | 187 + modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeploymentStatus.java | 4 modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java | 278 ++ modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleGroupDeployment.java | 294 -- modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeployment.java | 35 modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeploymentHistory.java | 127 - modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleVersion.java | 2 modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java | 14 modules/core/domain/src/main/java/org/rhq/core/domain/content/transfer/ResourcePackageDetails.java | 46 modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleCriteria.java | 51 modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java | 64 modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDestinationCriteria.java | 108 modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java | 12 modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleVersionCriteria.java | 8 modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java | 14 modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java | 57 modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceTypeCriteria.java | 19 modules/core/domain/src/main/java/org/rhq/core/domain/criteria/SavedSearchCriteria.java | 6 modules/core/domain/src/main/java/org/rhq/core/domain/criteria/TaggedCriteria.java | 84 modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementConverterClient.java | 360 --- modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java | 27 modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java | 4 modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java | 12 modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java | 17 modules/core/domain/src/main/java/org/rhq/core/domain/search/SavedSearch.java | 22 modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java | 20 modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java | 52 modules/core/domain/src/main/java/org/rhq/core/domain/tagging/compsite/TagReportComposite.java | 83 modules/core/domain/src/main/java/org/rhq/core/server/MeasurementConverter.java | 355 --- modules/core/domain/src/main/java/org/rhq/core/server/MeasurementParser.java | 104 modules/core/domain/src/test/java/org/rhq/core/domain/bundle/test/BundleTest.java | 8 modules/core/domain/src/test/java/org/rhq/core/domain/configuration/ResourceConfigurationUpdateIntegrationTest.java | 74 modules/core/domain/src/test/java/org/rhq/core/domain/search/SavedSearchTest.java | 54 modules/core/domain/src/test/java/org/rhq/core/domain/util/units/test/MeasurementConverterTest.java | 390 --- modules/core/native-system/ant-run.xml | 2 modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/bundle/BundleDeployRequest.java | 36 modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/bundle/BundleManagerProvider.java | 14 modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java | 210 + modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java | 90 modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/RetrieveContentBitsRunner.java | 76 modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java | 20 modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java | 12 modules/core/util/src/main/java/org/rhq/core/util/stream/StreamCopyDigest.java | 82 modules/core/util/src/main/java/org/rhq/core/util/updater/DeployDifferences.java | 36 modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java | 490 +++- modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentData.java | 146 + modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentDiskUsage.java | 83 modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentsMetadata.java | 121 - modules/core/util/src/main/java/org/rhq/core/util/updater/ExtractorZipFileVisitor.java | 1 modules/core/util/src/main/java/org/rhq/core/util/updater/StreamCopyDigest.java | 82 modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java | 103 modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawFileTest.java | 129 - modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawRelativeFileTest.java | 130 - modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java | 219 + modules/core/util/src/test/resources/ini-editor-test.ini | 72 modules/enterprise/agent/ant-run.xml | 2 modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java | 41 modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java | 21 modules/enterprise/gui/coregui/pom.xml | 6 modules/enterprise/gui/coregui/src/main/java/org/rhq/core/domain/measurement/MeasurementConverterClient.java | 360 +++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml | 36 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java | 12 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java | 179 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/DemoCanvas.java | 5 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java | 53 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java | 131 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java | 85 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java | 103 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java | 5 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java | 40 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleCreateWizard.java | 3 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleInfoStep.java | 208 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleSummaryStep.java | 8 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleTypeDropDownSelectItem.java | 103 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUpdateWizard.java | 40 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java | 28 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java | 267 ++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadRecipeStep.java | 46 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java | 136 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java | 138 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeploymentInfoStep.java | 89 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/CreateConfigStep.java | 57 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployOptionsStep.java | 96 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java | 117 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployTargetStep.java | 68 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java | 79 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java | 99 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java | 77 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java | 154 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java | 60 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java | 76 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectTemplateStep.java | 89 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/selection/PlatformResourceGroupSelector.java | 32 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/selection/SinglePlatformResourceGroupSelector.java | 70 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java | 119 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentListView.java | 93 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java | 314 ++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java | 180 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/resource/BundleResourceDeploymentDataSource.java | 109 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationDataSource.java | 175 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationListView.java | 98 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java | 238 ++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java | 46 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesDataSource.java | 21 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java | 91 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java | 14 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/AbstractBundleRevertWizard.java | 95 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/BundleRevertWizard.java | 58 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java | 170 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java | 108 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/RevertStep.java | 101 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeDataSource.java | 55 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeView.java | 26 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java | 23 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/file/FileListView.java | 57 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/HeaderLabel.java | 5 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/buttons/BackButton.java | 57 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java | 99 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java | 227 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java | 242 +- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TaggingDataSource.java | 8 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java | 207 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/DynamicCallbackForm.java | 37 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java | 11 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/content/repository/tree/ContentRepositoryTreeDataSource.java | 111 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/content/repository/tree/ContentRepositoryTreeView.java | 105 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java | 10 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java | 2 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedView.java | 9 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/TagCloudPortlet.java | 68 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/footer/FavoritesButton.java | 79 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java | 49 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ContentGWTService.java | 38 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java | 12 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RepoGWTService.java | 39 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SearchGWTService.java | 50 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TagGWTService.java | 3 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java | 10 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java | 37 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java | 117 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java | 100 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java | 69 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java | 24 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java | 55 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java | 1 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java | 61 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java | 50 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java | 10 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java | 46 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java | 32 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java | 13 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java | 111 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java | 107 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java | 145 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java | 476 ++++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchLogger.java | 7 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java | 156 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java | 178 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestResultsListBox.java | 157 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox.java | 307 ++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java | 10 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/MonitoringRequestCallback.java | 16 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AbstractGWTServiceImpl.java | 17 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleFileUploadServlet.java | 8 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java | 164 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ContentGWTServiceImpl.java | 50 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RepoGWTServiceImpl.java | 47 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java | 16 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SearchGWTServiceImpl.java | 68 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TagGWTServiceImpl.java | 10 modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css | 11 modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml | 63 modules/enterprise/gui/coregui/src/main/webapp/css/search.css | 218 + modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Over_end.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Over_start.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Over_stretch.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_end.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_start.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_stretch.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_Over_end.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_Over_start.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_Over_stretch.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_end.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_start.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_stretch.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/search/arrow-down-gray-no-border.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/search/arrow-down-white-no-border.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/search/corner-lower-left-8.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/search/corner-lower-right-8.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/search/corner-upper-left-8.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/search/corner-upper-right-8.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/search/menu_arrow.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/search/menu_arrow_down.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/search/star1.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/search/star2.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/search/star3.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/search/trash.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/BundleDeployment_16.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/BundleDeployment_24.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/BundleDestination_16.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/BundleDestination_24.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/Details_11.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/Ok_11.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/Warning_11.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/install-loader.gif |binary modules/enterprise/gui/coregui/src/main/webapp/js/search.js | 35 modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ServerProperties.java | 2 modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/i18n/InstallerI18NResourceKeys.java | 2 modules/enterprise/gui/installer-war/src/main/webapp/header.jsp | 2 modules/enterprise/gui/installer-war/src/main/webapp/start.jsp | 2 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java | 99 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/CreateNewPackageUIBean.java | 86 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/ListPackageHistoryUIBean.java | 28 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoAssociationsUIBean.java | 4 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoContentSourcesUIBean.java | 4 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoDisassociationsUIBean.java | 4 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoResourcesUIBean.java | 8 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoSubscriptionsUIBean.java | 8 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoUnsubscriptionsUIBean.java | 16 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java | 37 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java | 34 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/CreateNewPackageChildResourceUIBean.java | 99 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ListChildResourcesUIBean.java | 17 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemOOBHistoryUIBean.java | 18 modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties | 1 modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml | 13 modules/enterprise/gui/portal-war/src/main/webapp/admin/role/RolePermissionsForm.jsp | 21 modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml | 157 - modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml | 35 modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo.xhtml | 2 modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml | 47 modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml | 64 modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/layout/main.xhtml | 9 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/create.xhtml | 3 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml | 233 + modules/enterprise/gui/portal-war/src/main/webapp/rhq/subsystem/alertDefinitions.xhtml | 9 modules/enterprise/gui/portal-war/src/main/webapp/test/gwt/facelet.xhtml | 46 modules/enterprise/gui/portal-war/src/main/webapp/test/gwt/simple.html | 36 modules/enterprise/gui/portal-war/src/main/webapp/test/iframe/inner.xhtml | 36 modules/enterprise/gui/portal-war/src/main/webapp/test/iframe/outer.xhtml | 28 modules/enterprise/pom.xml | 1 modules/enterprise/remoting/client-api/src/main/java/org/rhq/enterprise/client/RemoteClient.java | 17 modules/enterprise/remoting/pom.xml | 18 modules/enterprise/server/jar/pom.xml | 20 modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g | 8 modules/enterprise/server/jar/src/main/java/org/rhq/core/server/MeasurementConverter.java | 355 +++ modules/enterprise/server/jar/src/main/java/org/rhq/core/server/MeasurementParser.java | 104 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerLocal.java | 4 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java | 5 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java | 465 ++- modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerLocal.java | 46 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java | 109 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/metadata/ConfigurationMetadataManagerBean.java | 31 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java | 193 + modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerHelper.java | 4 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java | 11 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java | 188 + modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/DistributionManagerBean.java | 6 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java | 4 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java | 53 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementOOBManagerBean.java | 2 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/BundleServerPluginFacet.java | 19 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/BundleServerPluginManager.java | 76 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/UnknownRecipeException.java | 55 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java | 24 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerLocal.java | 6 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java | 365 +-- modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java | 5 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java | 9 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerRemote.java | 2 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java | 11 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java | 81 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java | 29 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistant.java | 2 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java | 19 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java | 160 - modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java | 33 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java | 67 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java | 4 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/SearchTranslator.java | 4 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/SearchTranslatorFactory.java | 2 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/antlr/RHQLAdvancedTerm.java | 39 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/antlr/RHQLSimpleTerm.java | 13 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/antlr/RHQLTerm.java | 36 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java | 82 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerRemote.java | 3 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java | 131 - modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java | 43 modules/enterprise/server/jar/src/main/resources/single-line-rhql.txt | 14 modules/enterprise/server/jar/src/test/java/org/rhq/core/domain/util/units/test/MeasurementConverterTest.java | 390 +++ modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java | 108 modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateResourceTypeSubsystemTest.java | 98 modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateSubsytemTestBase.java | 27 modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/RHQLTest.java | 5 modules/enterprise/server/plugins/ant-bundle/src/main/java/org/rhq/enterprise/server/plugins/ant/AntBundleServerPluginComponent.java | 22 modules/enterprise/server/plugins/filetemplate-bundle/src/main/java/org/rhq/enterprise/server/plugins/filetemplate/BundleServerPluginComponent.java | 36 modules/enterprise/server/plugins/jboss-software/src/main/resources/META-INF/rhq-serverplugin.xml | 18 modules/enterprise/server/plugins/rhnhosted/src/main/java/org/rhq/enterprise/server/plugins/rhnhosted/RHNProvider.java | 2 modules/enterprise/server/plugins/yum/src/main/java/org/rhq/enterprise/server/plugins/yum/RepoProvider.java | 4 modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml | 23 modules/jopr/tools/jbas5-plugin-descriptor-gen/src/main/java/org/jboss/jopr/tool/jbas5/PluginDescriptorGenerator.java | 4 modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java | 31 modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/DeploymentAuditorBuildListener.java | 10 modules/plugins/ant-bundle/src/test/java/org/rhq/plugins/ant/AntBundlePluginComponentTest.java | 15 modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml | 2 modules/plugins/augeas/pom.xml | 14 modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java | 48 modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/ProcessingRecipeContext.java | 95 modules/plugins/filetemplate-bundle/src/test/java/org/rhq/plugins/filetemplate/ProcessingRecipeContextTest.java | 49 modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/AbstractManagedComponent.java | 2 modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java | 126 - modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java | 38 modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerPluginConfigurationProperties.java | 30 modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/InProcessJBossASDiscovery.java | 19 modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/JBossMessagingComponent.java | 70 modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/JBossMessagingDiscoveryComponent.java | 55 modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/JBossWebComponent.java | 6 modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentDiscoveryComponent.java | 319 +- modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/PlatformComponent.java | 13 modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ProfileServiceComponent.java | 5 modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/deploy/AbstractDeployer.java | 49 modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/CreateChildResourceFacetDelegate.java | 180 + modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml | 1179 +++++----- modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java | 47 modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/util/FileContentDelegate.java | 166 - modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml | 32 modules/plugins/jboss-cache-v3/src/main/java/org/rhq/plugins/jbosscache3/JBossCacheComponent.java | 11 modules/plugins/jboss-cache-v3/src/main/java/org/rhq/plugins/jbosscache3/JBossCacheDetailComponent.java | 16 modules/plugins/nagios/TODO.txt | 7 modules/plugins/platform/src/main/java/org/rhq/plugins/platform/CpuComponent.java | 30 modules/plugins/platform/src/main/java/org/rhq/plugins/platform/LinuxPlatformComponent.java | 13 pom.xml | 49 384 files changed, 18656 insertions(+), 7202 deletions(-)
New commits: commit b2468a3c15dc9f101c2fc62ec9a5c332dcf7c275 Author: alexander.kiefer79@googlemail.com <di34475@.dh-com.continental.steel> Date: Thu May 27 11:33:28 2010 +0200
Created a TODO textdoc that includes important information of things that will have to be done soon
diff --git a/modules/plugins/nagios/TODO.txt b/modules/plugins/nagios/TODO.txt new file mode 100644 index 0000000..9166b6a --- /dev/null +++ b/modules/plugins/nagios/TODO.txt @@ -0,0 +1,7 @@ +Important things that will have to be done in the future: + +-Enlarge the plugin to make it possible to get all the metrics of Nagios +-At the moment it is limited to only a few metrics because there is a bug in the parser that has to be fixed first +-Refactoring of the data model to find out if there are possibilities to improve the whole thing +-Update wiki documentation to include the latest changes +-More logging output for debug purpose in all the classes \ No newline at end of file
commit 2f31e051940af7dcfc9b77f51477497b30fd2e3f Merge: 1149b0f... 5036760... Author: alexander.kiefer79@googlemail.com <di34475@.dh-com.continental.steel> Date: Thu May 27 08:59:38 2010 +0200
Merge branch 'nagios' of ssh://git.fedorahosted.org/git/rhq/rhq into nagios
commit 1149b0f5ebd9b1e0db77497ea102fb015252911b Author: Simeon Pinder spinder@redhat.com Date: Wed May 26 20:06:39 2010 -0400
npe check and disabling testAntBundle.
diff --git a/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java b/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java index 2eb1d85..cd0e4c1 100644 --- a/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java +++ b/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java @@ -166,7 +166,9 @@ public class AntBundlePluginComponent implements ResourceComponent, BundleFacet
int deploymentId = bundleDeployment.getId(); antProps.setProperty(DeployPropertyNames.DEPLOY_ID, Integer.toString(deploymentId)); - antProps.setProperty(DeployPropertyNames.DEPLOY_NAME, bundleDeployment.getName()); + if (bundleDeployment.getName() != null) { + antProps.setProperty(DeployPropertyNames.DEPLOY_NAME, bundleDeployment.getName()); + } antProps.setProperty(DeployPropertyNames.DEPLOY_REVERT, String.valueOf(request.isRevert())); antProps.setProperty(DeployPropertyNames.DEPLOY_CLEAN, String.valueOf(request.isCleanDeployment()));
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 c995939..6a9d845 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 @@ -124,6 +124,7 @@ public class AntBundlePluginComponentTest { /** * Test a Ant script that includes all of the RHQ tasks. */ + @Test(enabled = false) public void testAntBundle() throws Exception { ResourceType resourceType = new ResourceType("testSimpleBundle", "plugin", ResourceCategory.SERVER, null); BundleType bundleType = new BundleType("testSimpleBundle", resourceType); @@ -167,6 +168,7 @@ public class AntBundlePluginComponentTest {
private String getRecipeFromFile(String filename) { InputStream stream = getClass().getClassLoader().getResourceAsStream(filename); + byte[] contents = StreamUtil.slurp(stream); return new String(contents); }
commit 967c37242702d5774e3f313b07dc5090e4f47eb9 Author: Simeon Pinder spinder@redhat.com Date: Wed May 26 18:34:41 2010 -0400
moving incorrect em.persist and put NPE check in.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java index 4439771..ae7c079 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java @@ -1278,23 +1278,7 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe PackageVersion newPackageVersion = new PackageVersion(existingPackage, version, architecture); newPackageVersion.setDisplayName(existingPackage.getName());
- // PackageBits bits = loadPackageBits(packageBitStream); - // TODO: THIS IS VERY BAD - MUST FIX - DO NOT SLURP THE ENTIRE FILE IN MEMORY - USE JDBC STREAMING - // Write the content into the newly created package version. This may eventually move, but for now we'll just - // use the byte array in the package version to store the bits. - byte[] packageBits; - try { - packageBits = StreamUtil.slurp(packageBitStream); - } catch (RuntimeException re) { - throw new RuntimeException("Error reading in the package file", re); - } - - PackageBits bits = new PackageBits(); - try { - bits.setBits(packageBits); - } catch (Exception e) { - log.error("Error savinf the package.", e); - } + PackageBits bits = loadPackageBits(packageBitStream);
newPackageVersion.setPackageBits(bits); newPackageVersion.setFileSize((long) bits.getBits().length); @@ -1612,24 +1596,7 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe }
//get the data and persist/merge packageVersion - // PackageBits bits = loadPackageBits(packageBitStream); - // TODO: THIS IS VERY BAD - MUST FIX - DO NOT SLURP THE ENTIRE FILE IN MEMORY - USE JDBC STREAMING - // Write the content into the newly created package version. This may eventually move, but for now we'll just - // use the byte array in the package version to store the bits. - byte[] packageBits; - try { - packageBits = StreamUtil.slurp(packageBitStream); - } catch (RuntimeException re) { - throw new RuntimeException("Error reading in the package file", re); - } - - PackageBits bits = new PackageBits(); - try { - bits.setBits(packageBits); - } catch (Exception e) { - log.error("Error savinf the package.", e); - } - + PackageBits bits = loadPackageBits(packageBitStream); packageVersion.setPackageBits(bits);
//populate extra details, persist @@ -1668,7 +1635,6 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe bits = new PackageBits(); try { bits.setBits(packageBits); - entityManager.persist(bits); } catch (Exception e) { log.error("Error saving the package.", e); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerHelper.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerHelper.java index 9d4a4bc..a00a40c 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerHelper.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerHelper.java @@ -95,7 +95,10 @@ public class ContentManagerHelper { details.setMetadata(packageVersion.getMetadata()); details.setSHA256(packageVersion.getSHA256()); details.setShortDescription(packageVersion.getShortDescription()); - details.setInstallationTimestamp(packageVersion.getFileCreatedDate()); + Long created = packageVersion.getFileCreatedDate(); + if (created != null) { + details.setInstallationTimestamp(created.longValue()); + }
return details; } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java index 438bb8a..d8651c9 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java @@ -530,19 +530,6 @@ public class ResourceFactoryManagerBean implements ResourceFactoryManagerLocal, packageVersionNumber, architectureId, packageBitStream, packageUploadDetails, newResourceTypeId); }
- // //check that Configuration is persisted correctly. - // if (deploymentTimeConfiguration.getId() > 0) { - // entityManager.merge(deploymentTimeConfiguration); - // } else { - // entityManager.persist(deploymentTimeConfiguration); - // } - // //check that Configuration is persisted correctly. - // if (pluginConfiguration.getId() > 0) { - // entityManager.merge(pluginConfiguration); - // } else { - // entityManager.persist(pluginConfiguration); - // } - // Persist in separate transaction so it is committed immediately, before the request is sent to the agent CreateResourceHistory persistedHistory = resourceFactoryManager.persistCreateHistory(user, parentResourceId, newResourceTypeId, newResourceName, packageVersion, deploymentTimeConfiguration);
commit f8f1cc42f9107fc2853a35a9a542eea64598bc8c Author: Heiko W. Rupp hwr@redhat.com Date: Wed May 26 22:03:23 2010 +0200
Fix language code (cherry picked from commit 20809c5d60d272751116daaa6c9dae1a9179ae15)
diff --git a/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/i18n/InstallerI18NResourceKeys.java b/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/i18n/InstallerI18NResourceKeys.java index 8dfdec9..be8ddc5 100644 --- a/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/i18n/InstallerI18NResourceKeys.java +++ b/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/i18n/InstallerI18NResourceKeys.java @@ -345,7 +345,7 @@ public interface InstallerI18NResourceKeys { String PROP_HTTP_PORT_HELP = "propertyHttpPortHelp";
@I18NMessages( { @I18NMessage(locale = "en", value = "Secure HTTPS Port"), - @I18NMessage(locale = "de", value = "HTTPS Port"), @I18NMessage(locale = "de", value = "Port HTTPS Sécurisé") }) + @I18NMessage(locale = "de", value = "HTTPS Port"), @I18NMessage(locale = "fr", value = "Port HTTPS Sécurisé") }) String PROP_HTTPS_PORT = "propertyHttpsPort"; @I18NMessage("-SecureHTTPSPort") String PROP_HTTPS_PORT_HELP = "propertyHttpsPortHelp";
commit a7650cf1ecfa043f53cb4269e837c1bd7e707568 Author: Simeon Pinder spinder@redhat.com Date: Wed May 26 15:30:40 2010 -0400
take two on regression fix.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java index 11f709f..4439771 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java @@ -1278,7 +1278,23 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe PackageVersion newPackageVersion = new PackageVersion(existingPackage, version, architecture); newPackageVersion.setDisplayName(existingPackage.getName());
- PackageBits bits = loadPackageBits(packageBitStream); + // PackageBits bits = loadPackageBits(packageBitStream); + // TODO: THIS IS VERY BAD - MUST FIX - DO NOT SLURP THE ENTIRE FILE IN MEMORY - USE JDBC STREAMING + // Write the content into the newly created package version. This may eventually move, but for now we'll just + // use the byte array in the package version to store the bits. + byte[] packageBits; + try { + packageBits = StreamUtil.slurp(packageBitStream); + } catch (RuntimeException re) { + throw new RuntimeException("Error reading in the package file", re); + } + + PackageBits bits = new PackageBits(); + try { + bits.setBits(packageBits); + } catch (Exception e) { + log.error("Error savinf the package.", e); + }
newPackageVersion.setPackageBits(bits); newPackageVersion.setFileSize((long) bits.getBits().length); @@ -1596,7 +1612,24 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe }
//get the data and persist/merge packageVersion - PackageBits bits = loadPackageBits(packageBitStream); + // PackageBits bits = loadPackageBits(packageBitStream); + // TODO: THIS IS VERY BAD - MUST FIX - DO NOT SLURP THE ENTIRE FILE IN MEMORY - USE JDBC STREAMING + // Write the content into the newly created package version. This may eventually move, but for now we'll just + // use the byte array in the package version to store the bits. + byte[] packageBits; + try { + packageBits = StreamUtil.slurp(packageBitStream); + } catch (RuntimeException re) { + throw new RuntimeException("Error reading in the package file", re); + } + + PackageBits bits = new PackageBits(); + try { + bits.setBits(packageBits); + } catch (Exception e) { + log.error("Error savinf the package.", e); + } + packageVersion.setPackageBits(bits);
//populate extra details, persist diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java index f55c24a..438bb8a 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java @@ -530,18 +530,18 @@ public class ResourceFactoryManagerBean implements ResourceFactoryManagerLocal, packageVersionNumber, architectureId, packageBitStream, packageUploadDetails, newResourceTypeId); }
- //check that Configuration is persisted correctly. - if (deploymentTimeConfiguration.getId() > 0) { - entityManager.merge(deploymentTimeConfiguration); - } else { - entityManager.persist(deploymentTimeConfiguration); - } - //check that Configuration is persisted correctly. - if (pluginConfiguration.getId() > 0) { - entityManager.merge(pluginConfiguration); - } else { - entityManager.persist(pluginConfiguration); - } + // //check that Configuration is persisted correctly. + // if (deploymentTimeConfiguration.getId() > 0) { + // entityManager.merge(deploymentTimeConfiguration); + // } else { + // entityManager.persist(deploymentTimeConfiguration); + // } + // //check that Configuration is persisted correctly. + // if (pluginConfiguration.getId() > 0) { + // entityManager.merge(pluginConfiguration); + // } else { + // entityManager.persist(pluginConfiguration); + // }
// Persist in separate transaction so it is committed immediately, before the request is sent to the agent CreateResourceHistory persistedHistory = resourceFactoryManager.persistCreateHistory(user, parentResourceId,
commit 784402edb5a410dd4eb7f4858b15e253fdd3a096 Merge: e0bc327... d627f31... Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 26 15:32:05 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit e0bc327c15beaefde092884b54f474445ef2e82f Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 26 15:29:40 2010 -0400
return 2.86 to the front lines
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index 4b4ce55..a00c8a5 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -2964,16 +2964,27 @@ </schema-directSQL> </schemaSpec>
- <schemaSpec version="2.87"> - <schema-directSQL> - <statement desc="Drop non-unique RHQ_RES_TYPE_IDX_PLG_NAME index"> - DROP INDEX RHQ_RES_TYPE_IDX_PLG_NAME - </statement> - <statement desc="Recreate RHQ_RES_TYPE_IDX_PLG_NAME index as unique"> - CREATE UNIQUE INDEX RHQ_RES_TYPE_IDX_PLG_NAME ON RHQ_RESOURCE_TYPE (name, plugin) - </statement> - </schema-directSQL> - </schemaSpec> + <schemaSpec version="2.86"> + <schema-directSQL> + <statement desc="Adding MANAGE_BUNDLE permission to overlord"> + INSERT INTO RHQ_PERMISSION VALUES(1, 12) + </statement> + <statement desc="Adding MANAGE_BUNDLE permission to superuser"> + INSERT INTO RHQ_PERMISSION VALUES(2, 12) + </statement> + </schema-directSQL> + </schemaSpec> + + <schemaSpec version="2.87"> + <schema-directSQL> + <statement desc="Drop non-unique RHQ_RES_TYPE_IDX_PLG_NAME index"> + DROP INDEX RHQ_RES_TYPE_IDX_PLG_NAME + </statement> + <statement desc="Recreate RHQ_RES_TYPE_IDX_PLG_NAME index as unique"> + CREATE UNIQUE INDEX RHQ_RES_TYPE_IDX_PLG_NAME ON RHQ_RESOURCE_TYPE (name, plugin) + </statement> + </schema-directSQL> + </schemaSpec>
</dbupgrade> </target>
commit d627f319282688c6491468bf1956f8cb80ca5a24 Author: Simeon Pinder spinder@redhat.com Date: Wed May 26 14:06:27 2010 -0400
fixing config property regression.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java index 3ecd40f..f55c24a 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java @@ -320,7 +320,7 @@ public class ResourceFactoryManagerBean implements ResourceFactoryManagerLocal, CreateResourceHistory history = new CreateResourceHistory(parentResource, resourceType, user.getName(), (InstalledPackage) null); history.setCreatedResourceName(createResourceName); - // history.setConfiguration(deploymentTimeConfiguration); + history.setConfiguration(deploymentTimeConfiguration); history.setStatus(CreateResourceStatus.IN_PROGRESS);
entityManager.persist(history);
commit 43bd4804ee5d9261be1a3c7007a12cfe1f96d1a9 Merge: a8c2a3e... 0d610ef... Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 26 10:17:14 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
Conflicts: etc/eclipse-tools/maven/RHQ Maven Build - Agent Only.launch
commit 0d610ef84d564a08a2def9589c5843f25c52eb4f Merge: 03050fc... e2f5021... Author: John Mazzitelli mazz@redhat.com Date: Wed May 26 10:05:38 2010 -0400
Merge branch 'bundle'
Conflicts: modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml
diff --cc modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml index 6363600,6687c62..2851427 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml @@@ -1,132 -1,101 +1,132 @@@ - <?xml version="1.0"?> - - <!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - - <html xmlns="http://www.w3.org/1999/xhtml" - xmlns:h="http://java.sun.com/jsf/html" - xmlns:f="http://java.sun.com/jsf/core" - xmlns:ui="http://java.sun.com/jsf/facelets" - xmlns:c="http://java.sun.com/jstl/core" - xmlns:onc="http://jboss.org/on/component" - xmlns:onf="http://jboss.org/on/function" - xmlns:s="http://jboss.com/products/seam/taglib" - xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" - xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E - - <ui:composition template="/rhq/resource/layout/main.xhtml"> - - <ui:param name="pageTitle" value="#{ResourceUIBean.resourceType.name} '#{ResourceUIBean.name}' - Create New Child of Type #{CreateNewPackageChildResourceUIBean.resourceType.name}"/> - <ui:param name="selectedTabName" value="Inventory.Overview"/> - <ui:define name="content"> - - <h:form id="uploadForm"> - - <input type="hidden" name="id" value="${ResourceUIBean.id}"/> - <input type="hidden" name="type" value="#{CreateNewPackageChildResourceUIBean.resourceType.id}"/> - <h:inputHidden value="#{CreateNewPackageChildResourceUIBean.packageType}" converter="PackageTypeConverter"/> - - rich:panel - - <f:facet name="header"><h:outputText value="Create New Resource"/></f:facet> - - <p><h:outputText value="In order to create a new #{CreateNewPackageChildResourceUIBean.resourceType.name}, a new - package must be deployed as the basis for the resource. The following information is required to - create the package."/></p> - - <table> - <c:if test="#{CreateNewPackageChildResourceUIBean.packageType.supportsArchitecture}"> - <tr> - <td align="right"><b><h:outputText value="Package Architecture #{CreateNewPackageChildResourceUIBean.packageType.supportsArchitecture}"/> </b></td> - <td align="left"> - <h:selectOneMenu value="#{CreateNewPackageChildResourceUIBean.selectedArchitectureId}"> - <f:selectItems value="#{CreateNewPackageChildResourceUIBean.architectures}" /> - </h:selectOneMenu> - </td> - </tr> - </c:if> - </table> - - <h:panelGrid columns="1" width="100%"> - rich:panel - <input type="button" - class="buttonmed" - value="UPLOAD FILE..." - onclick="javascript:open('/rhq/resource/inventory/create-file-upload.xhtml', 'uploadwin', 'titlebar=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,height=160,width=450')"/> - <rich:spacer width="5" /> - <h:outputText rendered="#{UploadNewChildPackageUIBean.fileUploaded}" - value="File Uploaded: #{UploadNewChildPackageUIBean.fileItem.fileName}"/> - </rich:panel> - </h:panelGrid> - - <h:outputText rendered="#{!ResourceUIBean.permissions.content}" - value="You do not have permissions to upload content"/> - + <?xml version="1.0"?> + + <!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + <html xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:composition template="/rhq/resource/layout/main.xhtml"> + + <ui:param name="pageTitle" value="#{ResourceUIBean.resourceType.name} '#{ResourceUIBean.name}' - Create New Child of Type #{CreateNewPackageChildResourceUIBean.resourceType.name}"/> + <ui:param name="selectedTabName" value="Inventory.Overview"/> + <ui:define name="content"> + + <h:form id="uploadForm"> + + <input type="hidden" name="id" value="${ResourceUIBean.id}"/> + <input type="hidden" name="type" value="#{CreateNewPackageChildResourceUIBean.resourceType.id}"/> + <h:inputHidden value="#{CreateNewPackageChildResourceUIBean.packageType}" converter="PackageTypeConverter"/> + + rich:panel + + <f:facet name="header"><h:outputText value="Create New Resource"/></f:facet> + + <p><h:outputText value="In order to create a new #{CreateNewPackageChildResourceUIBean.resourceType.name}, a new + package must be deployed as the basis for the resource. The following information is required to + create the package."/></p> + + <table> + <c:if test="#{CreateNewPackageChildResourceUIBean.packageType.supportsArchitecture}"> + <tr> + <td align="right"><b><h:outputText value="Package Architecture #{CreateNewPackageChildResourceUIBean.packageType.supportsArchitecture}"/> </b></td> + <td align="left"> + <h:selectOneMenu value="#{CreateNewPackageChildResourceUIBean.selectedArchitectureId}"> + <f:selectItems value="#{CreateNewPackageChildResourceUIBean.architectures}" /> + </h:selectOneMenu> + </td> + </tr> + </c:if> + </table> + + <h:panelGrid columns="1" width="100%"> + rich:panel + <input type="button" + class="buttonmed" + value="UPLOAD FILE..." + onclick="javascript:open('/rhq/resource/inventory/create-file-upload.xhtml', 'uploadwin', 'titlebar=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,height=160,width=450')"/> + <rich:spacer width="5" /> + <h:outputText rendered="#{UploadNewChildPackageUIBean.fileUploaded}" + value="File Uploaded: #{UploadNewChildPackageUIBean.fileItem.fileName}"/> + </rich:panel> + </h:panelGrid> + + <h:outputText rendered="#{!ResourceUIBean.permissions.content}" + value="You do not have permissions to upload content"/> + + <rich:panel > + + <f:facet name="header">Package Version Details</f:facet> + + <input type="hidden" name="packageVersion" value="true"/> + + <table> + <tr> + <td align="right"><b>Version *</b></td> + <td align="left"><h:inputText value="#{CreateNewPackageChildResourceUIBean.version}"/></td> + </tr> + <tr> + <td align="right"><b>Architecture </b></td> + <td align="left"> + <h:selectOneMenu value="#{CreateNewPackageChildResourceUIBean.selectedArchitectureId}"> + <f:selectItems value="#{CreateNewPackageChildResourceUIBean.architectures}" /> + </h:selectOneMenu> + </td> + </tr> + <tr> + <td align="right"><b>Type *</b></td> + <td align="left"> + <h:selectOneMenu value="#{CreateNewPackageChildResourceUIBean.selectedPackageTypeId}"> + <f:selectItems value="#{CreateNewPackageChildResourceUIBean.packageTypes}" /> + </h:selectOneMenu> + </td> + </tr> + </table> + </rich:panel> + + - <onc:config configurationDefinition="#{CreateNewPackageChildResourceUIBean.configurationDefinition}" - configuration="#{CreateNewPackageChildResourceUIBean.configuration}" - nullConfigurationDefinitionMessage="#{CreateNewPackageChildResourceUIBean.nullConfigurationDefinitionMessage}" - nullConfigurationMessage="#{CreateNewPackageChildResourceUIBean.nullConfigurationMessage}"/> - - <h:panelGrid id="buttonGrid" columns="2" styleClass="buttons-table" columnClasses="button-cell"> - - <h:commandButton style="margin-top: 10px;" value="CREATE" - action="#{CreateNewPackageChildResourceUIBean.createResource}" - rendered="#{UploadNewChildPackageUIBean.fileUploaded}" - styleClass="buttonmed"> - <s:defaultAction /> - </h:commandButton> - <h:commandButton style="margin-top: 10px;" value="CREATE" - action="#{CreateNewPackageChildResourceUIBean.createResource}" - disabled="true" - rendered="#{!UploadNewChildPackageUIBean.fileUploaded}" - styleClass="buttonmed-disabled"> - <s:defaultAction /> - </h:commandButton> - - <h:commandButton style="margin-top: 10px;" value="CANCEL" - immediate="true" - action="#{CreateNewPackageChildResourceUIBean.cancel}" styleClass="buttonmed"/> - - </h:panelGrid> - - </rich:panel> - - </h:form> - - </ui:define> - - </ui:composition> - - </html> + <onc:config configurationDefinition="#{CreateNewPackageChildResourceUIBean.configurationDefinition}" + configuration="#{CreateNewPackageChildResourceUIBean.configuration}" + nullConfigurationDefinitionMessage="#{CreateNewPackageChildResourceUIBean.nullConfigurationDefinitionMessage}" + nullConfigurationMessage="#{CreateNewPackageChildResourceUIBean.nullConfigurationMessage}"/> + + <h:panelGrid id="buttonGrid" columns="2" styleClass="buttons-table" columnClasses="button-cell"> + + <h:commandButton style="margin-top: 10px;" value="CREATE" + action="#{CreateNewPackageChildResourceUIBean.createResource}" + rendered="#{UploadNewChildPackageUIBean.fileUploaded}" + styleClass="buttonmed"> + <s:defaultAction /> + </h:commandButton> + <h:commandButton style="margin-top: 10px;" value="CREATE" + action="#{CreateNewPackageChildResourceUIBean.createResource}" + disabled="true" + rendered="#{!UploadNewChildPackageUIBean.fileUploaded}" + styleClass="buttonmed-disabled"> + <s:defaultAction /> + </h:commandButton> + + <h:commandButton style="margin-top: 10px;" value="CANCEL" + immediate="true" + action="#{CreateNewPackageChildResourceUIBean.cancel}" styleClass="buttonmed"/> + + </h:panelGrid> + + </rich:panel> + + </h:form> + + </ui:define> + + </ui:composition> + + </html>
commit e2f502125e2a83a2096134b5ba2a9d9f23a2ecbe Merge: 2ccab82... 4f38e45... Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 26 09:50:46 2010 -0400
Merge branch 'bundle' into bundle-jay
commit 2ccab825cfa691c2b974995efa6ac468586e6e4a Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 26 09:50:37 2010 -0400
LT commit
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml index 67eebb2..6687c62 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml @@ -1,101 +1,101 @@ -<?xml version="1.0"?> - -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:h="http://java.sun.com/jsf/html" - xmlns:f="http://java.sun.com/jsf/core" - xmlns:ui="http://java.sun.com/jsf/facelets" - xmlns:c="http://java.sun.com/jstl/core" - xmlns:onc="http://jboss.org/on/component" - xmlns:onf="http://jboss.org/on/function" - xmlns:s="http://jboss.com/products/seam/taglib" - xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" - xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E - -<ui:composition template="/rhq/resource/layout/main.xhtml"> - -<ui:param name="pageTitle" value="#{ResourceUIBean.resourceType.name} '#{ResourceUIBean.name}' - Create New Child of Type #{CreateNewPackageChildResourceUIBean.resourceType.name}"/> -<ui:param name="selectedTabName" value="Inventory.Overview"/> -<ui:define name="content"> - - <h:form id="uploadForm"> - - <input type="hidden" name="id" value="${ResourceUIBean.id}"/> - <input type="hidden" name="type" value="#{CreateNewPackageChildResourceUIBean.resourceType.id}"/> - <h:inputHidden value="#{CreateNewPackageChildResourceUIBean.packageType}" converter="PackageTypeConverter"/> - - rich:panel - - <f:facet name="header"><h:outputText value="Create New Resource"/></f:facet> - - <p><h:outputText value="In order to create a new #{CreateNewPackageChildResourceUIBean.resourceType.name}, a new - package must be deployed as the basis for the resource. The following information is required to - create the package."/></p> - - <table> - <c:if test="#{CreateNewPackageChildResourceUIBean.packageType.supportsArchitecture}"> - <tr> - <td align="right"><b><h:outputText value="Package Architecture #{CreateNewPackageChildResourceUIBean.packageType.supportsArchitecture}"/> </b></td> - <td align="left"> - <h:selectOneMenu value="#{CreateNewPackageChildResourceUIBean.selectedArchitectureId}"> - <f:selectItems value="#{CreateNewPackageChildResourceUIBean.architectures}" /> - </h:selectOneMenu> - </td> - </tr> - </c:if> - </table> - - <h:panelGrid columns="1" width="100%"> - rich:panel - <input type="button" - class="buttonmed" - value="UPLOAD FILE..." - onclick="javascript:open('/rhq/resource/inventory/create-file-upload.xhtml', 'uploadwin', 'titlebar=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,height=160,width=450')"/> - <rich:spacer width="5" /> - <h:outputText rendered="#{UploadNewChildPackageUIBean.fileUploaded}" - value="File Uploaded: #{UploadNewChildPackageUIBean.fileItem.fileName}"/> - </rich:panel> - </h:panelGrid> - - <h:outputText rendered="#{!ResourceUIBean.permissions.content}" - value="You do not have permissions to upload content"/> - - <onc:config configurationDefinition="#{CreateNewPackageChildResourceUIBean.configurationDefinition}" - configuration="#{CreateNewPackageChildResourceUIBean.configuration}" - nullConfigurationDefinitionMessage="#{CreateNewPackageChildResourceUIBean.nullConfigurationDefinitionMessage}" - nullConfigurationMessage="#{CreateNewPackageChildResourceUIBean.nullConfigurationMessage}"/> - - <h:panelGrid id="buttonGrid" columns="2" styleClass="buttons-table" columnClasses="button-cell"> - - <h:commandButton style="margin-top: 10px;" value="CREATE" - action="#{CreateNewPackageChildResourceUIBean.createResource}" - rendered="#{UploadNewChildPackageUIBean.fileUploaded}" - styleClass="buttonmed"> - <s:defaultAction /> - </h:commandButton> - <h:commandButton style="margin-top: 10px;" value="CREATE" - action="#{CreateNewPackageChildResourceUIBean.createResource}" - disabled="true" - rendered="#{!UploadNewChildPackageUIBean.fileUploaded}" - styleClass="buttonmed-disabled"> - <s:defaultAction /> - </h:commandButton> - - <h:commandButton style="margin-top: 10px;" value="CANCEL" - immediate="true" - action="#{CreateNewPackageChildResourceUIBean.cancel}" styleClass="buttonmed"/> - - </h:panelGrid> - - </rich:panel> - - </h:form> - -</ui:define> - -</ui:composition> - -</html> +<?xml version="1.0"?> + +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + +<ui:composition template="/rhq/resource/layout/main.xhtml"> + +<ui:param name="pageTitle" value="#{ResourceUIBean.resourceType.name} '#{ResourceUIBean.name}' - Create New Child of Type #{CreateNewPackageChildResourceUIBean.resourceType.name}"/> +<ui:param name="selectedTabName" value="Inventory.Overview"/> +<ui:define name="content"> + + <h:form id="uploadForm"> + + <input type="hidden" name="id" value="${ResourceUIBean.id}"/> + <input type="hidden" name="type" value="#{CreateNewPackageChildResourceUIBean.resourceType.id}"/> + <h:inputHidden value="#{CreateNewPackageChildResourceUIBean.packageType}" converter="PackageTypeConverter"/> + + rich:panel + + <f:facet name="header"><h:outputText value="Create New Resource"/></f:facet> + + <p><h:outputText value="In order to create a new #{CreateNewPackageChildResourceUIBean.resourceType.name}, a new + package must be deployed as the basis for the resource. The following information is required to + create the package."/></p> + + <table> + <c:if test="#{CreateNewPackageChildResourceUIBean.packageType.supportsArchitecture}"> + <tr> + <td align="right"><b><h:outputText value="Package Architecture #{CreateNewPackageChildResourceUIBean.packageType.supportsArchitecture}"/> </b></td> + <td align="left"> + <h:selectOneMenu value="#{CreateNewPackageChildResourceUIBean.selectedArchitectureId}"> + <f:selectItems value="#{CreateNewPackageChildResourceUIBean.architectures}" /> + </h:selectOneMenu> + </td> + </tr> + </c:if> + </table> + + <h:panelGrid columns="1" width="100%"> + rich:panel + <input type="button" + class="buttonmed" + value="UPLOAD FILE..." + onclick="javascript:open('/rhq/resource/inventory/create-file-upload.xhtml', 'uploadwin', 'titlebar=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,height=160,width=450')"/> + <rich:spacer width="5" /> + <h:outputText rendered="#{UploadNewChildPackageUIBean.fileUploaded}" + value="File Uploaded: #{UploadNewChildPackageUIBean.fileItem.fileName}"/> + </rich:panel> + </h:panelGrid> + + <h:outputText rendered="#{!ResourceUIBean.permissions.content}" + value="You do not have permissions to upload content"/> + + <onc:config configurationDefinition="#{CreateNewPackageChildResourceUIBean.configurationDefinition}" + configuration="#{CreateNewPackageChildResourceUIBean.configuration}" + nullConfigurationDefinitionMessage="#{CreateNewPackageChildResourceUIBean.nullConfigurationDefinitionMessage}" + nullConfigurationMessage="#{CreateNewPackageChildResourceUIBean.nullConfigurationMessage}"/> + + <h:panelGrid id="buttonGrid" columns="2" styleClass="buttons-table" columnClasses="button-cell"> + + <h:commandButton style="margin-top: 10px;" value="CREATE" + action="#{CreateNewPackageChildResourceUIBean.createResource}" + rendered="#{UploadNewChildPackageUIBean.fileUploaded}" + styleClass="buttonmed"> + <s:defaultAction /> + </h:commandButton> + <h:commandButton style="margin-top: 10px;" value="CREATE" + action="#{CreateNewPackageChildResourceUIBean.createResource}" + disabled="true" + rendered="#{!UploadNewChildPackageUIBean.fileUploaded}" + styleClass="buttonmed-disabled"> + <s:defaultAction /> + </h:commandButton> + + <h:commandButton style="margin-top: 10px;" value="CANCEL" + immediate="true" + action="#{CreateNewPackageChildResourceUIBean.cancel}" styleClass="buttonmed"/> + + </h:panelGrid> + + </rich:panel> + + </h:form> + +</ui:define> + +</ui:composition> + +</html>
commit 4f38e45658eb8128e554b212fbeee5d417d9f6ca Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 26 09:49:37 2010 -0400
LT commit
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml index 67eebb2..6687c62 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml @@ -1,101 +1,101 @@ -<?xml version="1.0"?> - -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:h="http://java.sun.com/jsf/html" - xmlns:f="http://java.sun.com/jsf/core" - xmlns:ui="http://java.sun.com/jsf/facelets" - xmlns:c="http://java.sun.com/jstl/core" - xmlns:onc="http://jboss.org/on/component" - xmlns:onf="http://jboss.org/on/function" - xmlns:s="http://jboss.com/products/seam/taglib" - xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" - xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E - -<ui:composition template="/rhq/resource/layout/main.xhtml"> - -<ui:param name="pageTitle" value="#{ResourceUIBean.resourceType.name} '#{ResourceUIBean.name}' - Create New Child of Type #{CreateNewPackageChildResourceUIBean.resourceType.name}"/> -<ui:param name="selectedTabName" value="Inventory.Overview"/> -<ui:define name="content"> - - <h:form id="uploadForm"> - - <input type="hidden" name="id" value="${ResourceUIBean.id}"/> - <input type="hidden" name="type" value="#{CreateNewPackageChildResourceUIBean.resourceType.id}"/> - <h:inputHidden value="#{CreateNewPackageChildResourceUIBean.packageType}" converter="PackageTypeConverter"/> - - rich:panel - - <f:facet name="header"><h:outputText value="Create New Resource"/></f:facet> - - <p><h:outputText value="In order to create a new #{CreateNewPackageChildResourceUIBean.resourceType.name}, a new - package must be deployed as the basis for the resource. The following information is required to - create the package."/></p> - - <table> - <c:if test="#{CreateNewPackageChildResourceUIBean.packageType.supportsArchitecture}"> - <tr> - <td align="right"><b><h:outputText value="Package Architecture #{CreateNewPackageChildResourceUIBean.packageType.supportsArchitecture}"/> </b></td> - <td align="left"> - <h:selectOneMenu value="#{CreateNewPackageChildResourceUIBean.selectedArchitectureId}"> - <f:selectItems value="#{CreateNewPackageChildResourceUIBean.architectures}" /> - </h:selectOneMenu> - </td> - </tr> - </c:if> - </table> - - <h:panelGrid columns="1" width="100%"> - rich:panel - <input type="button" - class="buttonmed" - value="UPLOAD FILE..." - onclick="javascript:open('/rhq/resource/inventory/create-file-upload.xhtml', 'uploadwin', 'titlebar=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,height=160,width=450')"/> - <rich:spacer width="5" /> - <h:outputText rendered="#{UploadNewChildPackageUIBean.fileUploaded}" - value="File Uploaded: #{UploadNewChildPackageUIBean.fileItem.fileName}"/> - </rich:panel> - </h:panelGrid> - - <h:outputText rendered="#{!ResourceUIBean.permissions.content}" - value="You do not have permissions to upload content"/> - - <onc:config configurationDefinition="#{CreateNewPackageChildResourceUIBean.configurationDefinition}" - configuration="#{CreateNewPackageChildResourceUIBean.configuration}" - nullConfigurationDefinitionMessage="#{CreateNewPackageChildResourceUIBean.nullConfigurationDefinitionMessage}" - nullConfigurationMessage="#{CreateNewPackageChildResourceUIBean.nullConfigurationMessage}"/> - - <h:panelGrid id="buttonGrid" columns="2" styleClass="buttons-table" columnClasses="button-cell"> - - <h:commandButton style="margin-top: 10px;" value="CREATE" - action="#{CreateNewPackageChildResourceUIBean.createResource}" - rendered="#{UploadNewChildPackageUIBean.fileUploaded}" - styleClass="buttonmed"> - <s:defaultAction /> - </h:commandButton> - <h:commandButton style="margin-top: 10px;" value="CREATE" - action="#{CreateNewPackageChildResourceUIBean.createResource}" - disabled="true" - rendered="#{!UploadNewChildPackageUIBean.fileUploaded}" - styleClass="buttonmed-disabled"> - <s:defaultAction /> - </h:commandButton> - - <h:commandButton style="margin-top: 10px;" value="CANCEL" - immediate="true" - action="#{CreateNewPackageChildResourceUIBean.cancel}" styleClass="buttonmed"/> - - </h:panelGrid> - - </rich:panel> - - </h:form> - -</ui:define> - -</ui:composition> - -</html> +<?xml version="1.0"?> + +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + +<ui:composition template="/rhq/resource/layout/main.xhtml"> + +<ui:param name="pageTitle" value="#{ResourceUIBean.resourceType.name} '#{ResourceUIBean.name}' - Create New Child of Type #{CreateNewPackageChildResourceUIBean.resourceType.name}"/> +<ui:param name="selectedTabName" value="Inventory.Overview"/> +<ui:define name="content"> + + <h:form id="uploadForm"> + + <input type="hidden" name="id" value="${ResourceUIBean.id}"/> + <input type="hidden" name="type" value="#{CreateNewPackageChildResourceUIBean.resourceType.id}"/> + <h:inputHidden value="#{CreateNewPackageChildResourceUIBean.packageType}" converter="PackageTypeConverter"/> + + rich:panel + + <f:facet name="header"><h:outputText value="Create New Resource"/></f:facet> + + <p><h:outputText value="In order to create a new #{CreateNewPackageChildResourceUIBean.resourceType.name}, a new + package must be deployed as the basis for the resource. The following information is required to + create the package."/></p> + + <table> + <c:if test="#{CreateNewPackageChildResourceUIBean.packageType.supportsArchitecture}"> + <tr> + <td align="right"><b><h:outputText value="Package Architecture #{CreateNewPackageChildResourceUIBean.packageType.supportsArchitecture}"/> </b></td> + <td align="left"> + <h:selectOneMenu value="#{CreateNewPackageChildResourceUIBean.selectedArchitectureId}"> + <f:selectItems value="#{CreateNewPackageChildResourceUIBean.architectures}" /> + </h:selectOneMenu> + </td> + </tr> + </c:if> + </table> + + <h:panelGrid columns="1" width="100%"> + rich:panel + <input type="button" + class="buttonmed" + value="UPLOAD FILE..." + onclick="javascript:open('/rhq/resource/inventory/create-file-upload.xhtml', 'uploadwin', 'titlebar=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,height=160,width=450')"/> + <rich:spacer width="5" /> + <h:outputText rendered="#{UploadNewChildPackageUIBean.fileUploaded}" + value="File Uploaded: #{UploadNewChildPackageUIBean.fileItem.fileName}"/> + </rich:panel> + </h:panelGrid> + + <h:outputText rendered="#{!ResourceUIBean.permissions.content}" + value="You do not have permissions to upload content"/> + + <onc:config configurationDefinition="#{CreateNewPackageChildResourceUIBean.configurationDefinition}" + configuration="#{CreateNewPackageChildResourceUIBean.configuration}" + nullConfigurationDefinitionMessage="#{CreateNewPackageChildResourceUIBean.nullConfigurationDefinitionMessage}" + nullConfigurationMessage="#{CreateNewPackageChildResourceUIBean.nullConfigurationMessage}"/> + + <h:panelGrid id="buttonGrid" columns="2" styleClass="buttons-table" columnClasses="button-cell"> + + <h:commandButton style="margin-top: 10px;" value="CREATE" + action="#{CreateNewPackageChildResourceUIBean.createResource}" + rendered="#{UploadNewChildPackageUIBean.fileUploaded}" + styleClass="buttonmed"> + <s:defaultAction /> + </h:commandButton> + <h:commandButton style="margin-top: 10px;" value="CREATE" + action="#{CreateNewPackageChildResourceUIBean.createResource}" + disabled="true" + rendered="#{!UploadNewChildPackageUIBean.fileUploaded}" + styleClass="buttonmed-disabled"> + <s:defaultAction /> + </h:commandButton> + + <h:commandButton style="margin-top: 10px;" value="CANCEL" + immediate="true" + action="#{CreateNewPackageChildResourceUIBean.cancel}" styleClass="buttonmed"/> + + </h:panelGrid> + + </rich:panel> + + </h:form> + +</ui:define> + +</ui:composition> + +</html>
commit 03050fcba7bd5a993605dbe2371b0261b6ebe9dc Merge: 06136ac... ebf1531... Author: John Mazzitelli mazz@redhat.com Date: Wed May 26 09:34:28 2010 -0400
Merge branch 'bundle'
Conflicts: modules/plugins/augeas/pom.xml
diff --cc modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java index 5513fc1,77a0f69..11f709f --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java @@@ -1278,10 -1216,24 +1278,10 @@@ public class ContentManagerBean impleme PackageVersion newPackageVersion = new PackageVersion(existingPackage, version, architecture); newPackageVersion.setDisplayName(existingPackage.getName());
- // TODO: THIS IS VERY BAD - MUST FIX - DO NOT SLURP THE ENTIRE FILE IN MEMORY - USE JDBC STREAMING - // Write the content into the newly created package version. This may eventually move, but for now we'll just - // use the byte array in the package version to store the bits. - byte[] packageBits; - try { - packageBits = StreamUtil.slurp(packageBitStream); - } catch (RuntimeException re) { - throw new RuntimeException("Error reading in the package file", re); - } + PackageBits bits = loadPackageBits(packageBitStream);
- PackageBits bits = new PackageBits(); - try { - bits.setBits(packageBits); - } catch (Exception e) { - log.error("Error savinf the package.", e); - } newPackageVersion.setPackageBits(bits); - + newPackageVersion.setFileSize((long) bits.getBits().length); newPackageVersion = persistOrMergePackageVersionSafely(newPackageVersion);
existingPackage.addVersion(newPackageVersion);
commit a8c2a3ec7422560c7853459ffb6616372ca20f5d Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 26 09:24:52 2010 -0400
LT commit
diff --git a/etc/eclipse-tools/maven/RHQ Maven Build - Agent Only.launch b/etc/eclipse-tools/maven/RHQ Maven Build - Agent Only.launch index dfdf4e3..367a1b3 100644 --- a/etc/eclipse-tools/maven/RHQ Maven Build - Agent Only.launch +++ b/etc/eclipse-tools/maven/RHQ Maven Build - Agent Only.launch @@ -1,11 +1,11 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> -<stringAttribute key="bad_container_name" value="\rhq\etc\eclipse-tools\maven"/> -<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> -</listAttribute> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${env_var:M2_HOME}/bin/${MAVEN_EXE}"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-o -Dmaven.test.skip=true -Dagent install"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/rhq}"/> -</launchConfiguration> +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> +<stringAttribute key="bad_container_name" value="\rhq\etc\eclipse-tools\maven"/> +<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> +<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> +<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> +</listAttribute> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${env_var:M2_HOME}/bin/${MAVEN_EXE}"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-o -Dmaven.test.skip=true -Dagent install"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/rhq}"/> +</launchConfiguration> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml index 6363600..2851427 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml @@ -1,68 +1,68 @@ -<?xml version="1.0"?> - -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:h="http://java.sun.com/jsf/html" - xmlns:f="http://java.sun.com/jsf/core" - xmlns:ui="http://java.sun.com/jsf/facelets" - xmlns:c="http://java.sun.com/jstl/core" - xmlns:onc="http://jboss.org/on/component" - xmlns:onf="http://jboss.org/on/function" - xmlns:s="http://jboss.com/products/seam/taglib" - xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" - xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E - -<ui:composition template="/rhq/resource/layout/main.xhtml"> - -<ui:param name="pageTitle" value="#{ResourceUIBean.resourceType.name} '#{ResourceUIBean.name}' - Create New Child of Type #{CreateNewPackageChildResourceUIBean.resourceType.name}"/> -<ui:param name="selectedTabName" value="Inventory.Overview"/> -<ui:define name="content"> - - <h:form id="uploadForm"> - - <input type="hidden" name="id" value="${ResourceUIBean.id}"/> - <input type="hidden" name="type" value="#{CreateNewPackageChildResourceUIBean.resourceType.id}"/> - <h:inputHidden value="#{CreateNewPackageChildResourceUIBean.packageType}" converter="PackageTypeConverter"/> - - rich:panel - - <f:facet name="header"><h:outputText value="Create New Resource"/></f:facet> - - <p><h:outputText value="In order to create a new #{CreateNewPackageChildResourceUIBean.resourceType.name}, a new - package must be deployed as the basis for the resource. The following information is required to - create the package."/></p> - - <table> - <c:if test="#{CreateNewPackageChildResourceUIBean.packageType.supportsArchitecture}"> - <tr> - <td align="right"><b><h:outputText value="Package Architecture #{CreateNewPackageChildResourceUIBean.packageType.supportsArchitecture}"/> </b></td> - <td align="left"> - <h:selectOneMenu value="#{CreateNewPackageChildResourceUIBean.selectedArchitectureId}"> - <f:selectItems value="#{CreateNewPackageChildResourceUIBean.architectures}" /> - </h:selectOneMenu> - </td> - </tr> - </c:if> - </table> - - <h:panelGrid columns="1" width="100%"> - rich:panel - <input type="button" - class="buttonmed" - value="UPLOAD FILE..." - onclick="javascript:open('/rhq/resource/inventory/create-file-upload.xhtml', 'uploadwin', 'titlebar=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,height=160,width=450')"/> - <rich:spacer width="5" /> - <h:outputText rendered="#{UploadNewChildPackageUIBean.fileUploaded}" - value="File Uploaded: #{UploadNewChildPackageUIBean.fileItem.fileName}"/> - </rich:panel> - </h:panelGrid> - - <h:outputText rendered="#{!ResourceUIBean.permissions.content}" - value="You do not have permissions to upload content"/> - +<?xml version="1.0"?> + +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + +<ui:composition template="/rhq/resource/layout/main.xhtml"> + +<ui:param name="pageTitle" value="#{ResourceUIBean.resourceType.name} '#{ResourceUIBean.name}' - Create New Child of Type #{CreateNewPackageChildResourceUIBean.resourceType.name}"/> +<ui:param name="selectedTabName" value="Inventory.Overview"/> +<ui:define name="content"> + + <h:form id="uploadForm"> + + <input type="hidden" name="id" value="${ResourceUIBean.id}"/> + <input type="hidden" name="type" value="#{CreateNewPackageChildResourceUIBean.resourceType.id}"/> + <h:inputHidden value="#{CreateNewPackageChildResourceUIBean.packageType}" converter="PackageTypeConverter"/> + + rich:panel + + <f:facet name="header"><h:outputText value="Create New Resource"/></f:facet> + + <p><h:outputText value="In order to create a new #{CreateNewPackageChildResourceUIBean.resourceType.name}, a new + package must be deployed as the basis for the resource. The following information is required to + create the package."/></p> + + <table> + <c:if test="#{CreateNewPackageChildResourceUIBean.packageType.supportsArchitecture}"> + <tr> + <td align="right"><b><h:outputText value="Package Architecture #{CreateNewPackageChildResourceUIBean.packageType.supportsArchitecture}"/> </b></td> + <td align="left"> + <h:selectOneMenu value="#{CreateNewPackageChildResourceUIBean.selectedArchitectureId}"> + <f:selectItems value="#{CreateNewPackageChildResourceUIBean.architectures}" /> + </h:selectOneMenu> + </td> + </tr> + </c:if> + </table> + + <h:panelGrid columns="1" width="100%"> + rich:panel + <input type="button" + class="buttonmed" + value="UPLOAD FILE..." + onclick="javascript:open('/rhq/resource/inventory/create-file-upload.xhtml', 'uploadwin', 'titlebar=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,height=160,width=450')"/> + <rich:spacer width="5" /> + <h:outputText rendered="#{UploadNewChildPackageUIBean.fileUploaded}" + value="File Uploaded: #{UploadNewChildPackageUIBean.fileItem.fileName}"/> + </rich:panel> + </h:panelGrid> + + <h:outputText rendered="#{!ResourceUIBean.permissions.content}" + value="You do not have permissions to upload content"/> + <rich:panel >
<f:facet name="header">Package Version Details</f:facet> @@ -94,39 +94,39 @@ </rich:panel>
- <onc:config configurationDefinition="#{CreateNewPackageChildResourceUIBean.configurationDefinition}" - configuration="#{CreateNewPackageChildResourceUIBean.configuration}" - nullConfigurationDefinitionMessage="#{CreateNewPackageChildResourceUIBean.nullConfigurationDefinitionMessage}" - nullConfigurationMessage="#{CreateNewPackageChildResourceUIBean.nullConfigurationMessage}"/> - - <h:panelGrid id="buttonGrid" columns="2" styleClass="buttons-table" columnClasses="button-cell"> - - <h:commandButton style="margin-top: 10px;" value="CREATE" - action="#{CreateNewPackageChildResourceUIBean.createResource}" - rendered="#{UploadNewChildPackageUIBean.fileUploaded}" - styleClass="buttonmed"> - <s:defaultAction /> - </h:commandButton> - <h:commandButton style="margin-top: 10px;" value="CREATE" - action="#{CreateNewPackageChildResourceUIBean.createResource}" - disabled="true" - rendered="#{!UploadNewChildPackageUIBean.fileUploaded}" - styleClass="buttonmed-disabled"> - <s:defaultAction /> - </h:commandButton> - - <h:commandButton style="margin-top: 10px;" value="CANCEL" - immediate="true" - action="#{CreateNewPackageChildResourceUIBean.cancel}" styleClass="buttonmed"/> - - </h:panelGrid> - - </rich:panel> - - </h:form> - -</ui:define> - -</ui:composition> - -</html> + <onc:config configurationDefinition="#{CreateNewPackageChildResourceUIBean.configurationDefinition}" + configuration="#{CreateNewPackageChildResourceUIBean.configuration}" + nullConfigurationDefinitionMessage="#{CreateNewPackageChildResourceUIBean.nullConfigurationDefinitionMessage}" + nullConfigurationMessage="#{CreateNewPackageChildResourceUIBean.nullConfigurationMessage}"/> + + <h:panelGrid id="buttonGrid" columns="2" styleClass="buttons-table" columnClasses="button-cell"> + + <h:commandButton style="margin-top: 10px;" value="CREATE" + action="#{CreateNewPackageChildResourceUIBean.createResource}" + rendered="#{UploadNewChildPackageUIBean.fileUploaded}" + styleClass="buttonmed"> + <s:defaultAction /> + </h:commandButton> + <h:commandButton style="margin-top: 10px;" value="CREATE" + action="#{CreateNewPackageChildResourceUIBean.createResource}" + disabled="true" + rendered="#{!UploadNewChildPackageUIBean.fileUploaded}" + styleClass="buttonmed-disabled"> + <s:defaultAction /> + </h:commandButton> + + <h:commandButton style="margin-top: 10px;" value="CANCEL" + immediate="true" + action="#{CreateNewPackageChildResourceUIBean.cancel}" styleClass="buttonmed"/> + + </h:panelGrid> + + </rich:panel> + + </h:form> + +</ui:define> + +</ui:composition> + +</html>
commit b81e16180565b6d38bd87c439258dc030a1433bf Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 26 09:23:20 2010 -0400
[BZ 596096] Fixed error in upgrade script
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index 4071b12..4b4ce55 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -2963,12 +2963,13 @@ </statement> </schema-directSQL> </schemaSpec> -
<schemaSpec version="2.87"> <schema-directSQL> - <statement desc="Make RHQ_RES_TYPE_IDX_PLG_NAME index unique"> - DROP INDEX RHQ_RES_TYPE_IDX_PLG_NAME ; + <statement desc="Drop non-unique RHQ_RES_TYPE_IDX_PLG_NAME index"> + DROP INDEX RHQ_RES_TYPE_IDX_PLG_NAME + </statement> + <statement desc="Recreate RHQ_RES_TYPE_IDX_PLG_NAME index as unique"> CREATE UNIQUE INDEX RHQ_RES_TYPE_IDX_PLG_NAME ON RHQ_RESOURCE_TYPE (name, plugin) </statement> </schema-directSQL>
commit 06136ac6f6ea806c3887cf2635ab0feb6b91378a Author: Simeon Pinder spinder@redhat.com Date: Wed May 26 04:22:31 2010 -0400
content synch up issue.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java index 4e16f53..468dfc2 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java @@ -69,6 +69,11 @@ import org.rhq.core.domain.resource.ProductVersion; + " AND pv.generalPackage.packageType.name = :packageTypeName " + " AND pv.generalPackage.packageType.resourceType.id = :resourceTypeId " + " AND pv.architecture.name = :architectureName " + " AND pv.version = :version "), + @NamedQuery(name = PackageVersion.QUERY_FIND_BY_PACKAGE_DETAILS_SHA, query = "SELECT pv FROM PackageVersion AS pv " + + " WHERE pv.generalPackage.name = :packageName " + + " AND pv.generalPackage.packageType.name = :packageTypeName " + " AND pv.sha256 = :sha " + + " AND pv.generalPackage.packageType.resourceType.id = :resourceTypeId " + + " AND pv.architecture.name = :architectureName " + " AND pv.version = :version "), @NamedQuery(name = PackageVersion.QUERY_FIND_ID_BY_PACKAGE_DETAILS_KEY_AND_RES_ID, query = "SELECT pv.id " + " FROM PackageVersion AS pv " + " JOIN pv.generalPackage.packageType.resourceType.resources r " + " WHERE pv.generalPackage.name = :packageName " @@ -249,6 +254,7 @@ public class PackageVersion implements Serializable { public static final String QUERY_FIND_BY_PACKAGE_SHA = "PackageVersion.findByPackageSha"; public static final String QUERY_FIND_BY_PACKAGE_SHA_RES_TYPE = "PackageVersion.findByPackageShaResType"; public static final String QUERY_FIND_BY_PACKAGE_DETAILS_KEY = "PackageVersion.findByPackageDetailsKey"; + public static final String QUERY_FIND_BY_PACKAGE_DETAILS_SHA = "PackageVersion.findByPackageDetailsSha"; public static final String QUERY_FIND_ID_BY_PACKAGE_DETAILS_KEY_AND_RES_ID = "PackageVersion.findIdByPackageDetailsKeyAndResId"; public static final String QUERY_FIND_BY_REPO_ID = "PackageVersion.findByRepoId"; public static final String QUERY_FIND_BY_REPO_ID_FILTERED = "PackageVersion.findByRepoIdFiltered"; diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java index a36770f..5513fc1 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java @@ -243,13 +243,14 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe
// See if package version already exists for the resource package Query packageVersionQuery = entityManager - .createNamedQuery(PackageVersion.QUERY_FIND_BY_PACKAGE_DETAILS_KEY); + .createNamedQuery(PackageVersion.QUERY_FIND_BY_PACKAGE_DETAILS_SHA); packageVersionQuery.setFlushMode(FlushModeType.COMMIT); packageVersionQuery.setParameter("packageName", resourcePackage.getName()); packageVersionQuery.setParameter("packageTypeName", resourcePackage.getPackageTypeName()); packageVersionQuery.setParameter("resourceTypeId", resource.getResourceType().getId()); packageVersionQuery.setParameter("architectureName", resourcePackage.getArchitectureName()); packageVersionQuery.setParameter("version", resourcePackage.getVersion()); + packageVersionQuery.setParameter("sha", resourcePackage.getSHA256());
List<PackageVersion> existingPackageVersionList = packageVersionQuery.getResultList();
commit 278fae722d5ca8ab81a5c2d77d8d7efda781dc74 Merge: bd8ee1e... fa3fb9c... Author: Simeon Pinder spinder@redhat.com Date: Wed May 26 04:21:35 2010 -0400
Merge branch 'master' of ssh://spinder@git.fedorahosted.org/git/rhq/rhq
commit bd8ee1ee291e656dfec223110ed51d0cb24d2219 Author: Simeon Pinder spinder@redhat.com Date: Wed May 26 02:51:17 2010 -0400
content: reapply ce0d8ab, sp changes, noResultException handling.
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/CreateNewPackageUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/CreateNewPackageUIBean.java index e488010..fbe9977 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/CreateNewPackageUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/CreateNewPackageUIBean.java @@ -27,6 +27,7 @@ import java.util.Map;
import javax.faces.application.FacesMessage; import javax.faces.model.SelectItem; +import javax.persistence.NoResultException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession;
@@ -80,6 +81,12 @@ public class CreateNewPackageUIBean { */ private static final String REPO_OPTION_NEW = "new";
+ /** + * Option value for no repo. This is a standalone war that may not be related to any repo. + * + */ + private static final String REPO_OPTION_NONE = "none"; + private String packageName; private String version; private int selectedArchitectureId; @@ -153,6 +160,7 @@ public class CreateNewPackageUIBean {
String repoOption = request.getParameter("repoOption"); UploadItem fileItem = uploadUIBean.getFileItem(); + boolean usingARepo = true;
// Validate if (packageName == null || packageName.trim().equals("")) { @@ -182,15 +190,21 @@ public class CreateNewPackageUIBean { return null; }
+ if (repoOption.equalsIgnoreCase(REPO_OPTION_NONE)) { + usingARepo = false; + } + // Determine which repo the package will go into String repoId = null; - try { - repoId = determineRepo(repoOption, subject, resource.getId()); - } catch (ContentException ce) { - String errorMessages = ThrowableUtil.getAllMessages(ce); - FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Failed to determine repository. Cause: " - + errorMessages); - return "failure"; + if (usingARepo) { + try { + repoId = determineRepo(repoOption, subject, resource.getId()); + } catch (ContentException ce) { + String errorMessages = ThrowableUtil.getAllMessages(ce); + FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Failed to determine repository. Cause: " + + errorMessages); + return "failure"; + } }
try { @@ -215,11 +229,9 @@ public class CreateNewPackageUIBean { workflow and we'll deal with the refactoring later. jdobies, Feb 27, 2008 */ - PackageVersion packageVersion; + PackageVersion packageVersion = null; try { ContentManagerLocal contentManager = LookupUtil.getContentManager(); - packageVersion = contentManager.createPackageVersion(packageName, packageTypeId, version, - architectureId, packageStream);
//store information about uploaded file for packageDetails as most of it is already available Map<String, String> packageUploadDetails = new HashMap<String, String>(); @@ -244,26 +256,30 @@ public class CreateNewPackageUIBean { packageVersion = contentManager.getUploadedPackageVersion(packageName, packageTypeId, version, architectureId, packageStream, packageUploadDetails, newResourceTypeId);
+ } catch (NoResultException nre) { + //eat the exception. Some of the queries return no results if no package yet exists which is fine. } catch (Exception e) { String errorMessages = ThrowableUtil.getAllMessages(e); FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Failed to create package [" + packageName - + "] in repo. Cause: " + errorMessages); + + "] in repository. Cause: " + errorMessages); return "failure"; }
int[] packageVersionList = new int[] { packageVersion.getId() };
// Add the package to the repo - try { - int iRepoId = Integer.parseInt(repoId); - - RepoManagerLocal repoManager = LookupUtil.getRepoManagerLocal(); - repoManager.addPackageVersionsToRepo(subject, iRepoId, packageVersionList); - } catch (Exception e) { - String errorMessages = ThrowableUtil.getAllMessages(e); - FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Failed to associate package [" - + packageName + "] with repository ID [" + repoId + "]. Cause: " + errorMessages); - return "failure"; + if (usingARepo) { + try { + int iRepoId = Integer.parseInt(repoId); + + RepoManagerLocal repoManager = LookupUtil.getRepoManagerLocal(); + repoManager.addPackageVersionsToRepo(subject, iRepoId, packageVersionList); + } catch (Exception e) { + String errorMessages = ThrowableUtil.getAllMessages(e); + FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Failed to associate package [" + + packageName + "] with repository ID [" + repoId + "]. Cause: " + errorMessages); + return "failure"; + } }
// Put the package ID in the session so it can fit into the deploy existing package workflow diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/CreateNewPackageChildResourceUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/CreateNewPackageChildResourceUIBean.java index a55927d..786d579 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/CreateNewPackageChildResourceUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/CreateNewPackageChildResourceUIBean.java @@ -29,6 +29,7 @@ import java.util.Map;
import javax.faces.application.FacesMessage; import javax.faces.model.SelectItem; +import javax.persistence.NoResultException;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -212,6 +213,8 @@ public class CreateNewPackageChildResourceUIBean {
}
+ } catch (NoResultException nre) { + //eat the exception. Some of the queries return no results if no package yet exists which is fine. } catch (Exception e) { String errorMessages = ThrowableUtil.getAllMessages(e); FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo.xhtml index 55fdd56..28edad0 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo.xhtml @@ -333,7 +333,6 @@ <rich:column colspan="#{param.debug ? 8 : 7}" width="100%">
- ui:remove <!-- The ability to associate/disassociate repos with content sources is not needed for JON. --> <h:commandButton action="#{RepoContentSourcesUIBean.associateWithContentProviders}" @@ -344,7 +343,6 @@ value="DISASSOCIATE SELECTED" target="selectedRepoContentProviders" styleClass="on-pager-button buttonsmall" /> - </ui:remove>
<ui:param name="paginationDataTableName" value="repoContentProvidersDataTable" /> diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java index 2136261..a36770f 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java @@ -191,27 +191,27 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe packageDiscoveredQuery.setParameter("resourceTypeId", resource.getResourceType().getId()); List<PackageVersion> discoveredPackages = packageDiscoveredQuery.getResultList(); if (discoveredPackages.size() > 0) { - //iterate over packages to determine first one with same file name - PackageVersion[] discovered = new PackageVersion[discoveredPackages.size()]; - discoveredPackages.toArray(discovered); - boolean located = false; - for (int i = 0; (!located && i < discovered.length); i++) { - packageVersion = discovered[i]; - //check that the returned file name is same as expected otherwise - //bail(bank1.war != crook1.war for auditing purposes) even though hash is equal. - if (packageVersion.getFileName().trim().equals(resourcePackage.getFileName().trim())) { - located = true; - //now assign PackageVersion details correctly - PackageDetailsKey discoveredKey = new PackageDetailsKey(packageVersion.getFileName(), - packageVersion.getVersion(), packageVersion.getGeneralPackage().getPackageType() - .getName(), resourcePackage.getArchitectureName()); - ResourcePackageDetails retrievedResourcePackage = new ResourcePackageDetails( - discoveredKey); - retrievedResourcePackage.setInstallationTimestamp(resourcePackage.getFileCreatedDate()); - //now reassign the resourcePackage to use this newly retrieved id. - resourcePackage = retrievedResourcePackage; - } - } + // //iterate over packages to determine first one with same file name + // PackageVersion[] discovered = new PackageVersion[discoveredPackages.size()]; + // discoveredPackages.toArray(discovered); + // boolean located = false; + // for (int i = 0; (!located && i < discovered.length); i++) { + // packageVersion = discovered[i]; + // //check that the returned file name is same as expected otherwise + // //bail(bank1.war != crook1.war for auditing purposes) even though hash is equal. + // if (packageVersion.getFileName().trim().equals(resourcePackage.getFileName().trim())) { + // located = true; + // //now assign PackageVersion details correctly + // PackageDetailsKey discoveredKey = new PackageDetailsKey(packageVersion.getFileName(), + // packageVersion.getVersion(), packageVersion.getGeneralPackage().getPackageType() + // .getName(), resourcePackage.getArchitectureName()); + // ResourcePackageDetails retrievedResourcePackage = new ResourcePackageDetails( + // discoveredKey); + // retrievedResourcePackage.setInstallationTimestamp(resourcePackage.getFileCreatedDate()); + // //now reassign the resourcePackage to use this newly retrieved id. + // resourcePackage = retrievedResourcePackage; + // } + // } packageVersion = discoveredPackages.get(0); //check that the returned file name is same as expected otherwise //bail(bank1.war != crook1.war for auditing purposes) even though hash is equal. @@ -1608,6 +1608,7 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe packageVersion.setSHA256(packageUploadDetails.get(ContentManagerBean.UPLOAD_SHA256)); } entityManager.merge(packageVersion); + entityManager.flush();
return packageVersion;
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java index 8b0e4d6..3ecd40f 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java @@ -30,6 +30,7 @@ import javax.ejb.Stateless; import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; import javax.persistence.EntityManager; +import javax.persistence.NoResultException; import javax.persistence.PersistenceContext; import javax.persistence.Query; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; @@ -319,7 +320,7 @@ public class ResourceFactoryManagerBean implements ResourceFactoryManagerLocal, CreateResourceHistory history = new CreateResourceHistory(parentResource, resourceType, user.getName(), (InstalledPackage) null); history.setCreatedResourceName(createResourceName); - history.setConfiguration(deploymentTimeConfiguration); + // history.setConfiguration(deploymentTimeConfiguration); history.setStatus(CreateResourceStatus.IN_PROGRESS);
entityManager.persist(history); @@ -529,6 +530,19 @@ public class ResourceFactoryManagerBean implements ResourceFactoryManagerLocal, packageVersionNumber, architectureId, packageBitStream, packageUploadDetails, newResourceTypeId); }
+ //check that Configuration is persisted correctly. + if (deploymentTimeConfiguration.getId() > 0) { + entityManager.merge(deploymentTimeConfiguration); + } else { + entityManager.persist(deploymentTimeConfiguration); + } + //check that Configuration is persisted correctly. + if (pluginConfiguration.getId() > 0) { + entityManager.merge(pluginConfiguration); + } else { + entityManager.persist(pluginConfiguration); + } + // Persist in separate transaction so it is committed immediately, before the request is sent to the agent CreateResourceHistory persistedHistory = resourceFactoryManager.persistCreateHistory(user, parentResourceId, newResourceTypeId, newResourceName, packageVersion, deploymentTimeConfiguration); @@ -544,6 +558,8 @@ public class ResourceFactoryManagerBean implements ResourceFactoryManagerLocal, AgentClient agentClient = agentManager.getAgentClient(agent); ResourceFactoryAgentService resourceFactoryAgentService = agentClient.getResourceFactoryAgentService(); resourceFactoryAgentService.createResource(request); + } catch (NoResultException nre) { + //eat the exception. Some of the queries return no results if no package yet exists which is fine. } catch (Exception e) { log.error("Error while sending create resource request to agent service", e);
commit fa3fb9ca9a441325c4d9746180933047eeddbe1f Merge: 406825b... 5e1253b... Author: John Sanda jsanda@redhat.com Date: Tue May 25 21:44:55 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 406825bb2a16302184f78dc7d0c032d22728df9a Author: John Sanda jsanda@redhat.com Date: Tue May 25 21:43:09 2010 -0400
[BZ 588700] Fixing alert dbupgrade so that rhq_config.version has a default value instead of null
diff --git a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java index bcd210c..d827f9e 100644 --- a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java +++ b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java @@ -202,8 +202,8 @@ public class CustomAlertSenderUpgradeTask implements DatabaseUpgradeTask { }
private String getInsertConfigSQL(int id) { - return "INSERT INTO rhq_config ( id, ctime, mtime )" // - + " VALUES ( " + id + ", " + NOW + ", " + NOW + " ) "; + return "INSERT INTO rhq_config ( id, version, ctime, mtime )" // + + " VALUES ( " + id + ", 0, " + NOW + ", " + NOW + " ) "; }
private String getInsertPropertySQL(int id, int configId, String name, String value) {
commit 5db6f43e511700a4de58dace6461a81b308ecc70 Author: Simeon Pinder spinder@redhat.com Date: Tue May 25 15:00:24 2010 -0400
BZ:589173: modified agent side and server side to update pkg version using Sha.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java index 4bfc1db..4e16f53 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java @@ -60,6 +60,10 @@ import org.rhq.core.domain.resource.ProductVersion; + " AND pv.architecture.id = :architectureId " + " AND pv.version = :version "), @NamedQuery(name = PackageVersion.QUERY_FIND_BY_PACKAGE_SHA, query = "SELECT pv FROM PackageVersion AS pv " + " WHERE pv.sha256 = :sha "), + @NamedQuery(name = PackageVersion.QUERY_FIND_BY_PACKAGE_SHA_RES_TYPE, query = "SELECT pv FROM PackageVersion AS pv " + + " WHERE pv.sha256 = :sha " + + " AND pv.displayName = :displayName " + + " AND pv.generalPackage.packageType.resourceType.id = :resourceTypeId "), @NamedQuery(name = PackageVersion.QUERY_FIND_BY_PACKAGE_DETAILS_KEY, query = "SELECT pv FROM PackageVersion AS pv " + " WHERE pv.generalPackage.name = :packageName " + " AND pv.generalPackage.packageType.name = :packageTypeName " @@ -243,6 +247,7 @@ public class PackageVersion implements Serializable {
public static final String QUERY_FIND_BY_PACKAGE_VER_ARCH = "PackageVersion.findByPackageVerArch"; public static final String QUERY_FIND_BY_PACKAGE_SHA = "PackageVersion.findByPackageSha"; + public static final String QUERY_FIND_BY_PACKAGE_SHA_RES_TYPE = "PackageVersion.findByPackageShaResType"; public static final String QUERY_FIND_BY_PACKAGE_DETAILS_KEY = "PackageVersion.findByPackageDetailsKey"; public static final String QUERY_FIND_ID_BY_PACKAGE_DETAILS_KEY_AND_RES_ID = "PackageVersion.findIdByPackageDetailsKeyAndResId"; public static final String QUERY_FIND_BY_REPO_ID = "PackageVersion.findByRepoId"; diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java index 9f6ff44..e46f403 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java @@ -23,6 +23,7 @@ package org.rhq.core.pc.content;
import java.io.File; +import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -39,6 +40,8 @@ import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; +import java.util.jar.Attributes; +import java.util.jar.Manifest;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -80,6 +83,7 @@ import org.rhq.core.util.MessageDigestGenerator; public class ContentManager extends AgentService implements ContainerService, ContentAgentService, ContentServices {
private static final int FACET_METHOD_TIMEOUT = 60 * 60 * 1000; // 60 minutes + public static final String RHQ_SHA256 = "RHQ-Sha256"; private final Log log = LogFactory.getLog(ContentManager.class);
/** @@ -661,24 +665,42 @@ public class ContentManager extends AgentService implements ContainerService, Co
for (ResourcePackageDetails detail : recentlyDiscoveredArray) { try { - //if the filesize of discovered package is null then it's an exploded and deployed war/ear. - if ((detail.getFileSize() == null) || (detail.getFileSize() == 0)) { - //when deployed exploded then don't calculate digest but update string with message to that effect. - //TODO: is this ok? Once exploded and run at all ... contents could be different. - detail.setSHA256("(deployed exploded. no message digest possible)"); + //only operate on .ear/.war + String currentFile = detail.getFileName(); + if (currentFile != null) { + currentFile = currentFile.toLowerCase(); } - //and for each detail where size != null or non empty ... then an un-exploded war/ear - if ((detail.getFileSize() != null) || (detail.getFileSize() > 0)) { - File localCopy = null; - if ((detail.getLocation() != null) && (!detail.getLocation().isEmpty())) { - localCopy = new File(detail.getLocation()); - //calculate md5 - String sha256 = new MessageDigestGenerator(MessageDigestGenerator.SHA_256) - .calcDigestString(localCopy); - //and attach it to the report returned to be picked up on server side in merge - detail.setSHA256(sha256); - //attach fileCreatedDate as well - detail.setInstallationTimestamp(Long.valueOf(System.currentTimeMillis())); + if (currentFile != null && (currentFile.endsWith(".ear") || currentFile.endsWith(".war"))) { + //if the filesize of discovered package is null then it's an exploded and deployed war/ear. + if ((detail.getFileSize() == null) || (detail.getFileSize() == 0)) { + //when deployed exploded then don't calculate digest but check for META-INF entry + File explodedDirectory = new File(detail.getLocation()); + File manifestFile = new File(explodedDirectory, "META-INF/MANIFEST.MF"); + Manifest manifest; + if (manifestFile.exists()) { + FileInputStream inputStream = new FileInputStream(manifestFile); + manifest = new Manifest(inputStream); + inputStream.close(); + Attributes attribs = manifest.getMainAttributes(); + String retrievedShaValue = attribs.getValue(RHQ_SHA256); + if ((retrievedShaValue != null) && (!retrievedShaValue.trim().isEmpty())) { + detail.setSHA256(retrievedShaValue); + } + } + } + //and for each detail where size != null or non empty ... then an un-exploded war/ear + else if ((detail.getFileSize() != null) || (detail.getFileSize() > 0)) { + File localCopy = null; + if ((detail.getLocation() != null) && (!detail.getLocation().isEmpty())) { + localCopy = new File(detail.getLocation()); + //calculate md5 + String sha256 = new MessageDigestGenerator(MessageDigestGenerator.SHA_256) + .calcDigestString(localCopy); + //and attach it to the report returned to be picked up on server side in merge + detail.setSHA256(sha256); + //attach fileCreatedDate as well + detail.setInstallationTimestamp(Long.valueOf(System.currentTimeMillis())); + } } } } catch (IOException iex) { diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/CreateNewPackageUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/CreateNewPackageUIBean.java index 3db7ce6..e488010 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/CreateNewPackageUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/CreateNewPackageUIBean.java @@ -21,7 +21,9 @@ package org.rhq.enterprise.gui.content; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.util.HashMap; import java.util.List; +import java.util.Map;
import javax.faces.application.FacesMessage; import javax.faces.model.SelectItem; @@ -44,9 +46,11 @@ import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceCreationDataType; import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.gui.util.FacesContextUtility; +import org.rhq.core.util.MessageDigestGenerator; import org.rhq.core.util.exception.ThrowableUtil; import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility; import org.rhq.enterprise.server.content.ContentException; +import org.rhq.enterprise.server.content.ContentManagerBean; import org.rhq.enterprise.server.content.ContentManagerLocal; import org.rhq.enterprise.server.content.ContentUIManagerLocal; import org.rhq.enterprise.server.content.RepoManagerLocal; @@ -216,6 +220,30 @@ public class CreateNewPackageUIBean { ContentManagerLocal contentManager = LookupUtil.getContentManager(); packageVersion = contentManager.createPackageVersion(packageName, packageTypeId, version, architectureId, packageStream); + + //store information about uploaded file for packageDetails as most of it is already available + Map<String, String> packageUploadDetails = new HashMap<String, String>(); + packageUploadDetails.put(ContentManagerBean.UPLOAD_FILE_SIZE, String.valueOf(fileItem.getFileSize())); + packageUploadDetails.put(ContentManagerBean.UPLOAD_FILE_INSTALL_DATE, String.valueOf(System + .currentTimeMillis())); + packageUploadDetails.put(ContentManagerBean.UPLOAD_OWNER, subject.getName()); + packageUploadDetails.put(ContentManagerBean.UPLOAD_FILE_NAME, fileItem.getFileName()); + + try {//Easier to implement here than in server side bean. Shouldn't affect performance too much. + packageUploadDetails.put(ContentManagerBean.UPLOAD_MD5, new MessageDigestGenerator( + MessageDigestGenerator.MD5).calcDigestString(fileItem.getFile())); + packageUploadDetails.put(ContentManagerBean.UPLOAD_SHA256, new MessageDigestGenerator( + MessageDigestGenerator.SHA_256).calcDigestString(fileItem.getFile())); + } catch (IOException e1) { + log.warn("Error calculating file digest(s) : " + e1.getMessage()); + e1.printStackTrace(); + } + + //TODO: need to get parent id instead right? ref to app server inst itself? + int newResourceTypeId = resource.getResourceType().getId(); + packageVersion = contentManager.getUploadedPackageVersion(packageName, packageTypeId, version, + architectureId, packageStream, packageUploadDetails, newResourceTypeId); + } catch (Exception e) { String errorMessages = ThrowableUtil.getAllMessages(e); FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Failed to create package [" + packageName diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/create.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/create.xhtml index 53f8f4d..ec32881 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/create.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/create.xhtml @@ -43,7 +43,8 @@ <h:form id="uploadForm"> <input type="hidden" name="id" value="${param.id}"/>
- <rich:panel rendered="#{CreateNewPackageUIBean.needRequestPackageDetails}"> + <!-- <rich:panel rendered="#{CreateNewPackageUIBean.needRequestPackageDetails}">--> + <rich:panel >
<f:facet name="header">New Package Details</f:facet>
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java index 507c432..2136261 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java @@ -149,8 +149,8 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe // For performance tracking long start = System.currentTimeMillis();
- log.debug("Merging [" + report.getDeployedPackages().size() + "] packages for Resource with id [" - + resourceId + "]..."); + log.debug("Merging [" + report.getDeployedPackages().size() + "] packages for Resource with id [" + resourceId + + "]...");
// Load the resource and its installed packages Resource resource = entityManager.find(Resource.class, resourceId); @@ -185,8 +185,10 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe if ((md5Value == null) || (md5Value.isEmpty())) { //query for installed packages with SHA256 Query packageDiscoveredQuery = entityManager - .createNamedQuery(PackageVersion.QUERY_FIND_BY_PACKAGE_SHA); + .createNamedQuery(PackageVersion.QUERY_FIND_BY_PACKAGE_SHA_RES_TYPE); packageDiscoveredQuery.setParameter("sha", shaValue); + packageDiscoveredQuery.setParameter("displayName", resourcePackage.getFileName()); + packageDiscoveredQuery.setParameter("resourceTypeId", resource.getResourceType().getId()); List<PackageVersion> discoveredPackages = packageDiscoveredQuery.getResultList(); if (discoveredPackages.size() > 0) { //iterate over packages to determine first one with same file name @@ -210,6 +212,17 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe resourcePackage = retrievedResourcePackage; } } + packageVersion = discoveredPackages.get(0); + //check that the returned file name is same as expected otherwise + //bail(bank1.war != crook1.war for auditing purposes) even though hash is equal. + //now assign PackageVersion details correctly + PackageDetailsKey discoveredKey = new PackageDetailsKey(packageVersion.getDisplayName(), + packageVersion.getVersion(), packageVersion.getGeneralPackage().getPackageType().getName(), + resourcePackage.getArchitectureName()); + ResourcePackageDetails retrievedResourcePackage = new ResourcePackageDetails(discoveredKey); + retrievedResourcePackage.setInstallationTimestamp(resourcePackage.getFileCreatedDate()); + //now reassign the resourcePackage to use this newly retrieved id. + resourcePackage = retrievedResourcePackage; } } } diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/deploy/AbstractDeployer.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/deploy/AbstractDeployer.java index 65f9598..8f98d9c 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/deploy/AbstractDeployer.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/deploy/AbstractDeployer.java @@ -23,11 +23,17 @@ package org.rhq.plugins.jbossas5.deploy;
import java.io.File; -import java.util.Set; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.net.URI; import java.util.Collection; +import java.util.Set; +import java.util.jar.Attributes; +import java.util.jar.Manifest;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.jboss.deployers.spi.management.KnownDeploymentTypes; import org.jboss.deployers.spi.management.ManagementView; import org.jboss.deployers.spi.management.deploy.DeploymentManager; @@ -40,6 +46,7 @@ import org.rhq.core.domain.content.transfer.ResourcePackageDetails; import org.rhq.core.domain.resource.CreateResourceStatus; import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.pluginapi.inventory.CreateResourceReport; +import org.rhq.core.util.MessageDigestGenerator; import org.rhq.plugins.jbossas5.connection.ProfileServiceConnection; import org.rhq.plugins.jbossas5.util.ConversionUtils; import org.rhq.plugins.jbossas5.util.DeploymentUtils; @@ -53,6 +60,7 @@ import org.rhq.plugins.jbossas5.util.DeploymentUtils; public abstract class AbstractDeployer implements Deployer { private static final ProfileKey FARM_PROFILE_KEY = new ProfileKey("farm"); private static final ProfileKey APPLICATIONS_PROFILE_KEY = new ProfileKey("applications"); + public static final String DEPLOYMENT_NAME_PROPERTY = "deploymentName";
private final Log log = LogFactory.getLog(this.getClass());
@@ -97,25 +105,54 @@ public abstract class AbstractDeployer implements Deployer { } if (!farmSupported) { throw new IllegalStateException("This application server instance is not a node in a cluster, " - + "so it does not support farmed deployments. Supported deployment profiles are " - + profileKeys + "."); + + "so it does not support farmed deployments. Supported deployment profiles are " + profileKeys + + "."); } if (deployExploded) { - throw new IllegalArgumentException("Deploying farmed applications in exploded form is not supported by the Profile Service."); + throw new IllegalArgumentException( + "Deploying farmed applications in exploded form is not supported by the Profile Service."); } deploymentManager.loadProfile(FARM_PROFILE_KEY); }
try { DeploymentUtils.deployArchive(deploymentManager, archiveFile, deployExploded); - } - finally { + } finally { // Make sure to switch back to the 'applications' profile if we switched to the 'farm' profile above. if (deployFarmed) { deploymentManager.loadProfile(APPLICATIONS_PROFILE_KEY); } }
+ //if deployed exploded, we need to store the sha of source package for correct versioning + if (deployExploded) { + String shaString = new MessageDigestGenerator(MessageDigestGenerator.SHA_256) + .getDigestString(archiveFile); + String deploymentName = deployTimeConfig.getSimple(DEPLOYMENT_NAME_PROPERTY).getStringValue(); + URI deployePackageURI = URI.create(deploymentName); + // e.g.: foo.war + String path = deployePackageURI.getPath(); + File location = new File(path); + //We've located the deployed + if ((location != null) && (location.isDirectory())) { + File manifestFile = new File(location, "META-INF/MANIFEST.MF"); + Manifest manifest; + if (manifestFile.exists()) { + FileInputStream inputStream = new FileInputStream(manifestFile); + manifest = new Manifest(inputStream); + inputStream.close(); + } else { + manifest = new Manifest(); + } + Attributes attribs = manifest.getMainAttributes(); + // attribs.put("RHQ-Sha256", shaString); + attribs.putValue("RHQ-Sha256", shaString); + FileOutputStream outputStream = new FileOutputStream(manifestFile); + manifest.write(outputStream); + outputStream.close(); + } + } + // Deployment was successful! createResourceReport.setResourceName(archiveName); createResourceReport.setResourceKey(archiveName); diff --git a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java index 7effdd5..4dc7a41 100644 --- a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java +++ b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java @@ -43,10 +43,11 @@ import java.util.jar.JarFile; import javax.management.MalformedObjectNameException; import javax.management.ObjectName;
+import com.jboss.jbossnetwork.product.jbpm.handlers.ControlActionFacade; +import com.jboss.jbossnetwork.product.jbpm.handlers.InPluginControlActionFacade; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.jboss.on.common.jbossas.JBPMWorkflowManager; -import org.jboss.on.common.jbossas.JBossASPaths; import org.jdom.Document; import org.jdom.Element; import org.jdom.input.SAXBuilder; @@ -62,13 +63,16 @@ import org.mc4j.ems.connection.support.ConnectionProvider; import org.mc4j.ems.connection.support.metadata.ConnectionTypeDescriptor; import org.mc4j.ems.connection.support.metadata.InternalVMTypeDescriptor;
-import org.rhq.core.domain.content.transfer.DeployPackagesResponse; -import org.rhq.core.domain.content.transfer.RemovePackagesResponse; +import org.jboss.on.common.jbossas.JBPMWorkflowManager; +import org.jboss.on.common.jbossas.JBossASPaths; + import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.PropertySimple; import org.rhq.core.domain.content.PackageDetailsKey; import org.rhq.core.domain.content.PackageType; import org.rhq.core.domain.content.transfer.DeployPackageStep; +import org.rhq.core.domain.content.transfer.DeployPackagesResponse; +import org.rhq.core.domain.content.transfer.RemovePackagesResponse; import org.rhq.core.domain.content.transfer.ResourcePackageDetails; import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.measurement.MeasurementDataNumeric; @@ -94,6 +98,7 @@ import org.rhq.core.pluginapi.support.SnapshotReportRequest; import org.rhq.core.pluginapi.support.SnapshotReportResults; import org.rhq.core.pluginapi.support.SupportFacet; import org.rhq.core.pluginapi.util.FileUtils; +import org.rhq.core.util.MessageDigestGenerator; import org.rhq.plugins.jbossas.helper.JavaSystemProperties; import org.rhq.plugins.jbossas.helper.MainDeployer; import org.rhq.plugins.jbossas.util.ConnectionFactoryConfigurationEditor; @@ -109,9 +114,6 @@ import org.rhq.plugins.jmx.JMXComponent; import org.rhq.plugins.jmx.JMXDiscoveryComponent; import org.rhq.plugins.jmx.ObjectNameQueryUtility;
-import com.jboss.jbossnetwork.product.jbpm.handlers.ControlActionFacade; -import com.jboss.jbossnetwork.product.jbpm.handlers.InPluginControlActionFacade; - /** * Supports JBoss 3.2.3 through 4.2.x * @@ -261,7 +263,7 @@ public class JBossASServerComponent implements MeasurementFacet, OperationFacet,
this.logFileEventDelegate = new LogFileEventResourceComponentHelper(this.resourceContext); this.logFileEventDelegate.startLogFileEventPollers(); - + // prepare to perform async avail checking String availCheckPeriodProp = pluginConfig.getSimpleValue(AVAIL_CHECK_PERIOD_CONFIG_PROP, null); if (availCheckPeriodProp != null) { @@ -279,7 +281,7 @@ public class JBossASServerComponent implements MeasurementFacet, OperationFacet, } }
- return; + return; }
public void stop() { @@ -319,12 +321,12 @@ public class JBossASServerComponent implements MeasurementFacet, OperationFacet, // A different server must have been started on our JNP URL - this is definitely something about which // the user should be informed. if (!this.loggedHijackedJnpUrlError) { - String namingURL = this.resourceContext.getPluginConfiguration(). - getSimpleValue(NAMING_URL_CONFIG_PROP, null); + String namingURL = this.resourceContext.getPluginConfiguration().getSimpleValue( + NAMING_URL_CONFIG_PROP, null); String message = "Availability check for JBoss AS Resource with configPath [" + this.configPath - + "] has connected to a different running JBoss AS instance which is installed at [" - + serverHomeViaJnp + "] using namingURL [" + namingURL - + "] - returning AvailabilityType.DOWN..."; + + "] has connected to a different running JBoss AS instance which is installed at [" + + serverHomeViaJnp + "] using namingURL [" + namingURL + + "] - returning AvailabilityType.DOWN..."; log.error(message); this.loggedHijackedJnpUrlError = true; // Throw an exception, so the PC can send the message to the Server for display in the GUI. @@ -343,7 +345,7 @@ public class JBossASServerComponent implements MeasurementFacet, OperationFacet, File serverHomeViaJnp; EmsAttribute serverHomeDirAttrib = bean.getAttribute("ServerHomeDir"); if (serverHomeDirAttrib != null) { - serverHomeViaJnp = (File)serverHomeDirAttrib.refresh(); + serverHomeViaJnp = (File) serverHomeDirAttrib.refresh(); } else { // We have a non-null MBean but a null ServerHomeDir attribute. This most likely means we're // connected to a JBoss 5.x or 6.x instance, because in those versions the ServerConfig MBean no @@ -356,12 +358,12 @@ public class JBossASServerComponent implements MeasurementFacet, OperationFacet, return serverHomeViaJnp; }
- private static File toFile(URL url) { + private static File toFile(URL url) { File file; try { - file = new File(url.toURI()); - } catch(URISyntaxException e) { - file = new File(url.getPath()); + file = new File(url.toURI()); + } catch (URISyntaxException e) { + file = new File(url.getPath()); } return file; } @@ -456,8 +458,8 @@ public class JBossASServerComponent implements MeasurementFacet, OperationFacet, public SnapshotReportResults getSnapshotReport(SnapshotReportRequest request) throws Exception { Configuration pluginConfig = resourceContext.getPluginConfiguration(); String tmpDir = resourceContext.getTemporaryDirectory().getAbsolutePath(); - JBossASSnapshotReport report = new JBossASSnapshotReport(request.getName(), request.getDescription(), pluginConfig, this.configPath - .getCanonicalPath(), tmpDir); + JBossASSnapshotReport report = new JBossASSnapshotReport(request.getName(), request.getDescription(), + pluginConfig, this.configPath.getCanonicalPath(), tmpDir); File reportFile = report.generate(); InputStream inputStream = new BufferedInputStream(new FileInputStream(reportFile)); SnapshotReportResults results = new SnapshotReportResults(inputStream); @@ -895,7 +897,8 @@ public class JBossASServerComponent implements MeasurementFacet, OperationFacet, }
InputStream isForTempDir = new BufferedInputStream(new FileInputStream(tempFile)); - deployer.createContent(details, isForTempDir, !zip, createBackup); + String shaString = new MessageDigestGenerator(MessageDigestGenerator.SHA_256).getDigestString(tempFile); + deployer.createContent(details, isForTempDir, !zip, createBackup, shaString);
String vhost = null; if (resourceTypeName.equals(RESOURCE_TYPE_WAR)) { diff --git a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/util/FileContentDelegate.java b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/util/FileContentDelegate.java index 331dc56..4f112b3 100644 --- a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/util/FileContentDelegate.java +++ b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/util/FileContentDelegate.java @@ -1,55 +1,58 @@ - /* - * Jopr Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * 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.jbossas.util; - - import java.io.BufferedInputStream; - import java.io.File; - import java.io.FileInputStream; - import java.io.FileNotFoundException; - import java.io.IOException; - import java.io.InputStream; - import java.util.Set; - - import org.apache.commons.logging.Log; - import org.apache.commons.logging.LogFactory; - - import org.rhq.core.domain.content.PackageDetails; - import org.rhq.core.domain.content.PackageDetailsKey; - import org.rhq.core.domain.content.transfer.ResourcePackageDetails; - import org.rhq.core.pluginapi.util.FileUtils; - import org.rhq.core.util.ZipUtil; - import org.rhq.core.util.file.FileUtil; - - /** - * Delegate class used for manipulating artifacts in a JON plugin. +/* + * Jopr Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * 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. * - * @author Greg Hinkle - * @author Jason Dobies + * 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.jbossas.util; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Set; +import java.util.jar.Attributes; +import java.util.jar.Manifest; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import org.rhq.core.domain.content.PackageDetails; +import org.rhq.core.domain.content.PackageDetailsKey; +import org.rhq.core.domain.content.transfer.ResourcePackageDetails; +import org.rhq.core.pluginapi.util.FileUtils; +import org.rhq.core.util.ZipUtil; +import org.rhq.core.util.file.FileUtil; + +/** +* Delegate class used for manipulating artifacts in a JON plugin. +* +* @author Greg Hinkle +* @author Jason Dobies +*/ public class FileContentDelegate { // Attributes --------------------------------------------
- private Log log = LogFactory.getLog(FileContentDelegate.class); + private Log log = LogFactory.getLog(FileContentDelegate.class);
protected File directory;
@@ -85,17 +88,34 @@ public class FileContentDelegate { * @param details describes the package being created * @param content content to be written for the package. NOTE this Stream will be closed by this method. * @param unzip if <code>true</code>, the content stream will be treated like a ZIP file and be unzipped as -* it is written, using the package name as the base directory; if <code>false</code> the + * it is written, using the package name as the base directory; if <code>false</code> the * @param createBackup If <code>true</code>, the original file will be backed up to file.bak + * @param shaString the SHA-256 of the specified input stream */ - public void createContent(PackageDetails details, InputStream content, boolean unzip, boolean createBackup) { + public void createContent(PackageDetails details, InputStream content, boolean unzip, boolean createBackup, + String shaString) { File contentFile = getPath(details); try { if (createBackup) { - moveToBackup(contentFile,".bak"); + moveToBackup(contentFile, ".bak"); } if (unzip) { ZipUtil.unzipFile(content, contentFile); + File manifestFile = new File(contentFile, "META-INF/MANIFEST.MF"); + Manifest manifest; + if (manifestFile.exists()) { + FileInputStream inputStream = new FileInputStream(manifestFile); + manifest = new Manifest(inputStream); + inputStream.close(); + } else { + manifest = new Manifest(); + } + Attributes attribs = manifest.getMainAttributes(); + // attribs.put("RHQ-Sha256", shaString); + attribs.putValue("RHQ-Sha256", shaString); + FileOutputStream outputStream = new FileOutputStream(manifestFile); + manifest.write(outputStream); + outputStream.close(); } else { FileUtil.writeFile(content, contentFile); } @@ -105,25 +125,25 @@ public class FileContentDelegate { } }
- /** - * Try to move the passed contentFile to a backup named contentFile + suffix - * @param contentFile File object pointing to the original file - * @param suffix the suffix to tack on - */ - private void moveToBackup(File contentFile, String suffix) { - - File backupFile = new File(contentFile.getAbsolutePath() + suffix); - if (backupFile.exists()) { - // remove - if (!backupFile.delete()) - log.warn("Removing of old backup file " + backupFile + " failed "); - } - if (!contentFile.renameTo(backupFile)) { - log.warn("Moving " + contentFile + " to backup " + backupFile + " failed"); - } - } - - public File getPath(PackageDetails details) { + /** + * Try to move the passed contentFile to a backup named contentFile + suffix + * @param contentFile File object pointing to the original file + * @param suffix the suffix to tack on + */ + private void moveToBackup(File contentFile, String suffix) { + + File backupFile = new File(contentFile.getAbsolutePath() + suffix); + if (backupFile.exists()) { + // remove + if (!backupFile.delete()) + log.warn("Removing of old backup file " + backupFile + " failed "); + } + if (!contentFile.renameTo(backupFile)) { + log.warn("Moving " + contentFile + " to backup " + backupFile + " failed"); + } + } + + public File getPath(PackageDetails details) { /* JBNADM-2022 - It still needs to be determined if it is the responsibility of the plugin container or the * plugin to be concerned with path information in the package name. For now, it's the plugin's * responsibility. We strip out the path information to keep control of where the JARs are @@ -174,10 +194,8 @@ public class FileContentDelegate {
try { FileUtils.purge(contentFile, true); - } - catch (IOException e) { - throw new RuntimeException("Failed to delete underlying file [" + contentFile + "] for " + details - + ".", e); + } catch (IOException e) { + throw new RuntimeException("Failed to delete underlying file [" + contentFile + "] for " + details + ".", e); } }
@@ -188,4 +206,4 @@ public class FileContentDelegate { */ return null; } - } \ No newline at end of file +} \ No newline at end of file
commit 123f9e9cd6a5da9f966c8e0d3f0814478459a34e Author: Simeon Pinder spinder@redhat.com Date: Fri May 21 16:49:58 2010 -0400
BZ-583104: populate install date details for content.
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java index e993082..9f6ff44 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java @@ -677,6 +677,8 @@ public class ContentManager extends AgentService implements ContainerService, Co .calcDigestString(localCopy); //and attach it to the report returned to be picked up on server side in merge detail.setSHA256(sha256); + //attach fileCreatedDate as well + detail.setInstallationTimestamp(Long.valueOf(System.currentTimeMillis())); } } } catch (IOException iex) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java index bd6d933..507c432 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java @@ -183,20 +183,33 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe //discovered with created String md5Value = resourcePackage.getMD5(); if ((md5Value == null) || (md5Value.isEmpty())) { - //query for installed packages with SHA256, we'll grab first one. All identical. + //query for installed packages with SHA256 Query packageDiscoveredQuery = entityManager .createNamedQuery(PackageVersion.QUERY_FIND_BY_PACKAGE_SHA); packageDiscoveredQuery.setParameter("sha", shaValue); List<PackageVersion> discoveredPackages = packageDiscoveredQuery.getResultList(); if (discoveredPackages.size() > 0) { - packageVersion = discoveredPackages.get(0); - //now assign PackageVersion details correctly - PackageDetailsKey discoveredKey = new PackageDetailsKey(packageVersion.getFileName(), - packageVersion.getVersion(), packageVersion.getGeneralPackage().getPackageType().getName(), - resourcePackage.getArchitectureName()); - ResourcePackageDetails retrievedResourcePackage = new ResourcePackageDetails(discoveredKey); - //now reassign the resourcePackage to use this newly retrieved id. - resourcePackage = retrievedResourcePackage; + //iterate over packages to determine first one with same file name + PackageVersion[] discovered = new PackageVersion[discoveredPackages.size()]; + discoveredPackages.toArray(discovered); + boolean located = false; + for (int i = 0; (!located && i < discovered.length); i++) { + packageVersion = discovered[i]; + //check that the returned file name is same as expected otherwise + //bail(bank1.war != crook1.war for auditing purposes) even though hash is equal. + if (packageVersion.getFileName().trim().equals(resourcePackage.getFileName().trim())) { + located = true; + //now assign PackageVersion details correctly + PackageDetailsKey discoveredKey = new PackageDetailsKey(packageVersion.getFileName(), + packageVersion.getVersion(), packageVersion.getGeneralPackage().getPackageType() + .getName(), resourcePackage.getArchitectureName()); + ResourcePackageDetails retrievedResourcePackage = new ResourcePackageDetails( + discoveredKey); + retrievedResourcePackage.setInstallationTimestamp(resourcePackage.getFileCreatedDate()); + //now reassign the resourcePackage to use this newly retrieved id. + resourcePackage = retrievedResourcePackage; + } + } } } }
commit c7a3cd80a75f9f5141a5a95553906eb4e361d134 Author: Simeon Pinder spinder@redhat.com Date: Thu May 20 16:10:29 2010 -0400
BZ-589193: numerous changes for details of content uploaded. UI + mergeDiscovery + agent side.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java index 42e7605..4bfc1db 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java @@ -58,6 +58,8 @@ import org.rhq.core.domain.resource.ProductVersion; @NamedQuery(name = PackageVersion.QUERY_FIND_BY_PACKAGE_VER_ARCH, query = "SELECT pv FROM PackageVersion AS pv " + " WHERE pv.generalPackage.name = :name " + " AND pv.generalPackage.packageType.id = :packageTypeId " + " AND pv.architecture.id = :architectureId " + " AND pv.version = :version "), + @NamedQuery(name = PackageVersion.QUERY_FIND_BY_PACKAGE_SHA, query = "SELECT pv FROM PackageVersion AS pv " + + " WHERE pv.sha256 = :sha "), @NamedQuery(name = PackageVersion.QUERY_FIND_BY_PACKAGE_DETAILS_KEY, query = "SELECT pv FROM PackageVersion AS pv " + " WHERE pv.generalPackage.name = :packageName " + " AND pv.generalPackage.packageType.name = :packageTypeName " @@ -240,6 +242,7 @@ public class PackageVersion implements Serializable { private static final long serialVersionUID = 1L;
public static final String QUERY_FIND_BY_PACKAGE_VER_ARCH = "PackageVersion.findByPackageVerArch"; + public static final String QUERY_FIND_BY_PACKAGE_SHA = "PackageVersion.findByPackageSha"; public static final String QUERY_FIND_BY_PACKAGE_DETAILS_KEY = "PackageVersion.findByPackageDetailsKey"; public static final String QUERY_FIND_ID_BY_PACKAGE_DETAILS_KEY_AND_RES_ID = "PackageVersion.findIdByPackageDetailsKeyAndResId"; public static final String QUERY_FIND_BY_REPO_ID = "PackageVersion.findByRepoId"; diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/transfer/ResourcePackageDetails.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/transfer/ResourcePackageDetails.java index 01e313d..c1440cc 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/transfer/ResourcePackageDetails.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/transfer/ResourcePackageDetails.java @@ -1,25 +1,25 @@ - /* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * 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. - */ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * 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.domain.content.transfer;
import org.rhq.core.domain.configuration.Configuration; @@ -67,5 +67,3 @@ public class ResourcePackageDetails extends PackageDetails { this.installationTimestamp = installationTimestamp; } } - - diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java index 1e2f6c8..e993082 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java @@ -22,8 +22,11 @@ */ package org.rhq.core.pc.content;
+import java.io.File; +import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; import java.util.List; @@ -45,15 +48,15 @@ import org.rhq.core.clientapi.agent.content.ContentAgentService; import org.rhq.core.clientapi.server.content.ContentDiscoveryReport; import org.rhq.core.clientapi.server.content.ContentServerService; import org.rhq.core.clientapi.server.content.DeletePackagesRequest; -import org.rhq.core.domain.content.transfer.DeployPackagesResponse; -import org.rhq.core.domain.content.transfer.RemovePackagesResponse; +import org.rhq.core.clientapi.server.content.DeployPackagesRequest; +import org.rhq.core.clientapi.server.content.RetrievePackageBitsRequest; import org.rhq.core.domain.content.PackageDetailsKey; import org.rhq.core.domain.content.PackageType; import org.rhq.core.domain.content.composite.PackageVersionMetadataComposite; import org.rhq.core.domain.content.transfer.DeployPackageStep; -import org.rhq.core.clientapi.server.content.DeployPackagesRequest; +import org.rhq.core.domain.content.transfer.DeployPackagesResponse; +import org.rhq.core.domain.content.transfer.RemovePackagesResponse; import org.rhq.core.domain.content.transfer.ResourcePackageDetails; -import org.rhq.core.clientapi.server.content.RetrievePackageBitsRequest; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.domain.util.PageControl; @@ -72,6 +75,7 @@ import org.rhq.core.pc.util.LoggingThreadFactory; import org.rhq.core.pluginapi.content.ContentContext; import org.rhq.core.pluginapi.content.ContentFacet; import org.rhq.core.pluginapi.content.ContentServices; +import org.rhq.core.util.MessageDigestGenerator;
public class ContentManager extends AgentService implements ContainerService, ContentAgentService, ContentServices {
@@ -264,11 +268,11 @@ public class ContentManager extends AgentService implements ContainerService, Co OutputStream outputStream, boolean resourceExists) { ContentContextImpl contextImpl = (ContentContextImpl) context; // this has to be of this type, we gave it to the plugin ContentServerService serverService = getContentServerService(); - + //we need to load the content to server before we will start download the content // it is because of timeout on remoteStreams serverService.preLoadRemoteContent(contextImpl.getResourceId(), packageDetailsKey); - + outputStream = remoteOutputStream(outputStream); long count = 0; if (resourceExists) { @@ -612,6 +616,8 @@ public class ContentManager extends AgentService implements ContainerService, Co if (log.isDebugEnabled()) { log.debug("Found [" + updatedPackageSet.size() + "] new packages for resource id [" + resourceId + "]"); } + //from set of new packages discovered, iterate through pkg details to get information for pkg version mapping. + updatedPackageSet = updateResourcePackageDetails(updatedPackageSet); }
// Add new content (yes, existingInstalledPackagesSet is same as details, but use the container's reference) @@ -641,6 +647,52 @@ public class ContentManager extends AgentService implements ContainerService, Co return report; }
+ /** Goes through newly discovered packages and calculates SHA256 for the packages discovered, updating + * ResourcePackageDetails in the process. + * + * @param discoveredPackageSet + * @return updated discoveredPackageSet + */ + private Set<ResourcePackageDetails> updateResourcePackageDetails(Set<ResourcePackageDetails> discoveredPackageSet) { + if (discoveredPackageSet != null && discoveredPackageSet.size() > 0) { + //iterate through pkg details list + ResourcePackageDetails list[] = new ResourcePackageDetails[discoveredPackageSet.size()]; + ResourcePackageDetails[] recentlyDiscoveredArray = discoveredPackageSet.toArray(list); + + for (ResourcePackageDetails detail : recentlyDiscoveredArray) { + try { + //if the filesize of discovered package is null then it's an exploded and deployed war/ear. + if ((detail.getFileSize() == null) || (detail.getFileSize() == 0)) { + //when deployed exploded then don't calculate digest but update string with message to that effect. + //TODO: is this ok? Once exploded and run at all ... contents could be different. + detail.setSHA256("(deployed exploded. no message digest possible)"); + } + //and for each detail where size != null or non empty ... then an un-exploded war/ear + if ((detail.getFileSize() != null) || (detail.getFileSize() > 0)) { + File localCopy = null; + if ((detail.getLocation() != null) && (!detail.getLocation().isEmpty())) { + localCopy = new File(detail.getLocation()); + //calculate md5 + String sha256 = new MessageDigestGenerator(MessageDigestGenerator.SHA_256) + .calcDigestString(localCopy); + //and attach it to the report returned to be picked up on server side in merge + detail.setSHA256(sha256); + } + } + } catch (IOException iex) { + //log exception but move on, discovery happens often. No reason to hold up anything. + if (log.isDebugEnabled()) { + log.debug("Problem calculating digest of package [" + detail.getName() + "]." + + iex.getMessage()); + } + } + } + discoveredPackageSet.clear(); + discoveredPackageSet.addAll(Arrays.asList(recentlyDiscoveredArray)); + } + return discoveredPackageSet; + } + /** * Returns the <code>ContentFacet</code> for the component associated with the specified resource ID. * @@ -704,4 +756,4 @@ public class ContentManager extends AgentService implements ContainerService, Co } } } -} +} diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/RetrieveContentBitsRunner.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/RetrieveContentBitsRunner.java index f260137..e9a82de 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/RetrieveContentBitsRunner.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/RetrieveContentBitsRunner.java @@ -1,38 +1,41 @@ - /* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * 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. - */ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * 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.pc.content;
import java.io.InputStream; + import org.rhq.core.clientapi.server.content.ContentServerService; import org.rhq.core.clientapi.server.content.ContentServiceResponse; import org.rhq.core.clientapi.server.content.RetrievePackageBitsRequest; import org.rhq.core.domain.content.ContentRequestStatus; +import org.rhq.core.domain.content.transfer.ResourcePackageDetails; +import org.rhq.core.util.MessageDigestGenerator;
- /** - * Runnable implementation to allow threaded requests to get a package content. - * - * @author Jason Dobies - */ +/** +* Runnable implementation to allow threaded requests to get a package content. +* +* @author Jason Dobies +*/ public class RetrieveContentBitsRunner implements Runnable { // Attributes --------------------------------------------
@@ -78,5 +81,24 @@ public class RetrieveContentBitsRunner implements Runnable { if (serverService != null) { serverService.completeRetrievePackageBitsRequest(response, inputStream); } + ResourcePackageDetails pkgDetails = request.getPackageDetails(); + if ((pkgDetails != null) && ((pkgDetails.getSHA256() == null) || (pkgDetails.getSHA256().trim().isEmpty()))) { + InputStream is; + try { + is = contentManager.performGetPackageBits(request.getResourceId(), request.getPackageDetails()); + pkgDetails.setSHA256(new MessageDigestGenerator(MessageDigestGenerator.SHA_256).calcDigestString(is)); + } catch (Exception e) { + e.printStackTrace(); + } + } + if ((pkgDetails != null) && ((pkgDetails.getMD5() == null) || (pkgDetails.getMD5().trim().isEmpty()))) { + InputStream is; + try { + is = contentManager.performGetPackageBits(request.getResourceId(), request.getPackageDetails()); + pkgDetails.setMD5((new MessageDigestGenerator(MessageDigestGenerator.MD5).calcDigestString(is))); + } catch (Exception e) { + e.printStackTrace(); + } + } } } \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/ListPackageHistoryUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/ListPackageHistoryUIBean.java index 354c60c..845c60d 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/ListPackageHistoryUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/ListPackageHistoryUIBean.java @@ -27,6 +27,9 @@ import javax.faces.model.DataModel; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
+import org.rhq.core.clientapi.util.units.UnitNumber; +import org.rhq.core.clientapi.util.units.UnitsConstants; +import org.rhq.core.clientapi.util.units.UnitsFormat; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; import org.rhq.core.domain.content.InstalledPackage; @@ -36,9 +39,6 @@ import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; import org.rhq.core.gui.util.FacesContextUtility; -import org.rhq.core.clientapi.util.units.UnitsFormat; -import org.rhq.core.clientapi.util.units.UnitNumber; -import org.rhq.core.clientapi.util.units.UnitsConstants; import org.rhq.enterprise.gui.common.framework.PagedDataTableUIBean; import org.rhq.enterprise.gui.common.paging.PageControlView; import org.rhq.enterprise.gui.common.paging.PagedListDataModel; @@ -103,6 +103,7 @@ public class ListPackageHistoryUIBean extends PagedDataTableUIBean { private List<PackageTableDataValue> toCombinedValues(InstalledPackage current, InstalledPackage old) { List<PackageTableDataValue> results = new ArrayList<PackageTableDataValue>();
+ // current.getPackageVersion(); results.add(new PackageTableDataValue("Name", current.getPackageVersion().getGeneralPackage().getName(), null)); results.add(new PackageTableDataValue("Version", current.getPackageVersion().getDisplayVersion(), ((old != null) ? old.getPackageVersion().getDisplayVersion() : null))); @@ -113,18 +114,21 @@ public class ListPackageHistoryUIBean extends PagedDataTableUIBean { (old != null) ? ((old.getPackageVersion().getFileSize() != null) ? old.getPackageVersion().getFileName() : null) : null));
- long fileSizeBytes = (current.getPackageVersion().getFileSize() != null) ? current.getPackageVersion().getFileSize() : 0; - long oldFileSizeBytes = (old != null) ? ((old.getPackageVersion().getFileSize() != null) ? old.getPackageVersion().getFileSize() : 0) : 0; - results.add(new PackageTableDataValue("File Size", - UnitsFormat.format(new UnitNumber(fileSizeBytes, UnitsConstants.UNIT_BYTES)).toString(), - UnitsFormat.format(new UnitNumber(oldFileSizeBytes, UnitsConstants.UNIT_BYTES)).toString())); + long fileSizeBytes = (current.getPackageVersion().getFileSize() != null) ? current.getPackageVersion() + .getFileSize() : 0; + long oldFileSizeBytes = (old != null) ? ((old.getPackageVersion().getFileSize() != null) ? old + .getPackageVersion().getFileSize() : 0) : 0; + results.add(new PackageTableDataValue("File Size", UnitsFormat.format( + new UnitNumber(fileSizeBytes, UnitsConstants.UNIT_BYTES)).toString(), UnitsFormat.format( + new UnitNumber(oldFileSizeBytes, UnitsConstants.UNIT_BYTES)).toString()));
results.add(new PackageTableDataValue("SHA256", current.getPackageVersion().getSHA256(), ((old != null) ? old .getPackageVersion().getSHA256() : null))); - results.add(new PackageTableDataValue("Installation Date", dateToString(current.getInstallationDate()), - dateToString((old != null) ? old.getInstallationDate() : null))); - results.add(new PackageTableDataValue("Owner", (current.getUser() != null) ? current.getUser().toString() - : null, (old != null) ? ((old.getUser() != null) ? old.getUser().toString() : null) : null)); + results.add(new PackageTableDataValue("Installation Date", dateToString(current.getPackageVersion() + .getFileCreatedDate()), dateToString((old != null) ? old.getPackageVersion().getFileCreatedDate() : null))); + //Comment for now. This field is not even in the list of InstalledPackage fields + //results.add(new PackageTableDataValue("Owner", (current.getUser() != null) ? current.getUser().toString() + // : null, (old != null) ? ((old.getUser() != null) ? old.getUser().toString() : null) : null));
// TODO: figure out how to know if the content is available /* diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/CreateNewPackageChildResourceUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/CreateNewPackageChildResourceUIBean.java index 16b8896..a55927d 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/CreateNewPackageChildResourceUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/CreateNewPackageChildResourceUIBean.java @@ -23,7 +23,9 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map;
import javax.faces.application.FacesMessage; import javax.faces.model.SelectItem; @@ -46,11 +48,14 @@ import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; import org.rhq.core.gui.configuration.ConfigurationMaskingUtility; import org.rhq.core.gui.util.FacesContextUtility; +import org.rhq.core.util.MessageDigestGenerator; import org.rhq.core.util.exception.ThrowableUtil; import org.rhq.enterprise.gui.legacy.ParamConstants; import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility; import org.rhq.enterprise.server.configuration.ConfigurationManagerLocal; +import org.rhq.enterprise.server.content.ContentManagerBean; import org.rhq.enterprise.server.content.ContentManagerLocal; +import org.rhq.enterprise.server.content.ContentUIManagerLocal; import org.rhq.enterprise.server.resource.ResourceFactoryManagerLocal; import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal; import org.rhq.enterprise.server.resource.ResourceTypeNotFoundException; @@ -78,6 +83,10 @@ public class CreateNewPackageChildResourceUIBean { private ResourceType resourceType; private PackageType packageType;
+ private String packageName; + private String version = "1.0";//default it to 1.0 + private int selectedPackageTypeId; + private int selectedArchitectureId;
private CreateResourceHistory retryCreateItem; @@ -105,11 +114,37 @@ public class CreateNewPackageChildResourceUIBean { uploadUIBean = FacesContextUtility.getManagedBean(UploadNewChildPackageUIBean.class); UploadItem fileItem = uploadUIBean.getFileItem();
+ //store information about uploaded file for packageDetails as most of it is already available + Map<String, String> packageUploadDetails = new HashMap<String, String>(); + packageUploadDetails.put(ContentManagerBean.UPLOAD_FILE_SIZE, String.valueOf(fileItem.getFileSize())); + packageUploadDetails.put(ContentManagerBean.UPLOAD_FILE_INSTALL_DATE, String + .valueOf(System.currentTimeMillis())); + packageUploadDetails.put(ContentManagerBean.UPLOAD_OWNER, user.getName()); + packageUploadDetails.put(ContentManagerBean.UPLOAD_FILE_NAME, fileItem.getFileName()); + + try {//Easier to implement here than in server side bean. Shouldn't affect performance too much. + packageUploadDetails.put(ContentManagerBean.UPLOAD_MD5, new MessageDigestGenerator( + MessageDigestGenerator.MD5).calcDigestString(fileItem.getFile())); + packageUploadDetails.put(ContentManagerBean.UPLOAD_SHA256, new MessageDigestGenerator( + MessageDigestGenerator.SHA_256).calcDigestString(fileItem.getFile())); + } catch (IOException e1) { + log.warn("Error calculating file digest(s) : " + e1.getMessage()); + e1.printStackTrace(); + } + // Validate if ((fileItem == null) || fileItem.getFile() == null) { FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "A package file must be uploaded"); return null; } + if ((getVersion() == null) || (getVersion().trim().length() == 0)) {//version + FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "A package version must be specified."); + return null; + } + if ((getSelectedPackageTypeId() < 0) || (getVersion().trim().length() == 0)) {//type + FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "A package type must be specified."); + return null; + }
ConfigurationManagerLocal configurationManager = LookupUtil.getConfigurationManager(); ConfigurationDefinition pluginConfigurationDefinition = configurationManager @@ -132,6 +167,9 @@ public class CreateNewPackageChildResourceUIBean { return OUTCOME_SUCCESS_OR_FAILURE; }
+ //pull in archictecture selection + selectedArchitectureId = getSelectedArchitectureId(); + // If the type does not support architectures, load the no architecture entity and use that if (!packageType.isSupportsArchitecture()) { ContentManagerLocal contentManager = LookupUtil.getContentManager(); @@ -160,9 +198,20 @@ public class CreateNewPackageChildResourceUIBean {
// RHQ-666 - Changed to not request the resource name from the user; simply pass null // JON 2.0 RC3 - use timestamp versioning; pass null for version - resourceFactoryManager.createResource(user, parentResource.getId(), getResourceTypeId(), null, - pluginConfiguration, packageName, null, selectedArchitectureId, deployTimeConfiguration, - packageContentStream); + // resourceFactoryManager.createResource(user, parentResource.getId(), getResourceTypeId(), null, + // pluginConfiguration, packageName, null, selectedArchitectureId, deployTimeConfiguration, + // packageContentStream); + if (packageUploadDetails != null) { + resourceFactoryManager.createResource(user, parentResource.getId(), getResourceTypeId(), null, + pluginConfiguration, packageName, getVersion(), selectedArchitectureId, + deployTimeConfiguration, packageContentStream, packageUploadDetails); + } else { + resourceFactoryManager.createResource(user, parentResource.getId(), getResourceTypeId(), null, + pluginConfiguration, packageName, null, selectedArchitectureId, deployTimeConfiguration, + packageContentStream); + + } + } catch (Exception e) { String errorMessages = ThrowableUtil.getAllMessages(e); FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, @@ -355,4 +404,45 @@ public class CreateNewPackageChildResourceUIBean { ParamConstants.RESOURCE_TYPE_ID_PARAM); } } + + public String getPackageName() { + return packageName; + } + + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public int getSelectedPackageTypeId() { + return selectedPackageTypeId; + } + + public void setSelectedPackageTypeId(int selectedPackageTypeId) { + this.selectedPackageTypeId = selectedPackageTypeId; + } + + public SelectItem[] getPackageTypes() { + Resource resource = EnterpriseFacesContextUtility.getResource(); + + ContentUIManagerLocal contentUIManager = LookupUtil.getContentUIManager(); + List<PackageType> packageTypes = contentUIManager.getPackageTypes(resource.getResourceType().getId()); + + SelectItem[] items = new SelectItem[packageTypes.size()]; + int itemCounter = 0; + for (PackageType packageType : packageTypes) { + SelectItem item = new SelectItem(packageType.getId(), packageType.getDisplayName()); + items[itemCounter++] = item; + } + + return items; + } + } \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml index 67eebb2..6363600 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/create-package-1.xhtml @@ -63,6 +63,37 @@ <h:outputText rendered="#{!ResourceUIBean.permissions.content}" value="You do not have permissions to upload content"/>
+ <rich:panel > + + <f:facet name="header">Package Version Details</f:facet> + + <input type="hidden" name="packageVersion" value="true"/> + + <table> + <tr> + <td align="right"><b>Version *</b></td> + <td align="left"><h:inputText value="#{CreateNewPackageChildResourceUIBean.version}"/></td> + </tr> + <tr> + <td align="right"><b>Architecture </b></td> + <td align="left"> + <h:selectOneMenu value="#{CreateNewPackageChildResourceUIBean.selectedArchitectureId}"> + <f:selectItems value="#{CreateNewPackageChildResourceUIBean.architectures}" /> + </h:selectOneMenu> + </td> + </tr> + <tr> + <td align="right"><b>Type *</b></td> + <td align="left"> + <h:selectOneMenu value="#{CreateNewPackageChildResourceUIBean.selectedPackageTypeId}"> + <f:selectItems value="#{CreateNewPackageChildResourceUIBean.packageTypes}" /> + </h:selectOneMenu> + </td> + </tr> + </table> + </rich:panel> + + <onc:config configurationDefinition="#{CreateNewPackageChildResourceUIBean.configurationDefinition}" configuration="#{CreateNewPackageChildResourceUIBean.configuration}" nullConfigurationDefinitionMessage="#{CreateNewPackageChildResourceUIBean.nullConfigurationDefinitionMessage}" diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java index c2c3ccd..bd6d933 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java @@ -111,6 +111,13 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe */ private static final int REQUEST_TIMEOUT = 1000 * 60 * 60;
+ public static final String UPLOAD_FILE_SIZE = "fileSize"; + public static final String UPLOAD_FILE_INSTALL_DATE = "fileInstallDate"; + public static final String UPLOAD_OWNER = "owner"; + public static final String UPLOAD_FILE_NAME = "fileName"; + public static final String UPLOAD_MD5 = "md5"; + public static final String UPLOAD_SHA256 = "sha256"; + // Attributes --------------------------------------------
private final Log log = LogFactory.getLog(this.getClass()); @@ -165,7 +172,35 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe
// The report contains an entire snapshot of packages, so each of these has to be represented // as an InstalledPackage + PackageVersion packageVersion = null; for (ResourcePackageDetails resourcePackage : report.getDeployedPackages()) { + + //check for pkgs detected on agent side but not mapped correctly + String shaValue = resourcePackage.getSHA256(); + if ((shaValue != null) && (!shaValue.isEmpty()) + && (shaValue.indexOf("(deployed exploded. no message digest possible)") == -1)) { + //if SHA set, but no MD5 then agent updated these packagedetails so we can link + //discovered with created + String md5Value = resourcePackage.getMD5(); + if ((md5Value == null) || (md5Value.isEmpty())) { + //query for installed packages with SHA256, we'll grab first one. All identical. + Query packageDiscoveredQuery = entityManager + .createNamedQuery(PackageVersion.QUERY_FIND_BY_PACKAGE_SHA); + packageDiscoveredQuery.setParameter("sha", shaValue); + List<PackageVersion> discoveredPackages = packageDiscoveredQuery.getResultList(); + if (discoveredPackages.size() > 0) { + packageVersion = discoveredPackages.get(0); + //now assign PackageVersion details correctly + PackageDetailsKey discoveredKey = new PackageDetailsKey(packageVersion.getFileName(), + packageVersion.getVersion(), packageVersion.getGeneralPackage().getPackageType().getName(), + resourcePackage.getArchitectureName()); + ResourcePackageDetails retrievedResourcePackage = new ResourcePackageDetails(discoveredKey); + //now reassign the resourcePackage to use this newly retrieved id. + resourcePackage = retrievedResourcePackage; + } + } + } + // Load the overall package (used in a few places later in this loop) Query packageQuery = entityManager.createNamedQuery(Package.QUERY_FIND_BY_NAME_PKG_TYPE_RESOURCE_TYPE); packageQuery.setFlushMode(FlushModeType.COMMIT); @@ -192,7 +227,7 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe
List<PackageVersion> existingPackageVersionList = packageVersionQuery.getResultList();
- PackageVersion packageVersion = null; + // PackageVersion packageVersion = null; if (existingPackageVersionList.size() > 0) { packageVersion = existingPackageVersionList.get(0); } @@ -1216,22 +1251,8 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe PackageVersion newPackageVersion = new PackageVersion(existingPackage, version, architecture); newPackageVersion.setDisplayName(existingPackage.getName());
- // TODO: THIS IS VERY BAD - MUST FIX - DO NOT SLURP THE ENTIRE FILE IN MEMORY - USE JDBC STREAMING - // Write the content into the newly created package version. This may eventually move, but for now we'll just - // use the byte array in the package version to store the bits. - byte[] packageBits; - try { - packageBits = StreamUtil.slurp(packageBitStream); - } catch (RuntimeException re) { - throw new RuntimeException("Error reading in the package file", re); - } + PackageBits bits = loadPackageBits(packageBitStream);
- PackageBits bits = new PackageBits(); - try { - bits.setBits(packageBits); - } catch (Exception e) { - log.error("Error savinf the package.", e); - } newPackageVersion.setPackageBits(bits);
newPackageVersion = persistOrMergePackageVersionSafely(newPackageVersion); @@ -1489,4 +1510,107 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe
return result; } + + /** Does much of same functionality as createPackageVersion, but uses same named query + * as the agent side discovery mechanism, and passes in additional parameters available + * when file has been uploaded via the UI. + */ + @Override + public PackageVersion getUploadedPackageVersion(String packageName, int packageTypeId, String version, + int architectureId, InputStream packageBitStream, Map<String, String> packageUploadDetails, + int newResourceTypeId) { + + PackageVersion packageVersion = null; + + //default version to 1.0 if is null, not provided for any reason. + if ((version == null) || (version.trim().isEmpty())) { + version = "1.0"; + } + + // See if package version already exists for the resource package + Query packageVersionQuery = entityManager.createNamedQuery(PackageVersion.QUERY_FIND_BY_PACKAGE_DETAILS_KEY); + packageVersionQuery.setFlushMode(FlushModeType.COMMIT); + packageVersionQuery.setParameter("packageName", packageName); + PackageType packageType = contentManager.getResourceCreationPackageType(newResourceTypeId); + packageVersionQuery.setParameter("packageTypeName", packageType.getName()); + packageVersionQuery.setParameter("resourceTypeId", newResourceTypeId); + + Architecture architecture = entityManager.find(Architecture.class, architectureId); + packageVersionQuery.setParameter("architectureName", architecture.getName()); + packageVersionQuery.setParameter("version", version); + + // Result of the query should be either 0 or 1 + List<PackageVersion> existingPackageVersionList = packageVersionQuery.getResultList(); + + if (existingPackageVersionList.size() > 0) { + packageVersion = existingPackageVersionList.get(0); + } + + Package existingPackage = null; + + Query packageQuery = entityManager.createNamedQuery(Package.QUERY_FIND_BY_NAME_PKG_TYPE_ID); + packageQuery.setParameter("name", packageName); + packageQuery.setParameter("packageTypeId", packageTypeId); + List<Package> existingPackageList = packageQuery.getResultList(); + + if (existingPackageList.size() == 0) { + // If the package doesn't exist, create that here + existingPackage = new Package(packageName, packageType); + existingPackage = persistOrMergePackageSafely(existingPackage); + } else { + existingPackage = existingPackageList.get(0); + } + + //initialize package version if not already + if (packageVersion == null) { + packageVersion = new PackageVersion(existingPackage, version, architecture); + packageVersion.setDisplayName(existingPackage.getName()); + entityManager.persist(packageVersion); + } + + //get the data and persist/merge packageVersion + PackageBits bits = loadPackageBits(packageBitStream); + packageVersion.setPackageBits(bits); + + //populate extra details, persist + if (packageUploadDetails != null) { + packageVersion.setFileCreatedDate(Long.valueOf(packageUploadDetails + .get(ContentManagerBean.UPLOAD_FILE_INSTALL_DATE))); + packageVersion.setFileName(packageUploadDetails.get(ContentManagerBean.UPLOAD_FILE_NAME)); + packageVersion.setFileSize(Long.valueOf(packageUploadDetails.get(ContentManagerBean.UPLOAD_FILE_SIZE))); + packageVersion.setMD5(packageUploadDetails.get(ContentManagerBean.UPLOAD_MD5)); + packageVersion.setSHA256(packageUploadDetails.get(ContentManagerBean.UPLOAD_SHA256)); + } + entityManager.merge(packageVersion); + + return packageVersion; + + } + + /** Pulls in package bits from the stream. Currently inefficient. + * + * @param packageBitStream + * @return PackageBits ref populated. + */ + private PackageBits loadPackageBits(InputStream packageBitStream) { + PackageBits bits = null; + // TODO: THIS IS VERY BAD - MUST FIX - DO NOT SLURP THE ENTIRE FILE IN MEMORY - USE JDBC STREAMING + // Write the content into the newly created package version. This may eventually move, but for now we'll just + // use the byte array in the package version to store the bits. + byte[] packageBits; + try { + packageBits = StreamUtil.slurp(packageBitStream); + } catch (RuntimeException re) { + throw new RuntimeException("Error reading in the package file", re); + } + + bits = new PackageBits(); + try { + bits.setBits(packageBits); + entityManager.persist(bits); + } catch (Exception e) { + log.error("Error saving the package.", e); + } + return bits; + } } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerHelper.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerHelper.java index 7656d93..9d4a4bc 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerHelper.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerHelper.java @@ -95,6 +95,7 @@ public class ContentManagerHelper { details.setMetadata(packageVersion.getMetadata()); details.setSHA256(packageVersion.getSHA256()); details.setShortDescription(packageVersion.getShortDescription()); + details.setInstallationTimestamp(packageVersion.getFileCreatedDate());
return details; } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java index 22f69aa..fc128a4 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java @@ -20,13 +20,13 @@ package org.rhq.enterprise.server.content;
import java.io.InputStream; import java.util.List; +import java.util.Map; import java.util.Set;
import javax.ejb.Local;
+import org.rhq.core.clientapi.server.content.ContentDiscoveryReport; import org.rhq.core.clientapi.server.content.ContentServiceResponse; -import org.rhq.core.domain.content.transfer.DeployPackagesResponse; -import org.rhq.core.domain.content.transfer.RemovePackagesResponse; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.content.Architecture; import org.rhq.core.domain.content.ContentServiceRequest; @@ -35,8 +35,9 @@ import org.rhq.core.domain.content.Package; import org.rhq.core.domain.content.PackageDetailsKey; import org.rhq.core.domain.content.PackageType; import org.rhq.core.domain.content.PackageVersion; -import org.rhq.core.clientapi.server.content.ContentDiscoveryReport; import org.rhq.core.domain.content.transfer.DeployPackageStep; +import org.rhq.core.domain.content.transfer.DeployPackagesResponse; +import org.rhq.core.domain.content.transfer.RemovePackagesResponse; import org.rhq.core.domain.content.transfer.ResourcePackageDetails; import org.rhq.core.domain.criteria.InstalledPackageCriteria; import org.rhq.core.domain.criteria.PackageVersionCriteria; @@ -210,6 +211,10 @@ public interface ContentManagerLocal { PackageVersion createPackageVersion(String packageName, int packageTypeId, String version, int architectureId, InputStream packageBitStream);
+ PackageVersion getUploadedPackageVersion(String packageName, int packageTypeId, String version, + int architectureId, InputStream packageBitStream, Map<String, String> packageUploadDetails, + int newResourceTypeId); + /** * Very simple method that persists the given package version within its own transaction. * diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java index 65ccce7..8b0e4d6 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java @@ -22,6 +22,7 @@ import java.io.ByteArrayInputStream; import java.io.InputStream; import java.util.Calendar; import java.util.List; +import java.util.Map; import java.util.Set;
import javax.ejb.EJB; @@ -483,6 +484,14 @@ public class ResourceFactoryManagerBean implements ResourceFactoryManagerLocal, public void createResource(Subject user, int parentResourceId, int newResourceTypeId, String newResourceName, Configuration pluginConfiguration, String packageName, String packageVersionNumber, Integer architectureId, Configuration deploymentTimeConfiguration, InputStream packageBitStream) { + createResource(user, parentResourceId, newResourceTypeId, newResourceName, pluginConfiguration, packageName, + packageVersionNumber, architectureId, deploymentTimeConfiguration, packageBitStream, null); + } + + public void createResource(Subject user, int parentResourceId, int newResourceTypeId, String newResourceName, + Configuration pluginConfiguration, String packageName, String packageVersionNumber, Integer architectureId, + Configuration deploymentTimeConfiguration, InputStream packageBitStream, + Map<String, String> packageUploadDetails) { log.info("Received call to create package backed resource under parent [" + parentResourceId + "]");
Resource resource = entityManager.find(Resource.class, parentResourceId); @@ -510,9 +519,15 @@ public class ResourceFactoryManagerBean implements ResourceFactoryManagerLocal, // default to no required architecture architectureId = (null != architectureId) ? architectureId : contentManager.getNoArchitecture().getId();
- // Create package and package version - PackageVersion packageVersion = contentManager.createPackageVersion(packageName, newPackageType.getId(), - packageVersionNumber, architectureId, packageBitStream); + // Create/locate package and package version + PackageVersion packageVersion = null; + if (packageUploadDetails == null) { + packageVersion = contentManager.createPackageVersion(packageName, newPackageType.getId(), + packageVersionNumber, architectureId, packageBitStream); + } else { + packageVersion = contentManager.getUploadedPackageVersion(packageName, newPackageType.getId(), + packageVersionNumber, architectureId, packageBitStream, packageUploadDetails, newResourceTypeId); + }
// Persist in separate transaction so it is committed immediately, before the request is sent to the agent CreateResourceHistory persistedHistory = resourceFactoryManager.persistCreateHistory(user, parentResourceId, diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerLocal.java index f5d267e..ea3784d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerLocal.java @@ -19,6 +19,7 @@ package org.rhq.enterprise.server.resource;
import java.io.InputStream; +import java.util.Map;
import javax.ejb.Local;
@@ -83,6 +84,11 @@ public interface ResourceFactoryManagerLocal { Configuration pluginConfiguration, String packageName, String packageVersion, Integer architectureId, Configuration deploymentTimeConfiguration, InputStream packageBitStream);
+ void createResource(Subject user, int parentResourceId, int newResourceTypeId, String newResourceName, + Configuration pluginConfiguration, String packageName, String packageVersion, Integer architectureId, + Configuration deploymentTimeConfiguration, InputStream packageBitStream, + Map<String, String> packageUploadDetails); + // Internal Utilities --------------------------------------------
/**
commit 5e1253bad20204d0a66dc244a684d8cef23f16cf Merge: 7921efb... 2dccbf9... Author: Ian P. Springer <ips@jetengine.(none)> Date: Tue May 25 17:14:34 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 7921efb639edd259791b8f4a2bfd53ae7aef85b6 Author: Ian P. Springer <ips@jetengine.(none)> Date: Wed May 19 15:38:43 2010 -0400
add jboss 3rd party uploads repo for augeas v0.0.2 jar (cherry picked from commit 6a9cbfc3b054b89d8c278eee62df6411daf650e1)
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index 9a781ba..963223b 100644 --- a/modules/plugins/augeas/pom.xml +++ b/modules/plugins/augeas/pom.xml @@ -93,6 +93,20 @@ </plugins> </build>
+ <repositories> + + <!-- for the augeas jar --> + <repository> + <id>jboss-thirdparty-uploads</id> + <name>JBoss Third-Party Uploads</name> + <url>https://repository.jboss.org/nexus/content/repositories/thirdparty-uploads/</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + + </repositories> + <profiles>
<profile>
commit ebf15313f235a0d1cc6c141a004005cb5182df48 Author: Greg Hinkle ghinkle@redhat.com Date: Tue May 25 16:52:29 2010 -0400
minor tweaks
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java index 22f911a..6d4a3fd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java @@ -27,9 +27,27 @@ package org.rhq.enterprise.gui.coregui.client; */ public class LinkManager {
+ private static boolean GWT = true; +
public static String getResourceLink(int resourceId) {
- return "Resource/" + resourceId; + if (GWT) { + return "Resource/" + resourceId; + } else { + return "/rhq/resource/summary/overview.xhtml?id=" + resourceId; + } } + + + public static String getResourceGroupLink(int resouceGroupId) { + + if (GWT) { + return "ResourceGroup/" + resouceGroupId; + } else { + return "/rhq/group/inventory/view.xhtml?groupId=" + resouceGroupId; + } + } + + } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java index c80b21d..0543eac 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java @@ -22,6 +22,7 @@ import com.google.gwt.event.logical.shared.ValueChangeEvent; import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.user.client.History; import com.google.gwt.user.client.ui.Hyperlink; +import com.smartgwt.client.types.ContentsType; import com.smartgwt.client.types.VerticalAlignment; import com.smartgwt.client.widgets.HTMLFlow; import com.smartgwt.client.widgets.Img; @@ -67,7 +68,17 @@ public class MenuBarView extends VLayout { }); }
- @Override + protected void onDraw2() { + super.onDraw(); + + HTMLFlow menu = new HTMLFlow(); + menu.setContentsType(ContentsType.PAGE); + menu.setContentsURL("/rhq/common/menu/menu.xhtml"); + addMember(menu); + } + + + // @Override protected void onDraw() { super.onDraw();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java index 8454bc4..2792255 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java @@ -46,6 +46,7 @@ public class TagCloudView extends VLayout { protected void onDraw() { super.onDraw();
+ removeMembers(getMembers());
GWTServiceLookup.getTagService().findTagReportCompositesByCriteria(new TagCriteria(), new AsyncCallback<PageList<TagReportComposite>>() {
commit a118fb535c50f0118790ab3ae3a9f3a9f6e0ec5d Author: Greg Hinkle ghinkle@redhat.com Date: Tue May 25 16:51:47 2010 -0400
fix delete for things that have tags related by adding cascading
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java index dfeed21..bed3a10 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java @@ -104,7 +104,7 @@ public class Bundle implements Serializable { @OneToMany(mappedBy = "bundle", fetch = FetchType.LAZY, cascade = CascadeType.ALL) private List<BundleVersion> bundleVersions = new ArrayList<BundleVersion>();
- @ManyToMany(mappedBy = "bundles", fetch = FetchType.LAZY) + @ManyToMany(mappedBy = "bundles", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE) private Set<Tag> tags;
public Bundle() { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java index b4b95d8..52d854a 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java @@ -122,7 +122,7 @@ public class BundleDeployment implements Serializable { @OneToMany(mappedBy = "bundleDeployment", fetch = FetchType.LAZY, cascade = CascadeType.ALL) private List<BundleResourceDeployment> resourceDeployments;
- @ManyToMany(mappedBy = "bundleDeployments", fetch = FetchType.LAZY) + @ManyToMany(mappedBy = "bundleDeployments", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE) private Set<Tag> tags;
public BundleDeployment() { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java index dea011e..1dc9ec2 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java @@ -28,6 +28,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set;
+import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; @@ -98,7 +99,7 @@ public class BundleDestination implements Serializable { @OneToMany(mappedBy = "destination", fetch = FetchType.LAZY) private List<BundleDeployment> deployments;
- @ManyToMany(mappedBy = "bundleDestinations", fetch = FetchType.LAZY) + @ManyToMany(mappedBy = "bundleDestinations", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE) private Set<Tag> tags;
public BundleDestination() { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleVersion.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleVersion.java index a5f918b..b8417d9 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleVersion.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleVersion.java @@ -124,7 +124,7 @@ public class BundleVersion implements Serializable { @OneToMany(mappedBy = "bundleVersion", fetch = FetchType.LAZY, cascade = CascadeType.ALL) private List<BundleFile> bundleFiles = new ArrayList<BundleFile>();
- @ManyToMany(mappedBy = "bundleVersions", fetch = FetchType.LAZY) + @ManyToMany(mappedBy = "bundleVersions", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE) private Set<Tag> tags;
public BundleVersion() { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java index 150266f..d3e69f5 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java @@ -1114,7 +1114,7 @@ public class Resource implements Comparable<Resource>, Serializable { // @OneToMany(mappedBy = "resource", fetch = FetchType.LAZY, cascade = CascadeType.ALL) // private List<BundleResourceDeployment> resourceDeployments = new ArrayList<BundleResourceDeployment>();
- @ManyToMany(mappedBy = "resources", fetch = FetchType.LAZY) + @ManyToMany(mappedBy = "resources", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE) private Set<Tag> tags;
public Resource() { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java index c8b7f1d..c9fb492 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java @@ -448,7 +448,7 @@ public class ResourceGroup extends Group { @OneToMany(mappedBy = "resourceGroup", cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) private Set<AlertDefinition> alertDefinitions = new LinkedHashSet<AlertDefinition>();
- @ManyToMany(mappedBy = "resourceGroups", fetch = FetchType.LAZY) + @ManyToMany(mappedBy = "resourceGroups", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE) private Set<Tag> tags;
/* no-arg constructor required by EJB spec */
commit f67db6c1e1b44b11971c450213890720902e2232 Author: Greg Hinkle ghinkle@redhat.com Date: Tue May 25 16:51:06 2010 -0400
Cleanup the wizard step canvases when the wizard closes
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java index e0f3f92..fbce82f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java @@ -19,6 +19,7 @@ package org.rhq.enterprise.gui.coregui.client.components.wizard;
import java.util.ArrayList; +import java.util.HashSet; import java.util.List;
import com.smartgwt.client.widgets.Canvas; @@ -59,6 +60,8 @@ public class WizardView extends VLayout { ArrayList<IButton> customButtons = new ArrayList<IButton>(); Canvas currentCanvas;
+ HashSet<Canvas> createdCanvases = new HashSet<Canvas>(); + public WizardView(Wizard wizard) { super(10); this.wizard = wizard; @@ -195,6 +198,8 @@ public class WizardView extends VLayout { contentLayout.removeMember(currentCanvas); } currentCanvas = wizardSteps.get(currentStep).getCanvas(); + createdCanvases.add(currentCanvas); + contentLayout.addMember(currentCanvas);
markForRedraw(); @@ -222,6 +227,12 @@ public class WizardView extends VLayout { }
public void closeDialog() { + + // Attempt to clean up canvases created in the steps + for (Canvas canvas : createdCanvases) { + canvas.markForDestroy(); + } + wizardWindow.destroy(); }
commit cb861499b222038f52a4879ae73334955716dc26 Author: Greg Hinkle ghinkle@redhat.com Date: Tue May 25 16:42:42 2010 -0400
Workaround for certain times when the upload form is not completely destroyed
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/DynamicCallbackForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/DynamicCallbackForm.java index 81f48fe..93b8428 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/DynamicCallbackForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/DynamicCallbackForm.java @@ -28,6 +28,8 @@ import com.smartgwt.client.widgets.form.DynamicForm;
public class DynamicCallbackForm extends DynamicForm implements DynamicCallbackFormImplHost {
+ private static int frameIndex = 0; + private String frameName; private Element synthesizedFrame; private DynamicCallbackFormHandlerCollection formHandlers; @@ -35,8 +37,8 @@ public class DynamicCallbackForm extends DynamicForm implements DynamicCallbackF
public DynamicCallbackForm(String frameName) { super(); - this.frameName = frameName; - setTarget(frameName); + this.frameName = frameName + (frameIndex++); + setTarget(this.frameName); init(); }
commit 2dccbf98d5dfb7931d1263f415e57927436397b4 Merge: 165c6dd... 28951fe... Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 25 16:00:34 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 165c6dd10417bbc3a2988491a07d01570d50ef5c Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 25 15:59:19 2010 -0400
[BZ 586500] Fixed Regression for Refresh Core menu item.
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml index 285807a..50efde2 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml @@ -491,50 +491,71 @@ v <rich:menuItem submitMode="none" </f:facet> </a4j:status>
- - - - - <rich:dropDownMenu rendered="#{request.method == 'GET'}"> - <f:facet name="label"> - <h:panelGroup> - <h:graphicImage value="/images/refreshRunning.gif" rendered="#{UserPreferencesUIBean.pageRefresh != 0}"/> - <h:graphicImage value="/images/refreshStopped.gif" rendered="#{UserPreferencesUIBean.pageRefresh == 0}"/> - <span id="refreshTimeLeft" style="width: 0px;"><h:outputText value="#{UserPreferencesUIBean.pageRefresh}" rendered="#{UserPreferencesUIBean.pageRefresh != 0}"/></span> - - </h:panelGroup> - </f:facet> - - ui:remove***** Logged in as > EDIT DETAILS *****</ui:remove> - - - - <rich:menuItem submitMode="none" onclick="updatePageRefresh('#{request.getAttribute('javax.servlet.forward.request_uri')}', 0)"> - <h:outputText value="Stop"/> - <f:facet name="icon"> - <h:graphicImage value="/images/#{UserPreferencesUIBean.pageRefresh == 0 ? 'check.png' : 'spacer.gif'}" width="16" height="16"/> - </f:facet> - </rich:menuItem> - <rich:menuItem submitMode="none" onclick="updatePageRefresh('#{request.getAttribute('javax.servlet.forward.request_uri')}',60)"> - <h:outputText value="Refresh every 1 minute"/> - <f:facet name="icon"> - <h:graphicImage value="/images/#{UserPreferencesUIBean.pageRefresh == 60 ? 'check.png' : 'spacer.gif'}" width="16" height="16"/> - </f:facet> - </rich:menuItem> - <rich:menuItem submitMode="none" onclick="updatePageRefresh('#{request.getAttribute('javax.servlet.forward.request_uri')}',300)"> - <h:outputText value="Refresh every 5 minutes"/> - <f:facet name="icon"> - <h:graphicImage value="/images/#{UserPreferencesUIBean.pageRefresh == 300 ? 'check.png' : 'spacer.gif'}" width="16" height="16"/> - </f:facet> - </rich:menuItem> - <rich:menuItem submitMode="none" onclick="updatePageRefresh('#{request.getAttribute('javax.servlet.forward.request_uri')}',600)"> - <h:outputText value="Refresh every 10 minutes"/> - <f:facet name="icon"> - <h:graphicImage value="/images/#{UserPreferencesUIBean.pageRefresh == 600 ? 'check.png' : 'spacer.gif'}" width="16" height="16"/> - </f:facet> - </rich:menuItem> - - </rich:dropDownMenu> + ui:remove***** Refresh Graphic *****</ui:remove> + <rich:dropDownMenu rendered="#{request.method == 'GET'}"> + <f:facet name="label"> + <h:panelGroup> + <h:graphicImage + value="/images/refreshRunning.gif" + rendered="#{UserPreferencesUIBean.pageRefresh != 0}" /> + <h:graphicImage + value="/images/refreshStopped.gif" + rendered="#{UserPreferencesUIBean.pageRefresh == 0}" /> + <span + id="refreshTimeLeft" + style="width: 0px;"><h:outputText + value="#{UserPreferencesUIBean.pageRefresh}" + rendered="#{UserPreferencesUIBean.pageRefresh != 0}" /></span> + + </h:panelGroup> + </f:facet> + + ui:remove***** Refresh Intervals *****</ui:remove> + <rich:menuItem + submitMode="none" + onclick="updatePageRefresh('#{request.getAttribute('javax.servlet.forward.request_uri')}', 0)"> + <h:outputText value="Stop" /> + <f:facet name="icon"> + <h:graphicImage + value="/images/#{UserPreferencesUIBean.pageRefresh == 0 ? 'check.png' : 'spacer.gif'}" + width="16" + height="16" /> + </f:facet> + </rich:menuItem> + <rich:menuItem + submitMode="none" + onclick="updatePageRefresh('#{request.getAttribute('javax.servlet.forward.request_uri')}',60)"> + <h:outputText value="Refresh every 1 minute" /> + <f:facet name="icon"> + <h:graphicImage + value="/images/#{UserPreferencesUIBean.pageRefresh == 60 ? 'check.png' : 'spacer.gif'}" + width="16" + height="16" /> + </f:facet> + </rich:menuItem> + <rich:menuItem + submitMode="none" + onclick="updatePageRefresh('#{request.getAttribute('javax.servlet.forward.request_uri')}',300)"> + <h:outputText value="Refresh every 5 minutes" /> + <f:facet name="icon"> + <h:graphicImage + value="/images/#{UserPreferencesUIBean.pageRefresh == 300 ? 'check.png' : 'spacer.gif'}" + width="16" + height="16" /> + </f:facet> + </rich:menuItem> + <rich:menuItem + submitMode="none" + onclick="updatePageRefresh('#{request.getAttribute('javax.servlet.forward.request_uri')}',600)"> + <h:outputText value="Refresh every 10 minutes" /> + <f:facet name="icon"> + <h:graphicImage + value="/images/#{UserPreferencesUIBean.pageRefresh == 600 ? 'check.png' : 'spacer.gif'}" + width="16" + height="16" /> + </f:facet> + </rich:menuItem> + </rich:dropDownMenu>
ui:remove===== LOGGED IN AS =====</ui:remove>
@@ -628,23 +649,24 @@ v <rich:menuItem submitMode="none"
function refresh() {
- timeLeft = timeLeft - 1; - document.getElementById("refreshTimeLeft").innerHTML = timeLeft; - - if (timeLeft < 1) { - window.location.href = window.location.href; - } - setTimeout("refresh()", 1000); - } - - var refreshTime = <h:outputText value="#{UserPreferencesUIBean.pageRefresh}"/>; - var timeLeft = refreshTime; + if (timeLeft > 0) { + timeLeft = timeLeft - 1; + document.getElementById("refreshTimeLeft").innerHTML = timeLeft; + setTimeout("refresh()", 1000); // call again in 1 second (1000ms) + }
- if (refreshTime > 0) { - setTimeout("refresh()", 1000); - } + if (timeLeft == 0) { + document.getElementById("refreshTimeLeft").innerHTML = timeLeft; + window.location.reload(true); + } + }
+ var refreshTime = <h:outputText value="#{UserPreferencesUIBean.pageRefresh}"/>; + var timeLeft = refreshTime;
+ if (refreshTime > 0) { + setTimeout("refresh()", 1000); + }
</script>
commit c5f30ff2caf4e7a155c166a277ad1f14cd6fc393 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 25 15:59:19 2010 -0400
[BZ 586500] Fixed Regression for Refresh Core menu item.
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml index 285807a..50efde2 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml @@ -491,50 +491,71 @@ v <rich:menuItem submitMode="none" </f:facet> </a4j:status>
- - - - - <rich:dropDownMenu rendered="#{request.method == 'GET'}"> - <f:facet name="label"> - <h:panelGroup> - <h:graphicImage value="/images/refreshRunning.gif" rendered="#{UserPreferencesUIBean.pageRefresh != 0}"/> - <h:graphicImage value="/images/refreshStopped.gif" rendered="#{UserPreferencesUIBean.pageRefresh == 0}"/> - <span id="refreshTimeLeft" style="width: 0px;"><h:outputText value="#{UserPreferencesUIBean.pageRefresh}" rendered="#{UserPreferencesUIBean.pageRefresh != 0}"/></span> - - </h:panelGroup> - </f:facet> - - ui:remove***** Logged in as > EDIT DETAILS *****</ui:remove> - - - - <rich:menuItem submitMode="none" onclick="updatePageRefresh('#{request.getAttribute('javax.servlet.forward.request_uri')}', 0)"> - <h:outputText value="Stop"/> - <f:facet name="icon"> - <h:graphicImage value="/images/#{UserPreferencesUIBean.pageRefresh == 0 ? 'check.png' : 'spacer.gif'}" width="16" height="16"/> - </f:facet> - </rich:menuItem> - <rich:menuItem submitMode="none" onclick="updatePageRefresh('#{request.getAttribute('javax.servlet.forward.request_uri')}',60)"> - <h:outputText value="Refresh every 1 minute"/> - <f:facet name="icon"> - <h:graphicImage value="/images/#{UserPreferencesUIBean.pageRefresh == 60 ? 'check.png' : 'spacer.gif'}" width="16" height="16"/> - </f:facet> - </rich:menuItem> - <rich:menuItem submitMode="none" onclick="updatePageRefresh('#{request.getAttribute('javax.servlet.forward.request_uri')}',300)"> - <h:outputText value="Refresh every 5 minutes"/> - <f:facet name="icon"> - <h:graphicImage value="/images/#{UserPreferencesUIBean.pageRefresh == 300 ? 'check.png' : 'spacer.gif'}" width="16" height="16"/> - </f:facet> - </rich:menuItem> - <rich:menuItem submitMode="none" onclick="updatePageRefresh('#{request.getAttribute('javax.servlet.forward.request_uri')}',600)"> - <h:outputText value="Refresh every 10 minutes"/> - <f:facet name="icon"> - <h:graphicImage value="/images/#{UserPreferencesUIBean.pageRefresh == 600 ? 'check.png' : 'spacer.gif'}" width="16" height="16"/> - </f:facet> - </rich:menuItem> - - </rich:dropDownMenu> + ui:remove***** Refresh Graphic *****</ui:remove> + <rich:dropDownMenu rendered="#{request.method == 'GET'}"> + <f:facet name="label"> + <h:panelGroup> + <h:graphicImage + value="/images/refreshRunning.gif" + rendered="#{UserPreferencesUIBean.pageRefresh != 0}" /> + <h:graphicImage + value="/images/refreshStopped.gif" + rendered="#{UserPreferencesUIBean.pageRefresh == 0}" /> + <span + id="refreshTimeLeft" + style="width: 0px;"><h:outputText + value="#{UserPreferencesUIBean.pageRefresh}" + rendered="#{UserPreferencesUIBean.pageRefresh != 0}" /></span> + + </h:panelGroup> + </f:facet> + + ui:remove***** Refresh Intervals *****</ui:remove> + <rich:menuItem + submitMode="none" + onclick="updatePageRefresh('#{request.getAttribute('javax.servlet.forward.request_uri')}', 0)"> + <h:outputText value="Stop" /> + <f:facet name="icon"> + <h:graphicImage + value="/images/#{UserPreferencesUIBean.pageRefresh == 0 ? 'check.png' : 'spacer.gif'}" + width="16" + height="16" /> + </f:facet> + </rich:menuItem> + <rich:menuItem + submitMode="none" + onclick="updatePageRefresh('#{request.getAttribute('javax.servlet.forward.request_uri')}',60)"> + <h:outputText value="Refresh every 1 minute" /> + <f:facet name="icon"> + <h:graphicImage + value="/images/#{UserPreferencesUIBean.pageRefresh == 60 ? 'check.png' : 'spacer.gif'}" + width="16" + height="16" /> + </f:facet> + </rich:menuItem> + <rich:menuItem + submitMode="none" + onclick="updatePageRefresh('#{request.getAttribute('javax.servlet.forward.request_uri')}',300)"> + <h:outputText value="Refresh every 5 minutes" /> + <f:facet name="icon"> + <h:graphicImage + value="/images/#{UserPreferencesUIBean.pageRefresh == 300 ? 'check.png' : 'spacer.gif'}" + width="16" + height="16" /> + </f:facet> + </rich:menuItem> + <rich:menuItem + submitMode="none" + onclick="updatePageRefresh('#{request.getAttribute('javax.servlet.forward.request_uri')}',600)"> + <h:outputText value="Refresh every 10 minutes" /> + <f:facet name="icon"> + <h:graphicImage + value="/images/#{UserPreferencesUIBean.pageRefresh == 600 ? 'check.png' : 'spacer.gif'}" + width="16" + height="16" /> + </f:facet> + </rich:menuItem> + </rich:dropDownMenu>
ui:remove===== LOGGED IN AS =====</ui:remove>
@@ -628,23 +649,24 @@ v <rich:menuItem submitMode="none"
function refresh() {
- timeLeft = timeLeft - 1; - document.getElementById("refreshTimeLeft").innerHTML = timeLeft; - - if (timeLeft < 1) { - window.location.href = window.location.href; - } - setTimeout("refresh()", 1000); - } - - var refreshTime = <h:outputText value="#{UserPreferencesUIBean.pageRefresh}"/>; - var timeLeft = refreshTime; + if (timeLeft > 0) { + timeLeft = timeLeft - 1; + document.getElementById("refreshTimeLeft").innerHTML = timeLeft; + setTimeout("refresh()", 1000); // call again in 1 second (1000ms) + }
- if (refreshTime > 0) { - setTimeout("refresh()", 1000); - } + if (timeLeft == 0) { + document.getElementById("refreshTimeLeft").innerHTML = timeLeft; + window.location.reload(true); + } + }
+ var refreshTime = <h:outputText value="#{UserPreferencesUIBean.pageRefresh}"/>; + var timeLeft = refreshTime;
+ if (refreshTime > 0) { + setTimeout("refresh()", 1000); + }
</script>
commit 28951fe704b7eb584d24161dcc6d4f2952222254 Author: John Sanda jsanda@redhat.com Date: Tue May 25 15:28:08 2010 -0400
[BZ 591490] Reverting alert links back to struts links since that UI code was reverted back to struts
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/subsystem/alertDefinitions.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/subsystem/alertDefinitions.xhtml index a1caee7..863357b 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/subsystem/alertDefinitions.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/subsystem/alertDefinitions.xhtml @@ -143,17 +143,20 @@ </onc:sortableColumnHeader> </f:facet>
- <h:outputLink value="/rhq/resource/alert/viewAlert.xhtml" rendered="#{empty item.original.alertDefinition.resourceType and empty item.original.alertDefinition.resourceGroup}"> + <h:outputLink value="/alerts/Config.do" rendered="#{empty item.original.alertDefinition.resourceType and empty item.original.alertDefinition.resourceGroup}"> + <f:param name="mode" value="viewRoles" /> <f:param name="id" value="#{item.original.alertDefinition.resource.id}" /> <f:param name="ad" value="#{item.original.alertDefinition.id}" /> <h:outputText value="#{item.original.alertDefinition.name}" /> </h:outputLink> - <h:outputLink value="/rhq/resource/alert/viewAlert.xhtml" rendered="#{not empty item.original.alertDefinition.resourceType}"> + <h:outputLink value="/alerts/Config.do" rendered="#{not empty item.original.alertDefinition.resourceType}"> + <f:param name="mode" value="viewRoles" /> <f:param name="type" value="#{item.original.alertDefinition.resourceType.id}" /> <f:param name="ad" value="#{item.original.alertDefinition.id}" /> <h:outputText value="#{item.original.alertDefinition.name}" /> </h:outputLink> - <h:outputLink value="/rhq/resource/alert/viewAlert.xhtml" rendered="#{not empty item.original.alertDefinition.resourceGroup}"> + <h:outputLink value="/alerts/Config.do" rendered="#{not empty item.original.alertDefinition.resourceGroup}"> + <f:param name="mode" value="viewRoles" /> <f:param name="groupId" value="#{item.original.alertDefinition.resourceGroup.id}" /> <f:param name="ad" value="#{item.original.alertDefinition.id}" /> <h:outputText value="#{item.original.alertDefinition.name}" />
commit 63ad14acc094e44dad2a79885a8ef72368c08782 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 25 12:12:35 2010 -0400
[BZ 594706] Remove cleanup of some obsolete prop def in favor of avoiding deadlock.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/metadata/ConfigurationMetadataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/metadata/ConfigurationMetadataManagerBean.java index e4c608c..8427c8b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/metadata/ConfigurationMetadataManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/metadata/ConfigurationMetadataManagerBean.java @@ -302,7 +302,6 @@ public class ConfigurationMetadataManagerBean implements ConfigurationMetadataMa * @param newProperty */ private void updatePropertyDefinition(PropertyDefinition existingProperty, PropertyDefinition newProperty) { - existingProperty.setDescription(newProperty.getDescription()); existingProperty.setDisplayName(newProperty.getDisplayName()); existingProperty.setActivationPolicy(newProperty.getActivationPolicy()); @@ -350,7 +349,7 @@ public class ConfigurationMetadataManagerBean implements ConfigurationMetadataMa PropertyDefinitionList exList = (PropertyDefinitionList) existingProperty; if (newProperty instanceof PropertyDefinitionList) { PropertyDefinitionList newList = (PropertyDefinitionList) newProperty; - replaceListPropertyMemberDefinition(exList, newList); + replaceListProperty(exList, newList); } else { // simple property or map-property replaceProperty(existingProperty, newProperty); } @@ -437,28 +436,36 @@ public class ConfigurationMetadataManagerBean implements ConfigurationMetadataMa }
/** - * This replaces the member property for the list. If it is a nested structure the whole thing - * is replaced from the top. The previous member property is removed. cascading should remove a nested - * structure. + * This replaces an existing list property def with a new list property definition. Primarily it replaces + * the member prop def for the list. If the member prop def is a nested structure the whole thing + * is replaced from the top. * - * @param existingProperty the existing prop - * @param newProperty the new prop that should replace the existing prop + * @param exList the existing prop def list + * @param newList the new prop def list */ - private void replaceListPropertyMemberDefinition(PropertyDefinitionList exList, PropertyDefinitionList newList) { - PropertyDefinition doomedMember = null; + private void replaceListProperty(PropertyDefinitionList exList, PropertyDefinitionList newList) { + PropertyDefinition doomedMemberDef = null;
// only remove the existing member if it is a different entity if (exList.getMemberDefinition().getId() != newList.getMemberDefinition().getId()) { - doomedMember = exList.getMemberDefinition(); + doomedMemberDef = exList.getMemberDefinition(); }
exList.setMemberDefinition(newList.getMemberDefinition()); exList.setMax(newList.getMax()); exList.setMin(newList.getMin());
- if (null != doomedMember) { - entityManager.remove(doomedMember); + // BZ 594706 + // Don't clean this up here because it's causing deadlocks in Oracle. Instead we'll just leave + // garbage in the db. Although annoying, and confusing for db queries, it's not a lot of data, + // just some extra prop defs and prop_def_enums. + if (null != doomedMemberDef) { + // entityManager.remove(doomedMemberDef); + if (log.isDebugEnabled()) { + log.debug("Ignoring cleanup of [" + doomedMemberDef + "] due to BZ 594706"); + } } + entityManager.merge(exList); entityManager.flush(); }
commit 3eda3f679f128eda9f5f412089082797d801f54c Merge: a85f1e5... fa15c72... Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 25 14:30:52 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
Conflicts: modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentDiscoveryComponent.java
commit a85f1e543e805b32d3cf13652d33c87a9931d7be Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 25 14:29:30 2010 -0400
LT commit
diff --git a/modules/core/util/src/test/resources/ini-editor-test.ini b/modules/core/util/src/test/resources/ini-editor-test.ini index c5eeef2..7a6d5f0 100644 --- a/modules/core/util/src/test/resources/ini-editor-test.ini +++ b/modules/core/util/src/test/resources/ini-editor-test.ini @@ -1,36 +1,36 @@ -[main] - # Where Puppet stores dynamic and growing data. - # The default value is '/var/puppet'. - vardir = /var/lib/puppet - - # The Puppet log directory. - # The default value is '$vardir/log'. - logdir = /var/log/puppet - - # Where Puppet PID files are kept. - # The default value is '$vardir/run'. - rundir = /var/run/puppet - - # Where SSL certificates are kept. - # The default value is '$confdir/ssl'. - ssldir = $vardir/ssl - -[puppetd] - # The file in which puppetd stores a list of the classes - # associated with the retrieved configuratiion. Can be loaded in - # the separate ``puppet`` executable using the ``--loadclasses`` - # option. - # The default value is '$confdir/classes.txt'. - classfile = $vardir/classes.txt - - # Where puppetd caches the local configuration. An - # extension indicating the cache format is added automatically. - # The default value is '$confdir/localconfig'. - localconfig = $vardir/localconfig - -[puppetca] -autosign = false - -[puppetmasterd] -ca = true -certname = mycertname +[main] + # Where Puppet stores dynamic and growing data. + # The default value is '/var/puppet'. + vardir = /var/lib/puppet + + # The Puppet log directory. + # The default value is '$vardir/log'. + logdir = /var/log/puppet + + # Where Puppet PID files are kept. + # The default value is '$vardir/run'. + rundir = /var/run/puppet + + # Where SSL certificates are kept. + # The default value is '$confdir/ssl'. + ssldir = $vardir/ssl + +[puppetd] + # The file in which puppetd stores a list of the classes + # associated with the retrieved configuratiion. Can be loaded in + # the separate ``puppet`` executable using the ``--loadclasses`` + # option. + # The default value is '$confdir/classes.txt'. + classfile = $vardir/classes.txt + + # Where puppetd caches the local configuration. An + # extension indicating the cache format is added automatically. + # The default value is '$confdir/localconfig'. + localconfig = $vardir/localconfig + +[puppetca] +autosign = false + +[puppetmasterd] +ca = true +certname = mycertname diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentDiscoveryComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentDiscoveryComponent.java index 4ee766f..f6af275 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentDiscoveryComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentDiscoveryComponent.java @@ -1,150 +1,150 @@ -/* -* Jopr Management Platform -* Copyright (C) 2005-2009 Red Hat, Inc. -* All rights reserved. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License, 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.jbossas5; - -import java.util.HashSet; -import java.util.Set; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.jboss.deployers.spi.management.ManagementView; -import org.jboss.managed.api.ComponentType; -import org.jboss.managed.api.ManagedComponent; -import org.rhq.core.domain.configuration.PropertySimple; -import org.rhq.core.domain.resource.ResourceType; -import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; -import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent; -import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; -import org.rhq.plugins.jbossas5.util.ConversionUtils; - -/** - * Discovery component for ManagedComponents exposed by the JBoss AS 5.x Profile Service that will be represented as - * child Resources of the JBoss AS Resource. - * - * @author Jason Dobies - * @author Mark Spritzer - * @author Ian Springer - */ -public class ManagedComponentDiscoveryComponent<P extends ProfileServiceComponent> implements - ResourceDiscoveryComponent<P> { - private final Log log = LogFactory.getLog(this.getClass()); - - public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<P> discoveryContext) - throws Exception { - ResourceType resourceType = discoveryContext.getResourceType(); - log.trace("Discovering " + resourceType.getName() + " Resources..."); - - ManagementView managementView = discoveryContext.getParentResourceComponent().getConnection() - .getManagementView(); - // TODO (ips): Only refresh the ManagementView *once* per runtime discovery scan, rather than every time this - // method is called. Do this by providing a runtime scan id in the ResourceDiscoveryContext. - managementView.load(); - - ComponentType componentType = getComponentType(discoveryContext); - Set<ManagedComponent> components; - try { - components = managementView.getComponentsForType(componentType); - } catch (Exception e) { - throw new IllegalStateException("Failed to get component types for " + resourceType + ".", e); - } - - Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>(components.size()); - /* Create a resource for each managed component found. We know all managed components will be of a - type we're interested in, so we can just add them all. There may be need for multiple iterations - over lists retrieved from different component types, but that is possible through the current API. - */ - for (ManagedComponent component : components) { - if (accept(discoveryContext, component)) { - String resourceName = getResourceName(component); - if (resourceName == null) { - resourceName = component.getName(); - } - String resourceKey = getResourceKey(component); - if (resourceKey == null) { - resourceKey = component.getName(); - } - String version = null; // (ips) I don't think there's anything generic we can do here. - - DiscoveredResourceDetails resource = new DiscoveredResourceDetails(resourceType, resourceKey, - resourceName, version, resourceType.getDescription(), discoveryContext - .getDefaultPluginConfiguration(), null); - - resource.getPluginConfiguration().put( - new PropertySimple(ManagedComponentComponent.Config.COMPONENT_NAME, resourceKey)); - - discoveredResources.add(resource); - } - } - - log.trace("Discovered " + discoveredResources.size() + " " + resourceType.getName() + " Resources."); - return discoveredResources; - } - - protected ComponentType getComponentType(ResourceDiscoveryContext<P> discoveryContext) { - ResourceType resourceType = discoveryContext.getResourceType(); - return ConversionUtils.getComponentType(resourceType); - } - - /** - * Subclasses can override this method if they don't want to use the ManagedComponent name as the initial - * Resource name. - * - * @param component the ManagedComponent being discovered - * @return the name to be assigned to the corresponding Resource - */ - protected String getResourceName(ManagedComponent component) { - return component.getName(); - } - - /** - * Return the unique resource key for the component. - * If you override this method, make sure to override - * {@link ManagedComponentComponent#getManagedComponent()} method as well - * because the return value of this method is used as the component name - * ({@link ManagedComponentComponent#getComponentName()}). - * - * @param component the component to uniquely identify - * @return the unique identifier for the component - */ - protected String getResourceKey(ManagedComponent component) { - return component.getName(); - } - - /** - * This method is called during {@link #discoverResources(ResourceDiscoveryContext)} to determine - * whether given component that has been found in the management view by this component's configured - * component type is applicable in the discovery context. - * <p> - * Because the Profile Service doesn't always provide the components in a hierarchy we present the resources - * we need this method to filter the components into their appropriate places. - * <p> - * This default implementation always returns true. - * - * @param discoveryContext the current discovery context - * @param component the discovered component - * @return true if the component logically belongs in the context, false otherwise. - */ - protected boolean accept(ResourceDiscoveryContext<P> discoveryContext, ManagedComponent component) { - return true; - } -} +/* +* Jopr Management Platform +* Copyright (C) 2005-2009 Red Hat, Inc. +* All rights reserved. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License, 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.jbossas5; + +import java.util.HashSet; +import java.util.Set; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.jboss.deployers.spi.management.ManagementView; +import org.jboss.managed.api.ComponentType; +import org.jboss.managed.api.ManagedComponent; +import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; +import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent; +import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; +import org.rhq.plugins.jbossas5.util.ConversionUtils; + +/** + * Discovery component for ManagedComponents exposed by the JBoss AS 5.x Profile Service that will be represented as + * child Resources of the JBoss AS Resource. + * + * @author Jason Dobies + * @author Mark Spritzer + * @author Ian Springer + */ +public class ManagedComponentDiscoveryComponent<P extends ProfileServiceComponent> implements + ResourceDiscoveryComponent<P> { + private final Log log = LogFactory.getLog(this.getClass()); + + public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<P> discoveryContext) + throws Exception { + ResourceType resourceType = discoveryContext.getResourceType(); + log.trace("Discovering " + resourceType.getName() + " Resources..."); + + ManagementView managementView = discoveryContext.getParentResourceComponent().getConnection() + .getManagementView(); + // TODO (ips): Only refresh the ManagementView *once* per runtime discovery scan, rather than every time this + // method is called. Do this by providing a runtime scan id in the ResourceDiscoveryContext. + managementView.load(); + + ComponentType componentType = getComponentType(discoveryContext); + Set<ManagedComponent> components; + try { + components = managementView.getComponentsForType(componentType); + } catch (Exception e) { + throw new IllegalStateException("Failed to get component types for " + resourceType + ".", e); + } + + Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>(components.size()); + /* Create a resource for each managed component found. We know all managed components will be of a + type we're interested in, so we can just add them all. There may be need for multiple iterations + over lists retrieved from different component types, but that is possible through the current API. + */ + for (ManagedComponent component : components) { + if (accept(discoveryContext, component)) { + String resourceName = getResourceName(component); + if (resourceName == null) { + resourceName = component.getName(); + } + String resourceKey = getResourceKey(component); + if (resourceKey == null) { + resourceKey = component.getName(); + } + String version = null; // (ips) I don't think there's anything generic we can do here. + + DiscoveredResourceDetails resource = new DiscoveredResourceDetails(resourceType, resourceKey, + resourceName, version, resourceType.getDescription(), discoveryContext + .getDefaultPluginConfiguration(), null); + + resource.getPluginConfiguration().put( + new PropertySimple(ManagedComponentComponent.Config.COMPONENT_NAME, resourceKey)); + + discoveredResources.add(resource); + } + } + + log.trace("Discovered " + discoveredResources.size() + " " + resourceType.getName() + " Resources."); + return discoveredResources; + } + + protected ComponentType getComponentType(ResourceDiscoveryContext<P> discoveryContext) { + ResourceType resourceType = discoveryContext.getResourceType(); + return ConversionUtils.getComponentType(resourceType); + } + + /** + * Subclasses can override this method if they don't want to use the ManagedComponent name as the initial + * Resource name. + * + * @param component the ManagedComponent being discovered + * @return the name to be assigned to the corresponding Resource + */ + protected String getResourceName(ManagedComponent component) { + return component.getName(); + } + + /** + * Return the unique resource key for the component. + * If you override this method, make sure to override + * {@link ManagedComponentComponent#getManagedComponent()} method as well + * because the return value of this method is used as the component name + * ({@link ManagedComponentComponent#getComponentName()}). + * + * @param component the component to uniquely identify + * @return the unique identifier for the component + */ + protected String getResourceKey(ManagedComponent component) { + return component.getName(); + } + + /** + * This method is called during {@link #discoverResources(ResourceDiscoveryContext)} to determine + * whether given component that has been found in the management view by this component's configured + * component type is applicable in the discovery context. + * <p> + * Because the Profile Service doesn't always provide the components in a hierarchy we present the resources + * we need this method to filter the components into their appropriate places. + * <p> + * This default implementation always returns true. + * + * @param discoveryContext the current discovery context + * @param component the discovered component + * @return true if the component logically belongs in the context, false otherwise. + */ + protected boolean accept(ResourceDiscoveryContext<P> discoveryContext, ManagedComponent component) { + return true; + } +}
commit f6bc179ab054b11fe0e06478fef3b15fe5772957 Merge: 673fc85... 5971d11... Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 25 12:44:47 2010 -0400
Merge branch 'bundle' into bundle-jay
Conflicts: modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentDiscoveryComponent.java
commit 673fc85e527e44f364a22f66971e19f8e25e9e80 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 25 12:44:04 2010 -0400
LT commit
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentDiscoveryComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentDiscoveryComponent.java index 4ee766f..f6af275 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentDiscoveryComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentDiscoveryComponent.java @@ -1,150 +1,150 @@ -/* -* Jopr Management Platform -* Copyright (C) 2005-2009 Red Hat, Inc. -* All rights reserved. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License, 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.jbossas5; - -import java.util.HashSet; -import java.util.Set; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.jboss.deployers.spi.management.ManagementView; -import org.jboss.managed.api.ComponentType; -import org.jboss.managed.api.ManagedComponent; -import org.rhq.core.domain.configuration.PropertySimple; -import org.rhq.core.domain.resource.ResourceType; -import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; -import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent; -import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; -import org.rhq.plugins.jbossas5.util.ConversionUtils; - -/** - * Discovery component for ManagedComponents exposed by the JBoss AS 5.x Profile Service that will be represented as - * child Resources of the JBoss AS Resource. - * - * @author Jason Dobies - * @author Mark Spritzer - * @author Ian Springer - */ -public class ManagedComponentDiscoveryComponent<P extends ProfileServiceComponent> implements - ResourceDiscoveryComponent<P> { - private final Log log = LogFactory.getLog(this.getClass()); - - public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<P> discoveryContext) - throws Exception { - ResourceType resourceType = discoveryContext.getResourceType(); - log.trace("Discovering " + resourceType.getName() + " Resources..."); - - ManagementView managementView = discoveryContext.getParentResourceComponent().getConnection() - .getManagementView(); - // TODO (ips): Only refresh the ManagementView *once* per runtime discovery scan, rather than every time this - // method is called. Do this by providing a runtime scan id in the ResourceDiscoveryContext. - managementView.load(); - - ComponentType componentType = getComponentType(discoveryContext); - Set<ManagedComponent> components; - try { - components = managementView.getComponentsForType(componentType); - } catch (Exception e) { - throw new IllegalStateException("Failed to get component types for " + resourceType + ".", e); - } - - Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>(components.size()); - /* Create a resource for each managed component found. We know all managed components will be of a - type we're interested in, so we can just add them all. There may be need for multiple iterations - over lists retrieved from different component types, but that is possible through the current API. - */ - for (ManagedComponent component : components) { - if (accept(discoveryContext, component)) { - String resourceName = getResourceName(component); - if (resourceName == null) { - resourceName = component.getName(); - } - String resourceKey = getResourceKey(component); - if (resourceKey == null) { - resourceKey = component.getName(); - } - String version = null; // (ips) I don't think there's anything generic we can do here. - - DiscoveredResourceDetails resource = new DiscoveredResourceDetails(resourceType, resourceKey, - resourceName, version, resourceType.getDescription(), discoveryContext - .getDefaultPluginConfiguration(), null); - - resource.getPluginConfiguration().put( - new PropertySimple(ManagedComponentComponent.Config.COMPONENT_NAME, resourceKey)); - - discoveredResources.add(resource); - } - } - - log.trace("Discovered " + discoveredResources.size() + " " + resourceType.getName() + " Resources."); - return discoveredResources; - } - - protected ComponentType getComponentType(ResourceDiscoveryContext<P> discoveryContext) { - ResourceType resourceType = discoveryContext.getResourceType(); - return ConversionUtils.getComponentType(resourceType); - } - - /** - * Subclasses can override this method if they don't want to use the ManagedComponent name as the initial - * Resource name. - * - * @param component the ManagedComponent being discovered - * @return the name to be assigned to the corresponding Resource - */ - protected String getResourceName(ManagedComponent component) { - return component.getName(); - } - - /** - * Return the unique resource key for the component. - * If you override this method, make sure to override - * {@link ManagedComponentComponent#getManagedComponent()} method as well - * because the return value of this method is used as the component name - * ({@link ManagedComponentComponent#getComponentName()}). - * - * @param component the component to uniquely identify - * @return the unique identifier for the component - */ - protected String getResourceKey(ManagedComponent component) { - return component.getName(); - } - - /** - * This method is called during {@link #discoverResources(ResourceDiscoveryContext)} to determine - * whether given component that has been found in the management view by this component's configured - * component type is applicable in the discovery context. - * <p> - * Because the Profile Service doesn't always provide the components in a hierarchy we present the resources - * we need this method to filter the components into their appropriate places. - * <p> - * This default implementation always returns true. - * - * @param discoveryContext the current discovery context - * @param component the discovered component - * @return true if the component logically belongs in the context, false otherwise. - */ - protected boolean accept(ResourceDiscoveryContext<P> discoveryContext, ManagedComponent component) { - return true; - } -} +/* +* Jopr Management Platform +* Copyright (C) 2005-2009 Red Hat, Inc. +* All rights reserved. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License, 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.jbossas5; + +import java.util.HashSet; +import java.util.Set; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.jboss.deployers.spi.management.ManagementView; +import org.jboss.managed.api.ComponentType; +import org.jboss.managed.api.ManagedComponent; +import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; +import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent; +import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; +import org.rhq.plugins.jbossas5.util.ConversionUtils; + +/** + * Discovery component for ManagedComponents exposed by the JBoss AS 5.x Profile Service that will be represented as + * child Resources of the JBoss AS Resource. + * + * @author Jason Dobies + * @author Mark Spritzer + * @author Ian Springer + */ +public class ManagedComponentDiscoveryComponent<P extends ProfileServiceComponent> implements + ResourceDiscoveryComponent<P> { + private final Log log = LogFactory.getLog(this.getClass()); + + public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<P> discoveryContext) + throws Exception { + ResourceType resourceType = discoveryContext.getResourceType(); + log.trace("Discovering " + resourceType.getName() + " Resources..."); + + ManagementView managementView = discoveryContext.getParentResourceComponent().getConnection() + .getManagementView(); + // TODO (ips): Only refresh the ManagementView *once* per runtime discovery scan, rather than every time this + // method is called. Do this by providing a runtime scan id in the ResourceDiscoveryContext. + managementView.load(); + + ComponentType componentType = getComponentType(discoveryContext); + Set<ManagedComponent> components; + try { + components = managementView.getComponentsForType(componentType); + } catch (Exception e) { + throw new IllegalStateException("Failed to get component types for " + resourceType + ".", e); + } + + Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>(components.size()); + /* Create a resource for each managed component found. We know all managed components will be of a + type we're interested in, so we can just add them all. There may be need for multiple iterations + over lists retrieved from different component types, but that is possible through the current API. + */ + for (ManagedComponent component : components) { + if (accept(discoveryContext, component)) { + String resourceName = getResourceName(component); + if (resourceName == null) { + resourceName = component.getName(); + } + String resourceKey = getResourceKey(component); + if (resourceKey == null) { + resourceKey = component.getName(); + } + String version = null; // (ips) I don't think there's anything generic we can do here. + + DiscoveredResourceDetails resource = new DiscoveredResourceDetails(resourceType, resourceKey, + resourceName, version, resourceType.getDescription(), discoveryContext + .getDefaultPluginConfiguration(), null); + + resource.getPluginConfiguration().put( + new PropertySimple(ManagedComponentComponent.Config.COMPONENT_NAME, resourceKey)); + + discoveredResources.add(resource); + } + } + + log.trace("Discovered " + discoveredResources.size() + " " + resourceType.getName() + " Resources."); + return discoveredResources; + } + + protected ComponentType getComponentType(ResourceDiscoveryContext<P> discoveryContext) { + ResourceType resourceType = discoveryContext.getResourceType(); + return ConversionUtils.getComponentType(resourceType); + } + + /** + * Subclasses can override this method if they don't want to use the ManagedComponent name as the initial + * Resource name. + * + * @param component the ManagedComponent being discovered + * @return the name to be assigned to the corresponding Resource + */ + protected String getResourceName(ManagedComponent component) { + return component.getName(); + } + + /** + * Return the unique resource key for the component. + * If you override this method, make sure to override + * {@link ManagedComponentComponent#getManagedComponent()} method as well + * because the return value of this method is used as the component name + * ({@link ManagedComponentComponent#getComponentName()}). + * + * @param component the component to uniquely identify + * @return the unique identifier for the component + */ + protected String getResourceKey(ManagedComponent component) { + return component.getName(); + } + + /** + * This method is called during {@link #discoverResources(ResourceDiscoveryContext)} to determine + * whether given component that has been found in the management view by this component's configured + * component type is applicable in the discovery context. + * <p> + * Because the Profile Service doesn't always provide the components in a hierarchy we present the resources + * we need this method to filter the components into their appropriate places. + * <p> + * This default implementation always returns true. + * + * @param discoveryContext the current discovery context + * @param component the discovered component + * @return true if the component logically belongs in the context, false otherwise. + */ + protected boolean accept(ResourceDiscoveryContext<P> discoveryContext, ManagedComponent component) { + return true; + } +}
commit 1b7b8acc134af53af250508f24bb6bacff4eacbb Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 25 12:41:58 2010 -0400
Fix NPE issue in Ant Bundle Plugin audit. Also, now throw IllegalArgumentException for bad null params to the audit call.
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java index 8f4af89..0f1d3b2 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java @@ -211,7 +211,12 @@ public class BundleManager extends AgentService implements BundleAgentService, B * convenience method:<br/> * category defaults to null<br/> * status defaults to SUCCESS<br/> - * attachement defaults null <br/> + * attachment defaults null <br/> + * + * @param bundleResourceDeployment not null + * @param action not null + * @param info not null + * @param message */ public void auditDeployment(BundleResourceDeployment bundleResourceDeployment, String action, String info, String message) { @@ -222,6 +227,10 @@ public class BundleManager extends AgentService implements BundleAgentService, B public void auditDeployment(BundleResourceDeployment bundleResourceDeployment, String action, String info, BundleResourceDeploymentHistory.Category category, BundleResourceDeploymentHistory.Status status, String message, String attachment) { + if (null == action || null == info) { + throw new IllegalArgumentException("action or info is null"); + } + if (null == status) { status = BundleResourceDeploymentHistory.Status.SUCCESS; } diff --git a/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java b/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java index b421ad1..2eb1d85 100644 --- a/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java +++ b/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java @@ -128,8 +128,8 @@ public class AntBundlePluginComponent implements ResourceComponent, BundleFacet // Send the diffs to the Server so it can store them as an entry in the deployment history. BundleManagerProvider bundleManagerProvider = request.getBundleManagerProvider(); DeployDifferences diffs = project.getDeployDifferences(); - bundleManagerProvider.auditDeployment(resourceDeployment, "Deployment Differences", null, - BundleResourceDeploymentHistory.Category.DEPLOY_STEP, null, diffs.toString(), null); + bundleManagerProvider.auditDeployment(resourceDeployment, "Deployment Differences", project.getName(), + BundleResourceDeploymentHistory.Category.DEPLOY_STEP, null, diffs.toString(), null); } catch (Throwable t) { if (log.isDebugEnabled()) { try {
commit fa15c72c4c63316760f10db332c3ec1f9660bc45 Author: Ian P. Springer <ips@jetengine.(none)> Date: Tue May 25 10:45:32 2010 -0400
fix SCM connection and developConnection URLs (cherry picked from commit 6dddb0393c6aac27de81c6f571d51d75a511a73a)
diff --git a/pom.xml b/pom.xml index 17373cf..996a17e 100644 --- a/pom.xml +++ b/pom.xml @@ -22,9 +22,9 @@ </organization>
<scm> - <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git</connection> - <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git</developerConnection> - <url>http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=tree</url> + <connection>scm:git:ssh://git.fedorahosted.org/git/rhq/rhq.git</connection> + <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq/rhq.git</developerConnection> + <url>http://git.fedorahosted.org/git/?p=rhq/rhq.git</url> </scm>
<issueManagement>
commit 363f24b524b58a8cbd32c13937f34d7877330067 Author: Ian P. Springer <ips@jetengine.(none)> Date: Tue May 25 10:38:21 2010 -0400
misc cosmetic (cherry picked from commit c8a3ca3ff97f1257d6b405fb30fa8df64e3bd493)
diff --git a/pom.xml b/pom.xml index 2fa260f..17373cf 100644 --- a/pom.xml +++ b/pom.xml @@ -514,8 +514,6 @@ </plugin> <plugin> <artifactId>maven-release-plugin</artifactId> - <!-- NOTE: If http://jira.codehaus.org/browse/MRELEASE-300 resurfaces, - it may be necessary to rollback to 2.0-beta-6. --> <version>2.0-beta-9</version> </plugin> <plugin> @@ -523,6 +521,10 @@ <version>2.4.2</version> </plugin> <plugin> + <artifactId>maven-scm-plugin</artifactId> + <version>1.3</version> + </plugin> + <plugin> <artifactId>maven-site-plugin</artifactId> <version>2.0.1</version> </plugin> @@ -561,11 +563,11 @@ <artifactId>properties-maven-plugin</artifactId> <version>1.0-alpha-2</version> </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>findbugs-maven-plugin</artifactId> - <version>${findbugs.version}</version> - </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>findbugs-maven-plugin</artifactId> + <version>${findbugs.version}</version> + </plugin> </plugins> </pluginManagement>
commit 0a7c4b5a2ae07be6551ff29ef873828a9d43daa9 Author: Ian P. Springer <ips@jetengine.(none)> Date: Tue May 25 10:24:07 2010 -0400
upgrade git scm provider from 1.2 to 1.3 to fix issue where it tries to push updates during release:prepare to all branches, rather than just the current branch (cherry picked from commit eec33e6b9ff4c9b0d6afd2842d86b25cc519388d)
diff --git a/pom.xml b/pom.xml index ded19ee..2fa260f 100644 --- a/pom.xml +++ b/pom.xml @@ -42,8 +42,6 @@ <!-- set the below prop to true to enable misc extra build output --> <rhq.debug>false</rhq.debug>
- <scm.branch>trunk</scm.branch> - <scm.module.path /> <findbugs.version>2.3</findbugs.version>
<doUpdate>false</doUpdate> @@ -491,6 +489,10 @@ <version>2.2</version> </plugin> <plugin> + <artifactId>maven-idea-plugin</artifactId> + <version>2.2</version> + </plugin> + <plugin> <artifactId>maven-install-plugin</artifactId> <version>2.3</version> </plugin> @@ -810,6 +812,13 @@
<plugin> <artifactId>maven-release-plugin</artifactId> + <dependencies> + <dependency> + <groupId>org.apache.maven.scm</groupId> + <artifactId>maven-scm-provider-gitexe</artifactId> + <version>1.3</version> + </dependency> + </dependencies> <configuration> <autoVersionSubmodules>true</autoVersionSubmodules> <updateDependencies>false</updateDependencies> @@ -817,6 +826,17 @@ </plugin>
<plugin> + <artifactId>maven-scm-plugin</artifactId> + <dependencies> + <dependency> + <groupId>org.apache.maven.scm</groupId> + <artifactId>maven-scm-provider-gitexe</artifactId> + <version>1.3</version> + </dependency> + </dependencies> + </plugin> + + <plugin> <artifactId>maven-surefire-plugin</artifactId> <configuration> <trimStackTrace>false</trimStackTrace> @@ -825,7 +845,6 @@
<plugin> <artifactId>maven-idea-plugin</artifactId> - <version>2.1</version> <configuration> <ideaVersion>6.x</ideaVersion> <downloadJavadocs>true</downloadJavadocs>
commit a076709cfe43e059b375d09fab4b6b6e901b90ac Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 25 12:12:35 2010 -0400
[BZ 594706] Remove cleanup of some obsolete prop def in favor of avoiding deadlock.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/metadata/ConfigurationMetadataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/metadata/ConfigurationMetadataManagerBean.java index e4c608c..8427c8b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/metadata/ConfigurationMetadataManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/metadata/ConfigurationMetadataManagerBean.java @@ -302,7 +302,6 @@ public class ConfigurationMetadataManagerBean implements ConfigurationMetadataMa * @param newProperty */ private void updatePropertyDefinition(PropertyDefinition existingProperty, PropertyDefinition newProperty) { - existingProperty.setDescription(newProperty.getDescription()); existingProperty.setDisplayName(newProperty.getDisplayName()); existingProperty.setActivationPolicy(newProperty.getActivationPolicy()); @@ -350,7 +349,7 @@ public class ConfigurationMetadataManagerBean implements ConfigurationMetadataMa PropertyDefinitionList exList = (PropertyDefinitionList) existingProperty; if (newProperty instanceof PropertyDefinitionList) { PropertyDefinitionList newList = (PropertyDefinitionList) newProperty; - replaceListPropertyMemberDefinition(exList, newList); + replaceListProperty(exList, newList); } else { // simple property or map-property replaceProperty(existingProperty, newProperty); } @@ -437,28 +436,36 @@ public class ConfigurationMetadataManagerBean implements ConfigurationMetadataMa }
/** - * This replaces the member property for the list. If it is a nested structure the whole thing - * is replaced from the top. The previous member property is removed. cascading should remove a nested - * structure. + * This replaces an existing list property def with a new list property definition. Primarily it replaces + * the member prop def for the list. If the member prop def is a nested structure the whole thing + * is replaced from the top. * - * @param existingProperty the existing prop - * @param newProperty the new prop that should replace the existing prop + * @param exList the existing prop def list + * @param newList the new prop def list */ - private void replaceListPropertyMemberDefinition(PropertyDefinitionList exList, PropertyDefinitionList newList) { - PropertyDefinition doomedMember = null; + private void replaceListProperty(PropertyDefinitionList exList, PropertyDefinitionList newList) { + PropertyDefinition doomedMemberDef = null;
// only remove the existing member if it is a different entity if (exList.getMemberDefinition().getId() != newList.getMemberDefinition().getId()) { - doomedMember = exList.getMemberDefinition(); + doomedMemberDef = exList.getMemberDefinition(); }
exList.setMemberDefinition(newList.getMemberDefinition()); exList.setMax(newList.getMax()); exList.setMin(newList.getMin());
- if (null != doomedMember) { - entityManager.remove(doomedMember); + // BZ 594706 + // Don't clean this up here because it's causing deadlocks in Oracle. Instead we'll just leave + // garbage in the db. Although annoying, and confusing for db queries, it's not a lot of data, + // just some extra prop defs and prop_def_enums. + if (null != doomedMemberDef) { + // entityManager.remove(doomedMemberDef); + if (log.isDebugEnabled()) { + log.debug("Ignoring cleanup of [" + doomedMemberDef + "] due to BZ 594706"); + } } + entityManager.merge(exList); entityManager.flush(); }
commit 6110257a9017dc68e8c28dea597922d1e26ed74b Author: Ian P. Springer <ips@jetengine.(none)> Date: Tue May 25 09:31:20 2010 -0400
Revert "[maven-release-plugin] prepare release RHQ_3_0_0_B06"
This reverts commit 33ee65714819c851690b1e566a4399be13150b70.
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml index c50034b..d7b9e91 100644 --- a/modules/common/ant-bundle/pom.xml +++ b/modules/common/ant-bundle/pom.xml @@ -1,11 +1,13 @@ -<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"> +<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%22%3E
<modelVersion>4.0.0</modelVersion>
<parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml index ed28f78..bc7965b 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml index c673c79..2cf950b 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/pom.xml b/modules/common/pom.xml index 5e15ea6..ee81a94 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>3.0.0.B06</version> + <version>3.0.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 663a600..d177f9e 100644 --- a/modules/core/client-api/pom.xml +++ b/modules/core/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.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 888404d..a51f92b 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index 459b21b..eb5d6ea 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> @@ -192,19 +192,19 @@ <property name="settings.localRepository" location="${user.home}/.m2/repository}" />
<condition property="rhq.ds.type-mapping" value="${rhq.dev.ds.type-mapping}" else="${rhq.test.ds.type-mapping}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.connection-url" value="${rhq.dev.ds.connection-url}" else="${rhq.test.ds.connection-url}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.user-name" value="${rhq.dev.ds.user-name}" else="${rhq.test.ds.user-name}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.password" value="${rhq.dev.ds.password}" else="${rhq.test.ds.password}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<ant antfile="${basedir}/src/main/scripts/dbsetup-build.xml"> @@ -240,19 +240,19 @@ <property name="settings.localRepository" location="${user.home}/.m2/repository}" />
<condition property="rhq.ds.type-mapping" value="${rhq.dev.ds.type-mapping}" else="${rhq.test.ds.type-mapping}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.connection-url" value="${rhq.dev.ds.connection-url}" else="${rhq.test.ds.connection-url}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.user-name" value="${rhq.dev.ds.user-name}" else="${rhq.test.ds.user-name}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.password" value="${rhq.dev.ds.password}" else="${rhq.test.ds.password}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<ant antfile="${basedir}/src/main/scripts/dbsetup-build.xml" target="dbsetup-combine"> @@ -289,23 +289,23 @@ <property name="settings.localRepository" location="${user.home}/.m2/repository}" />
<condition property="rhq.ds.type-mapping" value="${rhq.dev.ds.type-mapping}" else="${rhq.test.ds.type-mapping}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.connection-url" value="${rhq.dev.ds.connection-url}" else="${rhq.test.ds.connection-url}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.user-name" value="${rhq.dev.ds.user-name}" else="${rhq.test.ds.user-name}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.password" value="${rhq.dev.ds.password}" else="${rhq.test.ds.password}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.driver-class" value="${rhq.dev.ds.driver-class}" else="${rhq.test.ds.driver-class}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<ant antfile="${basedir}/src/main/scripts/dbsetup-build.xml" target="dbsetup-check-schema"> @@ -356,19 +356,19 @@ <property name="settings.localRepository" location="${user.home}/.m2/repository}" />
<condition property="rhq.ds.type-mapping" value="${rhq.dev.ds.type-mapping}" else="${rhq.test.ds.type-mapping}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.connection-url" value="${rhq.dev.ds.connection-url}" else="${rhq.test.ds.connection-url}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.user-name" value="${rhq.dev.ds.user-name}" else="${rhq.test.ds.user-name}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.password" value="${rhq.dev.ds.password}" else="${rhq.test.ds.password}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<ant antfile="${basedir}/src/main/scripts/dbsetup-build.xml" target="create-release-schema"> @@ -384,7 +384,7 @@ <property name="rhq.ds.password" value="${rhq.ds.password}" /> <property name="project.version" value="${project.version}" /> <property name="db.schema.version" value="${db.schema.version}" /> - <property name="jon.release" value="${jon.release}" /> + <property name="jon.release" value="${jon.release}"/> </ant> </tasks> </configuration> diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml index 9c8aca5..7ed877c 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml index 8e82464..0911918 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>3.0.0.B06</version> + <version>3.0.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 5b616ae..d47d4c8 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml index 56ea023..e1ce7ef 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml index 164b5bf..b0472c3 100644 --- a/modules/core/plugin-container/pom.xml +++ b/modules/core/plugin-container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.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 90562d8..7739177 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml index 0cd671c..eeb7e81 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/pom.xml b/modules/core/pom.xml index 1f413fa..7aad64c 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml index 9cf360d..bc41dc5 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml index 3f7ac30..d9f1c1c 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml index 9c88b63..8942239 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml index 761a749..8b9da9c 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml index f0fd77b..ad30bfb 100644 --- a/modules/enterprise/gui/base-perspective-jar/pom.xml +++ b/modules/enterprise/gui/base-perspective-jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> @@ -29,7 +29,7 @@ <seam.version>2.1.0.SP1</seam.version> <jboss-el.version>1.0_02.CR5</jboss-el.version> <richfaces.version>3.3.2.SR1</richfaces.version> - <rhq.version>3.0.0.B06</rhq.version> + <rhq.version>3.0.0-SNAPSHOT</rhq.version> </properties>
<dependencyManagement> diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml index 491d505..798a8ca 100644 --- a/modules/enterprise/gui/base-perspective-war/pom.xml +++ b/modules/enterprise/gui/base-perspective-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml index 54e3273..df05645 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>3.0.0.B06</version> + <version>3.0.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 eac2729..c5615d3 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -1,11 +1,12 @@ -<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"> +<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%22%3E
<modelVersion>4.0.0</modelVersion>
<parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> @@ -341,13 +342,13 @@ <fileset dir="war/WEB-INF/classes" /> </copy> --> - <property name="deployment.dir" location="${rhq.deploymentDir}" /> + <property name="deployment.dir" location="${rhq.deploymentDir}"/> <echo>*** Copying updated files from src${file.separator}main${file.separator}webapp${file.separator} to ${deployment.dir}${file.separator}... </echo> <copy todir="${deployment.dir}" verbose="${rhq.verbose}"> - <fileset dir="${basedir}/src/main/webapp" /> + <fileset dir="${basedir}/src/main/webapp"/> </copy> </tasks> </configuration> @@ -361,13 +362,13 @@ <phase>package</phase> <configuration> <tasks> - <property name="deployment.dir" location="${rhq.deploymentDir}" /> + <property name="deployment.dir" location="${rhq.deploymentDir}"/> <echo>*** Copying updated files from target${file.separator}${project.build.finalName}${file.separator} to ${deployment.dir}${file.separator}... </echo> <copy todir="${deployment.dir}" verbose="${rhq.verbose}"> - <fileset dir="${basedir}/target/${project.build.finalName}" /> + <fileset dir="${basedir}/target/${project.build.finalName}"/> </copy> </tasks> </configuration> @@ -381,9 +382,9 @@ <phase>clean</phase> <configuration> <tasks> - <property name="deployment.dir" location="${rhq.deploymentDir}" /> + <property name="deployment.dir" location="${rhq.deploymentDir}"/> <echo>*** Deleting ${deployment.dir}${file.separator}...</echo> - <delete dir="${deployment.dir}" /> + <delete dir="${deployment.dir}"/> </tasks> </configuration> <goals> diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml index e65696a..dcb1f88 100644 --- a/modules/enterprise/gui/installer-war/pom.xml +++ b/modules/enterprise/gui/installer-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml index ce5dfbd..0c529ba 100644 --- a/modules/enterprise/gui/pom.xml +++ b/modules/enterprise/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml index 32d044b..783942c 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/webdav-war/pom.xml b/modules/enterprise/gui/webdav-war/pom.xml index bed6a3f..aa880be 100644 --- a/modules/enterprise/gui/webdav-war/pom.xml +++ b/modules/enterprise/gui/webdav-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml index d50cbdc..7b3f967 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml index e1ab76d..33966bd 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-cli</artifactId> diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml index 739409e..605267f 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-client-api</artifactId> diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml index be25cc0..198c17b 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-parent</artifactId> diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml index 6366cb7..2ea73ee 100644 --- a/modules/enterprise/remoting/webservices/pom.xml +++ b/modules/enterprise/remoting/webservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-webservices</artifactId> diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml index 2b32e80..2c98817 100644 --- a/modules/enterprise/server/container-lib/pom.xml +++ b/modules/enterprise/server/container-lib/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml index afc9617..6b296df 100644 --- a/modules/enterprise/server/container/pom.xml +++ b/modules/enterprise/server/container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml index 258a946..bf15866 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml index 736e20d..e718952 100644 --- a/modules/enterprise/server/jar/pom.xml +++ b/modules/enterprise/server/jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml index f9229ef..ad4a632 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.server</groupId> <artifactId>alert-email</artifactId> - <version>3.0.0.B06</version> + <version>3.0.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 9e47d32..9f1a05c 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-irc</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version>
<name>RHQ Enterprise Server IRC Alert Plugin</name> diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml index e5ba966..7d884ca 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-microblog</artifactId> - <version>3.0.0.B06</version> + <version>3.0.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 bdb9341..c9df693 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-mobicents</artifactId> - <version>3.0.0.B06</version> + <version>3.0.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 637bb69..6f99cce 100644 --- a/modules/enterprise/server/plugins/alert-operations/pom.xml +++ b/modules/enterprise/server/plugins/alert-operations/pom.xml @@ -1,15 +1,16 @@ -<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"> +<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%22%3E <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-operations</artifactId> <packaging>jar</packaging> - <version>3.0.0.B06</version> + <version>3.0.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 89fdc9f..2287067 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-roles</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Roles Alert Plugin</name>
@@ -124,7 +124,8 @@ <include name="META-INF/**" /> </patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" + update="true"> </jar> </tasks> </configuration> diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml index bc98b9e..f8a5704 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-snmp</artifactId> - <version>3.0.0.B06</version> + <version>3.0.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 a6c3743..31520b5 100644 --- a/modules/enterprise/server/plugins/alert-subject/pom.xml +++ b/modules/enterprise/server/plugins/alert-subject/pom.xml @@ -1,15 +1,17 @@ <?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" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<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/xsd/maven-4.0.0.xsd%22%3E <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-subject</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Subject Alert Plugin</name>
@@ -91,10 +93,11 @@ <phase>compile</phase> <configuration> <tasks> - <mkdir dir="${rhq.deploymentDir}" /> - <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" /> + <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}" /> + <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}"/> </tasks> </configuration> <goals> @@ -107,9 +110,10 @@ <phase>clean</phase> <configuration> <tasks> - <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" /> + <property name="deployment.file" + location="${rhq.deploymentDir}/${project.build.finalName}.jar"/> <echo>*** Deleting ${deployment.file}...</echo> - <delete file="${deployment.file}" /> + <delete file="${deployment.file}"/> </tasks> </configuration> <goals> diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml index 9af4022..9dd813b 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> @@ -192,7 +192,8 @@ <include name="META-INF/**" /> </patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" + update="true"> </jar> </tasks> </configuration> diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml index 60e5690..73b41d6 100644 --- a/modules/enterprise/server/plugins/cobbler/pom.xml +++ b/modules/enterprise/server/plugins/cobbler/pom.xml @@ -1,17 +1,19 @@ <?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" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<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/xsd/maven-4.0.0.xsd%22%3E
<parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>rhq-serverplugin-cobbler</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Cobbler Plugin</name>
@@ -150,7 +152,8 @@ <include name="META-INF/**" /> </patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" + update="true"> </jar> </tasks> </configuration> diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml index 0e59679..0033d1b 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>3.0.0.B06</version> + <version>3.0.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 3119da9..44cdb03 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> @@ -179,7 +179,8 @@ <include name="META-INF/**" /> </patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" + update="true"> </jar> </tasks> </configuration> diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml index b91da52..7451668 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml index 724a1ce..0ac61d3 100644 --- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml index ed931c9..5a78451 100644 --- a/modules/enterprise/server/plugins/perspectives/core/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml index fa14b1d..1e17ce8 100644 --- a/modules/enterprise/server/plugins/pom.xml +++ b/modules/enterprise/server/plugins/pom.xml @@ -1,11 +1,14 @@ -<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"> +<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%22%3E
<modelVersion>4.0.0</modelVersion>
<parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml index 955bf2a..e4ab9b2 100644 --- a/modules/enterprise/server/plugins/rhnhosted/pom.xml +++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml index c30ac79..a6cba32 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>3.0.0.B06</version> + <version>3.0.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 3e2a7c9..9c7cc74 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>3.0.0.B06</version> + <version>3.0.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 003ca65..ebdd3da 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml index 45e6219..06c8981 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml index 3498ccd..aa278b8 100644 --- a/modules/enterprise/server/sars/agent-sar/pom.xml +++ b/modules/enterprise/server/sars/agent-sar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-sars-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml index 93afd9a..68deca1 100644 --- a/modules/enterprise/server/sars/pom.xml +++ b/modules/enterprise/server/sars/pom.xml @@ -1,11 +1,13 @@ -<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"> +<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%22%3E
<modelVersion>4.0.0</modelVersion>
<parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml index 1be8fdc..14738d0 100644 --- a/modules/enterprise/server/xml-schemas/pom.xml +++ b/modules/enterprise/server/xml-schemas/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/helpers/pluginAnnotations/pom.xml b/modules/helpers/pluginAnnotations/pom.xml index 0500f87..f9dde4c 100644 --- a/modules/helpers/pluginAnnotations/pom.xml +++ b/modules/helpers/pluginAnnotations/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
@@ -16,7 +16,7 @@
<name>RHQ plugin annotations</name> <description>Annotations to help generate plugin descriptors</description> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version>
<scm> <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/helpers/pluginGen</connection> diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml index d3bc054..4a31a97 100644 --- a/modules/helpers/pluginGen/pom.xml +++ b/modules/helpers/pluginGen/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
@@ -16,7 +16,7 @@
<name>RHQ plugin generator</name> <description>Helper to generate plugin skeletons</description> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version>
<scm> <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/helpers/pluginGen</connection> diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml index 9233417..a0721a9 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml index 3be4811..5d327ee 100644 --- a/modules/helpers/rtfilter/pom.xml +++ b/modules/helpers/rtfilter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml index 562d6bc..c37598e 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>3.0.0.B06</version> + <version>3.0.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 c530841..fcfd7c6 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> @@ -230,7 +230,8 @@ <include name="META-INF/**" /> </patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" + update="true"> </jar> </tasks> </configuration> diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml index 8641742..a6e1257 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index 931115b..9a781ba 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml index 6c9475a..d920440 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml index 8456a45..d5aaad5 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml index 77ad497..30889f7 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>3.0.0.B06</version> + <version>3.0.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 ff4bb67..b79645d 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml index c3da6c1..f7cf265 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml index 861cdd6..acb08ef 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml index 942f017..7dd0fde 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml index 31d4875..de89333 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> <artifactId>rhq-hudson-plugin</artifactId> - <version>3.0.0.B06</version> + <version>3.0.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 8f44ac9..853c020 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>3.0.0.B06</version> + <version>3.0.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 10e5dff..a0ade77 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml index 1ed2894..b9ed2b3 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>3.0.0.B06</version> + <version>3.0.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 a5466f0..b3846fa 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>3.0.0.B06</version> + <version>3.0.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 f3c3c10..443e524 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml index ae1f1ca..ac9885a 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml index b32c80c..d0c9053 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml index cf065cb..06ae2ae 100644 --- a/modules/plugins/netservices/pom.xml +++ b/modules/plugins/netservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml index b1b59f4..1acdb0f 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml index 20cd56c..39c75da 100644 --- a/modules/plugins/perftest/pom.xml +++ b/modules/plugins/perftest/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml index 937f524..97b83b0 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml index 8e752cb..85d6105 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml index 5a6c5bc..283ab6a 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml index fb4e3fd..5a4466c 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>3.0.0.B06</version> + <version>3.0.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 a818d2e..a190dcd 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>3.0.0.B06</version> + <version>3.0.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 79de99c..8f4e675 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml index 8a5ae94..0d41574 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml index 0afed5a..7719b14 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml index 8115e8d..2d9d715 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml index 8cbfd25..3579496 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml index b9d6671..41df1b8 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml index ca39ca2..205d5b0 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml index 7e6fb8b..e299efa 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>3.0.0.B06</version> + <version>3.0.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 9ff9209..b3d5e87 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/pom.xml b/modules/pom.xml index c35c685..bc96ae3 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml index 2839ddd..2235687 100644 --- a/modules/test-utils/pom.xml +++ b/modules/test-utils/pom.xml @@ -4,7 +4,7 @@ <parent> <artifactId>rhq-modules-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent> <artifactId>test-utils</artifactId> <name>RHQ Test Utils</name> diff --git a/pom.xml b/pom.xml index a2f3e3c..ded19ee 100644 --- a/pom.xml +++ b/pom.xml @@ -1,12 +1,14 @@ <?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"> +<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%22%3E
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> <packaging>pom</packaging>
<name>RHQ</name> @@ -596,9 +598,9 @@ <configuration> <tasks> <tstamp> - <format property="buildTime" pattern="MM/dd/yy hh:mm aa z" locale="en,US" timezone="GMT" /> + <format property="buildTime" pattern="MM/dd/yy hh:mm aa z" locale="en,US" timezone="GMT"/> </tstamp> - <mkdir dir="target" /> + <mkdir dir="target"/> <echo file="target/build-time.properties" level="error">buildTime = ${buildTime}</echo> </tasks> </configuration>
commit 33ee65714819c851690b1e566a4399be13150b70 Author: Ian P. Springer <ips@jetengine.(none)> Date: Tue May 25 09:28:15 2010 -0400
[maven-release-plugin] prepare release RHQ_3_0_0_B06
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml index d7b9e91..c50034b 100644 --- a/modules/common/ant-bundle/pom.xml +++ b/modules/common/ant-bundle/pom.xml @@ -1,13 +1,11 @@ -<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%22%3E +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml index bc7965b..ed28f78 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml index 2cf950b..c673c79 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/pom.xml b/modules/common/pom.xml index ee81a94..5e15ea6 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml index d177f9e..663a600 100644 --- a/modules/core/client-api/pom.xml +++ b/modules/core/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml index a51f92b..888404d 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index eb5d6ea..459b21b 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> @@ -192,19 +192,19 @@ <property name="settings.localRepository" location="${user.home}/.m2/repository}" />
<condition property="rhq.ds.type-mapping" value="${rhq.dev.ds.type-mapping}" else="${rhq.test.ds.type-mapping}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.connection-url" value="${rhq.dev.ds.connection-url}" else="${rhq.test.ds.connection-url}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.user-name" value="${rhq.dev.ds.user-name}" else="${rhq.test.ds.user-name}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.password" value="${rhq.dev.ds.password}" else="${rhq.test.ds.password}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<ant antfile="${basedir}/src/main/scripts/dbsetup-build.xml"> @@ -240,19 +240,19 @@ <property name="settings.localRepository" location="${user.home}/.m2/repository}" />
<condition property="rhq.ds.type-mapping" value="${rhq.dev.ds.type-mapping}" else="${rhq.test.ds.type-mapping}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.connection-url" value="${rhq.dev.ds.connection-url}" else="${rhq.test.ds.connection-url}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.user-name" value="${rhq.dev.ds.user-name}" else="${rhq.test.ds.user-name}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.password" value="${rhq.dev.ds.password}" else="${rhq.test.ds.password}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<ant antfile="${basedir}/src/main/scripts/dbsetup-build.xml" target="dbsetup-combine"> @@ -289,23 +289,23 @@ <property name="settings.localRepository" location="${user.home}/.m2/repository}" />
<condition property="rhq.ds.type-mapping" value="${rhq.dev.ds.type-mapping}" else="${rhq.test.ds.type-mapping}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.connection-url" value="${rhq.dev.ds.connection-url}" else="${rhq.test.ds.connection-url}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.user-name" value="${rhq.dev.ds.user-name}" else="${rhq.test.ds.user-name}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.password" value="${rhq.dev.ds.password}" else="${rhq.test.ds.password}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.driver-class" value="${rhq.dev.ds.driver-class}" else="${rhq.test.ds.driver-class}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<ant antfile="${basedir}/src/main/scripts/dbsetup-build.xml" target="dbsetup-check-schema"> @@ -356,19 +356,19 @@ <property name="settings.localRepository" location="${user.home}/.m2/repository}" />
<condition property="rhq.ds.type-mapping" value="${rhq.dev.ds.type-mapping}" else="${rhq.test.ds.type-mapping}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.connection-url" value="${rhq.dev.ds.connection-url}" else="${rhq.test.ds.connection-url}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.user-name" value="${rhq.dev.ds.user-name}" else="${rhq.test.ds.user-name}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.password" value="${rhq.dev.ds.password}" else="${rhq.test.ds.password}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<ant antfile="${basedir}/src/main/scripts/dbsetup-build.xml" target="create-release-schema"> @@ -384,7 +384,7 @@ <property name="rhq.ds.password" value="${rhq.ds.password}" /> <property name="project.version" value="${project.version}" /> <property name="db.schema.version" value="${db.schema.version}" /> - <property name="jon.release" value="${jon.release}"/> + <property name="jon.release" value="${jon.release}" /> </ant> </tasks> </configuration> diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml index 7ed877c..9c8aca5 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml index 0911918..8e82464 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml index d47d4c8..5b616ae 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml index e1ce7ef..56ea023 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml index b0472c3..164b5bf 100644 --- a/modules/core/plugin-container/pom.xml +++ b/modules/core/plugin-container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml index 7739177..90562d8 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml index eeb7e81..0cd671c 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/pom.xml b/modules/core/pom.xml index 7aad64c..1f413fa 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml index bc41dc5..9cf360d 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml index d9f1c1c..3f7ac30 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml index 8942239..9c88b63 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml index 8b9da9c..761a749 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml index ad30bfb..f0fd77b 100644 --- a/modules/enterprise/gui/base-perspective-jar/pom.xml +++ b/modules/enterprise/gui/base-perspective-jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> @@ -29,7 +29,7 @@ <seam.version>2.1.0.SP1</seam.version> <jboss-el.version>1.0_02.CR5</jboss-el.version> <richfaces.version>3.3.2.SR1</richfaces.version> - <rhq.version>3.0.0-SNAPSHOT</rhq.version> + <rhq.version>3.0.0.B06</rhq.version> </properties>
<dependencyManagement> diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml index 798a8ca..491d505 100644 --- a/modules/enterprise/gui/base-perspective-war/pom.xml +++ b/modules/enterprise/gui/base-perspective-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml index df05645..54e3273 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index c5615d3..eac2729 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -1,12 +1,11 @@ -<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%22%3E +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> @@ -342,13 +341,13 @@ <fileset dir="war/WEB-INF/classes" /> </copy> --> - <property name="deployment.dir" location="${rhq.deploymentDir}"/> + <property name="deployment.dir" location="${rhq.deploymentDir}" /> <echo>*** Copying updated files from src${file.separator}main${file.separator}webapp${file.separator} to ${deployment.dir}${file.separator}... </echo> <copy todir="${deployment.dir}" verbose="${rhq.verbose}"> - <fileset dir="${basedir}/src/main/webapp"/> + <fileset dir="${basedir}/src/main/webapp" /> </copy> </tasks> </configuration> @@ -362,13 +361,13 @@ <phase>package</phase> <configuration> <tasks> - <property name="deployment.dir" location="${rhq.deploymentDir}"/> + <property name="deployment.dir" location="${rhq.deploymentDir}" /> <echo>*** Copying updated files from target${file.separator}${project.build.finalName}${file.separator} to ${deployment.dir}${file.separator}... </echo> <copy todir="${deployment.dir}" verbose="${rhq.verbose}"> - <fileset dir="${basedir}/target/${project.build.finalName}"/> + <fileset dir="${basedir}/target/${project.build.finalName}" /> </copy> </tasks> </configuration> @@ -382,9 +381,9 @@ <phase>clean</phase> <configuration> <tasks> - <property name="deployment.dir" location="${rhq.deploymentDir}"/> + <property name="deployment.dir" location="${rhq.deploymentDir}" /> <echo>*** Deleting ${deployment.dir}${file.separator}...</echo> - <delete dir="${deployment.dir}"/> + <delete dir="${deployment.dir}" /> </tasks> </configuration> <goals> diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml index dcb1f88..e65696a 100644 --- a/modules/enterprise/gui/installer-war/pom.xml +++ b/modules/enterprise/gui/installer-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml index 0c529ba..ce5dfbd 100644 --- a/modules/enterprise/gui/pom.xml +++ b/modules/enterprise/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml index 783942c..32d044b 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/webdav-war/pom.xml b/modules/enterprise/gui/webdav-war/pom.xml index aa880be..bed6a3f 100644 --- a/modules/enterprise/gui/webdav-war/pom.xml +++ b/modules/enterprise/gui/webdav-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml index 7b3f967..d50cbdc 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml index 33966bd..e1ab76d 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<artifactId>rhq-remoting-cli</artifactId> diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml index 605267f..739409e 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<artifactId>rhq-remoting-client-api</artifactId> diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml index 198c17b..be25cc0 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<artifactId>rhq-remoting-parent</artifactId> diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml index 2ea73ee..6366cb7 100644 --- a/modules/enterprise/remoting/webservices/pom.xml +++ b/modules/enterprise/remoting/webservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<artifactId>rhq-remoting-webservices</artifactId> diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml index 2c98817..2b32e80 100644 --- a/modules/enterprise/server/container-lib/pom.xml +++ b/modules/enterprise/server/container-lib/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml index 6b296df..afc9617 100644 --- a/modules/enterprise/server/container/pom.xml +++ b/modules/enterprise/server/container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml index bf15866..258a946 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml index e718952..736e20d 100644 --- a/modules/enterprise/server/jar/pom.xml +++ b/modules/enterprise/server/jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml index ad4a632..f9229ef 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.server</groupId> <artifactId>alert-email</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 9f1a05c..9e47d32 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-irc</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version>
<name>RHQ Enterprise Server IRC Alert Plugin</name> diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml index 7d884ca..e5ba966 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-microblog</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 c9df693..bdb9341 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-mobicents</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 6f99cce..637bb69 100644 --- a/modules/enterprise/server/plugins/alert-operations/pom.xml +++ b/modules/enterprise/server/plugins/alert-operations/pom.xml @@ -1,16 +1,15 @@ -<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%22%3E +<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"> <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-operations</artifactId> <packaging>jar</packaging> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 2287067..89fdc9f 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-roles</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version>
<name>RHQ Enterprise Server Roles Alert Plugin</name>
@@ -124,8 +124,7 @@ <include name="META-INF/**" /> </patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" - update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> </jar> </tasks> </configuration> diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml index f8a5704..bc98b9e 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-snmp</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 31520b5..a6c3743 100644 --- a/modules/enterprise/server/plugins/alert-subject/pom.xml +++ b/modules/enterprise/server/plugins/alert-subject/pom.xml @@ -1,17 +1,15 @@ <?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" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd%22%3E +<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/xsd/maven-4.0.0.xsd"> <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-subject</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version>
<name>RHQ Enterprise Server Subject Alert Plugin</name>
@@ -93,11 +91,10 @@ <phase>compile</phase> <configuration> <tasks> - <mkdir dir="${rhq.deploymentDir}"/> - <property name="deployment.file" - location="${rhq.deploymentDir}/${project.build.finalName}.jar"/> + <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}"/> + <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}" /> </tasks> </configuration> <goals> @@ -110,10 +107,9 @@ <phase>clean</phase> <configuration> <tasks> - <property name="deployment.file" - location="${rhq.deploymentDir}/${project.build.finalName}.jar"/> + <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" /> <echo>*** Deleting ${deployment.file}...</echo> - <delete file="${deployment.file}"/> + <delete file="${deployment.file}" /> </tasks> </configuration> <goals> diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml index 9dd813b..9af4022 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> @@ -192,8 +192,7 @@ <include name="META-INF/**" /> </patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" - update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> </jar> </tasks> </configuration> diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml index 73b41d6..60e5690 100644 --- a/modules/enterprise/server/plugins/cobbler/pom.xml +++ b/modules/enterprise/server/plugins/cobbler/pom.xml @@ -1,19 +1,17 @@ <?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" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd%22%3E +<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/xsd/maven-4.0.0.xsd">
<parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>rhq-serverplugin-cobbler</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version>
<name>RHQ Enterprise Server Cobbler Plugin</name>
@@ -152,8 +150,7 @@ <include name="META-INF/**" /> </patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" - update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> </jar> </tasks> </configuration> diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml index 0033d1b..0e59679 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 44cdb03..3119da9 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> @@ -179,8 +179,7 @@ <include name="META-INF/**" /> </patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" - update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> </jar> </tasks> </configuration> diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml index 7451668..b91da52 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml index 0ac61d3..724a1ce 100644 --- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml index 5a78451..ed931c9 100644 --- a/modules/enterprise/server/plugins/perspectives/core/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml index 1e17ce8..fa14b1d 100644 --- a/modules/enterprise/server/plugins/pom.xml +++ b/modules/enterprise/server/plugins/pom.xml @@ -1,14 +1,11 @@ -<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%22%3E +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml index e4ab9b2..955bf2a 100644 --- a/modules/enterprise/server/plugins/rhnhosted/pom.xml +++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml index a6cba32..c30ac79 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 9c7cc74..3e2a7c9 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 ebdd3da..003ca65 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml index 06c8981..45e6219 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml index aa278b8..3498ccd 100644 --- a/modules/enterprise/server/sars/agent-sar/pom.xml +++ b/modules/enterprise/server/sars/agent-sar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-sars-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml index 68deca1..93afd9a 100644 --- a/modules/enterprise/server/sars/pom.xml +++ b/modules/enterprise/server/sars/pom.xml @@ -1,13 +1,11 @@ -<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%22%3E +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml index 14738d0..1be8fdc 100644 --- a/modules/enterprise/server/xml-schemas/pom.xml +++ b/modules/enterprise/server/xml-schemas/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/helpers/pluginAnnotations/pom.xml b/modules/helpers/pluginAnnotations/pom.xml index f9dde4c..0500f87 100644 --- a/modules/helpers/pluginAnnotations/pom.xml +++ b/modules/helpers/pluginAnnotations/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
@@ -16,7 +16,7 @@
<name>RHQ plugin annotations</name> <description>Annotations to help generate plugin descriptors</description> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version>
<scm> <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/helpers/pluginGen</connection> diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml index 4a31a97..d3bc054 100644 --- a/modules/helpers/pluginGen/pom.xml +++ b/modules/helpers/pluginGen/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
@@ -16,7 +16,7 @@
<name>RHQ plugin generator</name> <description>Helper to generate plugin skeletons</description> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version>
<scm> <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/helpers/pluginGen</connection> diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml index a0721a9..9233417 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml index 5d327ee..3be4811 100644 --- a/modules/helpers/rtfilter/pom.xml +++ b/modules/helpers/rtfilter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml index c37598e..562d6bc 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml index fcfd7c6..c530841 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> @@ -230,8 +230,7 @@ <include name="META-INF/**" /> </patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" - update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> </jar> </tasks> </configuration> diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml index a6e1257..8641742 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index 9a781ba..931115b 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml index d920440..6c9475a 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml index d5aaad5..8456a45 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml index 30889f7..77ad497 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml index b79645d..ff4bb67 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml index f7cf265..c3da6c1 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml index acb08ef..861cdd6 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml index 7dd0fde..942f017 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml index de89333..31d4875 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> <artifactId>rhq-hudson-plugin</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> <packaging>jar</packaging>
<name>RHQ Hudson Plugin</name> diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml index 853c020..8f44ac9 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 a0ade77..10e5dff 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml index b9ed2b3..1ed2894 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 b3846fa..a5466f0 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml index 443e524..f3c3c10 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml index ac9885a..ae1f1ca 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml index d0c9053..b32c80c 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml index 06ae2ae..cf065cb 100644 --- a/modules/plugins/netservices/pom.xml +++ b/modules/plugins/netservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml index 1acdb0f..b1b59f4 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml index 39c75da..20cd56c 100644 --- a/modules/plugins/perftest/pom.xml +++ b/modules/plugins/perftest/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml index 97b83b0..937f524 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml index 85d6105..8e752cb 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml index 283ab6a..5a6c5bc 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml index 5a4466c..fb4e3fd 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml index a190dcd..a818d2e 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml index 8f4e675..79de99c 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml index 0d41574..8a5ae94 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml index 7719b14..0afed5a 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml index 2d9d715..8115e8d 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml index 3579496..8cbfd25 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml index 41df1b8..b9d6671 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml index 205d5b0..ca39ca2 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml index e299efa..7e6fb8b 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 b3d5e87..9ff9209 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/pom.xml b/modules/pom.xml index bc96ae3..c35c685 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml index 2235687..2839ddd 100644 --- a/modules/test-utils/pom.xml +++ b/modules/test-utils/pom.xml @@ -4,7 +4,7 @@ <parent> <artifactId>rhq-modules-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent> <artifactId>test-utils</artifactId> <name>RHQ Test Utils</name> diff --git a/pom.xml b/pom.xml index ded19ee..a2f3e3c 100644 --- a/pom.xml +++ b/pom.xml @@ -1,14 +1,12 @@ <?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%22%3E +<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</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> <packaging>pom</packaging>
<name>RHQ</name> @@ -598,9 +596,9 @@ <configuration> <tasks> <tstamp> - <format property="buildTime" pattern="MM/dd/yy hh:mm aa z" locale="en,US" timezone="GMT"/> + <format property="buildTime" pattern="MM/dd/yy hh:mm aa z" locale="en,US" timezone="GMT" /> </tstamp> - <mkdir dir="target"/> + <mkdir dir="target" /> <echo file="target/build-time.properties" level="error">buildTime = ${buildTime}</echo> </tasks> </configuration>
commit 586390030e6180989537fc321556644268b56e51 Author: Ian P. Springer <ips@jetengine.(none)> Date: Tue May 25 09:17:42 2010 -0400
Revert "[maven-release-plugin] prepare release RHQ_3_0_0_B06"
This reverts commit 9f6a800863e41d3c741c3dc8d3a8a2f46040e827.
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml index c50034b..d7b9e91 100644 --- a/modules/common/ant-bundle/pom.xml +++ b/modules/common/ant-bundle/pom.xml @@ -1,11 +1,13 @@ -<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"> +<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%22%3E
<modelVersion>4.0.0</modelVersion>
<parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml index ed28f78..bc7965b 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml index c673c79..2cf950b 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/pom.xml b/modules/common/pom.xml index 5e15ea6..ee81a94 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>3.0.0.B06</version> + <version>3.0.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 663a600..d177f9e 100644 --- a/modules/core/client-api/pom.xml +++ b/modules/core/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.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 888404d..a51f92b 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index 459b21b..eb5d6ea 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> @@ -192,19 +192,19 @@ <property name="settings.localRepository" location="${user.home}/.m2/repository}" />
<condition property="rhq.ds.type-mapping" value="${rhq.dev.ds.type-mapping}" else="${rhq.test.ds.type-mapping}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.connection-url" value="${rhq.dev.ds.connection-url}" else="${rhq.test.ds.connection-url}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.user-name" value="${rhq.dev.ds.user-name}" else="${rhq.test.ds.user-name}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.password" value="${rhq.dev.ds.password}" else="${rhq.test.ds.password}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<ant antfile="${basedir}/src/main/scripts/dbsetup-build.xml"> @@ -240,19 +240,19 @@ <property name="settings.localRepository" location="${user.home}/.m2/repository}" />
<condition property="rhq.ds.type-mapping" value="${rhq.dev.ds.type-mapping}" else="${rhq.test.ds.type-mapping}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.connection-url" value="${rhq.dev.ds.connection-url}" else="${rhq.test.ds.connection-url}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.user-name" value="${rhq.dev.ds.user-name}" else="${rhq.test.ds.user-name}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.password" value="${rhq.dev.ds.password}" else="${rhq.test.ds.password}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<ant antfile="${basedir}/src/main/scripts/dbsetup-build.xml" target="dbsetup-combine"> @@ -289,23 +289,23 @@ <property name="settings.localRepository" location="${user.home}/.m2/repository}" />
<condition property="rhq.ds.type-mapping" value="${rhq.dev.ds.type-mapping}" else="${rhq.test.ds.type-mapping}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.connection-url" value="${rhq.dev.ds.connection-url}" else="${rhq.test.ds.connection-url}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.user-name" value="${rhq.dev.ds.user-name}" else="${rhq.test.ds.user-name}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.password" value="${rhq.dev.ds.password}" else="${rhq.test.ds.password}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.driver-class" value="${rhq.dev.ds.driver-class}" else="${rhq.test.ds.driver-class}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<ant antfile="${basedir}/src/main/scripts/dbsetup-build.xml" target="dbsetup-check-schema"> @@ -356,19 +356,19 @@ <property name="settings.localRepository" location="${user.home}/.m2/repository}" />
<condition property="rhq.ds.type-mapping" value="${rhq.dev.ds.type-mapping}" else="${rhq.test.ds.type-mapping}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.connection-url" value="${rhq.dev.ds.connection-url}" else="${rhq.test.ds.connection-url}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.user-name" value="${rhq.dev.ds.user-name}" else="${rhq.test.ds.user-name}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<condition property="rhq.ds.password" value="${rhq.dev.ds.password}" else="${rhq.test.ds.password}"> - <equals arg1="${db}" arg2="dev" /> + <equals arg1="${db}" arg2="dev"/> </condition>
<ant antfile="${basedir}/src/main/scripts/dbsetup-build.xml" target="create-release-schema"> @@ -384,7 +384,7 @@ <property name="rhq.ds.password" value="${rhq.ds.password}" /> <property name="project.version" value="${project.version}" /> <property name="db.schema.version" value="${db.schema.version}" /> - <property name="jon.release" value="${jon.release}" /> + <property name="jon.release" value="${jon.release}"/> </ant> </tasks> </configuration> diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml index 9c8aca5..7ed877c 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml index 8e82464..0911918 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>3.0.0.B06</version> + <version>3.0.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 5b616ae..d47d4c8 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml index 56ea023..e1ce7ef 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml index 164b5bf..b0472c3 100644 --- a/modules/core/plugin-container/pom.xml +++ b/modules/core/plugin-container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.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 90562d8..7739177 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml index 0cd671c..eeb7e81 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/pom.xml b/modules/core/pom.xml index 1f413fa..7aad64c 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml index 9cf360d..bc41dc5 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml index 3f7ac30..d9f1c1c 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml index 9c88b63..8942239 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml index 761a749..8b9da9c 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml index f0fd77b..ad30bfb 100644 --- a/modules/enterprise/gui/base-perspective-jar/pom.xml +++ b/modules/enterprise/gui/base-perspective-jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> @@ -29,7 +29,7 @@ <seam.version>2.1.0.SP1</seam.version> <jboss-el.version>1.0_02.CR5</jboss-el.version> <richfaces.version>3.3.2.SR1</richfaces.version> - <rhq.version>3.0.0.B06</rhq.version> + <rhq.version>3.0.0-SNAPSHOT</rhq.version> </properties>
<dependencyManagement> diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml index 491d505..798a8ca 100644 --- a/modules/enterprise/gui/base-perspective-war/pom.xml +++ b/modules/enterprise/gui/base-perspective-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml index 54e3273..df05645 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>3.0.0.B06</version> + <version>3.0.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 eac2729..c5615d3 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -1,11 +1,12 @@ -<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"> +<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%22%3E
<modelVersion>4.0.0</modelVersion>
<parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> @@ -341,13 +342,13 @@ <fileset dir="war/WEB-INF/classes" /> </copy> --> - <property name="deployment.dir" location="${rhq.deploymentDir}" /> + <property name="deployment.dir" location="${rhq.deploymentDir}"/> <echo>*** Copying updated files from src${file.separator}main${file.separator}webapp${file.separator} to ${deployment.dir}${file.separator}... </echo> <copy todir="${deployment.dir}" verbose="${rhq.verbose}"> - <fileset dir="${basedir}/src/main/webapp" /> + <fileset dir="${basedir}/src/main/webapp"/> </copy> </tasks> </configuration> @@ -361,13 +362,13 @@ <phase>package</phase> <configuration> <tasks> - <property name="deployment.dir" location="${rhq.deploymentDir}" /> + <property name="deployment.dir" location="${rhq.deploymentDir}"/> <echo>*** Copying updated files from target${file.separator}${project.build.finalName}${file.separator} to ${deployment.dir}${file.separator}... </echo> <copy todir="${deployment.dir}" verbose="${rhq.verbose}"> - <fileset dir="${basedir}/target/${project.build.finalName}" /> + <fileset dir="${basedir}/target/${project.build.finalName}"/> </copy> </tasks> </configuration> @@ -381,9 +382,9 @@ <phase>clean</phase> <configuration> <tasks> - <property name="deployment.dir" location="${rhq.deploymentDir}" /> + <property name="deployment.dir" location="${rhq.deploymentDir}"/> <echo>*** Deleting ${deployment.dir}${file.separator}...</echo> - <delete dir="${deployment.dir}" /> + <delete dir="${deployment.dir}"/> </tasks> </configuration> <goals> diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml index e65696a..dcb1f88 100644 --- a/modules/enterprise/gui/installer-war/pom.xml +++ b/modules/enterprise/gui/installer-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml index ce5dfbd..0c529ba 100644 --- a/modules/enterprise/gui/pom.xml +++ b/modules/enterprise/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml index 32d044b..783942c 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/webdav-war/pom.xml b/modules/enterprise/gui/webdav-war/pom.xml index bed6a3f..aa880be 100644 --- a/modules/enterprise/gui/webdav-war/pom.xml +++ b/modules/enterprise/gui/webdav-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml index d50cbdc..7b3f967 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml index e1ab76d..33966bd 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-cli</artifactId> diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml index 739409e..605267f 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-client-api</artifactId> diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml index be25cc0..198c17b 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-parent</artifactId> diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml index 6366cb7..2ea73ee 100644 --- a/modules/enterprise/remoting/webservices/pom.xml +++ b/modules/enterprise/remoting/webservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-webservices</artifactId> diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml index 2b32e80..2c98817 100644 --- a/modules/enterprise/server/container-lib/pom.xml +++ b/modules/enterprise/server/container-lib/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml index afc9617..6b296df 100644 --- a/modules/enterprise/server/container/pom.xml +++ b/modules/enterprise/server/container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml index 258a946..bf15866 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml index 736e20d..e718952 100644 --- a/modules/enterprise/server/jar/pom.xml +++ b/modules/enterprise/server/jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml index f9229ef..ad4a632 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.server</groupId> <artifactId>alert-email</artifactId> - <version>3.0.0.B06</version> + <version>3.0.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 9e47d32..9f1a05c 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-irc</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version>
<name>RHQ Enterprise Server IRC Alert Plugin</name> diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml index e5ba966..7d884ca 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-microblog</artifactId> - <version>3.0.0.B06</version> + <version>3.0.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 bdb9341..c9df693 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-mobicents</artifactId> - <version>3.0.0.B06</version> + <version>3.0.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 637bb69..6f99cce 100644 --- a/modules/enterprise/server/plugins/alert-operations/pom.xml +++ b/modules/enterprise/server/plugins/alert-operations/pom.xml @@ -1,15 +1,16 @@ -<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"> +<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%22%3E <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-operations</artifactId> <packaging>jar</packaging> - <version>3.0.0.B06</version> + <version>3.0.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 89fdc9f..2287067 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-roles</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Roles Alert Plugin</name>
@@ -124,7 +124,8 @@ <include name="META-INF/**" /> </patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" + update="true"> </jar> </tasks> </configuration> diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml index bc98b9e..f8a5704 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-snmp</artifactId> - <version>3.0.0.B06</version> + <version>3.0.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 a6c3743..31520b5 100644 --- a/modules/enterprise/server/plugins/alert-subject/pom.xml +++ b/modules/enterprise/server/plugins/alert-subject/pom.xml @@ -1,15 +1,17 @@ <?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" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<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/xsd/maven-4.0.0.xsd%22%3E <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-subject</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Subject Alert Plugin</name>
@@ -91,10 +93,11 @@ <phase>compile</phase> <configuration> <tasks> - <mkdir dir="${rhq.deploymentDir}" /> - <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" /> + <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}" /> + <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}"/> </tasks> </configuration> <goals> @@ -107,9 +110,10 @@ <phase>clean</phase> <configuration> <tasks> - <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" /> + <property name="deployment.file" + location="${rhq.deploymentDir}/${project.build.finalName}.jar"/> <echo>*** Deleting ${deployment.file}...</echo> - <delete file="${deployment.file}" /> + <delete file="${deployment.file}"/> </tasks> </configuration> <goals> diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml index 9af4022..9dd813b 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> @@ -192,7 +192,8 @@ <include name="META-INF/**" /> </patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" + update="true"> </jar> </tasks> </configuration> diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml index 60e5690..73b41d6 100644 --- a/modules/enterprise/server/plugins/cobbler/pom.xml +++ b/modules/enterprise/server/plugins/cobbler/pom.xml @@ -1,17 +1,19 @@ <?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" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<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/xsd/maven-4.0.0.xsd%22%3E
<parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>rhq-serverplugin-cobbler</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Cobbler Plugin</name>
@@ -150,7 +152,8 @@ <include name="META-INF/**" /> </patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" + update="true"> </jar> </tasks> </configuration> diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml index 0e59679..0033d1b 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>3.0.0.B06</version> + <version>3.0.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 3119da9..44cdb03 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> @@ -179,7 +179,8 @@ <include name="META-INF/**" /> </patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" + update="true"> </jar> </tasks> </configuration> diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml index b91da52..7451668 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml index 724a1ce..0ac61d3 100644 --- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml index ed931c9..5a78451 100644 --- a/modules/enterprise/server/plugins/perspectives/core/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml index fa14b1d..1e17ce8 100644 --- a/modules/enterprise/server/plugins/pom.xml +++ b/modules/enterprise/server/plugins/pom.xml @@ -1,11 +1,14 @@ -<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"> +<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%22%3E
<modelVersion>4.0.0</modelVersion>
<parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml index 955bf2a..e4ab9b2 100644 --- a/modules/enterprise/server/plugins/rhnhosted/pom.xml +++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml index c30ac79..a6cba32 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>3.0.0.B06</version> + <version>3.0.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 3e2a7c9..9c7cc74 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>3.0.0.B06</version> + <version>3.0.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 003ca65..ebdd3da 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml index 45e6219..06c8981 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml index 3498ccd..aa278b8 100644 --- a/modules/enterprise/server/sars/agent-sar/pom.xml +++ b/modules/enterprise/server/sars/agent-sar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-sars-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml index 93afd9a..68deca1 100644 --- a/modules/enterprise/server/sars/pom.xml +++ b/modules/enterprise/server/sars/pom.xml @@ -1,11 +1,13 @@ -<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"> +<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%22%3E
<modelVersion>4.0.0</modelVersion>
<parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml index 1be8fdc..14738d0 100644 --- a/modules/enterprise/server/xml-schemas/pom.xml +++ b/modules/enterprise/server/xml-schemas/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/helpers/pluginAnnotations/pom.xml b/modules/helpers/pluginAnnotations/pom.xml index 0500f87..f9dde4c 100644 --- a/modules/helpers/pluginAnnotations/pom.xml +++ b/modules/helpers/pluginAnnotations/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
@@ -16,7 +16,7 @@
<name>RHQ plugin annotations</name> <description>Annotations to help generate plugin descriptors</description> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version>
<scm> <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/helpers/pluginGen</connection> diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml index d3bc054..4a31a97 100644 --- a/modules/helpers/pluginGen/pom.xml +++ b/modules/helpers/pluginGen/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
@@ -16,7 +16,7 @@
<name>RHQ plugin generator</name> <description>Helper to generate plugin skeletons</description> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version>
<scm> <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/helpers/pluginGen</connection> diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml index 9233417..a0721a9 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml index 3be4811..5d327ee 100644 --- a/modules/helpers/rtfilter/pom.xml +++ b/modules/helpers/rtfilter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml index 562d6bc..c37598e 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>3.0.0.B06</version> + <version>3.0.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 c530841..fcfd7c6 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> @@ -230,7 +230,8 @@ <include name="META-INF/**" /> </patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" + update="true"> </jar> </tasks> </configuration> diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml index 8641742..a6e1257 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index 931115b..9a781ba 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml index 6c9475a..d920440 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml index 8456a45..d5aaad5 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml index 77ad497..30889f7 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>3.0.0.B06</version> + <version>3.0.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 ff4bb67..b79645d 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml index c3da6c1..f7cf265 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml index 861cdd6..acb08ef 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml index 942f017..7dd0fde 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml index 31d4875..de89333 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> <artifactId>rhq-hudson-plugin</artifactId> - <version>3.0.0.B06</version> + <version>3.0.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 8f44ac9..853c020 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>3.0.0.B06</version> + <version>3.0.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 10e5dff..a0ade77 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml index 1ed2894..b9ed2b3 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>3.0.0.B06</version> + <version>3.0.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 a5466f0..b3846fa 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>3.0.0.B06</version> + <version>3.0.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 f3c3c10..443e524 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml index ae1f1ca..ac9885a 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml index b32c80c..d0c9053 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml index cf065cb..06ae2ae 100644 --- a/modules/plugins/netservices/pom.xml +++ b/modules/plugins/netservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml index b1b59f4..1acdb0f 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml index 20cd56c..39c75da 100644 --- a/modules/plugins/perftest/pom.xml +++ b/modules/plugins/perftest/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml index 937f524..97b83b0 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml index 8e752cb..85d6105 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml index 5a6c5bc..283ab6a 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml index fb4e3fd..5a4466c 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>3.0.0.B06</version> + <version>3.0.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 a818d2e..a190dcd 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>3.0.0.B06</version> + <version>3.0.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 79de99c..8f4e675 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml index 8a5ae94..0d41574 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml index 0afed5a..7719b14 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml index 8115e8d..2d9d715 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml index 8cbfd25..3579496 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml index b9d6671..41df1b8 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml index ca39ca2..205d5b0 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml index 7e6fb8b..e299efa 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>3.0.0.B06</version> + <version>3.0.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 9ff9209..b3d5e87 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>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/pom.xml b/modules/pom.xml index c35c685..bc96ae3 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml index 2839ddd..2235687 100644 --- a/modules/test-utils/pom.xml +++ b/modules/test-utils/pom.xml @@ -4,7 +4,7 @@ <parent> <artifactId>rhq-modules-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> </parent> <artifactId>test-utils</artifactId> <name>RHQ Test Utils</name> diff --git a/pom.xml b/pom.xml index a2f3e3c..ded19ee 100644 --- a/pom.xml +++ b/pom.xml @@ -1,12 +1,14 @@ <?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"> +<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%22%3E
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B06</version> + <version>3.0.0-SNAPSHOT</version> <packaging>pom</packaging>
<name>RHQ</name> @@ -596,9 +598,9 @@ <configuration> <tasks> <tstamp> - <format property="buildTime" pattern="MM/dd/yy hh:mm aa z" locale="en,US" timezone="GMT" /> + <format property="buildTime" pattern="MM/dd/yy hh:mm aa z" locale="en,US" timezone="GMT"/> </tstamp> - <mkdir dir="target" /> + <mkdir dir="target"/> <echo file="target/build-time.properties" level="error">buildTime = ${buildTime}</echo> </tasks> </configuration>
commit 9f6a800863e41d3c741c3dc8d3a8a2f46040e827 Author: Ian P. Springer <ips@jetengine.(none)> Date: Tue May 25 08:55:23 2010 -0400
[maven-release-plugin] prepare release RHQ_3_0_0_B06
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml index d7b9e91..c50034b 100644 --- a/modules/common/ant-bundle/pom.xml +++ b/modules/common/ant-bundle/pom.xml @@ -1,13 +1,11 @@ -<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%22%3E +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml index bc7965b..ed28f78 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml index 2cf950b..c673c79 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/pom.xml b/modules/common/pom.xml index ee81a94..5e15ea6 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml index d177f9e..663a600 100644 --- a/modules/core/client-api/pom.xml +++ b/modules/core/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml index a51f92b..888404d 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index eb5d6ea..459b21b 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> @@ -192,19 +192,19 @@ <property name="settings.localRepository" location="${user.home}/.m2/repository}" />
<condition property="rhq.ds.type-mapping" value="${rhq.dev.ds.type-mapping}" else="${rhq.test.ds.type-mapping}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.connection-url" value="${rhq.dev.ds.connection-url}" else="${rhq.test.ds.connection-url}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.user-name" value="${rhq.dev.ds.user-name}" else="${rhq.test.ds.user-name}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.password" value="${rhq.dev.ds.password}" else="${rhq.test.ds.password}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<ant antfile="${basedir}/src/main/scripts/dbsetup-build.xml"> @@ -240,19 +240,19 @@ <property name="settings.localRepository" location="${user.home}/.m2/repository}" />
<condition property="rhq.ds.type-mapping" value="${rhq.dev.ds.type-mapping}" else="${rhq.test.ds.type-mapping}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.connection-url" value="${rhq.dev.ds.connection-url}" else="${rhq.test.ds.connection-url}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.user-name" value="${rhq.dev.ds.user-name}" else="${rhq.test.ds.user-name}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.password" value="${rhq.dev.ds.password}" else="${rhq.test.ds.password}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<ant antfile="${basedir}/src/main/scripts/dbsetup-build.xml" target="dbsetup-combine"> @@ -289,23 +289,23 @@ <property name="settings.localRepository" location="${user.home}/.m2/repository}" />
<condition property="rhq.ds.type-mapping" value="${rhq.dev.ds.type-mapping}" else="${rhq.test.ds.type-mapping}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.connection-url" value="${rhq.dev.ds.connection-url}" else="${rhq.test.ds.connection-url}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.user-name" value="${rhq.dev.ds.user-name}" else="${rhq.test.ds.user-name}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.password" value="${rhq.dev.ds.password}" else="${rhq.test.ds.password}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.driver-class" value="${rhq.dev.ds.driver-class}" else="${rhq.test.ds.driver-class}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<ant antfile="${basedir}/src/main/scripts/dbsetup-build.xml" target="dbsetup-check-schema"> @@ -356,19 +356,19 @@ <property name="settings.localRepository" location="${user.home}/.m2/repository}" />
<condition property="rhq.ds.type-mapping" value="${rhq.dev.ds.type-mapping}" else="${rhq.test.ds.type-mapping}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.connection-url" value="${rhq.dev.ds.connection-url}" else="${rhq.test.ds.connection-url}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.user-name" value="${rhq.dev.ds.user-name}" else="${rhq.test.ds.user-name}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<condition property="rhq.ds.password" value="${rhq.dev.ds.password}" else="${rhq.test.ds.password}"> - <equals arg1="${db}" arg2="dev"/> + <equals arg1="${db}" arg2="dev" /> </condition>
<ant antfile="${basedir}/src/main/scripts/dbsetup-build.xml" target="create-release-schema"> @@ -384,7 +384,7 @@ <property name="rhq.ds.password" value="${rhq.ds.password}" /> <property name="project.version" value="${project.version}" /> <property name="db.schema.version" value="${db.schema.version}" /> - <property name="jon.release" value="${jon.release}"/> + <property name="jon.release" value="${jon.release}" /> </ant> </tasks> </configuration> diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml index 7ed877c..9c8aca5 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml index 0911918..8e82464 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml index d47d4c8..5b616ae 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml index e1ce7ef..56ea023 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml index b0472c3..164b5bf 100644 --- a/modules/core/plugin-container/pom.xml +++ b/modules/core/plugin-container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml index 7739177..90562d8 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml index eeb7e81..0cd671c 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/pom.xml b/modules/core/pom.xml index 7aad64c..1f413fa 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml index bc41dc5..9cf360d 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml index d9f1c1c..3f7ac30 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml index 8942239..9c88b63 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml index 8b9da9c..761a749 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml index ad30bfb..f0fd77b 100644 --- a/modules/enterprise/gui/base-perspective-jar/pom.xml +++ b/modules/enterprise/gui/base-perspective-jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> @@ -29,7 +29,7 @@ <seam.version>2.1.0.SP1</seam.version> <jboss-el.version>1.0_02.CR5</jboss-el.version> <richfaces.version>3.3.2.SR1</richfaces.version> - <rhq.version>3.0.0-SNAPSHOT</rhq.version> + <rhq.version>3.0.0.B06</rhq.version> </properties>
<dependencyManagement> diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml index 798a8ca..491d505 100644 --- a/modules/enterprise/gui/base-perspective-war/pom.xml +++ b/modules/enterprise/gui/base-perspective-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml index df05645..54e3273 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index c5615d3..eac2729 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -1,12 +1,11 @@ -<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%22%3E +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> @@ -342,13 +341,13 @@ <fileset dir="war/WEB-INF/classes" /> </copy> --> - <property name="deployment.dir" location="${rhq.deploymentDir}"/> + <property name="deployment.dir" location="${rhq.deploymentDir}" /> <echo>*** Copying updated files from src${file.separator}main${file.separator}webapp${file.separator} to ${deployment.dir}${file.separator}... </echo> <copy todir="${deployment.dir}" verbose="${rhq.verbose}"> - <fileset dir="${basedir}/src/main/webapp"/> + <fileset dir="${basedir}/src/main/webapp" /> </copy> </tasks> </configuration> @@ -362,13 +361,13 @@ <phase>package</phase> <configuration> <tasks> - <property name="deployment.dir" location="${rhq.deploymentDir}"/> + <property name="deployment.dir" location="${rhq.deploymentDir}" /> <echo>*** Copying updated files from target${file.separator}${project.build.finalName}${file.separator} to ${deployment.dir}${file.separator}... </echo> <copy todir="${deployment.dir}" verbose="${rhq.verbose}"> - <fileset dir="${basedir}/target/${project.build.finalName}"/> + <fileset dir="${basedir}/target/${project.build.finalName}" /> </copy> </tasks> </configuration> @@ -382,9 +381,9 @@ <phase>clean</phase> <configuration> <tasks> - <property name="deployment.dir" location="${rhq.deploymentDir}"/> + <property name="deployment.dir" location="${rhq.deploymentDir}" /> <echo>*** Deleting ${deployment.dir}${file.separator}...</echo> - <delete dir="${deployment.dir}"/> + <delete dir="${deployment.dir}" /> </tasks> </configuration> <goals> diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml index dcb1f88..e65696a 100644 --- a/modules/enterprise/gui/installer-war/pom.xml +++ b/modules/enterprise/gui/installer-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml index 0c529ba..ce5dfbd 100644 --- a/modules/enterprise/gui/pom.xml +++ b/modules/enterprise/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml index 783942c..32d044b 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/webdav-war/pom.xml b/modules/enterprise/gui/webdav-war/pom.xml index aa880be..bed6a3f 100644 --- a/modules/enterprise/gui/webdav-war/pom.xml +++ b/modules/enterprise/gui/webdav-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml index 7b3f967..d50cbdc 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml index 33966bd..e1ab76d 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<artifactId>rhq-remoting-cli</artifactId> diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml index 605267f..739409e 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<artifactId>rhq-remoting-client-api</artifactId> diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml index 198c17b..be25cc0 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<artifactId>rhq-remoting-parent</artifactId> diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml index 2ea73ee..6366cb7 100644 --- a/modules/enterprise/remoting/webservices/pom.xml +++ b/modules/enterprise/remoting/webservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<artifactId>rhq-remoting-webservices</artifactId> diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml index 2c98817..2b32e80 100644 --- a/modules/enterprise/server/container-lib/pom.xml +++ b/modules/enterprise/server/container-lib/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml index 6b296df..afc9617 100644 --- a/modules/enterprise/server/container/pom.xml +++ b/modules/enterprise/server/container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml index bf15866..258a946 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml index e718952..736e20d 100644 --- a/modules/enterprise/server/jar/pom.xml +++ b/modules/enterprise/server/jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml index ad4a632..f9229ef 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.server</groupId> <artifactId>alert-email</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 9f1a05c..9e47d32 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-irc</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version>
<name>RHQ Enterprise Server IRC Alert Plugin</name> diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml index 7d884ca..e5ba966 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-microblog</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 c9df693..bdb9341 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-mobicents</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 6f99cce..637bb69 100644 --- a/modules/enterprise/server/plugins/alert-operations/pom.xml +++ b/modules/enterprise/server/plugins/alert-operations/pom.xml @@ -1,16 +1,15 @@ -<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%22%3E +<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"> <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-operations</artifactId> <packaging>jar</packaging> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 2287067..89fdc9f 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-roles</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version>
<name>RHQ Enterprise Server Roles Alert Plugin</name>
@@ -124,8 +124,7 @@ <include name="META-INF/**" /> </patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" - update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> </jar> </tasks> </configuration> diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml index f8a5704..bc98b9e 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-snmp</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 31520b5..a6c3743 100644 --- a/modules/enterprise/server/plugins/alert-subject/pom.xml +++ b/modules/enterprise/server/plugins/alert-subject/pom.xml @@ -1,17 +1,15 @@ <?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" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd%22%3E +<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/xsd/maven-4.0.0.xsd"> <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent> <modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>alert-subject</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version>
<name>RHQ Enterprise Server Subject Alert Plugin</name>
@@ -93,11 +91,10 @@ <phase>compile</phase> <configuration> <tasks> - <mkdir dir="${rhq.deploymentDir}"/> - <property name="deployment.file" - location="${rhq.deploymentDir}/${project.build.finalName}.jar"/> + <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}"/> + <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}" /> </tasks> </configuration> <goals> @@ -110,10 +107,9 @@ <phase>clean</phase> <configuration> <tasks> - <property name="deployment.file" - location="${rhq.deploymentDir}/${project.build.finalName}.jar"/> + <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" /> <echo>*** Deleting ${deployment.file}...</echo> - <delete file="${deployment.file}"/> + <delete file="${deployment.file}" /> </tasks> </configuration> <goals> diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml index 9dd813b..9af4022 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> @@ -192,8 +192,7 @@ <include name="META-INF/**" /> </patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" - update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> </jar> </tasks> </configuration> diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml index 73b41d6..60e5690 100644 --- a/modules/enterprise/server/plugins/cobbler/pom.xml +++ b/modules/enterprise/server/plugins/cobbler/pom.xml @@ -1,19 +1,17 @@ <?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" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd%22%3E +<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/xsd/maven-4.0.0.xsd">
<parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId> <artifactId>rhq-serverplugin-cobbler</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version>
<name>RHQ Enterprise Server Cobbler Plugin</name>
@@ -152,8 +150,7 @@ <include name="META-INF/**" /> </patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" - update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> </jar> </tasks> </configuration> diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml index 0033d1b..0e59679 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 44cdb03..3119da9 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> @@ -179,8 +179,7 @@ <include name="META-INF/**" /> </patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" - update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> </jar> </tasks> </configuration> diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml index 7451668..b91da52 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml index 0ac61d3..724a1ce 100644 --- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml index 5a78451..ed931c9 100644 --- a/modules/enterprise/server/plugins/perspectives/core/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml index 1e17ce8..fa14b1d 100644 --- a/modules/enterprise/server/plugins/pom.xml +++ b/modules/enterprise/server/plugins/pom.xml @@ -1,14 +1,11 @@ -<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%22%3E +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml index e4ab9b2..955bf2a 100644 --- a/modules/enterprise/server/plugins/rhnhosted/pom.xml +++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml index a6cba32..c30ac79 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 9c7cc74..3e2a7c9 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 ebdd3da..003ca65 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml index 06c8981..45e6219 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml index aa278b8..3498ccd 100644 --- a/modules/enterprise/server/sars/agent-sar/pom.xml +++ b/modules/enterprise/server/sars/agent-sar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-sars-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml index 68deca1..93afd9a 100644 --- a/modules/enterprise/server/sars/pom.xml +++ b/modules/enterprise/server/sars/pom.xml @@ -1,13 +1,11 @@ -<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%22%3E +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml index 14738d0..1be8fdc 100644 --- a/modules/enterprise/server/xml-schemas/pom.xml +++ b/modules/enterprise/server/xml-schemas/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/helpers/pluginAnnotations/pom.xml b/modules/helpers/pluginAnnotations/pom.xml index f9dde4c..0500f87 100644 --- a/modules/helpers/pluginAnnotations/pom.xml +++ b/modules/helpers/pluginAnnotations/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
@@ -16,7 +16,7 @@
<name>RHQ plugin annotations</name> <description>Annotations to help generate plugin descriptors</description> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version>
<scm> <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/helpers/pluginGen</connection> diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml index 4a31a97..d3bc054 100644 --- a/modules/helpers/pluginGen/pom.xml +++ b/modules/helpers/pluginGen/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
@@ -16,7 +16,7 @@
<name>RHQ plugin generator</name> <description>Helper to generate plugin skeletons</description> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version>
<scm> <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/helpers/pluginGen</connection> diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml index a0721a9..9233417 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml index 5d327ee..3be4811 100644 --- a/modules/helpers/rtfilter/pom.xml +++ b/modules/helpers/rtfilter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml index c37598e..562d6bc 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml index fcfd7c6..c530841 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> @@ -230,8 +230,7 @@ <include name="META-INF/**" /> </patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" - update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> </jar> </tasks> </configuration> diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml index a6e1257..8641742 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index 9a781ba..931115b 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml index d920440..6c9475a 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml index d5aaad5..8456a45 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml index 30889f7..77ad497 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml index b79645d..ff4bb67 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml index f7cf265..c3da6c1 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml index acb08ef..861cdd6 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml index 7dd0fde..942f017 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml index de89333..31d4875 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> <artifactId>rhq-hudson-plugin</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> <packaging>jar</packaging>
<name>RHQ Hudson Plugin</name> diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml index 853c020..8f44ac9 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 a0ade77..10e5dff 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml index b9ed2b3..1ed2894 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 b3846fa..a5466f0 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml index 443e524..f3c3c10 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml index ac9885a..ae1f1ca 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml index d0c9053..b32c80c 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml index 06ae2ae..cf065cb 100644 --- a/modules/plugins/netservices/pom.xml +++ b/modules/plugins/netservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml index 1acdb0f..b1b59f4 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml index 39c75da..20cd56c 100644 --- a/modules/plugins/perftest/pom.xml +++ b/modules/plugins/perftest/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml index 97b83b0..937f524 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml index 85d6105..8e752cb 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml index 283ab6a..5a6c5bc 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml index 5a4466c..fb4e3fd 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml index a190dcd..a818d2e 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml index 8f4e675..79de99c 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml index 0d41574..8a5ae94 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml index 7719b14..0afed5a 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml index 2d9d715..8115e8d 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml index 3579496..8cbfd25 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml index 41df1b8..b9d6671 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml index 205d5b0..ca39ca2 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml index e299efa..7e6fb8b 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</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 b3d5e87..9ff9209 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>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/pom.xml b/modules/pom.xml index bc96ae3..c35c685 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml index 2235687..2839ddd 100644 --- a/modules/test-utils/pom.xml +++ b/modules/test-utils/pom.xml @@ -4,7 +4,7 @@ <parent> <artifactId>rhq-modules-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> </parent> <artifactId>test-utils</artifactId> <name>RHQ Test Utils</name> diff --git a/pom.xml b/pom.xml index ded19ee..a2f3e3c 100644 --- a/pom.xml +++ b/pom.xml @@ -1,14 +1,12 @@ <?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%22%3E +<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</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B06</version> <packaging>pom</packaging>
<name>RHQ</name> @@ -598,9 +596,9 @@ <configuration> <tasks> <tstamp> - <format property="buildTime" pattern="MM/dd/yy hh:mm aa z" locale="en,US" timezone="GMT"/> + <format property="buildTime" pattern="MM/dd/yy hh:mm aa z" locale="en,US" timezone="GMT" /> </tstamp> - <mkdir dir="target"/> + <mkdir dir="target" /> <echo file="target/build-time.properties" level="error">buildTime = ${buildTime}</echo> </tasks> </configuration>
commit 20f91e8d5a42e2c36acb97aa8ac5c011e5613259 Merge: 91edfac... a19ca6b... Author: John Sanda jsanda@redhat.com Date: Tue May 25 07:44:41 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 91edfacbaf5ab9ebb8ecd187d40a153d476695f3 Author: John Sanda jsanda@redhat.com Date: Tue May 25 07:42:46 2010 -0400
[BZ 586068] Moving formatting logic to ui bean where it is used.
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemOOBHistoryUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemOOBHistoryUIBean.java index 94e262a..9589494 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemOOBHistoryUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemOOBHistoryUIBean.java @@ -24,6 +24,7 @@ import org.rhq.core.domain.measurement.composite.MeasurementOOBComposite; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; import org.rhq.core.gui.util.FacesContextUtility; +import org.rhq.core.server.MeasurementConverter; import org.rhq.core.util.IntExtractor; import org.rhq.enterprise.gui.common.framework.PagedDataTableUIBean; import org.rhq.enterprise.gui.common.paging.PageControlView; @@ -31,6 +32,8 @@ import org.rhq.enterprise.gui.common.paging.ResourceNameDisambiguatingPagedListD import org.rhq.enterprise.server.measurement.MeasurementOOBManagerLocal; import org.rhq.enterprise.server.util.LookupUtil;
+import java.util.List; + /** * Backing bean fr the OOB subsysems view, oobHistory.xhtml * @@ -115,6 +118,8 @@ public class SubsystemOOBHistoryUIBean extends PagedDataTableUIBean {
result = manager.getSchedulesWithOOBs(getSubject(), metricFilter, resourceFilter, parentFilter, pc);
+ applyFormatting(result); + return result; }
@@ -128,5 +133,18 @@ public class SubsystemOOBHistoryUIBean extends PagedDataTableUIBean { outer.resourceFilter = FacesContextUtility.getOptionalRequestParameter(FORM_PREFIX + "resourceFilter"); outer.parentFilter = FacesContextUtility.getOptionalRequestParameter(FORM_PREFIX + "parentFilter"); } + + private void applyFormatting(List<MeasurementOOBComposite> composites) { + for (MeasurementOOBComposite oob : composites) { + oob.setFormattedOutlier(MeasurementConverter.format(oob.getOutlier(), oob.getUnits(), true)); + formatBaseband(oob); + } + } + + private void formatBaseband(MeasurementOOBComposite oob) { + String min = MeasurementConverter.format(oob.getBlMin(), oob.getUnits(), true); + String max = MeasurementConverter.format(oob.getBlMax(), oob.getUnits(), true); + oob.setFormattedBaseband(min + ", " + max); + } } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementOOBManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementOOBManagerBean.java index 0d68094..72d1cd4 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementOOBManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementOOBManagerBean.java @@ -319,8 +319,6 @@ public class MeasurementOOBManagerBean implements MeasurementOOBManagerLocal {
}
- applyFormatting(results); - return new PageList<MeasurementOOBComposite>(results, (int) totalCount, pc); }
@@ -373,23 +371,7 @@ public class MeasurementOOBManagerBean implements MeasurementOOBManagerLocal { long totalCount = (Long) countQuery.getSingleResult(); PageList<MeasurementOOBComposite> result = new PageList<MeasurementOOBComposite>(results, (int) totalCount, pc);
- applyFormatting(result); - return result; - - } - - private void applyFormatting(List<MeasurementOOBComposite> composites) { - for (MeasurementOOBComposite oob : composites) { - oob.setFormattedOutlier(MeasurementConverter.format(oob.getOutlier(), oob.getUnits(), true)); - formatBaseband(oob); - } - } - - private void formatBaseband(MeasurementOOBComposite oob) { - String min = MeasurementConverter.format(oob.getBlMin(), oob.getUnits(), true); - String max = MeasurementConverter.format(oob.getBlMax(), oob.getUnits(), true); - oob.setFormattedBaseband(min + ", " + max); }
/**
commit a19ca6be7ee20ad3fffb2f15d4722c105f62cbad Author: Joseph Marques joseph@redhat.com Date: Mon May 24 18:06:57 2010 -0400
fix ArrayIndexOutOfBoundsException when there are search terms but the user repositions the cursor at the beginning of the SearchBar
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java index 38fadd1..c83f4a1 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java @@ -377,7 +377,7 @@ public class SearchAssistManager { String[] tokens = assistant.getTerms().toArray(new String[0]); debug("" + tokens.length + " tokens are " + Arrays.asList(tokens));
- if (tokens.length == 0) { + if (tokens.length == 0 || caretPos == 0) { debug("getAdvancedSuggestions: no terms"); return convert(getAllContexts()); // no terms yet defined }
commit d6abc10184a942057979de3d84ee36d7c24560b9 Merge: a76664e... 7a55d68... Author: Ian P. Springer <ips@jetengine.(none)> Date: Mon May 24 18:15:10 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit a76664e065a7b97e7e7c3296bdfd5fb50856cb57 Author: Ian P. Springer <ips@jetengine.(none)> Date: Mon May 24 18:12:59 2010 -0400
upgrade SIGAR from 1.6.4 to 1.6.5 (fixes https://bugzilla.redhat.com/show_bug.cgi?id=591519)
diff --git a/modules/core/native-system/ant-run.xml b/modules/core/native-system/ant-run.xml index 856c682..3856bcd 100644 --- a/modules/core/native-system/ant-run.xml +++ b/modules/core/native-system/ant-run.xml @@ -11,7 +11,7 @@ Ant Script that builds a test jar to run SIGAR bug replication code. <!-- in case it wasn't passed in, assume the default location --> <property name="settings.localRepository" location="${user.home}/.m2/repository"/> <property name="project.version" value="3.0.0-SNAPSHOT"/> - <property name="sigar.version" value="1.6.4.129"/> + <property name="sigar.version" value="1.6.5.132"/>
<fileset dir="${settings.localRepository}" id="jar.fileset"> <include name="i18nlog/i18nlog/1.0.9/i18nlog-1.0.9.jar" /> diff --git a/modules/enterprise/agent/ant-run.xml b/modules/enterprise/agent/ant-run.xml index 16a0194..fbe78f1 100644 --- a/modules/enterprise/agent/ant-run.xml +++ b/modules/enterprise/agent/ant-run.xml @@ -11,7 +11,7 @@ Ant Script that provides ways to package the Agent. <!-- in case these weren't passed in (i.e. not invoked via maven), assume some defaults --> <property name="settings.localRepository" location="${user.home}/.m2/repository"/> <property name="project.version" value="2.0.0-SNAPSHOT"/> - <property name="sigar.version" value="1.6.4.129"/> + <property name="sigar.version" value="1.6.5.132"/> <property name="getopt.version" value="1.0.13"/> <property name="jaxb-api.version" value="2.1"/> <property name="jaxb-impl.version" value="2.1"/> diff --git a/pom.xml b/pom.xml index 0736bc7..ded19ee 100644 --- a/pom.xml +++ b/pom.xml @@ -81,7 +81,7 @@ <jtds.version>1.2.2</jtds.version> <richfaces.version>3.3.3.CR1</richfaces.version> <jline.version>0.9.94</jline.version> - <sigar.version>1.6.4.129</sigar.version> + <sigar.version>1.6.5.132</sigar.version> <quartz.version>1.6.5</quartz.version> <jna.version>3.2.2</jna.version>
commit 7a55d68849899f038f61f9e29df577f0e07e64c1 Author: John Sanda jsanda@redhat.com Date: Mon May 24 16:46:22 2010 -0400
Fixing compilation errors
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/core/domain/util/units/test/MeasurementConverterTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/core/domain/util/units/test/MeasurementConverterTest.java index 0688c79..b4f64e4 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/core/domain/util/units/test/MeasurementConverterTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/core/domain/util/units/test/MeasurementConverterTest.java @@ -28,13 +28,13 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale;
+import org.rhq.core.server.MeasurementConverter; +import org.rhq.enterprise.server.test.AbstractEJB3Test; import org.testng.annotations.Test;
-import org.rhq.core.domain.measurement.MeasurementConverterClient; import org.rhq.core.domain.measurement.MeasurementUnits; import org.rhq.core.domain.measurement.composite.MeasurementNumericValueAndUnits; import org.rhq.core.domain.measurement.util.MeasurementConversionException; -import org.rhq.core.domain.test.AbstractEJB3Test; import org.rhq.core.server.MeasurementParser;
// TODO two tests in here need to be re-enables once the GWT client issues are resolved @@ -98,7 +98,7 @@ public class MeasurementConverterTest extends AbstractEJB3Test { MeasurementUnits expectedUnits) { incrementPrecisionScalingTestCount();
- String[] results = MeasurementConverterClient.formatToSignificantPrecision(values, units, true); + String[] results = MeasurementConverter.formatToSignificantPrecision(values, units, true); for (int i = 0; i < results.length; i++) { String expected = expectedResults[i]; String actual = results[i]; @@ -109,7 +109,7 @@ public class MeasurementConverterTest extends AbstractEJB3Test { Locale.setDefault(Locale.US); MeasurementNumericValueAndUnits vu = MeasurementParser.parse(expected, expectedUnits); Locale.setDefault(defaultLocale); - expected = MeasurementConverterClient.format(vu.getValue(), expectedUnits, false, null, 4); + expected = MeasurementConverter.format(vu.getValue(), expectedUnits, false, null, 4); }
assert actual.equals(expected) : "Test " + precisionScalingTestCount.get() + ": " + "Index " + i + ", " @@ -150,7 +150,7 @@ public class MeasurementConverterTest extends AbstractEJB3Test { }
for (String unitVariation : unitsVariations) { - String original = MeasurementConverterClient.format(POSITIVE, units, false); + String original = MeasurementConverter.format(POSITIVE, units, false); String toBeTested = magnitudeVariation.trim() + unitVariation.trim();
assert original.equals(toBeTested) : "Error constructing whitespace string: " + "Expected '" @@ -174,7 +174,7 @@ public class MeasurementConverterTest extends AbstractEJB3Test { }
for (String unitVariation : unitsVariations) { - String original = MeasurementConverterClient.format(-POSITIVE, units, false); + String original = MeasurementConverter.format(-POSITIVE, units, false); String toBeTested = "-" + magnitudeVariation.trim() + unitVariation.trim();
assert original.equals(toBeTested) : "Error constructing whitespace string: " + "Expected '" @@ -259,7 +259,7 @@ public class MeasurementConverterTest extends AbstractEJB3Test { private void validateScale(double fromValue, MeasurementUnits fromUnits, double toValue, MeasurementUnits toUnits) { MeasurementNumericValueAndUnits valueAndUnits = new MeasurementNumericValueAndUnits(fromValue, fromUnits); try { - double derived = MeasurementConverterClient.scale(valueAndUnits, toUnits); + double derived = MeasurementConverter.scale(valueAndUnits, toUnits); assert Math.abs(toValue - derived) < 1e-9 : "Scale conversion error: " +
"From value '" + fromValue + "', " + "with units of '" + fromUnits.name() + "', " + "displayed as '" @@ -287,7 +287,7 @@ public class MeasurementConverterTest extends AbstractEJB3Test {
private void validateFormatConvert(double passedValue, double expectedValue, MeasurementUnits units) { try { - String intermediate = MeasurementConverterClient.format(passedValue, units, false); + String intermediate = MeasurementConverter.format(passedValue, units, false); MeasurementNumericValueAndUnits results = MeasurementParser.parse(intermediate, units);
assert (Math.abs(results.getValue() - expectedValue) < 1e-9 && results.getUnits() == units) : "double input was '"
commit 5971d11749552d65176840755d105df2efd5e503 Author: Greg Hinkle ghinkle@redhat.com Date: Mon May 24 16:18:12 2010 -0400
Fix table rendering order problem (buttons missing)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java index 6ff4f0c..9167473 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java @@ -161,7 +161,6 @@ public class Table extends VLayout { super.onInit();
- // NOTE: It is essential that we wait to hide any excluded fields until after super.onDraw() is called, since // super.onDraw() is what actually adds the fields to the ListGrid (based on what fields are defined in // the underlying datasource). @@ -184,129 +183,80 @@ public class Table extends VLayout {
tableInfo.setWrap(false);
- for (final TableActionInfo tableAction : tableActions) { - IButton button = new IButton(tableAction.title); - button.setDisabled(true); - button.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent clickEvent) { - if (tableAction.confirmMessage != null) {
- String message = tableAction.confirmMessage.replaceAll("\#", String.valueOf(listGrid - .getSelection().length)); + }
- SC.ask(message, new BooleanCallback() { - public void execute(Boolean confirmed) { - if (confirmed) { - tableAction.action.executeAction(listGrid.getSelection()); - } - } - }); - } else { - tableAction.action.executeAction(listGrid.getSelection()); - } - } - }); - tableAction.actionButton = button; - footer.addMember(button); - }
- for (Canvas extraWidgetCanvas : extraWidgets) { - footer.addMember(extraWidgetCanvas); - } + @Override + protected void onDraw() { + super.onDraw();
+ removeMembers(getMembers());
- footer.addMember(new LayoutSpacer()); + addMember(titleLayout); + addMember(listGrid); + if (showFooter) {
- IButton refreshButton = new IButton("Refresh"); - refreshButton.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent clickEvent) { - listGrid.invalidateCache(); - } - }); - footer.addMember(refreshButton);
- footer.addMember(tableInfo); + for (final TableActionInfo tableAction : tableActions) { + IButton button = new IButton(tableAction.title); + button.setDisabled(true); + button.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + if (tableAction.confirmMessage != null) { + + String message = tableAction.confirmMessage.replaceAll("\#", String.valueOf(listGrid + .getSelection().length));
- // Manages enable/disable buttons for the grid - listGrid.addSelectionChangedHandler(new SelectionChangedHandler() { - public void onSelectionChanged(SelectionEvent selectionEvent) { - refreshTableInfo(); + SC.ask(message, new BooleanCallback() { + public void execute(Boolean confirmed) { + if (confirmed) { + tableAction.action.executeAction(listGrid.getSelection()); + } + } + }); + } else { + tableAction.action.executeAction(listGrid.getSelection()); + } + } + }); + tableAction.actionButton = button; + footer.addMember(button); } - });
- listGrid.addDataArrivedHandler(new DataArrivedHandler() { - public void onDataArrived(DataArrivedEvent dataArrivedEvent) { - refreshTableInfo(); - fieldSizes.clear(); - totalWidth = 0; + for (Canvas extraWidgetCanvas : extraWidgets) { + footer.addMember(extraWidgetCanvas); } - });
- // TODO GH: This doesn't yet work as desired to force the fields to fit to the table when you resize one of them. - if (false) { // If Force Fit - listGrid.addDataArrivedHandler(new DataArrivedHandler() { - public void onDataArrived(DataArrivedEvent dataArrivedEvent) { - for (ListGridField f : listGrid.getFields()) {
- int size = listGrid.getFieldWidth(f.getName()); - fieldSizes.add(size); - totalWidth += size; - } + footer.addMember(new LayoutSpacer()); + + IButton refreshButton = new IButton("Refresh"); + refreshButton.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + listGrid.invalidateCache(); } }); + footer.addMember(refreshButton);
- listGrid.addFieldStateChangedHandler(new FieldStateChangedHandler() { - public void onFieldStateChanged(FieldStateChangedEvent fieldStateChangedEvent) { - - if (autoSizing) { - return; - } - autoSizing = true; - - ArrayList<Integer> newSizes = new ArrayList<Integer>(); - int total = 0; - int resizeCol = 0; - int i = 0; - for (ListGridField f : listGrid.getFields()) { - int size = listGrid.getFieldWidth(f.getName()); - newSizes.add(size); - total += size; - if (fieldSizes.get(i) != size) { - resizeCol = i; - } - i++; - System.out.println("Field " + f.getName() + " width: " + listGrid.getFieldWidth(f.getName())); - } - - int diff = totalWidth - total; - int fieldsLeft = listGrid.getFields().length - resizeCol - 1; + footer.addMember(tableInfo);
- if (fieldsLeft > 0) { - int perFieldSizeDiff = diff / fieldsLeft; - for (int j = resizeCol + 1; j < listGrid.getFields().length; j++) { - listGrid.resizeField(j, fieldSizes.get(j) + perFieldSizeDiff); - } - } - - fieldSizes = newSizes; - markForRedraw(); - - autoSizing = false; + // Manages enable/disable buttons for the grid + listGrid.addSelectionChangedHandler(new SelectionChangedHandler() { + public void onSelectionChanged(SelectionEvent selectionEvent) { + refreshTableInfo(); } }); - } - }
+ listGrid.addDataArrivedHandler(new DataArrivedHandler() { + public void onDataArrived(DataArrivedEvent dataArrivedEvent) { + refreshTableInfo(); + fieldSizes.clear(); + totalWidth = 0; + } + });
- @Override - protected void onDraw() { - super.onDraw(); - - removeMembers(getMembers());
- addMember(titleLayout); - addMember(listGrid); - if (showFooter) { addMember(footer); } }
commit beb8a138dc8bfb19aff5bb688ac99f491e688fe7 Merge: d160bce... 5eb7cc4... Author: Greg Hinkle ghinkle@redhat.com Date: Mon May 24 15:17:55 2010 -0400
Merge branch 'bundle' of ssh://git.fedorahosted.org/git/rhq/rhq into localbundle
commit d160bce2e9bed02cb524c094ac8aebe8431628b7 Author: Greg Hinkle ghinkle@redhat.com Date: Mon May 24 15:12:28 2010 -0400
Need the thirdparty repos to find the new augeas dep
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index 9a781ba..f210815 100644 --- a/modules/plugins/augeas/pom.xml +++ b/modules/plugins/augeas/pom.xml @@ -93,6 +93,21 @@ </plugins> </build>
+ <repositories> + + <!-- for the augeas jar --> + <repository> + <id>jboss-thirdparty-uploads</id> + <name>JBoss Third-Party Uploads</name> + <url>https://repository.jboss.org/nexus/content/repositories/thirdparty-uploads/</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + + </repositories> + + <profiles>
<profile>
commit 5eb7cc4cd03114b4d6e8ea2f2da851fad8bf9d7e Author: John Mazzitelli mazz@redhat.com Date: Mon May 24 14:44:40 2010 -0400
need to make sure we are getting non-zero back from the disk usage API
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java index 99793e5..f7185d7 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java @@ -229,7 +229,16 @@ public class Deployer { public DeploymentDiskUsage estimateDiskUsage() throws Exception { final DeploymentDiskUsage diskUsage = new DeploymentDiskUsage();
- diskUsage.setMaxDiskUsable(this.deploymentData.getDestinationDir().getUsableSpace()); + File partition = this.deploymentData.getDestinationDir(); + long usableSpace = partition.getUsableSpace(); + while (usableSpace == 0L && partition != null) { + partition = partition.getParentFile(); + if (partition != null) { + usableSpace = partition.getUsableSpace(); + } + } + + diskUsage.setMaxDiskUsable(usableSpace);
Set<File> zipFiles = this.deploymentData.getZipFiles(); for (File zipFile : zipFiles) {
commit 197880f2173382c1b6db4896f62836e653324a41 Merge: 084b6c0... 6a31c12... Author: Greg Hinkle ghinkle@redhat.com Date: Mon May 24 14:37:01 2010 -0400
merging master to bundle
Merge remote branch 'remotes/origin/master' into localbundle
Conflicts: modules/core/client-api/src/main/java/org/rhq/core/clientapi/descriptor/PluginTransformer.java modules/core/dbutils/pom.xml modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml modules/enterprise/gui/coregui/pom.xml modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml modules/enterprise/gui/portal-war/pom.xml modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JBossProductType.java modules/plugins/platform/src/main/java/org/rhq/plugins/platform/LinuxPlatformComponent.java
diff --cc modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index 2a36ec5,6ec7660..4071b12 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@@ -2908,46 -2918,18 +2934,46 @@@ REFERENCES RHQ_TAGGING ( ID ) </statement> </schema-directSQL> - </schemaSpec> + + <schema-directSQL> + <statement> + CREATE TABLE RHQ_TAGGING_BUNDLE_DEST_MAP ( BUNDLE_DESTINATION_ID INTEGER ) + </statement> + </schema-directSQL> + <schema-alterColumn table="RHQ_TAGGING_BUNDLE_DEST_MAP" column="BUNDLE_DESTINATION_ID" nullable="false" /> + <schema-addColumn table="RHQ_TAGGING_BUNDLE_DEST_MAP" column="TAG_ID" columnType="INTEGER" /> + <schema-alterColumn table="RHQ_TAGGING_BUNDLE_DEST_MAP" column="TAG_ID" nullable="false" /> + <schema-directSQL> + <statement> + ALTER TABLE RHQ_TAGGING_BUNDLE_DEST_MAP + ADD CONSTRAINT RHQ_TAGGING_BUNDLE_DES_MAP_KEY + PRIMARY KEY ( BUNDLE_DESTINATION_ID, TAG_ID ) + </statement> + <statement> + ALTER TABLE RHQ_TAGGING_BUNDLE_DEST_MAP + ADD CONSTRAINT RHQ_TBDM_B_DESTINATION_ID_FK + FOREIGN KEY ( BUNDLE_DESTINATION_ID ) + REFERENCES RHQ_BUNDLE_DESTINATION ( ID ) + </statement> + <statement> + ALTER TABLE RHQ_TAGGING_BUNDLE_DEST_MAP + ADD CONSTRAINT RHQ_TBDESTM_TAG_ID_FK + FOREIGN KEY ( TAG_ID ) + REFERENCES RHQ_TAGGING ( ID ) + </statement> + </schema-directSQL> + </schemaSpec>
- <schemaSpec version="2.86"> - <schema-directSQL> - <statement desc="Adding MANAGE_BUNDLE permission to overlord"> - INSERT INTO RHQ_PERMISSION VALUES(1, 12) - </statement> - <statement desc="Adding MANAGE_BUNDLE permission to superuser"> - INSERT INTO RHQ_PERMISSION VALUES(2, 12) - </statement> - </schema-directSQL> - </schemaSpec> + + <schemaSpec version="2.87"> + <schema-directSQL> + <statement desc="Make RHQ_RES_TYPE_IDX_PLG_NAME index unique"> + DROP INDEX RHQ_RES_TYPE_IDX_PLG_NAME ; + CREATE UNIQUE INDEX RHQ_RES_TYPE_IDX_PLG_NAME ON RHQ_RESOURCE_TYPE (name, plugin) + </statement> + </schema-directSQL> + </schemaSpec> + </dbupgrade> </target> </project> diff --cc modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml index 6c6433c,e1e627b..f7a5a2c --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml @@@ -44,23 -45,23 +45,26 @@@
<entry-point class='org.rhq.enterprise.gui.coregui.client.CoreGUI'/> + <entry-point class='org.rhq.enterprise.gui.coregui.client.SearchGUI'/>
- <servlet path="/RoleGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.RoleGWTServiceImpl"/> - <servlet path="/SubjectGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.SubjectGWTServiceImpl"/> - <servlet path="/ResourceGroupGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.ResourceGroupGWTServiceImpl"/> - <servlet path="/ResourceGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.ResourceGWTServiceImpl"/> + <servlet path="/AlertGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.AlertGWTServiceImpl"/> + <servlet path="/AuthorizationGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.AuthorizationGWTServiceImpl"/> + <servlet path="/AvailabilityGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.AvailabilityGWTServiceImpl"/> + <servlet path="/BundleGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.BundleGWTServiceImpl"/> <servlet path="/ConfigurationGwtService" class="org.rhq.enterprise.gui.coregui.server.gwt.ConfigurationGWTServiceImpl"/> - <servlet path="/ResourceTypeGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.ResourceTypeGWTServiceImpl"/> <servlet path="/MeasurementDataGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.MeasurementDataGWTServiceImpl"/> - <servlet path="/AlertGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.AlertGWTServiceImpl"/> <servlet path="/OperationGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.OperationGWTServiceImpl"/> - <servlet path="/BundleGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.BundleGWTServiceImpl"/> + <servlet path="/RemoteInstallGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.RemoteInstallGWTServiceImpl"/> <servlet path="/ResourceBossGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.ResourceBossGWTServiceImpl"/> - <servlet path="/AuthorizationGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.AuthorizationGWTServiceImpl"/> - <servlet path="/AvailabilityGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.AvailabilityGWTServiceImpl"/> + <servlet path="/ResourceGroupGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.ResourceGroupGWTServiceImpl"/> + <servlet path="/ResourceGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.ResourceGWTServiceImpl"/> + <servlet path="/ResourceTypeGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.ResourceTypeGWTServiceImpl"/> + <servlet path="/RoleGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.RoleGWTServiceImpl"/> + <servlet path="/SearchGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.SearchGWTServiceImpl"/> + <servlet path="/SubjectGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.SubjectGWTServiceImpl"/> <servlet path="/TagGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.TagGWTServiceImpl"/> + <servlet path="/RemoteInstallGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.RemoteInstallGWTServiceImpl"/> + <servlet path="/RepoGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.RepoGWTServiceImpl"/> + <servlet path="/ContentGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.ContentGWTServiceImpl"/>
</module> diff --cc modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java index 0d15b46,a39a8a1..c49908f --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java @@@ -194,18 -161,14 +199,16 @@@ public class CoreGUI implements EntryPo History.fireCurrentHistoryState(); }
- public void onValueChange(ValueChangeEvent<String> stringValueChangeEvent) { - System.out.println("Handling history event: " + stringValueChangeEvent.getValue()); - currentViewPath = new ViewPath(stringValueChangeEvent.getValue());
- rootCanvas.renderView(currentViewPath); + String event = URL.decodeComponent(stringValueChangeEvent.getValue()); + System.out.println("Handling history event: " + event);
+ currentViewPath = new ViewPath(event); + + rootCanvas.renderView(currentViewPath); }
- public Canvas createContent(String breadcrumbName) { Canvas canvas;
diff --cc modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java index 8dbdaa5,9d173a2..d48dd7a --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java @@@ -96,15 -96,10 +96,19 @@@ public class GWTServiceLookup return secure(RemoteInstallGWTServiceAsync.Util.getInstance()); }
+ public static RepoGWTServiceAsync getRepoService() { + return secure(RepoGWTServiceAsync.Util.getInstance()); + } + + public static ContentGWTServiceAsync getContentService() { + return secure(ContentGWTServiceAsync.Util.getInstance()); + } + + public static SearchGWTServiceAsync getSearchService() { + return secure(SearchGWTServiceAsync.Util.getInstance()); + } + + private static <T> T secure(Object sdt) { if (!(sdt instanceof ServiceDefTarget)) return null; diff --cc modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml index dd4df53,45b8fc2..97b5a3e --- a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml +++ b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml @@@ -80,15 -84,6 +80,19 @@@ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI RemoteInstallGWTService</servlet-name> <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.RemoteInstallGWTServiceImpl</servlet-class> </servlet> + <servlet> ++ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI SearchGWTService</servlet-name> ++ <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.SearchGWTServiceImpl</servlet-class> ++ </servlet> ++ <servlet> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI RepoGWTService</servlet-name> + <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.RepoGWTServiceImpl</servlet-class> + </servlet> + <servlet> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI ContentGWTService</servlet-name> + <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.ContentGWTServiceImpl</servlet-class> + </servlet> +
<servlet-mapping> <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI RoleGWTService</servlet-name> @@@ -162,12 -161,4 +166,20 @@@ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI RemoteInstallGWTService</servlet-name> <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/RemoteInstallGWTService</url-pattern> </servlet-mapping> + <servlet-mapping> ++ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI SearchGWTService</servlet-name> ++ <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/SearchGWTService</url-pattern> ++ </servlet-mapping> ++ <servlet-mapping> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI RepoGWTService</servlet-name> + <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/RepoGWTService</url-pattern> + </servlet-mapping> + <servlet-mapping> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI ContentGWTService</servlet-name> + <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/ContentGWTService</url-pattern> + </servlet-mapping> ++ <servlet-mapping> ++ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI SearchGWTService</servlet-name> ++ <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/SearchGWTService</url-pattern> ++ </servlet-mapping> </web-app>
commit 084b6c04727a4bb382815d46c5bf5a179cb22afc Author: Greg Hinkle ghinkle@redhat.com Date: Mon May 24 14:13:35 2010 -0400
Fix null session login detection issue
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java index abcec22..0d15b46 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java @@ -123,6 +123,7 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { GWTServiceLookup.getSubjectService().findSubjectsByCriteria(criteria, new AsyncCallback<PageList<Subject>>() { public void onFailure(Throwable caught) { CoreGUI.getErrorHandler().handleError("Failed to load user's subject", caught); + new LoginView().showLoginDialog(); }
public void onSuccess(PageList<Subject> result) { 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 68a544f..0eafbc6 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 @@ -83,8 +83,6 @@ public class LoginView extends Canvas { CoreGUI.checkLoginStatus(); } }); - } else { - CoreGUI.checkLoginStatus(); }
} 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 7eadda6..7acfcbe 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 @@ -35,8 +35,13 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession;
+import org.rhq.core.domain.auth.Subject; +import org.rhq.enterprise.gui.legacy.ParamConstants; import org.rhq.enterprise.gui.legacy.WebUser; 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;
/** * @author Greg Hinkle @@ -59,17 +64,36 @@ public class SessionAccessServlet extends HttpServlet { */ WebUser webUser = SessionUtils.getWebUser(session);
- if (webUser != null) {
- ServletOutputStream out = response.getOutputStream(); + if (webUser != null && webUser.getSubject() != null) {
- String output = - String.valueOf(webUser.getSubject().getId()) + ":" + - String.valueOf(webUser.getSessionId()); + // the web user exists, so update our SessionManager's session last-access-time + Subject subject = webUser.getSubject();
+ try {
- out.write(output.getBytes()); + SessionManager.getInstance().getSubject(subject.getSessionId());
+ + ServletOutputStream out = response.getOutputStream(); + + String output = + String.valueOf(webUser.getSubject().getId()) + ":" + + String.valueOf(webUser.getSessionId()); + + + out.write(output.getBytes()); + + + } catch (SessionNotFoundException snfe) { + session.removeAttribute(ParamConstants.USER_PARAM); + SessionUtils.setWebUser(session, null); + webUser = null; + } catch (SessionTimeoutException ste) { + session.removeAttribute(ParamConstants.USER_PARAM); + SessionUtils.setWebUser(session, null); + webUser = null; + } } } }
commit ea7bb8464d72fed58820734e859fb8304a6ccaa1 Author: John Mazzitelli mazz@redhat.com Date: Mon May 24 13:58:20 2010 -0400
fix some typos in the test ant scripts
diff --git a/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant1.zip b/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant1.zip index 4d591cd..4254981 100644 Binary files a/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant1.zip and b/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant1.zip differ diff --git a/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant2.zip b/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant2.zip index f206b7e..c6963b2 100644 Binary files a/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant2.zip and b/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant2.zip differ
commit f560b24cec2d9fc88a369554d197b111c0d8486a Author: Greg Hinkle ghinkle@redhat.com Date: Mon May 24 13:44:45 2010 -0400
logout typo
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java index 9a84992..abcec22 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java @@ -221,7 +221,7 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { } else if (breadcrumbName.equals("Bundles")) { canvas = new BundleTopView(); } else if (breadcrumbName.equals("LogOut")) { - canvas = new LoginView(); + canvas = new LoginView(true); } else if (breadcrumbName.equals("Tag")) { canvas = new TaggedView(); } else {
commit 6a31c12f691c2e41ec833e0ef667851b38e6a12a Author: John Sanda jsanda@redhat.com Date: Mon May 24 13:44:22 2010 -0400
Removing scratch work that was accidentally committed
diff --git a/modules/core/domain/mvn.out b/modules/core/domain/mvn.out deleted file mode 100644 index 492a5b3..0000000 --- a/modules/core/domain/mvn.out +++ /dev/null @@ -1,1714 +0,0 @@ -[INFO] Scanning for projects... -[INFO] snapshot org.rhq:rhq-parent:3.0.0-SNAPSHOT: checking for updates from jboss-snapshots -[INFO] ------------------------------------------------------------------------ -[INFO] Building RHQ Domain Model -[INFO] task-segment: [clean, gwt:compile] -[INFO] ------------------------------------------------------------------------ -[INFO] [clean:clean {execution: default-clean}] -[INFO] Deleting /Users/john/Development/redhat/imanage/rhq/modules/core/domain/target -[INFO] snapshot org.rhq:rhq-core-util:3.0.0-SNAPSHOT: checking for updates from jboss-snapshots -[INFO] [gwt:compile {execution: default-cli}] -[INFO] using GWT jars from project dependencies : 2.0.0 -[WARNING] You should not declare gwt-dev as a project dependency. This may introduce complex dependency conflicts -[INFO] auto discovered modules [org.rhq.core.RHQDomain] -[INFO] establishing classpath list (scope = compile) -[INFO] using GWT jars for specified version 2.0.0 -[INFO] using GWT jars for specified version 2.0.0 -[INFO] Compiling module org.rhq.core.RHQDomain -[INFO] Validating newly compiled units -[INFO] [ERROR] Errors in 'file:/Users/john/Development/redhat/imanage/rhq/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java' -[INFO] [ERROR] Line 23: The import org.rhq.core.server.MeasurementConverter cannot be resolved -[INFO] [ERROR] Line 165: MeasurementConverter cannot be resolved -[INFO] [ERROR] Line 166: MeasurementConverter cannot be resolved -[INFO] [ERROR] Line 174: MeasurementConverter cannot be resolved -[INFO] Resolving org.rhq.core.domain.operation.GroupOperationScheduleEntity -[INFO] Found type 'org.rhq.core.domain.operation.GroupOperationScheduleEntity' -[INFO] Found type 'org.rhq.core.domain.operation.OperationScheduleEntity' -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.operation.ScheduleJobId -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.operation.ScheduleJobId -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:792) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:741) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] Resolving org.rhq.core.domain.content.RepoPackageVersion -[INFO] Found type 'org.rhq.core.domain.content.RepoPackageVersion' -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.content.RepoPackageVersionPK -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.content.RepoPackageVersionPK -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] Resolving org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple -[INFO] Found type 'org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple' -[INFO] Found type 'org.rhq.core.domain.configuration.definition.PropertyDefinition' -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:792) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:741) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionList -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionList -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:792) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:741) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionMap -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionMap -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:792) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:741) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null -[INFO] Resolving org.rhq.core.domain.criteria.RoleCriteria -[INFO] Found type 'org.rhq.core.domain.criteria.RoleCriteria' -[INFO] Found type 'org.rhq.core.domain.authz.Role' -[INFO] Found type 'org.rhq.core.domain.resource.group.ResourceGroup' -[INFO] Found type 'org.rhq.core.domain.resource.Resource' -[INFO] Found type 'org.rhq.core.domain.content.ResourceRepo' -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.content.ResourceRepoPK -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.content.ResourceRepoPK -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] Found type 'org.rhq.core.domain.content.Repo' -[INFO] Found type 'org.rhq.core.domain.content.RepoContentSource' -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.content.RepoContentSourcePK -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.content.RepoContentSourcePK -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] Found type 'org.rhq.core.domain.content.RepoDistribution' -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.content.RepoDistributionPK -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.content.RepoDistributionPK -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] Found type 'org.rhq.core.domain.content.RepoAdvisory' -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.content.RepoAdvisoryPK -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.content.RepoAdvisoryPK -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] Found type 'org.rhq.core.domain.content.PackageVersion' -[INFO] Found type 'org.rhq.core.domain.content.ProductVersionPackageVersion' -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.content.ProductVersionPackageVersionPK -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.content.ProductVersionPackageVersionPK -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] Found type 'org.rhq.core.domain.content.RepoRepoGroup' -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.content.RepoRepoGroupPK -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.content.RepoRepoGroupPK -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] Found type 'org.rhq.core.domain.content.RepoRepoRelationship' -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.content.RepoRepoRelationshipPK -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.content.RepoRepoRelationshipPK -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [WARN] Ignoring unresolvable annotation type org.rhq.core.domain.util.Summary -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.util.Summary -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationClass(TypeOracleMediator.java:481) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:563) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveField(TypeOracleMediator.java:868) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:777) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [WARN] Ignoring unresolvable annotation type org.rhq.core.domain.util.Summary -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.util.Summary -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationClass(TypeOracleMediator.java:481) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:563) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveField(TypeOracleMediator.java:868) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:777) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [WARN] Ignoring unresolvable annotation type org.rhq.core.domain.util.Summary -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.util.Summary -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationClass(TypeOracleMediator.java:481) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:563) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveField(TypeOracleMediator.java:868) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:777) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [WARN] Ignoring unresolvable annotation type org.rhq.core.domain.util.Summary -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.util.Summary -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationClass(TypeOracleMediator.java:481) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:563) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveField(TypeOracleMediator.java:868) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:777) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [WARN] Ignoring unresolvable annotation type org.rhq.core.domain.util.Summary -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.util.Summary -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationClass(TypeOracleMediator.java:481) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:563) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveField(TypeOracleMediator.java:868) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:777) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] Resolving org.rhq.core.domain.content.PackageVersionContentSource -[INFO] Found type 'org.rhq.core.domain.content.PackageVersionContentSource' -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.content.PackageVersionContentSourcePK -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.content.PackageVersionContentSourcePK -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] Resolving org.rhq.core.domain.configuration.PropertyMap -[INFO] Found type 'org.rhq.core.domain.configuration.PropertyMap' -[INFO] Found type 'org.rhq.core.domain.configuration.Property' -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.PropertySimple -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.PropertySimple -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:792) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:741) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.PropertyList -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.PropertyList -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:792) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:741) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.PropertyMap -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.PropertyMap -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:792) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:741) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null -[INFO] Resolving org.rhq.core.domain.configuration.Configuration -[INFO] Found type 'org.rhq.core.domain.configuration.Configuration' -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.PropertyList -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.PropertyList -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:649) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:909) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.PropertySimple -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.PropertySimple -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:649) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:909) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.PropertyMap -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.PropertyMap -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:649) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:909) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] Found type 'org.rhq.core.domain.configuration.PropertyList' -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.Property -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.Property -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveField(TypeOracleMediator.java:868) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:777) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) -[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) -[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] Resolving org.rhq.core.domain.configuration.definition.ConfigurationDefinition.GroupComparator -[INFO] Found type 'org.rhq.core.domain.configuration.definition.ConfigurationDefinition' -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:792) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:698) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionList -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionList -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:792) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:698) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionMap -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionMap -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:792) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:698) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null -[INFO] Resolving org.rhq.core.domain.bundle.BundleVersionRepo -[INFO] Found type 'org.rhq.core.domain.bundle.BundleVersionRepo' -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.bundle.BundleVersionRepoPK -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.bundle.BundleVersionRepoPK -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] Resolving org.rhq.core.domain.configuration.definition.PropertyDefinitionMap -[INFO] Found type 'org.rhq.core.domain.configuration.definition.PropertyDefinitionMap' -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionList -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionList -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionMap -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionMap -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null -[INFO] Resolving org.rhq.core.domain.resource.ResourceType -[INFO] Found type 'org.rhq.core.domain.resource.ResourceType' -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.resource.ResourceType -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.resource.ResourceType -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:649) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [WARN] Ignoring unresolvable annotation type org.rhq.core.domain.util.Summary -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.util.Summary -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationClass(TypeOracleMediator.java:481) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:563) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveField(TypeOracleMediator.java:868) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:777) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [WARN] Ignoring unresolvable annotation type org.rhq.core.domain.util.Summary -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.util.Summary -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationClass(TypeOracleMediator.java:481) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:563) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveField(TypeOracleMediator.java:868) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:777) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [WARN] Ignoring unresolvable annotation type org.rhq.core.domain.util.Summary -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.util.Summary -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationClass(TypeOracleMediator.java:481) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:563) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveField(TypeOracleMediator.java:868) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:777) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [WARN] Ignoring unresolvable annotation type org.rhq.core.domain.util.Summary -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.util.Summary -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationClass(TypeOracleMediator.java:481) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:563) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveField(TypeOracleMediator.java:868) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:777) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] Resolving org.rhq.core.domain.configuration.definition.PropertyDefinitionList -[INFO] Found type 'org.rhq.core.domain.configuration.definition.PropertyDefinitionList' -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionList -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionList -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null -[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionMap -[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionMap -[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) -[INFO] at java.security.AccessController.doPrivileged(Native Method) -[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) -[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) -[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) -[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) -[INFO] at java.lang.Class.forName0(Native Method) -[INFO] at java.lang.Class.forName(Class.java:247) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) -[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) -[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) -[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) -[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) -[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) -[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) -[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) -[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) -[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) -[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) -[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) -[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null -[INFO] Compiling 4 permutations -[INFO] Compiling permutation 0... -[INFO] Compiling permutation 2... -[INFO] Compiling permutation 3... -[INFO] Process output -[INFO] Compiling permutation 1... -[INFO] Compile of permutations succeeded -[INFO] Linking into /Users/john/Development/redhat/imanage/rhq/modules/core/domain/target/rhq-core-domain-ejb3/org.rhq.core.RHQDomain. Writing extras to /Users/john/Development/redhat/imanage/rhq/modules/core/domain/target/extra/org.rhq.core.RHQDomain -[INFO] Link succeeded -[INFO] Compilation succeeded -- 36.634s -[INFO] ------------------------------------------------------------------------ -[INFO] BUILD SUCCESSFUL -[INFO] ------------------------------------------------------------------------ -[INFO] Total time: 1 minute 12 seconds -[INFO] Finished at: Mon May 24 10:12:35 EDT 2010 -[INFO] Final Memory: 32M/527M -[INFO] ------------------------------------------------------------------------
commit 5157d3bd8b21541f82f28670a267b160ae366d94 Author: Greg Hinkle ghinkle@redhat.com Date: Mon May 24 13:44:18 2010 -0400
allow gwt logout
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java index b914a4b..9a84992 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java @@ -220,8 +220,8 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { canvas = new DashboardsView(); } else if (breadcrumbName.equals("Bundles")) { canvas = new BundleTopView(); - /*} else if (breadcrumbName.equals("LogOut")) { -// canvas = new LoginView();*/ + } else if (breadcrumbName.equals("LogOut")) { + canvas = new LoginView(); } else if (breadcrumbName.equals("Tag")) { canvas = new TaggedView(); } else { 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 39f9066..68a544f 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 @@ -53,17 +53,42 @@ import com.smartgwt.client.widgets.form.fields.events.KeyPressHandler; import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.auth.Subject; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.SubjectGWTServiceAsync;
/** * @author Greg Hinkle */ -public class LoginView { +public class LoginView extends Canvas {
private Window window; private DynamicForm form;
+ + public LoginView() { + this(false); + } + + public LoginView(boolean logout) { + + if (logout && CoreGUI.getSessionSubject() != null) { + GWTServiceLookup.getSubjectService().logout(CoreGUI.getSessionSubject(), new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to logout", caught); + CoreGUI.checkLoginStatus(); + } + + public void onSuccess(Void result) { + CoreGUI.checkLoginStatus(); + } + }); + } else { + CoreGUI.checkLoginStatus(); + } + + } + public void showLoginDialog() {
form = new DynamicForm(); @@ -72,7 +97,7 @@ public class LoginView {
CanvasItem logo = new CanvasItem(); - logo.setCanvas(new Img("header/rhq_logo_28px.png",80,28)); + logo.setCanvas(new Img("header/rhq_logo_28px.png", 80, 28)); logo.setShowTitle(false);
HeaderItem header = new HeaderItem(); @@ -105,7 +130,7 @@ public class LoginView { window = new Window(); window.setTitle("RHQ Login"); window.setWidth(400); - window.setHeight(400); + window.setHeight(250); window.setIsModal(true); window.setShowModalMask(true); window.setCanDragResize(true);
commit 797f13a4df3a2c1798649557c9911682e3e0b9b8 Author: John Sanda jsanda@redhat.com Date: Mon May 24 13:39:22 2010 -0400
[BZ 586068] Moving formatting code out of core/domain to avoid problems with gwt
There are some classes and packages such as java.text that cannot be used in GWT code. One of my previous commits refactored MeasurementOOBComposite to use MeasurementConverter which has a dependency on java.text. I removed the formatting calls from MeausrementOOBComposite and moved formmatting classes into server/jar. The formatting is now done in the SLSB method from which the MeasurementOOBComposites are returned. The GWT-based formatter, MeasurementConverterClient has been moved to coregui.
diff --git a/modules/core/domain/mvn.out b/modules/core/domain/mvn.out new file mode 100644 index 0000000..492a5b3 --- /dev/null +++ b/modules/core/domain/mvn.out @@ -0,0 +1,1714 @@ +[INFO] Scanning for projects... +[INFO] snapshot org.rhq:rhq-parent:3.0.0-SNAPSHOT: checking for updates from jboss-snapshots +[INFO] ------------------------------------------------------------------------ +[INFO] Building RHQ Domain Model +[INFO] task-segment: [clean, gwt:compile] +[INFO] ------------------------------------------------------------------------ +[INFO] [clean:clean {execution: default-clean}] +[INFO] Deleting /Users/john/Development/redhat/imanage/rhq/modules/core/domain/target +[INFO] snapshot org.rhq:rhq-core-util:3.0.0-SNAPSHOT: checking for updates from jboss-snapshots +[INFO] [gwt:compile {execution: default-cli}] +[INFO] using GWT jars from project dependencies : 2.0.0 +[WARNING] You should not declare gwt-dev as a project dependency. This may introduce complex dependency conflicts +[INFO] auto discovered modules [org.rhq.core.RHQDomain] +[INFO] establishing classpath list (scope = compile) +[INFO] using GWT jars for specified version 2.0.0 +[INFO] using GWT jars for specified version 2.0.0 +[INFO] Compiling module org.rhq.core.RHQDomain +[INFO] Validating newly compiled units +[INFO] [ERROR] Errors in 'file:/Users/john/Development/redhat/imanage/rhq/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java' +[INFO] [ERROR] Line 23: The import org.rhq.core.server.MeasurementConverter cannot be resolved +[INFO] [ERROR] Line 165: MeasurementConverter cannot be resolved +[INFO] [ERROR] Line 166: MeasurementConverter cannot be resolved +[INFO] [ERROR] Line 174: MeasurementConverter cannot be resolved +[INFO] Resolving org.rhq.core.domain.operation.GroupOperationScheduleEntity +[INFO] Found type 'org.rhq.core.domain.operation.GroupOperationScheduleEntity' +[INFO] Found type 'org.rhq.core.domain.operation.OperationScheduleEntity' +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.operation.ScheduleJobId +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.operation.ScheduleJobId +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:792) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:741) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] Resolving org.rhq.core.domain.content.RepoPackageVersion +[INFO] Found type 'org.rhq.core.domain.content.RepoPackageVersion' +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.content.RepoPackageVersionPK +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.content.RepoPackageVersionPK +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] Resolving org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple +[INFO] Found type 'org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple' +[INFO] Found type 'org.rhq.core.domain.configuration.definition.PropertyDefinition' +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:792) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:741) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionList +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionList +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:792) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:741) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionMap +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionMap +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:792) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:741) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null +[INFO] Resolving org.rhq.core.domain.criteria.RoleCriteria +[INFO] Found type 'org.rhq.core.domain.criteria.RoleCriteria' +[INFO] Found type 'org.rhq.core.domain.authz.Role' +[INFO] Found type 'org.rhq.core.domain.resource.group.ResourceGroup' +[INFO] Found type 'org.rhq.core.domain.resource.Resource' +[INFO] Found type 'org.rhq.core.domain.content.ResourceRepo' +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.content.ResourceRepoPK +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.content.ResourceRepoPK +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] Found type 'org.rhq.core.domain.content.Repo' +[INFO] Found type 'org.rhq.core.domain.content.RepoContentSource' +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.content.RepoContentSourcePK +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.content.RepoContentSourcePK +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] Found type 'org.rhq.core.domain.content.RepoDistribution' +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.content.RepoDistributionPK +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.content.RepoDistributionPK +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] Found type 'org.rhq.core.domain.content.RepoAdvisory' +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.content.RepoAdvisoryPK +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.content.RepoAdvisoryPK +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] Found type 'org.rhq.core.domain.content.PackageVersion' +[INFO] Found type 'org.rhq.core.domain.content.ProductVersionPackageVersion' +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.content.ProductVersionPackageVersionPK +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.content.ProductVersionPackageVersionPK +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] Found type 'org.rhq.core.domain.content.RepoRepoGroup' +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.content.RepoRepoGroupPK +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.content.RepoRepoGroupPK +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] Found type 'org.rhq.core.domain.content.RepoRepoRelationship' +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.content.RepoRepoRelationshipPK +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.content.RepoRepoRelationshipPK +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [WARN] Ignoring unresolvable annotation type org.rhq.core.domain.util.Summary +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.util.Summary +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationClass(TypeOracleMediator.java:481) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:563) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveField(TypeOracleMediator.java:868) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:777) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [WARN] Ignoring unresolvable annotation type org.rhq.core.domain.util.Summary +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.util.Summary +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationClass(TypeOracleMediator.java:481) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:563) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveField(TypeOracleMediator.java:868) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:777) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [WARN] Ignoring unresolvable annotation type org.rhq.core.domain.util.Summary +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.util.Summary +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationClass(TypeOracleMediator.java:481) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:563) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveField(TypeOracleMediator.java:868) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:777) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [WARN] Ignoring unresolvable annotation type org.rhq.core.domain.util.Summary +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.util.Summary +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationClass(TypeOracleMediator.java:481) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:563) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveField(TypeOracleMediator.java:868) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:777) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [WARN] Ignoring unresolvable annotation type org.rhq.core.domain.util.Summary +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.util.Summary +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationClass(TypeOracleMediator.java:481) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:563) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveField(TypeOracleMediator.java:868) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:777) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:100) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] Resolving org.rhq.core.domain.content.PackageVersionContentSource +[INFO] Found type 'org.rhq.core.domain.content.PackageVersionContentSource' +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.content.PackageVersionContentSourcePK +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.content.PackageVersionContentSourcePK +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] Resolving org.rhq.core.domain.configuration.PropertyMap +[INFO] Found type 'org.rhq.core.domain.configuration.PropertyMap' +[INFO] Found type 'org.rhq.core.domain.configuration.Property' +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.PropertySimple +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.PropertySimple +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:792) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:741) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.PropertyList +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.PropertyList +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:792) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:741) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.PropertyMap +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.PropertyMap +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:792) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:741) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null +[INFO] Resolving org.rhq.core.domain.configuration.Configuration +[INFO] Found type 'org.rhq.core.domain.configuration.Configuration' +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.PropertyList +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.PropertyList +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:649) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:909) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.PropertySimple +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.PropertySimple +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:649) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:909) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.PropertyMap +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.PropertyMap +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:649) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:909) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] Found type 'org.rhq.core.domain.configuration.PropertyList' +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.Property +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.Property +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveField(TypeOracleMediator.java:868) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:777) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.access$200(TypeOracleMediator.java:78) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator$1.resolveClass(TypeOracleMediator.java:279) +[INFO] at com.google.gwt.dev.javac.asm.ResolveTypeSignature.visitClassType(ResolveTypeSignature.java:140) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:184) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.parseType(SignatureReader.java:219) +[INFO] at com.google.gwt.dev.asm.signature.SignatureReader.accept(SignatureReader.java:102) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveMethod(TypeOracleMediator.java:972) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:767) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] Resolving org.rhq.core.domain.configuration.definition.ConfigurationDefinition.GroupComparator +[INFO] Found type 'org.rhq.core.domain.configuration.definition.ConfigurationDefinition' +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:792) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:698) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionList +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionList +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:792) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:698) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionMap +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionMap +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:792) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:698) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null +[INFO] Resolving org.rhq.core.domain.bundle.BundleVersionRepo +[INFO] Found type 'org.rhq.core.domain.bundle.BundleVersionRepo' +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.bundle.BundleVersionRepoPK +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.bundle.BundleVersionRepoPK +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] Resolving org.rhq.core.domain.configuration.definition.PropertyDefinitionMap +[INFO] Found type 'org.rhq.core.domain.configuration.definition.PropertyDefinitionMap' +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionList +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionList +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionMap +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionMap +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null +[INFO] Resolving org.rhq.core.domain.resource.ResourceType +[INFO] Found type 'org.rhq.core.domain.resource.ResourceType' +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.resource.ResourceType +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.resource.ResourceType +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:649) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [WARN] Ignoring unresolvable annotation type org.rhq.core.domain.util.Summary +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.util.Summary +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationClass(TypeOracleMediator.java:481) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:563) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveField(TypeOracleMediator.java:868) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:777) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [WARN] Ignoring unresolvable annotation type org.rhq.core.domain.util.Summary +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.util.Summary +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationClass(TypeOracleMediator.java:481) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:563) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveField(TypeOracleMediator.java:868) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:777) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [WARN] Ignoring unresolvable annotation type org.rhq.core.domain.util.Summary +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.util.Summary +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationClass(TypeOracleMediator.java:481) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:563) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveField(TypeOracleMediator.java:868) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:777) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [WARN] Ignoring unresolvable annotation type org.rhq.core.domain.util.Summary +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.util.Summary +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationClass(TypeOracleMediator.java:481) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:563) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveField(TypeOracleMediator.java:868) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:777) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] Resolving org.rhq.core.domain.configuration.definition.PropertyDefinitionList +[INFO] Found type 'org.rhq.core.domain.configuration.definition.PropertyDefinitionList' +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionList +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionList +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null +[INFO] [ERROR] Annotation error: cannot resolve org.rhq.core.domain.configuration.definition.PropertyDefinitionMap +[INFO] java.lang.ClassNotFoundException: org.rhq.core.domain.configuration.definition.PropertyDefinitionMap +[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) +[INFO] at java.security.AccessController.doPrivileged(Native Method) +[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:315) +[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) +[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:250) +[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398) +[INFO] at java.lang.Class.forName0(Native Method) +[INFO] at java.lang.Class.forName(Class.java:247) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:666) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotationValue(TypeOracleMediator.java:605) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.createAnnotation(TypeOracleMediator.java:399) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:568) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:583) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:724) +[INFO] at com.google.gwt.dev.javac.TypeOracleMediator.addNewUnits(TypeOracleMediator.java:353) +[INFO] at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:135) +[INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:79) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:284) +[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:181) +[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:280) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:502) +[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414) +[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:201) +[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) +[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) +[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) +[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:159) +[INFO] [ERROR] Annotation error: expected class java.lang.Class, got null +[INFO] Compiling 4 permutations +[INFO] Compiling permutation 0... +[INFO] Compiling permutation 2... +[INFO] Compiling permutation 3... +[INFO] Process output +[INFO] Compiling permutation 1... +[INFO] Compile of permutations succeeded +[INFO] Linking into /Users/john/Development/redhat/imanage/rhq/modules/core/domain/target/rhq-core-domain-ejb3/org.rhq.core.RHQDomain. Writing extras to /Users/john/Development/redhat/imanage/rhq/modules/core/domain/target/extra/org.rhq.core.RHQDomain +[INFO] Link succeeded +[INFO] Compilation succeeded -- 36.634s +[INFO] ------------------------------------------------------------------------ +[INFO] BUILD SUCCESSFUL +[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 1 minute 12 seconds +[INFO] Finished at: Mon May 24 10:12:35 EDT 2010 +[INFO] Final Memory: 32M/527M +[INFO] ------------------------------------------------------------------------ diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementConverterClient.java b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementConverterClient.java deleted file mode 100644 index f78b62c..0000000 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementConverterClient.java +++ /dev/null @@ -1,360 +0,0 @@ - /* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, 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.domain.measurement; - - import org.rhq.core.domain.measurement.composite.MeasurementNumericValueAndUnits; - import org.rhq.core.domain.measurement.util.MeasurementConversionException; - - import com.google.gwt.i18n.client.NumberFormat; - - import java.util.HashSet; - import java.util.Set; - - public class MeasurementConverterClient { - private static final int MAX_PRECISION_DIGITS = 4; - private static final String NULL_OR_NAN_FORMATTED_VALUE = "--no data available--"; - - - private static NumberFormat getDefaultNumberFormat() { - NumberFormat nf = NumberFormat.getFormat("0.0"); - - return nf; - } - - public static Double scale(MeasurementNumericValueAndUnits origin, MeasurementUnits targetUnits) - throws MeasurementConversionException { - MeasurementUnits originUnits = origin.getUnits(); - Double originValue = origin.getValue(); - - return originValue * MeasurementUnits.calculateOffset(originUnits, targetUnits); - } - - public static Double scale(Double origin, MeasurementUnits targetUnits) throws MeasurementConversionException { - boolean wasNegative = false; - if (origin < 0) { - wasNegative = true; - origin = -origin; - } - - MeasurementUnits baseUnit = targetUnits.getBaseUnits(); - MeasurementNumericValueAndUnits valueAndUnits = new MeasurementNumericValueAndUnits(origin, baseUnit); - - Double results = scale(valueAndUnits, targetUnits); - if (wasNegative) { - results = -results; - } - - return results; - } - - public static String format(String value, MeasurementUnits targetUnits) { - if (targetUnits == null) { - return value; - } else { - return value + targetUnits; - } - } - - /** - * Formats the given array of double values: determines the necessary precision such that when formatted, they are - * distinct and reasonable to look at. For example, for values { 1.45 1.46 1.47 1.48 1.49 } the desired precision is - * 2 - less precision loses significant digits, and more precision provides no added benefit. Max precision is - * bounded for presentation considerations. - * - * @param values the values to be formatted - * @param targetUnits the target units for the values - * @param bestFit whether or not to use a normalized scale for the family of units - * - * @return the formatted values - */ - public static String[] formatToSignificantPrecision(double[] values, MeasurementUnits targetUnits, boolean bestFit) { - if ((null == values) || (values.length == 0)) { - return null; - } - - MeasurementUnits originalUnits = targetUnits; - - /* - * in the overwhelming majority of cases, you're going to want to apply a bestFit - * to the passed data, but it's not required; it's perfectly possible to allow a - * list of doubles to be formatted without being fit, in which case the targetUnits - * will be part of the formatted display for each result element - */ - if (bestFit) { - // find bestFit units by taking the average - Double average = 0.0; - - for (int i = 0, sz = values.length; i < sz; i++) { - /* - * adding fractional amount iterative leads to greater - * error, but prevents overflow on large data sets - */ - average += (values[i] / sz); - } - - MeasurementNumericValueAndUnits fittedAverage = fit(average, targetUnits); - //noinspection UnnecessaryLocalVariable - MeasurementUnits fittedUnits = fittedAverage.getUnits(); - - /* - * and change the local reference to targetUnits, so that the same logic - * can be used both for the bestFit and non-bestFit computations - */ - targetUnits = fittedUnits; - } - - @SuppressWarnings("unused") - Set<String> existingStrings; // technically this *is* unused because - int precisionDigits = 0; - boolean scaleWithMorePrecision = true; - String[] results = new String[values.length]; - NumberFormat nf = getDefaultNumberFormat(); - - /* - * we scale at most to MAX_PRECISION_DIGITS to allow for presentation limits - * - * increase the maxPrecisionDigits in the while condition - * itself to ensure it gets done for every loop - */ - while (scaleWithMorePrecision && (++precisionDigits <= MAX_PRECISION_DIGITS)) { - /* - * make the assumption that we no longer need to scale beyond this iteration - */ - scaleWithMorePrecision = false; - - /* - * we need to record the uniquely formatted values so we can determine - */ - existingStrings = new HashSet<String>(); - nf = NumberFormat.getFormat(getFormat(0, precisionDigits)); - - Double[] scaledValues = new Double[values.length]; - - for (int i = 0; i < scaledValues.length; i++) { - /* - * For relative units apply the scale now, prior to the nf.format(), since we are not using format( Double...). - * Otherwise, apply standard multi-unit scaling. - */ - if (MeasurementUnits.Family.RELATIVE == originalUnits.getFamily()) { - scaledValues[i] = MeasurementUnits.scaleUp(values[i], originalUnits); - } else { - scaledValues[i] = scale(new MeasurementNumericValueAndUnits(values[i], originalUnits), targetUnits); - } - } - - for (int i = 0; i < results.length; i++) { - /* - * JUST get the formatted value, specifically DON'T tack on the formatted units yet; - * we do this to see how many units we'll have to scale to afterwards (outside this - * while loop) to make the array of values passed to us unique - */ - String formatted = nf.format(scaledValues[i]); - - /* - * check whether formatted value was in the set or not; if it was, we have to - * loop, but only if we're not not already at our maximum precision - */ - boolean wasNewElement = existingStrings.add(formatted); - - if ((!wasNewElement) && (precisionDigits < MAX_PRECISION_DIGITS)) { - scaleWithMorePrecision = true; - break; - } - - results[i] = formatted; - } - } - - /* - * we did the best we could in terms of trying to find a precision that adds the most - * uniqueness to the given set of values, NOW tack on the formatted value for the units - */ - for (int i = 0; i < results.length; i++) { - results[i] = format(results[i], targetUnits); - } - - return results; - } - - public static String format(Double value, MeasurementUnits targetUnits, boolean bestFit) { - return format(value, targetUnits, bestFit, null, null); - } - - public static String format(Double value, MeasurementUnits targetUnits, boolean bestFit, - Integer minimumFractionDigits, Integer maximumFractionDigits) { - if (value == null || Double.isNaN(value)) { - return NULL_OR_NAN_FORMATTED_VALUE; - } - if (bestFit) { - MeasurementNumericValueAndUnits valueAndUnits = fit(value, targetUnits); - - value = valueAndUnits.getValue(); - targetUnits = valueAndUnits.getUnits(); - } - - // apply relative scale at presentation time - if (MeasurementUnits.Family.RELATIVE == targetUnits.getFamily()) { - value = MeasurementUnits.scaleUp(value, targetUnits); - } - - NumberFormat numberFormat = - NumberFormat.getFormat( - getFormat( - minimumFractionDigits != null ? minimumFractionDigits : 1, - maximumFractionDigits != null ? maximumFractionDigits : 1)); - - String formatted = numberFormat.format(value); - - return format(formatted, targetUnits); - } - - public static String scaleAndFormat(Double origin, MeasurementSchedule targetSchedule, boolean bestFit) - throws MeasurementConversionException { - MeasurementUnits targetUnits = targetSchedule.getDefinition().getUnits(); - - return scaleAndFormat(origin, targetUnits, bestFit, null, null); - } - - public static String scaleAndFormat(Double origin, MeasurementUnits targetUnits, boolean bestFit) - throws MeasurementConversionException { - - return scaleAndFormat(origin, targetUnits, bestFit, null, null); - } - - public static String scaleAndFormat(Double origin, MeasurementUnits targetUnits, boolean bestFit, - Integer minimumFractionDigits, Integer maximumFractionDigits) throws MeasurementConversionException { - - MeasurementUnits baseUnits = targetUnits.getBaseUnits(); - MeasurementNumericValueAndUnits valueAndUnits = new MeasurementNumericValueAndUnits(origin, baseUnits); - Double scaledMagnitude = scale(valueAndUnits, targetUnits); - - return format(scaledMagnitude, targetUnits, bestFit); - } - - public static MeasurementNumericValueAndUnits fit(Double origin, MeasurementUnits units) { - return fit(origin, units, null, null); - } - - public static MeasurementNumericValueAndUnits fit(Double origin, MeasurementUnits units, MeasurementUnits lowUnits, - MeasurementUnits highUnits) { - - // work-around for the various Chart descendants not properly setting their units field; - if (null == units) { - return new MeasurementNumericValueAndUnits(origin, units); - } - - // by definition, absolutely specified units don't scale to anything - if ((MeasurementUnits.Family.ABSOLUTE == units.getFamily()) - || (MeasurementUnits.Family.DURATION == units.getFamily())) { - return new MeasurementNumericValueAndUnits(origin, units); - } - - // by definition relative-valued units are self-scaled (converted at formatting) - if (MeasurementUnits.Family.RELATIVE == units.getFamily()) { - return new MeasurementNumericValueAndUnits(origin, units); - } - - if (MeasurementUnits.Family.TEMPERATURE == units.getFamily()) { - return new MeasurementNumericValueAndUnits(origin, units); - } - - // if the magnitude is zero, the best-fit also will spin around forever since it won't change - if (Math.abs(origin) < 1e-9) { - return new MeasurementNumericValueAndUnits(origin, units); - } - - boolean wasNegative = false; - - if (origin < 0) { - wasNegative = true; - origin = -origin; - } - - MeasurementNumericValueAndUnits currentValueAndUnits; - MeasurementNumericValueAndUnits nextValueAndUnits = new MeasurementNumericValueAndUnits(origin, units); - - // first, make the value smaller if it's too big - int maxOrdinal = (highUnits != null) ? (highUnits.ordinal() + 1) : MeasurementUnits.values().length; - - do { - currentValueAndUnits = nextValueAndUnits; - - int nextOrdinal = currentValueAndUnits.getUnits().ordinal() + 1; - if (nextOrdinal == maxOrdinal) { - // we could theoretically get bigger, but we don't have any units to represent that - break; - } - - MeasurementUnits biggerUnits = MeasurementUnits.values()[nextOrdinal]; - if (biggerUnits.getFamily() != currentValueAndUnits.getUnits().getFamily()) { - // we're as big as we can get, break out of the loop so we can return - break; - } - - Double smallerValue = scale(currentValueAndUnits, biggerUnits); - - nextValueAndUnits = new MeasurementNumericValueAndUnits(smallerValue, biggerUnits); - } while (nextValueAndUnits.getValue() > 1.0); - - // next, make the value bigger if it's too small - int minOrdinal = (lowUnits != null) ? (lowUnits.ordinal() - 1) : -1; - - while (currentValueAndUnits.getValue() < 1.0) { - int nextOrdinal = currentValueAndUnits.getUnits().ordinal() - 1; - if (nextOrdinal == minOrdinal) { - // we could theoretically get smaller, but we don't have any units to represent that - break; - } - - MeasurementUnits smallerUnits = MeasurementUnits.values()[nextOrdinal]; - if (smallerUnits.getFamily() != currentValueAndUnits.getUnits().getFamily()) { - // we're as small as we can get, break out of the loop so we can return - break; - } - - Double biggerValue = scale(currentValueAndUnits, smallerUnits); - - nextValueAndUnits = new MeasurementNumericValueAndUnits(biggerValue, smallerUnits); - - currentValueAndUnits = nextValueAndUnits; - } - - if (wasNegative) { - return new MeasurementNumericValueAndUnits(-currentValueAndUnits.getValue(), currentValueAndUnits - .getUnits()); - } - - return currentValueAndUnits; - } - - public static String getFormat(int minDigits, int maxDigits) { - StringBuilder buf = new StringBuilder("0."); - for (int i = 0; i < minDigits;i++) { - buf.append("0"); - } - for (int i = 0; i < (maxDigits-minDigits);i++) { - buf.append("#"); - } - return buf.toString(); - } -} diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java index ecb0cd8..f32c07b 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java @@ -47,6 +47,8 @@ public class MeasurementOOBComposite implements Serializable { private MeasurementUnits units; private String parentName; private Integer parentId; + private String formattedOutlier; + private String formattedBaseband;
public MeasurementOOBComposite(String resourceName, int resourceId, String scheduleName, int scheduleId, long timestamp, int definitionId, int factor, double blMin, double blMax, MeasurementUnits units, @@ -107,6 +109,10 @@ public class MeasurementOOBComposite implements Serializable { return timestamp; }
+ public MeasurementUnits getUnits() { + return units; + } + public double getBlMin() { return blMin; } @@ -160,20 +166,21 @@ public class MeasurementOOBComposite implements Serializable { } }
- /* public String getFormattedBaseband() { - String min = MeasurementConverter.format(blMin, units, true); - String max = MeasurementConverter.format(blMax, units, true); - - String result = min + ", " + max; + return formattedBaseband; + }
- return result; + public void setFormattedBaseband(String formattedBaseband) { + this.formattedBaseband = formattedBaseband; }
public String getFormattedOutlier() { - return MeasurementConverter.format(outlier, units, true); + return formattedOutlier; + } + + public void setFormattedOutlier(String formattedOutlier) { + this.formattedOutlier = formattedOutlier; } - */
@Override public String toString() { diff --git a/modules/core/domain/src/main/java/org/rhq/core/server/MeasurementConverter.java b/modules/core/domain/src/main/java/org/rhq/core/server/MeasurementConverter.java deleted file mode 100644 index 443964f..0000000 --- a/modules/core/domain/src/main/java/org/rhq/core/server/MeasurementConverter.java +++ /dev/null @@ -1,355 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, 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.server; - -import java.text.NumberFormat; -import java.util.HashSet; -import java.util.Set; - -import org.rhq.core.domain.measurement.MeasurementSchedule; -import org.rhq.core.domain.measurement.MeasurementUnits; -import org.rhq.core.domain.measurement.composite.MeasurementNumericValueAndUnits; -import org.rhq.core.domain.measurement.util.MeasurementConversionException; - -public class MeasurementConverter { - private static final int MAX_PRECISION_DIGITS = 4; - private static final String NULL_OR_NAN_FORMATTED_VALUE = "--no data available--"; - - - private static NumberFormat getDefaultNumberFormat() { - NumberFormat nf = NumberFormat.getNumberInstance(); - - nf.setMinimumFractionDigits(1); - nf.setMaximumFractionDigits(1); - - return nf; - } - - public static Double scale(MeasurementNumericValueAndUnits origin, MeasurementUnits targetUnits) - throws MeasurementConversionException { - MeasurementUnits originUnits = origin.getUnits(); - Double originValue = origin.getValue(); - - return originValue * MeasurementUnits.calculateOffset(originUnits, targetUnits); - } - - public static Double scale(Double origin, MeasurementUnits targetUnits) throws MeasurementConversionException { - boolean wasNegative = false; - if (origin < 0) { - wasNegative = true; - origin = -origin; - } - - MeasurementUnits baseUnit = targetUnits.getBaseUnits(); - MeasurementNumericValueAndUnits valueAndUnits = new MeasurementNumericValueAndUnits(origin, baseUnit); - - Double results = scale(valueAndUnits, targetUnits); - if (wasNegative) { - results = -results; - } - - return results; - } - - public static String format(String value, MeasurementUnits targetUnits) { - if (targetUnits == null) { - return value; - } else { - return value + targetUnits; - } - } - - /** - * Formats the given array of double values: determines the necessary precision such that when formatted, they are - * distinct and reasonable to look at. For example, for values { 1.45 1.46 1.47 1.48 1.49 } the desired precision is - * 2 - less precision loses significant digits, and more precision provides no added benefit. Max precision is - * bounded for presentation considerations. - * - * @param values the values to be formatted - * @param targetUnits the target units for the values - * @param bestFit whether or not to use a normalized scale for the family of units - * - * @return the formatted values - */ - public static String[] formatToSignificantPrecision(double[] values, MeasurementUnits targetUnits, boolean bestFit) { - if ((null == values) || (values.length == 0)) { - return null; - } - - MeasurementUnits originalUnits = targetUnits; - - /* - * in the overwhelming majority of cases, you're going to want to apply a bestFit - * to the passed data, but it's not required; it's perfectly possible to allow a - * list of doubles to be formatted without being fit, in which case the targetUnits - * will be part of the formatted display for each result element - */ - if (bestFit) { - // find bestFit units by taking the average - Double average = 0.0; - - for (int i = 0, sz = values.length; i < sz; i++) { - /* - * adding fractional amount iterative leads to greater - * error, but prevents overflow on large data sets - */ - average += (values[i] / sz); - } - - MeasurementNumericValueAndUnits fittedAverage = fit(average, targetUnits); - //noinspection UnnecessaryLocalVariable - MeasurementUnits fittedUnits = fittedAverage.getUnits(); - - /* - * and change the local reference to targetUnits, so that the same logic - * can be used both for the bestFit and non-bestFit computations - */ - targetUnits = fittedUnits; - } - - @SuppressWarnings("unused") - Set<String> existingStrings; // technically this *is* unused because - int precisionDigits = 0; - boolean scaleWithMorePrecision = true; - String[] results = new String[values.length]; - NumberFormat nf = getDefaultNumberFormat(); - - /* - * we scale at most to MAX_PRECISION_DIGITS to allow for presentation limits - * - * increase the maxPrecisionDigits in the while condition - * itself to ensure it gets done for every loop - */ - while (scaleWithMorePrecision && (++precisionDigits <= MAX_PRECISION_DIGITS)) { - /* - * make the assumption that we no longer need to scale beyond this iteration - */ - scaleWithMorePrecision = false; - - /* - * we need to record the uniquely formatted values so we can determine - */ - existingStrings = new HashSet<String>(); - nf.setMinimumFractionDigits(0); - nf.setMaximumFractionDigits(precisionDigits); - - Double[] scaledValues = new Double[values.length]; - - for (int i = 0; i < scaledValues.length; i++) { - /* - * For relative units apply the scale now, prior to the nf.format(), since we are not using format( Double...). - * Otherwise, apply standard multi-unit scaling. - */ - if (MeasurementUnits.Family.RELATIVE == originalUnits.getFamily()) { - scaledValues[i] = MeasurementUnits.scaleUp(values[i], originalUnits); - } else { - scaledValues[i] = scale(new MeasurementNumericValueAndUnits(values[i], originalUnits), targetUnits); - } - } - - for (int i = 0; i < results.length; i++) { - /* - * JUST get the formatted value, specifically DON'T tack on the formatted units yet; - * we do this to see how many units we'll have to scale to afterwards (outside this - * while loop) to make the array of values passed to us unique - */ - String formatted = nf.format(scaledValues[i]); - - /* - * check whether formatted value was in the set or not; if it was, we have to - * loop, but only if we're not not already at our maximum precision - */ - boolean wasNewElement = existingStrings.add(formatted); - - if ((!wasNewElement) && (precisionDigits < MAX_PRECISION_DIGITS)) { - scaleWithMorePrecision = true; - break; - } - - results[i] = formatted; - } - } - - /* - * we did the best we could in terms of trying to find a precision that adds the most - * uniqueness to the given set of values, NOW tack on the formatted value for the units - */ - for (int i = 0; i < results.length; i++) { - results[i] = format(results[i], targetUnits); - } - - return results; - } - - public static String format(Double value, MeasurementUnits targetUnits, boolean bestFit) { - return format(value, targetUnits, bestFit, null, null); - } - - public static String format(Double value, MeasurementUnits targetUnits, boolean bestFit, - Integer minimumFractionDigits, Integer maximumFractionDigits) { - if (value == null || Double.isNaN(value)) { - return NULL_OR_NAN_FORMATTED_VALUE; - } - if (bestFit) { - MeasurementNumericValueAndUnits valueAndUnits = fit(value, targetUnits); - - value = valueAndUnits.getValue(); - targetUnits = valueAndUnits.getUnits(); - } - - // apply relative scale at presentation time - if (MeasurementUnits.Family.RELATIVE == targetUnits.getFamily()) { - value = MeasurementUnits.scaleUp(value, targetUnits); - } - - NumberFormat numberFormat = getDefaultNumberFormat(); - if (null != minimumFractionDigits) { - numberFormat.setMinimumFractionDigits(minimumFractionDigits); - } - if (null != maximumFractionDigits) { - numberFormat.setMaximumFractionDigits(maximumFractionDigits); - } - String formatted = numberFormat.format(value); - - return format(formatted, targetUnits); - } - - public static String scaleAndFormat(Double origin, MeasurementSchedule targetSchedule, boolean bestFit) - throws MeasurementConversionException { - MeasurementUnits targetUnits = targetSchedule.getDefinition().getUnits(); - - return scaleAndFormat(origin, targetUnits, bestFit, null, null); - } - - public static String scaleAndFormat(Double origin, MeasurementUnits targetUnits, boolean bestFit) - throws MeasurementConversionException { - - return scaleAndFormat(origin, targetUnits, bestFit, null, null); - } - - public static String scaleAndFormat(Double origin, MeasurementUnits targetUnits, boolean bestFit, - Integer minimumFractionDigits, Integer maximumFractionDigits) throws MeasurementConversionException { - - MeasurementUnits baseUnits = targetUnits.getBaseUnits(); - MeasurementNumericValueAndUnits valueAndUnits = new MeasurementNumericValueAndUnits(origin, baseUnits); - Double scaledMagnitude = scale(valueAndUnits, targetUnits); - - return format(scaledMagnitude, targetUnits, bestFit); - } - - public static MeasurementNumericValueAndUnits fit(Double origin, MeasurementUnits units) { - return fit(origin, units, null, null); - } - - public static MeasurementNumericValueAndUnits fit(Double origin, MeasurementUnits units, MeasurementUnits lowUnits, - MeasurementUnits highUnits) { - - // work-around for the various Chart descendants not properly setting their units field; - if (null == units) { - return new MeasurementNumericValueAndUnits(origin, units); - } - - // by definition, absolutely specified units don't scale to anything - if ((MeasurementUnits.Family.ABSOLUTE == units.getFamily()) - || (MeasurementUnits.Family.DURATION == units.getFamily())) { - return new MeasurementNumericValueAndUnits(origin, units); - } - - // by definition relative-valued units are self-scaled (converted at formatting) - if (MeasurementUnits.Family.RELATIVE == units.getFamily()) { - return new MeasurementNumericValueAndUnits(origin, units); - } - - if (MeasurementUnits.Family.TEMPERATURE == units.getFamily()) { - return new MeasurementNumericValueAndUnits(origin, units); - } - - // if the magnitude is zero, the best-fit also will spin around forever since it won't change - if (Math.abs(origin) < 1e-9) { - return new MeasurementNumericValueAndUnits(origin, units); - } - - boolean wasNegative = false; - - if (origin < 0) { - wasNegative = true; - origin = -origin; - } - - MeasurementNumericValueAndUnits currentValueAndUnits; - MeasurementNumericValueAndUnits nextValueAndUnits = new MeasurementNumericValueAndUnits(origin, units); - - // first, make the value smaller if it's too big - int maxOrdinal = (highUnits != null) ? (highUnits.ordinal() + 1) : MeasurementUnits.values().length; - - do { - currentValueAndUnits = nextValueAndUnits; - - int nextOrdinal = currentValueAndUnits.getUnits().ordinal() + 1; - if (nextOrdinal == maxOrdinal) { - // we could theoretically get bigger, but we don't have any units to represent that - break; - } - - MeasurementUnits biggerUnits = MeasurementUnits.values()[nextOrdinal]; - if (biggerUnits.getFamily() != currentValueAndUnits.getUnits().getFamily()) { - // we're as big as we can get, break out of the loop so we can return - break; - } - - Double smallerValue = scale(currentValueAndUnits, biggerUnits); - - nextValueAndUnits = new MeasurementNumericValueAndUnits(smallerValue, biggerUnits); - } while (nextValueAndUnits.getValue() > 1.0); - - // next, make the value bigger if it's too small - int minOrdinal = (lowUnits != null) ? (lowUnits.ordinal() - 1) : -1; - - while (currentValueAndUnits.getValue() < 1.0) { - int nextOrdinal = currentValueAndUnits.getUnits().ordinal() - 1; - if (nextOrdinal == minOrdinal) { - // we could theoretically get smaller, but we don't have any units to represent that - break; - } - - MeasurementUnits smallerUnits = MeasurementUnits.values()[nextOrdinal]; - if (smallerUnits.getFamily() != currentValueAndUnits.getUnits().getFamily()) { - // we're as small as we can get, break out of the loop so we can return - break; - } - - Double biggerValue = scale(currentValueAndUnits, smallerUnits); - - nextValueAndUnits = new MeasurementNumericValueAndUnits(biggerValue, smallerUnits); - - currentValueAndUnits = nextValueAndUnits; - } - - if (wasNegative) { - return new MeasurementNumericValueAndUnits(-currentValueAndUnits.getValue(), currentValueAndUnits - .getUnits()); - } - - return currentValueAndUnits; - } -} diff --git a/modules/core/domain/src/main/java/org/rhq/core/server/MeasurementParser.java b/modules/core/domain/src/main/java/org/rhq/core/server/MeasurementParser.java deleted file mode 100644 index 42cd8f3..0000000 --- a/modules/core/domain/src/main/java/org/rhq/core/server/MeasurementParser.java +++ /dev/null @@ -1,104 +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.core.server; - -import org.rhq.core.domain.measurement.MeasurementSchedule; -import org.rhq.core.domain.measurement.MeasurementUnits; -import org.rhq.core.domain.measurement.composite.MeasurementNumericValueAndUnits; -import org.rhq.core.domain.measurement.util.MeasurementConversionException; - -import java.text.DecimalFormat; -import java.text.ParseException; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * @author Greg Hinkle - */ -public class MeasurementParser { - - private static final String NUMBER_OPTIONAL_UNIT_PATTERN_STRING = "([\+\-]?" + // number sign is optional but valid - "[0-9\.\,]{1,})" + // followed by at least one magnitude identifier, capture number plus sign - "([\%a-z]*)"; // followed by an optional units identifier, capture entire suffix - private static final Pattern NUMBER_OPTIONAL_UNIT_PATTERN; - static { - NUMBER_OPTIONAL_UNIT_PATTERN = Pattern.compile(NUMBER_OPTIONAL_UNIT_PATTERN_STRING, Pattern.CASE_INSENSITIVE); - } - - public static MeasurementNumericValueAndUnits parse(String input, MeasurementUnits targetUnits) - throws MeasurementConversionException { - input = input.replaceAll("\s", ""); // our pattern assumes no whitespace - Matcher matcher = NUMBER_OPTIONAL_UNIT_PATTERN.matcher(input); - - if (!matcher.matches()) { - throw new MeasurementConversionException("The passed input '" + input + "' could not be parsed correctly " - + "by the regular expression " + NUMBER_OPTIONAL_UNIT_PATTERN_STRING); - } - - String magnitude = matcher.group(1); - String units = matcher.group(2); - - MeasurementUnits fromUnits; - if (units.equals("")) { - /* - * no units is valid, and we assume the passed targetUnits; however, we will - * still need to check that the number is well-formed, so continue processing. - */ - fromUnits = targetUnits; - } else { - fromUnits = MeasurementUnits.getUsingDisplayUnits(units, targetUnits.getFamily()); - - if ((fromUnits == null) || (!fromUnits.isComparableTo(targetUnits))) { - throw new MeasurementConversionException("The units in '" + input + "' were not valid, " + "expected '" - + targetUnits.getFamily() + "' units, received '" + units + "' units"); - } - } - - try { - if (magnitude.startsWith("+")) { - magnitude = magnitude.substring(1); - } - - Number convertedMagnitude = DecimalFormat.getInstance().parse(magnitude); - Double scaledMagnitude; - - // apply relative scale if applicable, otherwise perform standard scaling - if (MeasurementUnits.Family.RELATIVE == targetUnits.getFamily()) { - scaledMagnitude = MeasurementUnits.scaleDown(convertedMagnitude.doubleValue(), targetUnits); - } else { - MeasurementNumericValueAndUnits valueAndUnits = new MeasurementNumericValueAndUnits(convertedMagnitude - .doubleValue(), fromUnits); - scaledMagnitude = MeasurementConverter.scale(valueAndUnits, targetUnits); - } - - return new MeasurementNumericValueAndUnits(scaledMagnitude, targetUnits); - } catch (ParseException pe) { - throw new MeasurementConversionException("The magnitude in '" + input + "' did not parse correctly " - + "as a valid, localized, stringified number "); - } - - } - - public static MeasurementNumericValueAndUnits parse(String input, MeasurementSchedule targetSchedule) - throws MeasurementConversionException { - MeasurementUnits targetUnits = targetSchedule.getDefinition().getUnits(); - - return parse(input, targetUnits); - } -} diff --git a/modules/core/domain/src/test/java/org/rhq/core/domain/util/units/test/MeasurementConverterTest.java b/modules/core/domain/src/test/java/org/rhq/core/domain/util/units/test/MeasurementConverterTest.java deleted file mode 100644 index 0688c79..0000000 --- a/modules/core/domain/src/test/java/org/rhq/core/domain/util/units/test/MeasurementConverterTest.java +++ /dev/null @@ -1,390 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, 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.domain.util.units.test; - -import java.text.DecimalFormat; -import java.text.NumberFormat; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; - -import org.testng.annotations.Test; - -import org.rhq.core.domain.measurement.MeasurementConverterClient; -import org.rhq.core.domain.measurement.MeasurementUnits; -import org.rhq.core.domain.measurement.composite.MeasurementNumericValueAndUnits; -import org.rhq.core.domain.measurement.util.MeasurementConversionException; -import org.rhq.core.domain.test.AbstractEJB3Test; -import org.rhq.core.server.MeasurementParser; - -// TODO two tests in here need to be re-enables once the GWT client issues are resolved -@Test -public class MeasurementConverterTest extends AbstractEJB3Test { - private final double POSITIVE = 300; - private final double NEGATIVE = -42; - - private final String[] WHITESPACE = new String[] { " ", "\f", "\n", "\r", "\t" }; - - private ThreadLocal<Integer> precisionScalingTestCount = null; - - private void incrementPrecisionScalingTestCount() { - if (precisionScalingTestCount == null) { - precisionScalingTestCount = new ThreadLocal<Integer>() { - @Override - protected Integer initialValue() { - return 0; - } - }; - } - precisionScalingTestCount.set(precisionScalingTestCount.get() + 1); - } - - @Test(groups = "integration.ejb3", enabled = false) - // TODO fix me - public void testPrecisionScaling() throws Exception { - - // if all values are equal, it will format to the max precision - - testPrecisionScaling(new double[] { 1.41, 1.41, 1.41, 1.41, 1.41 }, MeasurementUnits.NONE, new String[] { - "1.41", "1.41", "1.41", "1.41", "1.41" }, MeasurementUnits.NONE); - - // if all values are unique, it won't need to format any of them to more digits - testPrecisionScaling(new double[] { 1.41, 1.42, 1.43, 1.44, 1.45 }, MeasurementUnits.NONE, new String[] { - "1.41", "1.42", "1.43", "1.44", "1.45" }, MeasurementUnits.NONE); - - // even if only two are equal, it will scale all the way to max precision looking for uniqueness - testPrecisionScaling(new double[] { 1.4, 1.4, 1.5, 1.6, 1.7 }, MeasurementUnits.NONE, new String[] { "1.4", - "1.4", "1.5", "1.6", "1.7" }, MeasurementUnits.NONE); - - // to final a "good looking" target scaling units, it will use the mathematical mean - // NOTE: formatting doesn't round up/down, thus introducing error from cutting digits (256 -> 0.2KB [instead of 0.25KB]) - testPrecisionScaling(new double[] { 128, 256, 512, 1024, 8192 }, MeasurementUnits.BYTES, new String[] { - "0.1KB", "0.2KB", "0.5KB", "1KB", "8KB" }, MeasurementUnits.KILOBYTES); - - // same test with negative numbers - testPrecisionScaling(new double[] { -128, -256, -512, -1024, -8192 }, MeasurementUnits.BYTES, new String[] { - "-0.1KB", "-0.2KB", "-0.5KB", "-1KB", "-8KB" }, MeasurementUnits.KILOBYTES); - - // test self scaling relative units - testPrecisionScaling(new double[] { 0.0, 0.065, 1.0, 0.123456 }, MeasurementUnits.PERCENTAGE, new String[] { - "0%", "6.5%", "100%", "12.3%" }, MeasurementUnits.PERCENTAGE); - - // test self scaling relative units - testPrecisionScaling(new double[] { 0.0621, 0.065, 0.0620, 0.6202 }, MeasurementUnits.PERCENTAGE, new String[] { - "6.21%", "6.5%", "6.2%", "62.02%" }, MeasurementUnits.PERCENTAGE); - } - - private void testPrecisionScaling(double[] values, MeasurementUnits units, String[] expectedResults, - MeasurementUnits expectedUnits) { - incrementPrecisionScalingTestCount(); - - String[] results = MeasurementConverterClient.formatToSignificantPrecision(values, units, true); - for (int i = 0; i < results.length; i++) { - String expected = expectedResults[i]; - String actual = results[i]; - - // The expected output is in Locale.US. Handle running the tests in a different default locale - if (expected.contains(".") && (!Locale.getDefault().equals(Locale.US))) { - Locale defaultLocale = Locale.getDefault(); - Locale.setDefault(Locale.US); - MeasurementNumericValueAndUnits vu = MeasurementParser.parse(expected, expectedUnits); - Locale.setDefault(defaultLocale); - expected = MeasurementConverterClient.format(vu.getValue(), expectedUnits, false, null, 4); - } - - assert actual.equals(expected) : "Test " + precisionScalingTestCount.get() + ": " + "Index " + i + ", " - + "Expected " + expected + ", " + "Received " + actual + ", " + "Units " + units.getName(); - } - } - - @Test(groups = "integration.ejb3", enabled = false) - // TODO fix me - public void testConversionSuccess() throws Exception { - // test the straight-forward, non-whitespace cases - for (MeasurementUnits units : MeasurementUnits.values()) { - validateFormatConvert(POSITIVE, units); - validateFormatConvert(NEGATIVE, units); - } - - List<String> signVariations; - List<String> magnitudeVariations; - List<String> unitsVariations; - - // use the same NumberFormat that the MeasurementConverter uses, so that we get the correct expected results - NumberFormat nf = DecimalFormat.getNumberInstance(); - nf.setMinimumFractionDigits(1); - nf.setMaximumFractionDigits(1); - - // test a couple hundred thousand variations of whitespace around each positive number with units - signVariations = getWhitespaceVariationsAroundSingleTokens("", "+"); - magnitudeVariations = getWhitespaceVariationsAroundSingleTokens(nf.format(POSITIVE)); - for (MeasurementUnits units : MeasurementUnits.values()) { - unitsVariations = getWhitespaceVariationsAroundSingleTokens(units.toString()); - - // splice all combinations together and test conversion validity - for (String signVariation : signVariations) { - for (String magnitudeVariation : magnitudeVariations) { - if (MeasurementUnits.Family.RELATIVE == units.getFamily()) { - magnitudeVariation = nf.format(MeasurementUnits.scaleUp(nf.parse(magnitudeVariation.trim()) - .doubleValue(), units)); - } - - for (String unitVariation : unitsVariations) { - String original = MeasurementConverterClient.format(POSITIVE, units, false); - String toBeTested = magnitudeVariation.trim() + unitVariation.trim(); - - assert original.equals(toBeTested) : "Error constructing whitespace string: " + "Expected '" - + original + "', " + "Received '" + toBeTested + "' " + "for units '" + units.name() + "'"; - - validateConvert(POSITIVE, signVariation + magnitudeVariation + unitVariation, units); - } - } - } - } - - // test a couple hundred thousand variations of whitespace around each negative number with units - signVariations = getWhitespaceVariationsAroundSingleTokens("-"); - for (MeasurementUnits units : MeasurementUnits.values()) { - unitsVariations = getWhitespaceVariationsAroundSingleTokens(units.toString()); - - for (String signVariation : signVariations) { - for (String magnitudeVariation : magnitudeVariations) { - if (units == MeasurementUnits.PERCENTAGE) { - magnitudeVariation = nf.format(100 * nf.parse(magnitudeVariation.trim()).doubleValue()); - } - - for (String unitVariation : unitsVariations) { - String original = MeasurementConverterClient.format(-POSITIVE, units, false); - String toBeTested = "-" + magnitudeVariation.trim() + unitVariation.trim(); - - assert original.equals(toBeTested) : "Error constructing whitespace string: " + "Expected '" - + original + "', " + "Received '" + toBeTested + "' " + "for units '" + units.name() + "'"; - - validateConvert(-POSITIVE, signVariation + magnitudeVariation + unitVariation, units); - } - } - } - } - } - - @Test(groups = "integration.ejb3") - public void testScalingSuccess() throws Exception { - // Family.BYTES - validateScaleAndInverse(1024.0, MeasurementUnits.BYTES, 1.0, MeasurementUnits.KILOBYTES); - validateScaleAndInverse(1048576.0, MeasurementUnits.BYTES, 1.0, MeasurementUnits.MEGABYTES); - validateScaleAndInverse(1073741824.0, MeasurementUnits.BYTES, 1.0, MeasurementUnits.GIGABYTES); - validateScaleAndInverse(1099511627776.0, MeasurementUnits.BYTES, 1.0, MeasurementUnits.TERABYTES); - validateScaleAndInverse(1125899906842624.0, MeasurementUnits.BYTES, 1.0, MeasurementUnits.PETABYTES); - - validateScaleAndInverse(1024.0, MeasurementUnits.KILOBYTES, 1.0, MeasurementUnits.MEGABYTES); - validateScaleAndInverse(1048576.0, MeasurementUnits.KILOBYTES, 1.0, MeasurementUnits.GIGABYTES); - validateScaleAndInverse(1073741824.0, MeasurementUnits.KILOBYTES, 1.0, MeasurementUnits.TERABYTES); - validateScaleAndInverse(1099511627776.0, MeasurementUnits.KILOBYTES, 1.0, MeasurementUnits.PETABYTES); - - validateScaleAndInverse(1024.0, MeasurementUnits.MEGABYTES, 1.0, MeasurementUnits.GIGABYTES); - validateScaleAndInverse(1048576.0, MeasurementUnits.MEGABYTES, 1.0, MeasurementUnits.TERABYTES); - validateScaleAndInverse(1073741824.0, MeasurementUnits.MEGABYTES, 1.0, MeasurementUnits.PETABYTES); - - validateScaleAndInverse(1024.0, MeasurementUnits.GIGABYTES, 1.0, MeasurementUnits.TERABYTES); - validateScaleAndInverse(1048576.0, MeasurementUnits.GIGABYTES, 1.0, MeasurementUnits.PETABYTES); - - validateScaleAndInverse(1024.0, MeasurementUnits.TERABYTES, 1.0, MeasurementUnits.PETABYTES); - - // Family.BITS - validateScaleAndInverse(1024.0, MeasurementUnits.BITS, 1.0, MeasurementUnits.KILOBITS); - validateScaleAndInverse(1048576.0, MeasurementUnits.BITS, 1.0, MeasurementUnits.MEGABITS); - validateScaleAndInverse(1073741824.0, MeasurementUnits.BITS, 1.0, MeasurementUnits.GIGABITS); - validateScaleAndInverse(1099511627776.0, MeasurementUnits.BITS, 1.0, MeasurementUnits.TERABITS); - validateScaleAndInverse(1125899906842624.0, MeasurementUnits.BITS, 1.0, MeasurementUnits.PETABITS); - - validateScaleAndInverse(1024.0, MeasurementUnits.KILOBITS, 1.0, MeasurementUnits.MEGABITS); - validateScaleAndInverse(1048576.0, MeasurementUnits.KILOBITS, 1.0, MeasurementUnits.GIGABITS); - validateScaleAndInverse(1073741824.0, MeasurementUnits.KILOBITS, 1.0, MeasurementUnits.TERABITS); - validateScaleAndInverse(1099511627776.0, MeasurementUnits.KILOBITS, 1.0, MeasurementUnits.PETABITS); - - validateScaleAndInverse(1024.0, MeasurementUnits.MEGABITS, 1.0, MeasurementUnits.GIGABITS); - validateScaleAndInverse(1048576.0, MeasurementUnits.MEGABITS, 1.0, MeasurementUnits.TERABITS); - validateScaleAndInverse(1073741824.0, MeasurementUnits.MEGABITS, 1.0, MeasurementUnits.PETABITS); - - validateScaleAndInverse(1024.0, MeasurementUnits.GIGABITS, 1.0, MeasurementUnits.TERABITS); - validateScaleAndInverse(1048576.0, MeasurementUnits.GIGABITS, 1.0, MeasurementUnits.PETABITS); - - validateScaleAndInverse(1024.0, MeasurementUnits.TERABITS, 1.0, MeasurementUnits.PETABITS); - - // Family.DURATION - validateScaleAndInverse(1000.0, MeasurementUnits.EPOCH_MILLISECONDS, 1.0, MeasurementUnits.EPOCH_SECONDS); - - // Family.TIME - validateScaleAndInverse(1000.0, MeasurementUnits.MILLISECONDS, 1.0, MeasurementUnits.SECONDS); - validateScaleAndInverse(60000.0, MeasurementUnits.MILLISECONDS, 1.0, MeasurementUnits.MINUTES); - validateScaleAndInverse(3600000.0, MeasurementUnits.MILLISECONDS, 1.0, MeasurementUnits.HOURS); - validateScaleAndInverse(86400000.0, MeasurementUnits.MILLISECONDS, 1.0, MeasurementUnits.DAYS); - - validateScaleAndInverse(60.0, MeasurementUnits.SECONDS, 1.0, MeasurementUnits.MINUTES); - validateScaleAndInverse(3600.0, MeasurementUnits.SECONDS, 1.0, MeasurementUnits.HOURS); - validateScaleAndInverse(86400.0, MeasurementUnits.SECONDS, 1.0, MeasurementUnits.DAYS); - - validateScaleAndInverse(60.0, MeasurementUnits.MINUTES, 1.0, MeasurementUnits.HOURS); - validateScaleAndInverse(1440.0, MeasurementUnits.MINUTES, 1.0, MeasurementUnits.DAYS); - - validateScaleAndInverse(24.0, MeasurementUnits.HOURS, 1.0, MeasurementUnits.DAYS); - } - - private void validateScaleAndInverse(double fromValue, MeasurementUnits fromUnits, double toValue, - MeasurementUnits toUnits) { - validateScale(fromValue, fromUnits, toValue, toUnits); - validateScale(toValue, toUnits, fromValue, fromUnits); - } - - private void validateScale(double fromValue, MeasurementUnits fromUnits, double toValue, MeasurementUnits toUnits) { - MeasurementNumericValueAndUnits valueAndUnits = new MeasurementNumericValueAndUnits(fromValue, fromUnits); - try { - double derived = MeasurementConverterClient.scale(valueAndUnits, toUnits); - assert Math.abs(toValue - derived) < 1e-9 : "Scale conversion error: " + - - "From value '" + fromValue + "', " + "with units of '" + fromUnits.name() + "', " + "displayed as '" - + fromUnits + "', " + - - "To value '" + toValue + "', " + "with units of '" + toUnits.name() + "', " + "displayed as '" - + toUnits + "', " + - - "Received value '" + derived + "'"; - - } catch (MeasurementConversionException mce) { - assert false : "Unexpected MeasurementConversionException: " + - - "From value '" + fromValue + "', " + "with units of '" + fromUnits.name() + "', " + "displayed as '" - + fromUnits + "', " + - - "To value '" + toValue + "', " + "with units of '" + toUnits.name() + "', " + "displayed as '" - + toUnits; - } - } - - private void validateFormatConvert(double value, MeasurementUnits units) { - validateFormatConvert(value, value, units); - } - - private void validateFormatConvert(double passedValue, double expectedValue, MeasurementUnits units) { - try { - String intermediate = MeasurementConverterClient.format(passedValue, units, false); - MeasurementNumericValueAndUnits results = MeasurementParser.parse(intermediate, units); - - assert (Math.abs(results.getValue() - expectedValue) < 1e-9 && results.getUnits() == units) : "double input was '" - + passedValue - + "', " - + "units input was '" - + units.name() - + "', " - + - - "intermediate string was '" - + intermediate - + "', " - + - - "Expected value '" - + expectedValue - + "', " - + "with units of '" - + units.name() - + "', " - + "displayed as '" - + units - + "', " - + - - "Received value '" - + results.getValue() - + "', " - + "with units of '" - + results.getUnits().getName() - + "', " + "displayed as '" + results.getUnits() + "'"; - } catch (MeasurementConversionException mce) { - assert false : "Error during conversion: " + mce.getMessage(); - } - } - - private void validateConvert(double value, String intermediate, MeasurementUnits units) { - validateConvert(value, value, intermediate, units); - } - - private void validateConvert(double passedValue, double expectedValue, String intermediate, MeasurementUnits units) { - try { - MeasurementNumericValueAndUnits results = MeasurementParser.parse(intermediate, units); - - assert (Math.abs(results.getValue() - expectedValue) < 1e-9 && results.getUnits() == units) : "double input was '" - + passedValue - + "', " - + "units input was '" - + units.name() - + "', " - + - - "intermediate string was '" - + intermediate - + "', " - + - - "Expected value '" - + expectedValue - + "', " - + "with units of '" - + units.name() - + "', " - + "displayed as '" - + units - + "', " - + - - "Received value '" - + results.getValue() - + "', " - + "with units of '" - + results.getUnits().getName() - + "', " + "displayed as '" + results.getUnits() + "'"; - } catch (MeasurementConversionException mce) { - assert false : "Error during conversion: " + mce.getMessage(); - } - } - - private List<String> getWhitespaceVariationsAroundSingleTokens(String... tokens) { - List<String> variations = new ArrayList<String>(); - - for (String token : tokens) { - for (String white : WHITESPACE) { - variations.add(token); - //variations.add( token + white ); - //variations.add( white + token ); - //variations.add( white + token + white ); - - variations.add(token + white + white); - //variations.add( white + white + token ); - //variations.add( white + white + token + white + white ); - } - } - - return variations; - } - -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/core/domain/measurement/MeasurementConverterClient.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/core/domain/measurement/MeasurementConverterClient.java new file mode 100644 index 0000000..f78b62c --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/core/domain/measurement/MeasurementConverterClient.java @@ -0,0 +1,360 @@ + /* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * 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.domain.measurement; + + import org.rhq.core.domain.measurement.composite.MeasurementNumericValueAndUnits; + import org.rhq.core.domain.measurement.util.MeasurementConversionException; + + import com.google.gwt.i18n.client.NumberFormat; + + import java.util.HashSet; + import java.util.Set; + + public class MeasurementConverterClient { + private static final int MAX_PRECISION_DIGITS = 4; + private static final String NULL_OR_NAN_FORMATTED_VALUE = "--no data available--"; + + + private static NumberFormat getDefaultNumberFormat() { + NumberFormat nf = NumberFormat.getFormat("0.0"); + + return nf; + } + + public static Double scale(MeasurementNumericValueAndUnits origin, MeasurementUnits targetUnits) + throws MeasurementConversionException { + MeasurementUnits originUnits = origin.getUnits(); + Double originValue = origin.getValue(); + + return originValue * MeasurementUnits.calculateOffset(originUnits, targetUnits); + } + + public static Double scale(Double origin, MeasurementUnits targetUnits) throws MeasurementConversionException { + boolean wasNegative = false; + if (origin < 0) { + wasNegative = true; + origin = -origin; + } + + MeasurementUnits baseUnit = targetUnits.getBaseUnits(); + MeasurementNumericValueAndUnits valueAndUnits = new MeasurementNumericValueAndUnits(origin, baseUnit); + + Double results = scale(valueAndUnits, targetUnits); + if (wasNegative) { + results = -results; + } + + return results; + } + + public static String format(String value, MeasurementUnits targetUnits) { + if (targetUnits == null) { + return value; + } else { + return value + targetUnits; + } + } + + /** + * Formats the given array of double values: determines the necessary precision such that when formatted, they are + * distinct and reasonable to look at. For example, for values { 1.45 1.46 1.47 1.48 1.49 } the desired precision is + * 2 - less precision loses significant digits, and more precision provides no added benefit. Max precision is + * bounded for presentation considerations. + * + * @param values the values to be formatted + * @param targetUnits the target units for the values + * @param bestFit whether or not to use a normalized scale for the family of units + * + * @return the formatted values + */ + public static String[] formatToSignificantPrecision(double[] values, MeasurementUnits targetUnits, boolean bestFit) { + if ((null == values) || (values.length == 0)) { + return null; + } + + MeasurementUnits originalUnits = targetUnits; + + /* + * in the overwhelming majority of cases, you're going to want to apply a bestFit + * to the passed data, but it's not required; it's perfectly possible to allow a + * list of doubles to be formatted without being fit, in which case the targetUnits + * will be part of the formatted display for each result element + */ + if (bestFit) { + // find bestFit units by taking the average + Double average = 0.0; + + for (int i = 0, sz = values.length; i < sz; i++) { + /* + * adding fractional amount iterative leads to greater + * error, but prevents overflow on large data sets + */ + average += (values[i] / sz); + } + + MeasurementNumericValueAndUnits fittedAverage = fit(average, targetUnits); + //noinspection UnnecessaryLocalVariable + MeasurementUnits fittedUnits = fittedAverage.getUnits(); + + /* + * and change the local reference to targetUnits, so that the same logic + * can be used both for the bestFit and non-bestFit computations + */ + targetUnits = fittedUnits; + } + + @SuppressWarnings("unused") + Set<String> existingStrings; // technically this *is* unused because + int precisionDigits = 0; + boolean scaleWithMorePrecision = true; + String[] results = new String[values.length]; + NumberFormat nf = getDefaultNumberFormat(); + + /* + * we scale at most to MAX_PRECISION_DIGITS to allow for presentation limits + * + * increase the maxPrecisionDigits in the while condition + * itself to ensure it gets done for every loop + */ + while (scaleWithMorePrecision && (++precisionDigits <= MAX_PRECISION_DIGITS)) { + /* + * make the assumption that we no longer need to scale beyond this iteration + */ + scaleWithMorePrecision = false; + + /* + * we need to record the uniquely formatted values so we can determine + */ + existingStrings = new HashSet<String>(); + nf = NumberFormat.getFormat(getFormat(0, precisionDigits)); + + Double[] scaledValues = new Double[values.length]; + + for (int i = 0; i < scaledValues.length; i++) { + /* + * For relative units apply the scale now, prior to the nf.format(), since we are not using format( Double...). + * Otherwise, apply standard multi-unit scaling. + */ + if (MeasurementUnits.Family.RELATIVE == originalUnits.getFamily()) { + scaledValues[i] = MeasurementUnits.scaleUp(values[i], originalUnits); + } else { + scaledValues[i] = scale(new MeasurementNumericValueAndUnits(values[i], originalUnits), targetUnits); + } + } + + for (int i = 0; i < results.length; i++) { + /* + * JUST get the formatted value, specifically DON'T tack on the formatted units yet; + * we do this to see how many units we'll have to scale to afterwards (outside this + * while loop) to make the array of values passed to us unique + */ + String formatted = nf.format(scaledValues[i]); + + /* + * check whether formatted value was in the set or not; if it was, we have to + * loop, but only if we're not not already at our maximum precision + */ + boolean wasNewElement = existingStrings.add(formatted); + + if ((!wasNewElement) && (precisionDigits < MAX_PRECISION_DIGITS)) { + scaleWithMorePrecision = true; + break; + } + + results[i] = formatted; + } + } + + /* + * we did the best we could in terms of trying to find a precision that adds the most + * uniqueness to the given set of values, NOW tack on the formatted value for the units + */ + for (int i = 0; i < results.length; i++) { + results[i] = format(results[i], targetUnits); + } + + return results; + } + + public static String format(Double value, MeasurementUnits targetUnits, boolean bestFit) { + return format(value, targetUnits, bestFit, null, null); + } + + public static String format(Double value, MeasurementUnits targetUnits, boolean bestFit, + Integer minimumFractionDigits, Integer maximumFractionDigits) { + if (value == null || Double.isNaN(value)) { + return NULL_OR_NAN_FORMATTED_VALUE; + } + if (bestFit) { + MeasurementNumericValueAndUnits valueAndUnits = fit(value, targetUnits); + + value = valueAndUnits.getValue(); + targetUnits = valueAndUnits.getUnits(); + } + + // apply relative scale at presentation time + if (MeasurementUnits.Family.RELATIVE == targetUnits.getFamily()) { + value = MeasurementUnits.scaleUp(value, targetUnits); + } + + NumberFormat numberFormat = + NumberFormat.getFormat( + getFormat( + minimumFractionDigits != null ? minimumFractionDigits : 1, + maximumFractionDigits != null ? maximumFractionDigits : 1)); + + String formatted = numberFormat.format(value); + + return format(formatted, targetUnits); + } + + public static String scaleAndFormat(Double origin, MeasurementSchedule targetSchedule, boolean bestFit) + throws MeasurementConversionException { + MeasurementUnits targetUnits = targetSchedule.getDefinition().getUnits(); + + return scaleAndFormat(origin, targetUnits, bestFit, null, null); + } + + public static String scaleAndFormat(Double origin, MeasurementUnits targetUnits, boolean bestFit) + throws MeasurementConversionException { + + return scaleAndFormat(origin, targetUnits, bestFit, null, null); + } + + public static String scaleAndFormat(Double origin, MeasurementUnits targetUnits, boolean bestFit, + Integer minimumFractionDigits, Integer maximumFractionDigits) throws MeasurementConversionException { + + MeasurementUnits baseUnits = targetUnits.getBaseUnits(); + MeasurementNumericValueAndUnits valueAndUnits = new MeasurementNumericValueAndUnits(origin, baseUnits); + Double scaledMagnitude = scale(valueAndUnits, targetUnits); + + return format(scaledMagnitude, targetUnits, bestFit); + } + + public static MeasurementNumericValueAndUnits fit(Double origin, MeasurementUnits units) { + return fit(origin, units, null, null); + } + + public static MeasurementNumericValueAndUnits fit(Double origin, MeasurementUnits units, MeasurementUnits lowUnits, + MeasurementUnits highUnits) { + + // work-around for the various Chart descendants not properly setting their units field; + if (null == units) { + return new MeasurementNumericValueAndUnits(origin, units); + } + + // by definition, absolutely specified units don't scale to anything + if ((MeasurementUnits.Family.ABSOLUTE == units.getFamily()) + || (MeasurementUnits.Family.DURATION == units.getFamily())) { + return new MeasurementNumericValueAndUnits(origin, units); + } + + // by definition relative-valued units are self-scaled (converted at formatting) + if (MeasurementUnits.Family.RELATIVE == units.getFamily()) { + return new MeasurementNumericValueAndUnits(origin, units); + } + + if (MeasurementUnits.Family.TEMPERATURE == units.getFamily()) { + return new MeasurementNumericValueAndUnits(origin, units); + } + + // if the magnitude is zero, the best-fit also will spin around forever since it won't change + if (Math.abs(origin) < 1e-9) { + return new MeasurementNumericValueAndUnits(origin, units); + } + + boolean wasNegative = false; + + if (origin < 0) { + wasNegative = true; + origin = -origin; + } + + MeasurementNumericValueAndUnits currentValueAndUnits; + MeasurementNumericValueAndUnits nextValueAndUnits = new MeasurementNumericValueAndUnits(origin, units); + + // first, make the value smaller if it's too big + int maxOrdinal = (highUnits != null) ? (highUnits.ordinal() + 1) : MeasurementUnits.values().length; + + do { + currentValueAndUnits = nextValueAndUnits; + + int nextOrdinal = currentValueAndUnits.getUnits().ordinal() + 1; + if (nextOrdinal == maxOrdinal) { + // we could theoretically get bigger, but we don't have any units to represent that + break; + } + + MeasurementUnits biggerUnits = MeasurementUnits.values()[nextOrdinal]; + if (biggerUnits.getFamily() != currentValueAndUnits.getUnits().getFamily()) { + // we're as big as we can get, break out of the loop so we can return + break; + } + + Double smallerValue = scale(currentValueAndUnits, biggerUnits); + + nextValueAndUnits = new MeasurementNumericValueAndUnits(smallerValue, biggerUnits); + } while (nextValueAndUnits.getValue() > 1.0); + + // next, make the value bigger if it's too small + int minOrdinal = (lowUnits != null) ? (lowUnits.ordinal() - 1) : -1; + + while (currentValueAndUnits.getValue() < 1.0) { + int nextOrdinal = currentValueAndUnits.getUnits().ordinal() - 1; + if (nextOrdinal == minOrdinal) { + // we could theoretically get smaller, but we don't have any units to represent that + break; + } + + MeasurementUnits smallerUnits = MeasurementUnits.values()[nextOrdinal]; + if (smallerUnits.getFamily() != currentValueAndUnits.getUnits().getFamily()) { + // we're as small as we can get, break out of the loop so we can return + break; + } + + Double biggerValue = scale(currentValueAndUnits, smallerUnits); + + nextValueAndUnits = new MeasurementNumericValueAndUnits(biggerValue, smallerUnits); + + currentValueAndUnits = nextValueAndUnits; + } + + if (wasNegative) { + return new MeasurementNumericValueAndUnits(-currentValueAndUnits.getValue(), currentValueAndUnits + .getUnits()); + } + + return currentValueAndUnits; + } + + public static String getFormat(int minDigits, int maxDigits) { + StringBuilder buf = new StringBuilder("0."); + for (int i = 0; i < minDigits;i++) { + buf.append("0"); + } + for (int i = 0; i < (maxDigits-minDigits);i++) { + buf.append("#"); + } + return buf.toString(); + } +} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/core/server/MeasurementConverter.java b/modules/enterprise/server/jar/src/main/java/org/rhq/core/server/MeasurementConverter.java new file mode 100644 index 0000000..443964f --- /dev/null +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/core/server/MeasurementConverter.java @@ -0,0 +1,355 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * 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.server; + +import java.text.NumberFormat; +import java.util.HashSet; +import java.util.Set; + +import org.rhq.core.domain.measurement.MeasurementSchedule; +import org.rhq.core.domain.measurement.MeasurementUnits; +import org.rhq.core.domain.measurement.composite.MeasurementNumericValueAndUnits; +import org.rhq.core.domain.measurement.util.MeasurementConversionException; + +public class MeasurementConverter { + private static final int MAX_PRECISION_DIGITS = 4; + private static final String NULL_OR_NAN_FORMATTED_VALUE = "--no data available--"; + + + private static NumberFormat getDefaultNumberFormat() { + NumberFormat nf = NumberFormat.getNumberInstance(); + + nf.setMinimumFractionDigits(1); + nf.setMaximumFractionDigits(1); + + return nf; + } + + public static Double scale(MeasurementNumericValueAndUnits origin, MeasurementUnits targetUnits) + throws MeasurementConversionException { + MeasurementUnits originUnits = origin.getUnits(); + Double originValue = origin.getValue(); + + return originValue * MeasurementUnits.calculateOffset(originUnits, targetUnits); + } + + public static Double scale(Double origin, MeasurementUnits targetUnits) throws MeasurementConversionException { + boolean wasNegative = false; + if (origin < 0) { + wasNegative = true; + origin = -origin; + } + + MeasurementUnits baseUnit = targetUnits.getBaseUnits(); + MeasurementNumericValueAndUnits valueAndUnits = new MeasurementNumericValueAndUnits(origin, baseUnit); + + Double results = scale(valueAndUnits, targetUnits); + if (wasNegative) { + results = -results; + } + + return results; + } + + public static String format(String value, MeasurementUnits targetUnits) { + if (targetUnits == null) { + return value; + } else { + return value + targetUnits; + } + } + + /** + * Formats the given array of double values: determines the necessary precision such that when formatted, they are + * distinct and reasonable to look at. For example, for values { 1.45 1.46 1.47 1.48 1.49 } the desired precision is + * 2 - less precision loses significant digits, and more precision provides no added benefit. Max precision is + * bounded for presentation considerations. + * + * @param values the values to be formatted + * @param targetUnits the target units for the values + * @param bestFit whether or not to use a normalized scale for the family of units + * + * @return the formatted values + */ + public static String[] formatToSignificantPrecision(double[] values, MeasurementUnits targetUnits, boolean bestFit) { + if ((null == values) || (values.length == 0)) { + return null; + } + + MeasurementUnits originalUnits = targetUnits; + + /* + * in the overwhelming majority of cases, you're going to want to apply a bestFit + * to the passed data, but it's not required; it's perfectly possible to allow a + * list of doubles to be formatted without being fit, in which case the targetUnits + * will be part of the formatted display for each result element + */ + if (bestFit) { + // find bestFit units by taking the average + Double average = 0.0; + + for (int i = 0, sz = values.length; i < sz; i++) { + /* + * adding fractional amount iterative leads to greater + * error, but prevents overflow on large data sets + */ + average += (values[i] / sz); + } + + MeasurementNumericValueAndUnits fittedAverage = fit(average, targetUnits); + //noinspection UnnecessaryLocalVariable + MeasurementUnits fittedUnits = fittedAverage.getUnits(); + + /* + * and change the local reference to targetUnits, so that the same logic + * can be used both for the bestFit and non-bestFit computations + */ + targetUnits = fittedUnits; + } + + @SuppressWarnings("unused") + Set<String> existingStrings; // technically this *is* unused because + int precisionDigits = 0; + boolean scaleWithMorePrecision = true; + String[] results = new String[values.length]; + NumberFormat nf = getDefaultNumberFormat(); + + /* + * we scale at most to MAX_PRECISION_DIGITS to allow for presentation limits + * + * increase the maxPrecisionDigits in the while condition + * itself to ensure it gets done for every loop + */ + while (scaleWithMorePrecision && (++precisionDigits <= MAX_PRECISION_DIGITS)) { + /* + * make the assumption that we no longer need to scale beyond this iteration + */ + scaleWithMorePrecision = false; + + /* + * we need to record the uniquely formatted values so we can determine + */ + existingStrings = new HashSet<String>(); + nf.setMinimumFractionDigits(0); + nf.setMaximumFractionDigits(precisionDigits); + + Double[] scaledValues = new Double[values.length]; + + for (int i = 0; i < scaledValues.length; i++) { + /* + * For relative units apply the scale now, prior to the nf.format(), since we are not using format( Double...). + * Otherwise, apply standard multi-unit scaling. + */ + if (MeasurementUnits.Family.RELATIVE == originalUnits.getFamily()) { + scaledValues[i] = MeasurementUnits.scaleUp(values[i], originalUnits); + } else { + scaledValues[i] = scale(new MeasurementNumericValueAndUnits(values[i], originalUnits), targetUnits); + } + } + + for (int i = 0; i < results.length; i++) { + /* + * JUST get the formatted value, specifically DON'T tack on the formatted units yet; + * we do this to see how many units we'll have to scale to afterwards (outside this + * while loop) to make the array of values passed to us unique + */ + String formatted = nf.format(scaledValues[i]); + + /* + * check whether formatted value was in the set or not; if it was, we have to + * loop, but only if we're not not already at our maximum precision + */ + boolean wasNewElement = existingStrings.add(formatted); + + if ((!wasNewElement) && (precisionDigits < MAX_PRECISION_DIGITS)) { + scaleWithMorePrecision = true; + break; + } + + results[i] = formatted; + } + } + + /* + * we did the best we could in terms of trying to find a precision that adds the most + * uniqueness to the given set of values, NOW tack on the formatted value for the units + */ + for (int i = 0; i < results.length; i++) { + results[i] = format(results[i], targetUnits); + } + + return results; + } + + public static String format(Double value, MeasurementUnits targetUnits, boolean bestFit) { + return format(value, targetUnits, bestFit, null, null); + } + + public static String format(Double value, MeasurementUnits targetUnits, boolean bestFit, + Integer minimumFractionDigits, Integer maximumFractionDigits) { + if (value == null || Double.isNaN(value)) { + return NULL_OR_NAN_FORMATTED_VALUE; + } + if (bestFit) { + MeasurementNumericValueAndUnits valueAndUnits = fit(value, targetUnits); + + value = valueAndUnits.getValue(); + targetUnits = valueAndUnits.getUnits(); + } + + // apply relative scale at presentation time + if (MeasurementUnits.Family.RELATIVE == targetUnits.getFamily()) { + value = MeasurementUnits.scaleUp(value, targetUnits); + } + + NumberFormat numberFormat = getDefaultNumberFormat(); + if (null != minimumFractionDigits) { + numberFormat.setMinimumFractionDigits(minimumFractionDigits); + } + if (null != maximumFractionDigits) { + numberFormat.setMaximumFractionDigits(maximumFractionDigits); + } + String formatted = numberFormat.format(value); + + return format(formatted, targetUnits); + } + + public static String scaleAndFormat(Double origin, MeasurementSchedule targetSchedule, boolean bestFit) + throws MeasurementConversionException { + MeasurementUnits targetUnits = targetSchedule.getDefinition().getUnits(); + + return scaleAndFormat(origin, targetUnits, bestFit, null, null); + } + + public static String scaleAndFormat(Double origin, MeasurementUnits targetUnits, boolean bestFit) + throws MeasurementConversionException { + + return scaleAndFormat(origin, targetUnits, bestFit, null, null); + } + + public static String scaleAndFormat(Double origin, MeasurementUnits targetUnits, boolean bestFit, + Integer minimumFractionDigits, Integer maximumFractionDigits) throws MeasurementConversionException { + + MeasurementUnits baseUnits = targetUnits.getBaseUnits(); + MeasurementNumericValueAndUnits valueAndUnits = new MeasurementNumericValueAndUnits(origin, baseUnits); + Double scaledMagnitude = scale(valueAndUnits, targetUnits); + + return format(scaledMagnitude, targetUnits, bestFit); + } + + public static MeasurementNumericValueAndUnits fit(Double origin, MeasurementUnits units) { + return fit(origin, units, null, null); + } + + public static MeasurementNumericValueAndUnits fit(Double origin, MeasurementUnits units, MeasurementUnits lowUnits, + MeasurementUnits highUnits) { + + // work-around for the various Chart descendants not properly setting their units field; + if (null == units) { + return new MeasurementNumericValueAndUnits(origin, units); + } + + // by definition, absolutely specified units don't scale to anything + if ((MeasurementUnits.Family.ABSOLUTE == units.getFamily()) + || (MeasurementUnits.Family.DURATION == units.getFamily())) { + return new MeasurementNumericValueAndUnits(origin, units); + } + + // by definition relative-valued units are self-scaled (converted at formatting) + if (MeasurementUnits.Family.RELATIVE == units.getFamily()) { + return new MeasurementNumericValueAndUnits(origin, units); + } + + if (MeasurementUnits.Family.TEMPERATURE == units.getFamily()) { + return new MeasurementNumericValueAndUnits(origin, units); + } + + // if the magnitude is zero, the best-fit also will spin around forever since it won't change + if (Math.abs(origin) < 1e-9) { + return new MeasurementNumericValueAndUnits(origin, units); + } + + boolean wasNegative = false; + + if (origin < 0) { + wasNegative = true; + origin = -origin; + } + + MeasurementNumericValueAndUnits currentValueAndUnits; + MeasurementNumericValueAndUnits nextValueAndUnits = new MeasurementNumericValueAndUnits(origin, units); + + // first, make the value smaller if it's too big + int maxOrdinal = (highUnits != null) ? (highUnits.ordinal() + 1) : MeasurementUnits.values().length; + + do { + currentValueAndUnits = nextValueAndUnits; + + int nextOrdinal = currentValueAndUnits.getUnits().ordinal() + 1; + if (nextOrdinal == maxOrdinal) { + // we could theoretically get bigger, but we don't have any units to represent that + break; + } + + MeasurementUnits biggerUnits = MeasurementUnits.values()[nextOrdinal]; + if (biggerUnits.getFamily() != currentValueAndUnits.getUnits().getFamily()) { + // we're as big as we can get, break out of the loop so we can return + break; + } + + Double smallerValue = scale(currentValueAndUnits, biggerUnits); + + nextValueAndUnits = new MeasurementNumericValueAndUnits(smallerValue, biggerUnits); + } while (nextValueAndUnits.getValue() > 1.0); + + // next, make the value bigger if it's too small + int minOrdinal = (lowUnits != null) ? (lowUnits.ordinal() - 1) : -1; + + while (currentValueAndUnits.getValue() < 1.0) { + int nextOrdinal = currentValueAndUnits.getUnits().ordinal() - 1; + if (nextOrdinal == minOrdinal) { + // we could theoretically get smaller, but we don't have any units to represent that + break; + } + + MeasurementUnits smallerUnits = MeasurementUnits.values()[nextOrdinal]; + if (smallerUnits.getFamily() != currentValueAndUnits.getUnits().getFamily()) { + // we're as small as we can get, break out of the loop so we can return + break; + } + + Double biggerValue = scale(currentValueAndUnits, smallerUnits); + + nextValueAndUnits = new MeasurementNumericValueAndUnits(biggerValue, smallerUnits); + + currentValueAndUnits = nextValueAndUnits; + } + + if (wasNegative) { + return new MeasurementNumericValueAndUnits(-currentValueAndUnits.getValue(), currentValueAndUnits + .getUnits()); + } + + return currentValueAndUnits; + } +} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/core/server/MeasurementParser.java b/modules/enterprise/server/jar/src/main/java/org/rhq/core/server/MeasurementParser.java new file mode 100644 index 0000000..42cd8f3 --- /dev/null +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/core/server/MeasurementParser.java @@ -0,0 +1,104 @@ +/* + * 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.core.server; + +import org.rhq.core.domain.measurement.MeasurementSchedule; +import org.rhq.core.domain.measurement.MeasurementUnits; +import org.rhq.core.domain.measurement.composite.MeasurementNumericValueAndUnits; +import org.rhq.core.domain.measurement.util.MeasurementConversionException; + +import java.text.DecimalFormat; +import java.text.ParseException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * @author Greg Hinkle + */ +public class MeasurementParser { + + private static final String NUMBER_OPTIONAL_UNIT_PATTERN_STRING = "([\+\-]?" + // number sign is optional but valid + "[0-9\.\,]{1,})" + // followed by at least one magnitude identifier, capture number plus sign + "([\%a-z]*)"; // followed by an optional units identifier, capture entire suffix + private static final Pattern NUMBER_OPTIONAL_UNIT_PATTERN; + static { + NUMBER_OPTIONAL_UNIT_PATTERN = Pattern.compile(NUMBER_OPTIONAL_UNIT_PATTERN_STRING, Pattern.CASE_INSENSITIVE); + } + + public static MeasurementNumericValueAndUnits parse(String input, MeasurementUnits targetUnits) + throws MeasurementConversionException { + input = input.replaceAll("\s", ""); // our pattern assumes no whitespace + Matcher matcher = NUMBER_OPTIONAL_UNIT_PATTERN.matcher(input); + + if (!matcher.matches()) { + throw new MeasurementConversionException("The passed input '" + input + "' could not be parsed correctly " + + "by the regular expression " + NUMBER_OPTIONAL_UNIT_PATTERN_STRING); + } + + String magnitude = matcher.group(1); + String units = matcher.group(2); + + MeasurementUnits fromUnits; + if (units.equals("")) { + /* + * no units is valid, and we assume the passed targetUnits; however, we will + * still need to check that the number is well-formed, so continue processing. + */ + fromUnits = targetUnits; + } else { + fromUnits = MeasurementUnits.getUsingDisplayUnits(units, targetUnits.getFamily()); + + if ((fromUnits == null) || (!fromUnits.isComparableTo(targetUnits))) { + throw new MeasurementConversionException("The units in '" + input + "' were not valid, " + "expected '" + + targetUnits.getFamily() + "' units, received '" + units + "' units"); + } + } + + try { + if (magnitude.startsWith("+")) { + magnitude = magnitude.substring(1); + } + + Number convertedMagnitude = DecimalFormat.getInstance().parse(magnitude); + Double scaledMagnitude; + + // apply relative scale if applicable, otherwise perform standard scaling + if (MeasurementUnits.Family.RELATIVE == targetUnits.getFamily()) { + scaledMagnitude = MeasurementUnits.scaleDown(convertedMagnitude.doubleValue(), targetUnits); + } else { + MeasurementNumericValueAndUnits valueAndUnits = new MeasurementNumericValueAndUnits(convertedMagnitude + .doubleValue(), fromUnits); + scaledMagnitude = MeasurementConverter.scale(valueAndUnits, targetUnits); + } + + return new MeasurementNumericValueAndUnits(scaledMagnitude, targetUnits); + } catch (ParseException pe) { + throw new MeasurementConversionException("The magnitude in '" + input + "' did not parse correctly " + + "as a valid, localized, stringified number "); + } + + } + + public static MeasurementNumericValueAndUnits parse(String input, MeasurementSchedule targetSchedule) + throws MeasurementConversionException { + MeasurementUnits targetUnits = targetSchedule.getDefinition().getUnits(); + + return parse(input, targetUnits); + } +} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementOOBManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementOOBManagerBean.java index c7e4ce4..0d68094 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementOOBManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementOOBManagerBean.java @@ -54,6 +54,7 @@ import org.rhq.core.domain.measurement.composite.MeasurementOOBComposite; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; import org.rhq.core.domain.util.PageOrdering; +import org.rhq.core.server.MeasurementConverter; import org.rhq.core.server.PersistenceUtility; import org.rhq.core.util.jdbc.JDBCUtil; import org.rhq.enterprise.server.RHQConstants; @@ -318,6 +319,8 @@ public class MeasurementOOBManagerBean implements MeasurementOOBManagerLocal {
}
+ applyFormatting(results); + return new PageList<MeasurementOOBComposite>(results, (int) totalCount, pc); }
@@ -370,10 +373,25 @@ public class MeasurementOOBManagerBean implements MeasurementOOBManagerLocal { long totalCount = (Long) countQuery.getSingleResult(); PageList<MeasurementOOBComposite> result = new PageList<MeasurementOOBComposite>(results, (int) totalCount, pc);
+ applyFormatting(result); + return result;
}
+ private void applyFormatting(List<MeasurementOOBComposite> composites) { + for (MeasurementOOBComposite oob : composites) { + oob.setFormattedOutlier(MeasurementConverter.format(oob.getOutlier(), oob.getUnits(), true)); + formatBaseband(oob); + } + } + + private void formatBaseband(MeasurementOOBComposite oob) { + String min = MeasurementConverter.format(oob.getBlMin(), oob.getUnits(), true); + String max = MeasurementConverter.format(oob.getBlMax(), oob.getUnits(), true); + oob.setFormattedBaseband(min + ", " + max); + } + /** * Return the 1h numeric data for the passed primary keys (schedule, timestamp) * @param pks Primary keys to look up diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/core/domain/util/units/test/MeasurementConverterTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/core/domain/util/units/test/MeasurementConverterTest.java new file mode 100644 index 0000000..0688c79 --- /dev/null +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/core/domain/util/units/test/MeasurementConverterTest.java @@ -0,0 +1,390 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * 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.domain.util.units.test; + +import java.text.DecimalFormat; +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; + +import org.testng.annotations.Test; + +import org.rhq.core.domain.measurement.MeasurementConverterClient; +import org.rhq.core.domain.measurement.MeasurementUnits; +import org.rhq.core.domain.measurement.composite.MeasurementNumericValueAndUnits; +import org.rhq.core.domain.measurement.util.MeasurementConversionException; +import org.rhq.core.domain.test.AbstractEJB3Test; +import org.rhq.core.server.MeasurementParser; + +// TODO two tests in here need to be re-enables once the GWT client issues are resolved +@Test +public class MeasurementConverterTest extends AbstractEJB3Test { + private final double POSITIVE = 300; + private final double NEGATIVE = -42; + + private final String[] WHITESPACE = new String[] { " ", "\f", "\n", "\r", "\t" }; + + private ThreadLocal<Integer> precisionScalingTestCount = null; + + private void incrementPrecisionScalingTestCount() { + if (precisionScalingTestCount == null) { + precisionScalingTestCount = new ThreadLocal<Integer>() { + @Override + protected Integer initialValue() { + return 0; + } + }; + } + precisionScalingTestCount.set(precisionScalingTestCount.get() + 1); + } + + @Test(groups = "integration.ejb3", enabled = false) + // TODO fix me + public void testPrecisionScaling() throws Exception { + + // if all values are equal, it will format to the max precision + + testPrecisionScaling(new double[] { 1.41, 1.41, 1.41, 1.41, 1.41 }, MeasurementUnits.NONE, new String[] { + "1.41", "1.41", "1.41", "1.41", "1.41" }, MeasurementUnits.NONE); + + // if all values are unique, it won't need to format any of them to more digits + testPrecisionScaling(new double[] { 1.41, 1.42, 1.43, 1.44, 1.45 }, MeasurementUnits.NONE, new String[] { + "1.41", "1.42", "1.43", "1.44", "1.45" }, MeasurementUnits.NONE); + + // even if only two are equal, it will scale all the way to max precision looking for uniqueness + testPrecisionScaling(new double[] { 1.4, 1.4, 1.5, 1.6, 1.7 }, MeasurementUnits.NONE, new String[] { "1.4", + "1.4", "1.5", "1.6", "1.7" }, MeasurementUnits.NONE); + + // to final a "good looking" target scaling units, it will use the mathematical mean + // NOTE: formatting doesn't round up/down, thus introducing error from cutting digits (256 -> 0.2KB [instead of 0.25KB]) + testPrecisionScaling(new double[] { 128, 256, 512, 1024, 8192 }, MeasurementUnits.BYTES, new String[] { + "0.1KB", "0.2KB", "0.5KB", "1KB", "8KB" }, MeasurementUnits.KILOBYTES); + + // same test with negative numbers + testPrecisionScaling(new double[] { -128, -256, -512, -1024, -8192 }, MeasurementUnits.BYTES, new String[] { + "-0.1KB", "-0.2KB", "-0.5KB", "-1KB", "-8KB" }, MeasurementUnits.KILOBYTES); + + // test self scaling relative units + testPrecisionScaling(new double[] { 0.0, 0.065, 1.0, 0.123456 }, MeasurementUnits.PERCENTAGE, new String[] { + "0%", "6.5%", "100%", "12.3%" }, MeasurementUnits.PERCENTAGE); + + // test self scaling relative units + testPrecisionScaling(new double[] { 0.0621, 0.065, 0.0620, 0.6202 }, MeasurementUnits.PERCENTAGE, new String[] { + "6.21%", "6.5%", "6.2%", "62.02%" }, MeasurementUnits.PERCENTAGE); + } + + private void testPrecisionScaling(double[] values, MeasurementUnits units, String[] expectedResults, + MeasurementUnits expectedUnits) { + incrementPrecisionScalingTestCount(); + + String[] results = MeasurementConverterClient.formatToSignificantPrecision(values, units, true); + for (int i = 0; i < results.length; i++) { + String expected = expectedResults[i]; + String actual = results[i]; + + // The expected output is in Locale.US. Handle running the tests in a different default locale + if (expected.contains(".") && (!Locale.getDefault().equals(Locale.US))) { + Locale defaultLocale = Locale.getDefault(); + Locale.setDefault(Locale.US); + MeasurementNumericValueAndUnits vu = MeasurementParser.parse(expected, expectedUnits); + Locale.setDefault(defaultLocale); + expected = MeasurementConverterClient.format(vu.getValue(), expectedUnits, false, null, 4); + } + + assert actual.equals(expected) : "Test " + precisionScalingTestCount.get() + ": " + "Index " + i + ", " + + "Expected " + expected + ", " + "Received " + actual + ", " + "Units " + units.getName(); + } + } + + @Test(groups = "integration.ejb3", enabled = false) + // TODO fix me + public void testConversionSuccess() throws Exception { + // test the straight-forward, non-whitespace cases + for (MeasurementUnits units : MeasurementUnits.values()) { + validateFormatConvert(POSITIVE, units); + validateFormatConvert(NEGATIVE, units); + } + + List<String> signVariations; + List<String> magnitudeVariations; + List<String> unitsVariations; + + // use the same NumberFormat that the MeasurementConverter uses, so that we get the correct expected results + NumberFormat nf = DecimalFormat.getNumberInstance(); + nf.setMinimumFractionDigits(1); + nf.setMaximumFractionDigits(1); + + // test a couple hundred thousand variations of whitespace around each positive number with units + signVariations = getWhitespaceVariationsAroundSingleTokens("", "+"); + magnitudeVariations = getWhitespaceVariationsAroundSingleTokens(nf.format(POSITIVE)); + for (MeasurementUnits units : MeasurementUnits.values()) { + unitsVariations = getWhitespaceVariationsAroundSingleTokens(units.toString()); + + // splice all combinations together and test conversion validity + for (String signVariation : signVariations) { + for (String magnitudeVariation : magnitudeVariations) { + if (MeasurementUnits.Family.RELATIVE == units.getFamily()) { + magnitudeVariation = nf.format(MeasurementUnits.scaleUp(nf.parse(magnitudeVariation.trim()) + .doubleValue(), units)); + } + + for (String unitVariation : unitsVariations) { + String original = MeasurementConverterClient.format(POSITIVE, units, false); + String toBeTested = magnitudeVariation.trim() + unitVariation.trim(); + + assert original.equals(toBeTested) : "Error constructing whitespace string: " + "Expected '" + + original + "', " + "Received '" + toBeTested + "' " + "for units '" + units.name() + "'"; + + validateConvert(POSITIVE, signVariation + magnitudeVariation + unitVariation, units); + } + } + } + } + + // test a couple hundred thousand variations of whitespace around each negative number with units + signVariations = getWhitespaceVariationsAroundSingleTokens("-"); + for (MeasurementUnits units : MeasurementUnits.values()) { + unitsVariations = getWhitespaceVariationsAroundSingleTokens(units.toString()); + + for (String signVariation : signVariations) { + for (String magnitudeVariation : magnitudeVariations) { + if (units == MeasurementUnits.PERCENTAGE) { + magnitudeVariation = nf.format(100 * nf.parse(magnitudeVariation.trim()).doubleValue()); + } + + for (String unitVariation : unitsVariations) { + String original = MeasurementConverterClient.format(-POSITIVE, units, false); + String toBeTested = "-" + magnitudeVariation.trim() + unitVariation.trim(); + + assert original.equals(toBeTested) : "Error constructing whitespace string: " + "Expected '" + + original + "', " + "Received '" + toBeTested + "' " + "for units '" + units.name() + "'"; + + validateConvert(-POSITIVE, signVariation + magnitudeVariation + unitVariation, units); + } + } + } + } + } + + @Test(groups = "integration.ejb3") + public void testScalingSuccess() throws Exception { + // Family.BYTES + validateScaleAndInverse(1024.0, MeasurementUnits.BYTES, 1.0, MeasurementUnits.KILOBYTES); + validateScaleAndInverse(1048576.0, MeasurementUnits.BYTES, 1.0, MeasurementUnits.MEGABYTES); + validateScaleAndInverse(1073741824.0, MeasurementUnits.BYTES, 1.0, MeasurementUnits.GIGABYTES); + validateScaleAndInverse(1099511627776.0, MeasurementUnits.BYTES, 1.0, MeasurementUnits.TERABYTES); + validateScaleAndInverse(1125899906842624.0, MeasurementUnits.BYTES, 1.0, MeasurementUnits.PETABYTES); + + validateScaleAndInverse(1024.0, MeasurementUnits.KILOBYTES, 1.0, MeasurementUnits.MEGABYTES); + validateScaleAndInverse(1048576.0, MeasurementUnits.KILOBYTES, 1.0, MeasurementUnits.GIGABYTES); + validateScaleAndInverse(1073741824.0, MeasurementUnits.KILOBYTES, 1.0, MeasurementUnits.TERABYTES); + validateScaleAndInverse(1099511627776.0, MeasurementUnits.KILOBYTES, 1.0, MeasurementUnits.PETABYTES); + + validateScaleAndInverse(1024.0, MeasurementUnits.MEGABYTES, 1.0, MeasurementUnits.GIGABYTES); + validateScaleAndInverse(1048576.0, MeasurementUnits.MEGABYTES, 1.0, MeasurementUnits.TERABYTES); + validateScaleAndInverse(1073741824.0, MeasurementUnits.MEGABYTES, 1.0, MeasurementUnits.PETABYTES); + + validateScaleAndInverse(1024.0, MeasurementUnits.GIGABYTES, 1.0, MeasurementUnits.TERABYTES); + validateScaleAndInverse(1048576.0, MeasurementUnits.GIGABYTES, 1.0, MeasurementUnits.PETABYTES); + + validateScaleAndInverse(1024.0, MeasurementUnits.TERABYTES, 1.0, MeasurementUnits.PETABYTES); + + // Family.BITS + validateScaleAndInverse(1024.0, MeasurementUnits.BITS, 1.0, MeasurementUnits.KILOBITS); + validateScaleAndInverse(1048576.0, MeasurementUnits.BITS, 1.0, MeasurementUnits.MEGABITS); + validateScaleAndInverse(1073741824.0, MeasurementUnits.BITS, 1.0, MeasurementUnits.GIGABITS); + validateScaleAndInverse(1099511627776.0, MeasurementUnits.BITS, 1.0, MeasurementUnits.TERABITS); + validateScaleAndInverse(1125899906842624.0, MeasurementUnits.BITS, 1.0, MeasurementUnits.PETABITS); + + validateScaleAndInverse(1024.0, MeasurementUnits.KILOBITS, 1.0, MeasurementUnits.MEGABITS); + validateScaleAndInverse(1048576.0, MeasurementUnits.KILOBITS, 1.0, MeasurementUnits.GIGABITS); + validateScaleAndInverse(1073741824.0, MeasurementUnits.KILOBITS, 1.0, MeasurementUnits.TERABITS); + validateScaleAndInverse(1099511627776.0, MeasurementUnits.KILOBITS, 1.0, MeasurementUnits.PETABITS); + + validateScaleAndInverse(1024.0, MeasurementUnits.MEGABITS, 1.0, MeasurementUnits.GIGABITS); + validateScaleAndInverse(1048576.0, MeasurementUnits.MEGABITS, 1.0, MeasurementUnits.TERABITS); + validateScaleAndInverse(1073741824.0, MeasurementUnits.MEGABITS, 1.0, MeasurementUnits.PETABITS); + + validateScaleAndInverse(1024.0, MeasurementUnits.GIGABITS, 1.0, MeasurementUnits.TERABITS); + validateScaleAndInverse(1048576.0, MeasurementUnits.GIGABITS, 1.0, MeasurementUnits.PETABITS); + + validateScaleAndInverse(1024.0, MeasurementUnits.TERABITS, 1.0, MeasurementUnits.PETABITS); + + // Family.DURATION + validateScaleAndInverse(1000.0, MeasurementUnits.EPOCH_MILLISECONDS, 1.0, MeasurementUnits.EPOCH_SECONDS); + + // Family.TIME + validateScaleAndInverse(1000.0, MeasurementUnits.MILLISECONDS, 1.0, MeasurementUnits.SECONDS); + validateScaleAndInverse(60000.0, MeasurementUnits.MILLISECONDS, 1.0, MeasurementUnits.MINUTES); + validateScaleAndInverse(3600000.0, MeasurementUnits.MILLISECONDS, 1.0, MeasurementUnits.HOURS); + validateScaleAndInverse(86400000.0, MeasurementUnits.MILLISECONDS, 1.0, MeasurementUnits.DAYS); + + validateScaleAndInverse(60.0, MeasurementUnits.SECONDS, 1.0, MeasurementUnits.MINUTES); + validateScaleAndInverse(3600.0, MeasurementUnits.SECONDS, 1.0, MeasurementUnits.HOURS); + validateScaleAndInverse(86400.0, MeasurementUnits.SECONDS, 1.0, MeasurementUnits.DAYS); + + validateScaleAndInverse(60.0, MeasurementUnits.MINUTES, 1.0, MeasurementUnits.HOURS); + validateScaleAndInverse(1440.0, MeasurementUnits.MINUTES, 1.0, MeasurementUnits.DAYS); + + validateScaleAndInverse(24.0, MeasurementUnits.HOURS, 1.0, MeasurementUnits.DAYS); + } + + private void validateScaleAndInverse(double fromValue, MeasurementUnits fromUnits, double toValue, + MeasurementUnits toUnits) { + validateScale(fromValue, fromUnits, toValue, toUnits); + validateScale(toValue, toUnits, fromValue, fromUnits); + } + + private void validateScale(double fromValue, MeasurementUnits fromUnits, double toValue, MeasurementUnits toUnits) { + MeasurementNumericValueAndUnits valueAndUnits = new MeasurementNumericValueAndUnits(fromValue, fromUnits); + try { + double derived = MeasurementConverterClient.scale(valueAndUnits, toUnits); + assert Math.abs(toValue - derived) < 1e-9 : "Scale conversion error: " + + + "From value '" + fromValue + "', " + "with units of '" + fromUnits.name() + "', " + "displayed as '" + + fromUnits + "', " + + + "To value '" + toValue + "', " + "with units of '" + toUnits.name() + "', " + "displayed as '" + + toUnits + "', " + + + "Received value '" + derived + "'"; + + } catch (MeasurementConversionException mce) { + assert false : "Unexpected MeasurementConversionException: " + + + "From value '" + fromValue + "', " + "with units of '" + fromUnits.name() + "', " + "displayed as '" + + fromUnits + "', " + + + "To value '" + toValue + "', " + "with units of '" + toUnits.name() + "', " + "displayed as '" + + toUnits; + } + } + + private void validateFormatConvert(double value, MeasurementUnits units) { + validateFormatConvert(value, value, units); + } + + private void validateFormatConvert(double passedValue, double expectedValue, MeasurementUnits units) { + try { + String intermediate = MeasurementConverterClient.format(passedValue, units, false); + MeasurementNumericValueAndUnits results = MeasurementParser.parse(intermediate, units); + + assert (Math.abs(results.getValue() - expectedValue) < 1e-9 && results.getUnits() == units) : "double input was '" + + passedValue + + "', " + + "units input was '" + + units.name() + + "', " + + + + "intermediate string was '" + + intermediate + + "', " + + + + "Expected value '" + + expectedValue + + "', " + + "with units of '" + + units.name() + + "', " + + "displayed as '" + + units + + "', " + + + + "Received value '" + + results.getValue() + + "', " + + "with units of '" + + results.getUnits().getName() + + "', " + "displayed as '" + results.getUnits() + "'"; + } catch (MeasurementConversionException mce) { + assert false : "Error during conversion: " + mce.getMessage(); + } + } + + private void validateConvert(double value, String intermediate, MeasurementUnits units) { + validateConvert(value, value, intermediate, units); + } + + private void validateConvert(double passedValue, double expectedValue, String intermediate, MeasurementUnits units) { + try { + MeasurementNumericValueAndUnits results = MeasurementParser.parse(intermediate, units); + + assert (Math.abs(results.getValue() - expectedValue) < 1e-9 && results.getUnits() == units) : "double input was '" + + passedValue + + "', " + + "units input was '" + + units.name() + + "', " + + + + "intermediate string was '" + + intermediate + + "', " + + + + "Expected value '" + + expectedValue + + "', " + + "with units of '" + + units.name() + + "', " + + "displayed as '" + + units + + "', " + + + + "Received value '" + + results.getValue() + + "', " + + "with units of '" + + results.getUnits().getName() + + "', " + "displayed as '" + results.getUnits() + "'"; + } catch (MeasurementConversionException mce) { + assert false : "Error during conversion: " + mce.getMessage(); + } + } + + private List<String> getWhitespaceVariationsAroundSingleTokens(String... tokens) { + List<String> variations = new ArrayList<String>(); + + for (String token : tokens) { + for (String white : WHITESPACE) { + variations.add(token); + //variations.add( token + white ); + //variations.add( white + token ); + //variations.add( white + token + white ); + + variations.add(token + white + white); + //variations.add( white + white + token ); + //variations.add( white + white + token + white + white ); + } + } + + return variations; + } + +}
commit 276df89bafc0dbf4860275bdb90cf33882024cd5 Author: Greg Hinkle ghinkle@redhat.com Date: Mon May 24 13:29:22 2010 -0400
Improved tag editing and Table component
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java index 60e0aab..27f8b0b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java @@ -99,8 +99,9 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView {
LinkItem bundleName = new LinkItem("bundle"); bundleName.setTitle("Bundle"); - bundleName.setTarget("#Bundles/Bundle/" + bundle.getId()); + bundleName.setValue("#Bundles/Bundle/" + bundle.getId()); bundleName.setLinkTitle(bundle.getName()); + bundleName.setTarget("_self");
CanvasItem tagItem = new CanvasItem("tag"); tagItem.setShowTitle(false); @@ -119,6 +120,7 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { }); } }); + tagEditor.setVertical(true); tagItem.setCanvas(tagEditor); tagItem.setRowSpan(4);
@@ -126,8 +128,11 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { deployed.setValue(new Date(deployment.getCtime()));
LinkItem destinationGroup = new LinkItem("group"); - destinationGroup.setTarget("#ResourceGroup/" + deployment.getDestination().getGroup().getId()); + destinationGroup.setTitle("Group"); + destinationGroup.setValue("#ResourceGroup/" + deployment.getDestination().getGroup().getId()); destinationGroup.setLinkTitle(deployment.getDestination().getGroup().getName()); + destinationGroup.setTarget("_self"); +
StaticTextItem path = new StaticTextItem("path", "Path"); path.setValue(deployment.getDestination().getDeployDir()); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java index 48d9b47..80af8fe 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java @@ -95,6 +95,7 @@ public class BundleDestinationView extends VLayout implements BookmarkableView { bundleName.setTitle("Bundle"); bundleName.setValue("#Bundles/Bundle/" + bundle.getId()); bundleName.setLinkTitle(bundle.getName()); + bundleName.setTarget("_self");
CanvasItem tagItem = new CanvasItem("tag"); tagItem.setShowTitle(false); @@ -113,6 +114,7 @@ public class BundleDestinationView extends VLayout implements BookmarkableView { }); } }); + tagEditor.setVertical(true); tagItem.setCanvas(tagEditor); tagItem.setRowSpan(4);
@@ -123,6 +125,7 @@ public class BundleDestinationView extends VLayout implements BookmarkableView { destinationGroup.setTitle("Group"); destinationGroup.setValue("#ResourceGroup/" + destination.getGroup().getId()); destinationGroup.setLinkTitle(destination.getGroup().getName()); + destinationGroup.setTarget("_self");
StaticTextItem path = new StaticTextItem("path", "Path"); path.setValue(destination.getDeployDir()); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java index d6ebef8..176305b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java @@ -43,11 +43,10 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity; /** * @author Greg Hinkle */ -public class BundlesListView extends VLayout { - - private Table table; +public class BundlesListView extends Table {
public BundlesListView() { + super("Bundles"); setWidth100(); setHeight100(); } @@ -56,35 +55,33 @@ public class BundlesListView extends VLayout { protected void onInit() { super.onInit();
- table = new Table("Bundles"); - - table.setDataSource(new BundlesWithLatestVersionDataSource()); + setDataSource(new BundlesWithLatestVersionDataSource());
- table.getListGrid().getField("id").setWidth("60"); - table.getListGrid().getField("name").setWidth("25%"); - table.getListGrid().getField("name").setCellFormatter(new CellFormatter() { + getListGrid().getField("id").setWidth("60"); + getListGrid().getField("name").setWidth("25%"); + getListGrid().getField("name").setCellFormatter(new CellFormatter() { public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { return "<a href="#Bundles/Bundle/" + listGridRecord.getAttribute("id") + "">" + o + "</a>"; } });
- table.getListGrid().getField("description").setWidth("25%"); - table.getListGrid().getField("latestVersion").setWidth("25%"); - table.getListGrid().getField("versionsCount").setWidth("*"); + getListGrid().getField("description").setWidth("25%"); + getListGrid().getField("latestVersion").setWidth("25%"); + getListGrid().getField("versionsCount").setWidth("*");
- table.getListGrid().setSelectionType(SelectionStyle.SIMPLE); - table.getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX); + getListGrid().setSelectionType(SelectionStyle.SIMPLE); +// getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX);
- table.addTableAction("New", Table.SelectionEnablement.ALWAYS, null, new TableAction() { + addTableAction("New", Table.SelectionEnablement.ALWAYS, null, new TableAction() { public void executeAction(ListGridRecord[] selection) { new BundleCreateWizard().startBundleWizard();
} });
- table.addTableAction("Delete", Table.SelectionEnablement.ANY, "Are You Sure?", new TableAction() { + addTableAction("Delete", Table.SelectionEnablement.ANY, "Are You Sure?", new TableAction() { public void executeAction(ListGridRecord[] selections) { - BundlesWithLatestVersionDataSource ds = (BundlesWithLatestVersionDataSource) table.getDataSource(); + BundlesWithLatestVersionDataSource ds = (BundlesWithLatestVersionDataSource) getDataSource(); for (ListGridRecord selection : selections) { BundleGWTServiceAsync bundleManager = GWTServiceLookup.getBundleService(); final BundleWithLatestVersionComposite object = ds.copyValues(selection); @@ -105,14 +102,14 @@ public class BundlesListView extends VLayout {
// can change this back to SINGLE selection when we feel like it. currently allowing the wizard to // select the bundle. - table.addTableAction("Deploy", Table.SelectionEnablement.ALWAYS, null, new TableAction() { + addTableAction("Deploy", Table.SelectionEnablement.ALWAYS, null, new TableAction() { public void executeAction(ListGridRecord[] selection) { if (selection.length == 0) { new BundleDeployWizard().startBundleWizard(); return; }
- BundlesWithLatestVersionDataSource ds = (BundlesWithLatestVersionDataSource) table.getDataSource(); + BundlesWithLatestVersionDataSource ds = (BundlesWithLatestVersionDataSource) getDataSource(); final BundleWithLatestVersionComposite object = ds.copyValues(selection[0]); BundleCriteria bc = new BundleCriteria(); bc.addFilterId(object.getBundleId()); @@ -135,16 +132,13 @@ public class BundlesListView extends VLayout { }); } }); - - addMember(table); - }
public void setCriteria(Criteria criteria) { - this.table.getListGrid().fetchData(criteria); + this.getListGrid().fetchData(criteria); }
public int getMatches() { - return this.table.getListGrid().getTotalRows(); + return this.getListGrid().getTotalRows(); } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java index 0ce4c53..c678d6f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java @@ -125,6 +125,7 @@ public class BundleVersionView extends VLayout implements BookmarkableView { }); } }); + tagEditor.setVertical(true); tagItem.setCanvas(tagEditor); tagItem.setRowSpan(4);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java index 02f2013..6ff4f0c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java @@ -55,6 +55,7 @@ public class Table extends VLayout {
private static final SelectionEnablement DEFAULT_SELECTION_ENABLEMENT = SelectionEnablement.ALWAYS;
+ private HLayout titleLayout; private HTMLFlow title;
private Canvas titleComponent; @@ -64,6 +65,9 @@ public class Table extends VLayout { private Label tableInfo; private String[] excludedFieldNames;
+ + private boolean showFooter = true; + /** * Specifies how many rows must be selected in order for a {@link TableAction} button to be enabled. */ @@ -157,6 +161,7 @@ public class Table extends VLayout { super.onInit();
+ // NOTE: It is essential that we wait to hide any excluded fields until after super.onDraw() is called, since // super.onDraw() is what actually adds the fields to the ListGrid (based on what fields are defined in // the underlying datasource). @@ -166,7 +171,7 @@ public class Table extends VLayout { } }
- HLayout titleLayout = new HLayout(); + titleLayout = new HLayout(); titleLayout.setAutoHeight(); titleLayout.setAlign(VerticalAlignment.BOTTOM); titleLayout.addMember(title); @@ -176,9 +181,6 @@ public class Table extends VLayout { titleLayout.addMember(titleComponent); }
- addMember(titleLayout); - addMember(listGrid); - addMember(footer);
tableInfo.setWrap(false);
@@ -295,6 +297,28 @@ public class Table extends VLayout { } }
+ + @Override + protected void onDraw() { + super.onDraw(); + + removeMembers(getMembers()); + + addMember(titleLayout); + addMember(listGrid); + if (showFooter) { + addMember(footer); + } + } + + public boolean isShowFooter() { + return showFooter; + } + + public void setShowFooter(boolean showFooter) { + this.showFooter = showFooter; + } + private int totalWidth; private ArrayList<Integer> fieldSizes = new ArrayList<Integer>(); private boolean autoSizing = false; @@ -362,28 +386,30 @@ public class Table extends VLayout {
private void refreshTableInfo() { - int count = this.listGrid.getSelection().length; - for (TableActionInfo tableAction : tableActions) { - boolean enabled; - switch (tableAction.enablement) { - case ALWAYS: - enabled = true; - break; - case ANY: - enabled = (count >= 1); - break; - case SINGLE: - enabled = (count == 1); - break; - case MULTIPLE: - enabled = (count > 1); - break; - default: - throw new IllegalStateException("Unhandled SelectionEnablement: " + tableAction.enablement.name()); + if (showFooter) { + int count = this.listGrid.getSelection().length; + for (TableActionInfo tableAction : tableActions) { + boolean enabled; + switch (tableAction.enablement) { + case ALWAYS: + enabled = true; + break; + case ANY: + enabled = (count >= 1); + break; + case SINGLE: + enabled = (count == 1); + break; + case MULTIPLE: + enabled = (count > 1); + break; + default: + throw new IllegalStateException("Unhandled SelectionEnablement: " + tableAction.enablement.name()); + } + tableAction.actionButton.setDisabled(!enabled); } - tableAction.actionButton.setDisabled(!enabled); + this.tableInfo.setContents("Total: " + listGrid.getTotalRows() + " (" + count + " selected)"); } - this.tableInfo.setContents("Total: " + listGrid.getTotalRows() + " (" + count + " selected)"); }
// -------------- Inner utility class ------------- diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java index dd63fca..6219504 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java @@ -32,13 +32,21 @@ import java.util.Set; import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.HorizontalPanel; +import com.google.gwt.user.client.ui.Widget; import com.smartgwt.client.data.DSResponse; import com.smartgwt.client.types.TextMatchStyle; import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.Dialog; import com.smartgwt.client.widgets.HTMLFlow; import com.smartgwt.client.widgets.Img; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; +import com.smartgwt.client.widgets.events.HoverEvent; +import com.smartgwt.client.widgets.events.HoverHandler; +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.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.ComboBoxItem; import com.smartgwt.client.widgets.form.fields.events.BlurEvent; @@ -49,6 +57,7 @@ import com.smartgwt.client.widgets.form.fields.events.KeyPressEvent; import com.smartgwt.client.widgets.form.fields.events.KeyPressHandler; import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.Layout; +import com.smartgwt.client.widgets.layout.LayoutSpacer; import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.criteria.TagCriteria; @@ -126,122 +135,159 @@ public class TagEditorView extends Layout { tagLayout.setHeight(18); //tagLayout.set
- HTMLFlow tagString = new HTMLFlow(tag.toString()); + HTMLFlow tagString = new HTMLFlow( + "<a href="#Tag/" + tag.toString() + "">" + + tag.toString() + "</a>"); tagString.setAutoWidth(); + tagLayout.addMember(tagString); - if (editing) { - Img remove = new Img("[skin]/images/actions/remove.png", 16, 16); + + if (!readOnly) { + final LayoutSpacer spacer = new LayoutSpacer(); + spacer.setHeight(16); + spacer.setWidth(16); + + final Img remove = new Img("[skin]/images/actions/remove.png", 16, 16); remove.setTooltip("Click to remove this tag"); remove.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { tags.remove(tag); save(); -// TagEditorView.this.setup(); } }); tagLayout.addMember(remove); + tagLayout.addMember(spacer); + remove.hide(); + + tagLayout.addMouseOverHandler(new MouseOverHandler() { + public void onMouseOver(MouseOverEvent mouseOverEvent) { + remove.show(); + spacer.hide(); + } + }); + tagLayout.addMouseOutHandler(new MouseOutHandler() { + public void onMouseOut(MouseOutEvent mouseOutEvent) { + spacer.show(); + remove.hide(); + } + }); + }
- tagLayout.setHeight(32); + tagLayout.setHeight(16); layout.addMember(tagLayout);
-// -// Canvas spacer = new Canvas(); -// spacer.setWidth(8); -// layout.addMember(spacer); + + } + + + if (!readOnly) { + final Img modeImg = new Img("[skin]/images/actions/add.png", 16, 16); + + modeImg.setTooltip("Click to edit tags"); + modeImg.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + + showTagInput(modeImg.getAbsoluteLeft(), modeImg.getAbsoluteTop()); + } + }); + layout.addMember(modeImg); }
- HLayout editLayout = new HLayout(); - editLayout.setHeight(32);
- if (editing) { - form = new DynamicForm(); - final ComboBoxItem tagInput = new ComboBoxItem("tag"); - tagInput.setShowTitle(false); - tagInput.setHideEmptyPickList(true); + layout.setAutoWidth(); + addMember(layout); + + markForRedraw(); + } + + + private void showTagInput(int left, int top) { + form = new DynamicForm(); + final Dialog dialog = new Dialog(); + + final ComboBoxItem tagInput = new ComboBoxItem("tag"); + tagInput.setShowTitle(false); + tagInput.setHideEmptyPickList(true); // tagInput.setOptionDataSource(new TaggingDataSource()); - TagCriteria criteria = new TagCriteria(); - criteria.addSortNamespace(PageOrdering.ASC); - criteria.addSortSemantic(PageOrdering.ASC); - criteria.addSortName(PageOrdering.ASC); - GWTServiceLookup.getTagService().findTagsByCriteria(criteria, - new AsyncCallback<PageList<Tag>>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load tags", caught); - } + TagCriteria criteria = new TagCriteria(); + criteria.addSortNamespace(PageOrdering.ASC); + criteria.addSortSemantic(PageOrdering.ASC); + criteria.addSortName(PageOrdering.ASC); + GWTServiceLookup.getTagService().findTagsByCriteria(criteria, + new AsyncCallback<PageList<Tag>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load tags", caught); + }
- public void onSuccess(PageList<Tag> result) { - String[] values = new String[result.size()]; - int i = 0; - for (Tag tag : result) { - values[i++] = tag.toString(); - } - tagInput.setValueMap(values); + public void onSuccess(PageList<Tag> result) { + String[] values = new String[result.size()]; + int i = 0; + for (Tag tag : result) { + values[i++] = tag.toString(); } - }); + tagInput.setValueMap(values); + } + });
- tagInput.setValueField("tag"); - tagInput.setDisplayField("tag"); - tagInput.setType("comboBox"); - tagInput.setTextMatchStyle(TextMatchStyle.SUBSTRING); - tagInput.setTooltip("Enter a tag in the format "(namespace:)(semantic=)tagname" (e.g. it:env=QA, or owner=John)"); - /*tagInput.addBlurHandler(new BlurHandler() { - public void onBlur(BlurEvent blurEvent) { + tagInput.setValueField("tag"); + tagInput.setDisplayField("tag"); + tagInput.setType("comboBox"); + tagInput.setTextMatchStyle(TextMatchStyle.SUBSTRING); + tagInput.setTooltip("Enter a tag in the format "(namespace:)(semantic=)tagname" (e.g. it:env=QA, or owner=John)"); + /*tagInput.addBlurHandler(new BlurHandler() { + public void onBlur(BlurEvent blurEvent) { + String tag = form.getValueAsString("tag"); + if (tag != null) { + Tag newTag = new Tag(tag); + tags.add(newTag); + save(); +// TagEditorView.this.setup(); + } + } + });*/ + tagInput.addKeyPressHandler(new KeyPressHandler() { + public void onKeyPress(KeyPressEvent event) { + if ((event.getCharacterValue() != null) && (event.getCharacterValue() == KeyCodes.KEY_ENTER)) { String tag = form.getValueAsString("tag"); if (tag != null) { Tag newTag = new Tag(tag); tags.add(newTag); save(); -// TagEditorView.this.setup(); - } - } - });*/ - tagInput.addKeyPressHandler(new KeyPressHandler() { - public void onKeyPress(KeyPressEvent event) { - if ((event.getCharacterValue() != null) && (event.getCharacterValue() == KeyCodes.KEY_ENTER)) { - String tag = form.getValueAsString("tag"); - if (tag != null) { - Tag newTag = new Tag(tag); - tags.add(newTag); - save(); + dialog.destroy(); // TagEditorView.this.setup(); - } } } - }); - - form.setFields(tagInput); + } + });
- editLayout.addMember(form); - } + form.setFields(tagInput);
+ dialog.setIsModal(true); + dialog.setShowHeader(false); + dialog.setShowEdges(false); + dialog.setEdgeSize(10); + dialog.setWidth(200); + dialog.setHeight(30);
- if (!readOnly) { - Img modeImg = new Img("[skin]/images/actions/" + (editing ? "approve" : "edit") + ".png", 16, 16); - modeImg.setTooltip(editing ? "Click to save edits" : "Click to edit tags"); - modeImg.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent clickEvent) { - - if (editing) { - save(); - } - editing = !editing; - TagEditorView.this.setup();
- } - }); - editLayout.addMember(modeImg); - } + dialog.setShowToolbar(false);
+ Map bodyDefaults = new HashMap(); + bodyDefaults.put("layoutLeftMargin", 5); + bodyDefaults.put("membersMargin", 10); + dialog.setBodyDefaults(bodyDefaults);
- layout.addMember(editLayout); + dialog.addItem(form);
+ dialog.setDismissOnEscape(true); + dialog.setDismissOnOutsideClick(true);
- layout.setAutoWidth(); - addMember(layout); + dialog.show(); + dialog.moveTo(left - 8, top - 4); + tagInput.focusInItem();
- markForRedraw(); }
private void save() { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java index 8d8f371..61cd57f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java @@ -22,6 +22,7 @@ import java.util.ArrayList;
import com.google.gwt.event.dom.client.KeyCodes; import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.data.SortSpecifier; import com.smartgwt.client.types.Alignment; import com.smartgwt.client.types.ListGridFieldType; import com.smartgwt.client.types.SelectionAppearance; @@ -41,11 +42,9 @@ import org.rhq.enterprise.gui.coregui.client.components.table.TableAction; /** * @author Greg Hinkle */ -public class ResourceSearchView extends VLayout { +public class ResourceSearchView extends Table { private static final String DEFAULT_TITLE = "Resources";
- private Table table; - private ArrayList<ResourceSelectListener> selectListeners = new ArrayList<ResourceSelectListener>();
/** @@ -55,6 +54,10 @@ public class ResourceSearchView extends VLayout { this(null); }
+ public ResourceSearchView(String title, String[] excludeFields) { + this(null, title, null, excludeFields); + } + /** * A Resource list filtered by a given criteria. */ @@ -62,10 +65,15 @@ public class ResourceSearchView extends VLayout { this(criteria, DEFAULT_TITLE); }
+ public ResourceSearchView(Criteria criteria, String title) { + this(criteria, title, null, null); + } + /** * A Resource list filtered by a given criteria with the given title. */ - public ResourceSearchView(Criteria criteria, String title) { + public ResourceSearchView(Criteria criteria, String title, SortSpecifier[] sortSpecifier, String[] excludeFields) { + super(title, criteria, sortSpecifier, excludeFields);
setWidth100(); setHeight100(); @@ -78,13 +86,12 @@ public class ResourceSearchView extends VLayout {
final ResourceDatasource datasource = new ResourceDatasource(); - table = new Table(title, criteria); - table.setTitleComponent(searchPanel); - table.setDataSource(datasource); + setTitleComponent(searchPanel); + setDataSource(datasource);
- table.getListGrid().setSelectionType(SelectionStyle.SIMPLE); - table.getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX); - table.getListGrid().setResizeFieldsInRealTime(true); + getListGrid().setSelectionType(SelectionStyle.SIMPLE); +// getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX); + getListGrid().setResizeFieldsInRealTime(true);
ListGridField idField = new ListGridField("id", "Id", 55); idField.setType(ListGridFieldType.INTEGER); @@ -102,24 +109,23 @@ public class ResourceSearchView extends VLayout {
ListGridField availabilityField = new ListGridField("currentAvailability", "Availability", 55); availabilityField.setAlign(Alignment.CENTER); - table.getListGrid().setFields(idField, nameField, descriptionField, typeNameField, pluginNameField, - categoryField, availabilityField); + getListGrid().setFields(idField, nameField, descriptionField, typeNameField, pluginNameField, + categoryField, availabilityField);
- table.addTableAction("Uninventory", Table.SelectionEnablement.ANY, - "Are you sure you want to delete # resources?", new TableAction() { - public void executeAction(ListGridRecord[] selection) { - table.getListGrid().removeSelectedData(); - } - }); + addTableAction("Uninventory", Table.SelectionEnablement.ANY, + "Are you sure you want to delete # resources?", new TableAction() { + public void executeAction(ListGridRecord[] selection) { + getListGrid().removeSelectedData(); + } + });
- addMember(table);
searchBox.addKeyPressHandler(new KeyPressHandler() { public void onKeyPress(KeyPressEvent event) { if ((event.getCharacterValue() != null) && (event.getCharacterValue() == KeyCodes.KEY_ENTER)) { datasource.setQuery((String) searchBox.getValue());
- Criteria c = table.getListGrid().getCriteria(); + Criteria c = getListGrid().getCriteria(); if (c == null) { c = new Criteria(); } @@ -127,7 +133,7 @@ public class ResourceSearchView extends VLayout { c.addCriteria("name", (String) searchBox.getValue());
long start = System.currentTimeMillis(); - table.getListGrid().fetchData(c); + getListGrid().fetchData(c); System.out.println("Loaded in: " + (System.currentTimeMillis() - start)); } } @@ -136,13 +142,8 @@ public class ResourceSearchView extends VLayout {
- public void setCriteria(Criteria criteria) { - this.table.getListGrid().fetchData(criteria); - } - - public int getMatches() { - return this.table.getListGrid().getTotalRows(); + return this.getListGrid().getTotalRows(); }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java index ec2c2c4..996c199 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java @@ -24,9 +24,12 @@ package org.rhq.enterprise.gui.coregui.client.report.tag;
import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.layout.SectionStack; import com.smartgwt.client.widgets.layout.SectionStackSection; import com.smartgwt.client.widgets.layout.VLayout; +import com.smartgwt.client.widgets.tile.TileGrid; +import com.smartgwt.client.widgets.tile.TileLayout;
import org.rhq.core.domain.criteria.TagCriteria; import org.rhq.core.domain.tagging.Tag; @@ -67,15 +70,24 @@ public class TaggedView extends VLayout implements BookmarkableView { TagCloudView tagCloudView = new TagCloudView(); tagCloudView.setAutoHeight(); addMember(tagCloudView); - - sectionStack = new SectionStack(); - sectionStack.setHeight("*"); - - sectionStack.addSection(getResourceStack()); - - sectionStack.addSection(getBundleStack()); - - addMember(sectionStack); +// +// sectionStack = new SectionStack(); +// sectionStack.setHeight("*"); +// +// sectionStack.addSection(getResourceStack()); +// +// sectionStack.addSection(getBundleStack()); +// +// addMember(sectionStack); + + TileLayout tileLayout = new TileLayout(); + tileLayout.setWidth100(); + tileLayout.setTileHeight(250); + tileLayout.setTileWidth(getWidth()/2 - 20); + addMember(tileLayout); + + tileLayout.addTile(getResourceCanvas()); + tileLayout.addTile(getBundleCanvas());
}
@@ -90,11 +102,11 @@ public class TaggedView extends VLayout implements BookmarkableView { criteria.addCriteria("tagName", tag.getName());
- resourceView.setCriteria(criteria); - bundlesView.setCriteria(criteria); + resourceView.refresh(criteria); + bundlesView.refresh(criteria);
- TagCriteria criteria = new TagCriteria(); +/* TagCriteria criteria = new TagCriteria(); criteria.addFilterNamespace(tag.getNamespace()); criteria.addFilterSemantic(tag.getSemantic()); criteria.addFilterName(tag.getName()); @@ -109,26 +121,19 @@ public class TaggedView extends VLayout implements BookmarkableView { sectionStack.setSectionTitle(0, "Resources: " + tagReport.getResourceCount()); sectionStack.setSectionTitle(1, "Bundles: " + tagReport.getBundleCount()); } - }); + });*/ }
- private SectionStackSection getResourceStack() { - resourceSection = new SectionStackSection(); - resourceSection.setTitle("Resources"); - - - resourceView = new ResourceSearchView(); - resourceSection.addItem(resourceView); - return resourceSection; + private Canvas getResourceCanvas() { + resourceView = new ResourceSearchView("Tagged Resources", new String[]{"pluginName","category","currentAvailability"}); + resourceView.setShowFooter(false); + return resourceView; }
- private SectionStackSection getBundleStack() { - bundleSection = new SectionStackSection(); - bundleSection.setTitle("Bundles"); - + private Canvas getBundleCanvas() { bundlesView = new BundlesListView(); - bundleSection.addItem(bundlesView); - return bundleSection; + bundlesView.setShowFooter(false); + return bundlesView; }
public void renderView(ViewPath viewPath) {
commit af4d7854fc2408c76f31d610791e016240fb9409 Author: Greg Hinkle ghinkle@redhat.com Date: Mon May 24 13:28:57 2010 -0400
Relogin when the session has timed out
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java index 992b0c6..b914a4b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java @@ -152,40 +152,43 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
private void buildCoreUI() { - this.rootCanvas = new RootCanvas(); - rootCanvas.setOverflow(Overflow.HIDDEN); - - // HTMLPane menuPane = new HTMLPane(); - // menuPane.setWidth100(); - // menuPane.setHeight(26); - // menuPane.setContentsType(ContentsType.PAGE); - // menuPane.setContentsURL("/rhq/common/menu/menu.xhtml"); - // menuPane.setZIndex(400000); - // layout.addMember(menuPane); - - MenuBarView menuBarView = new MenuBarView(); - menuBarView.setWidth("100%"); - // WidgetCanvas menuCanvas = new WidgetCanvas(menuBarView); - // menuCanvas.setTop(0); - // menuCanvas.setWidth100(); - // menuCanvas.draw(); - rootCanvas.addMember(menuBarView); - - breadCrumbTrailPane = new BreadcrumbTrailPane(); - rootCanvas.addMember(breadCrumbTrailPane); - - DOM.setInnerHTML(RootPanel.get("Loading-Panel").getElement(), ""); - - Canvas canvas = new Canvas(CONTENT_CANVAS_ID); - canvas.setWidth100(); - canvas.setHeight100(); - rootCanvas.addMember(canvas); - - rootCanvas.addMember(new Footer()); - - rootCanvas.draw(); - - History.addValueChangeHandler(this); + // If the core gui is already built (eg. from previous login, just refire event) + if (this.rootCanvas == null) { + this.rootCanvas = new RootCanvas(); + rootCanvas.setOverflow(Overflow.HIDDEN); + + // HTMLPane menuPane = new HTMLPane(); + // menuPane.setWidth100(); + // menuPane.setHeight(26); + // menuPane.setContentsType(ContentsType.PAGE); + // menuPane.setContentsURL("/rhq/common/menu/menu.xhtml"); + // menuPane.setZIndex(400000); + // layout.addMember(menuPane); + + MenuBarView menuBarView = new MenuBarView(); + menuBarView.setWidth("100%"); + // WidgetCanvas menuCanvas = new WidgetCanvas(menuBarView); + // menuCanvas.setTop(0); + // menuCanvas.setWidth100(); + // menuCanvas.draw(); + rootCanvas.addMember(menuBarView); + + breadCrumbTrailPane = new BreadcrumbTrailPane(); + rootCanvas.addMember(breadCrumbTrailPane); + + DOM.setInnerHTML(RootPanel.get("Loading-Panel").getElement(), ""); + + Canvas canvas = new Canvas(CONTENT_CANVAS_ID); + canvas.setWidth100(); + canvas.setHeight100(); + rootCanvas.addMember(canvas); + + rootCanvas.addMember(new Footer()); + + rootCanvas.draw(); + + History.addValueChangeHandler(this); + }
History.fireCurrentHistoryState(); } @@ -217,8 +220,8 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { canvas = new DashboardsView(); } else if (breadcrumbName.equals("Bundles")) { canvas = new BundleTopView(); - /*} else if (breadcrumbName.equals("LogOut")) { - // canvas = new LoginView();*/ + /*} else if (breadcrumbName.equals("LogOut")) { +// canvas = new LoginView();*/ } else if (breadcrumbName.equals("Tag")) { canvas = new TaggedView(); } else { 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 6136c85..39f9066 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 @@ -24,6 +24,7 @@ package org.rhq.enterprise.gui.coregui.client;
import java.util.HashMap;
+import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.http.client.Request; import com.google.gwt.http.client.RequestBuilder; import com.google.gwt.http.client.RequestCallback; @@ -47,6 +48,8 @@ import com.smartgwt.client.widgets.form.fields.SubmitItem; import com.smartgwt.client.widgets.form.fields.TextItem; import com.smartgwt.client.widgets.form.fields.events.ClickEvent; import com.smartgwt.client.widgets.form.fields.events.ClickHandler; +import com.smartgwt.client.widgets.form.fields.events.KeyPressEvent; +import com.smartgwt.client.widgets.form.fields.events.KeyPressHandler; import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.auth.Subject; @@ -67,6 +70,7 @@ public class LoginView { form.setMargin(10); form.setShowInlineErrors(false);
+ CanvasItem logo = new CanvasItem(); logo.setCanvas(new Img("header/rhq_logo_28px.png",80,28)); logo.setShowTitle(false); @@ -77,13 +81,23 @@ public class LoginView {
TextItem user = new TextItem("user", "User"); user.setRequired(true); + user.setAttribute("canAutocomplete", true); + user.setAttribute("autoComplete", true); PasswordItem password = new PasswordItem("password", "Password"); password.setRequired(true); + password.setAttribute("autocomplete", true);
final SubmitItem login = new SubmitItem("login", "Login"); login.setAlign(Alignment.CENTER); login.setColSpan(2);
+ password.addKeyPressHandler(new KeyPressHandler() { + public void onKeyPress(KeyPressEvent event) { + if ((event.getCharacterValue() != null) && (event.getCharacterValue() == KeyCodes.KEY_ENTER)) { + form.submit(); + } + } + });
form.setFields(logo, header, user, password, login);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/MonitoringRequestCallback.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/MonitoringRequestCallback.java index f095e83..4456c1c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/MonitoringRequestCallback.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/MonitoringRequestCallback.java @@ -23,6 +23,8 @@ import com.google.gwt.http.client.RequestCallback; import com.google.gwt.http.client.Response; import com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI; + /** * @author Greg Hinkle */ @@ -32,6 +34,8 @@ public class MonitoringRequestCallback implements RequestCallback { private String name; private long start = System.currentTimeMillis();
+ private static final int STATUS_CODE_OK = 200; + private RequestCallback callback;
public MonitoringRequestCallback(String name, RequestCallback callback) { @@ -51,8 +55,16 @@ public class MonitoringRequestCallback implements RequestCallback { }
public void onResponseReceived(Request request, Response response) { - RPCManager.getInstance().succeedCall(this); - callback.onResponseReceived(request, response); + if (STATUS_CODE_OK == response.getStatusCode()) { + + RPCManager.getInstance().succeedCall(this); + callback.onResponseReceived(request, response); + } else { + RPCManager.getInstance().failCall(this); + callback.onResponseReceived(request, response); + + CoreGUI.checkLoginStatus(); + } }
commit 53d34d5afee2a6b16007ab35c391eaf0a03c52f1 Author: Ian P. Springer <ips@jetengine.(none)> Date: Mon May 24 11:05:19 2010 -0400
improve testMoveResourceType() so that it verifies that when a ResourceType X is moved, that Resources of type X are also moved (cherry picked from commit 1fe024068b6aaa61068382cf3cbc099a638e3200)
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateResourceTypeSubsystemTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateResourceTypeSubsystemTest.java index bda11e9..0d70634 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateResourceTypeSubsystemTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateResourceTypeSubsystemTest.java @@ -19,10 +19,17 @@ package org.rhq.enterprise.server.resource.metadata.test;
import java.util.Set; +import java.util.UUID;
import javax.persistence.EntityManager; import javax.transaction.Status;
+import org.jetbrains.annotations.NotNull; +import org.rhq.core.domain.auth.Subject; +import org.rhq.core.domain.criteria.ResourceCriteria; +import org.rhq.core.domain.resource.InventoryStatus; +import org.rhq.core.domain.resource.Resource; +import org.rhq.enterprise.server.util.LookupUtil; import org.testng.annotations.Test;
import org.rhq.core.domain.measurement.DisplayType; @@ -126,25 +133,36 @@ public class UpdateResourceTypeSubsystemTest extends UpdateSubsytemTestBase { System.out.println("testMoveResourceType --- start"); try { registerPlugin("update2-v1_0.xml"); + ResourceType platform1 = getResourceType("myPlatform"); + Resource platformResource = createResource("foo-myPlatform", "foo-myPlatform", platform1); + ResourceType service1 = getResourceType("service1"); + Resource service1Resource = createResource("foo-service1", "foo-service1", service1); + platformResource.addChildResource(service1Resource); + ResourceType nestedOne = getResourceType("nestedOne"); + Resource nestedOneResource = createResource("foo-nestedOne", "foo-nestedOne", nestedOne); + service1Resource.addChildResource(nestedOneResource); + Subject overlord = LookupUtil.getSubjectManager().getOverlord(); + resourceManager.createResource(overlord, platformResource, -1); + getTransactionManager().begin(); - EntityManager em = getEntityManager(); + EntityManager em = getEntityManager(); platform1 = em.find(ResourceType.class, platform1.getId());
assert platform1 != null : "I did not find myPlatform"; Set<MeasurementDefinition> defs = platform1.getMetricDefinitions(); - assert defs.size() == 1 : "I was expecting 1 definition at platform level in v1"; + assert defs.size() == 1 : "I was expecting 1 metric definition at platform level in v1"; assert DisplayType.DETAIL == defs.iterator().next().getDisplayType() : "Display type should be DETAIL in v1";
// one child service in v1 Set<ResourceType> platformChildren = platform1.getChildResourceTypes(); assert platformChildren.size() == 1 : "Expected 1 direct child service of platform in v1"; - ResourceType service1 = platformChildren.iterator().next(); + service1 = platformChildren.iterator().next(); assert service1.getName().equals("service1") : "Expected 'service1' as name of direct platform child in v1"; assert service1.getMetricDefinitions().size() == 1 : "Expected 1 metric for 'service1' in v1"; - Set<ResourceType> nestedService = service1.getChildResourceTypes(); - assert nestedService.size() == 1 : "Expected 1 nested service of 'service1' in v1"; - Set<MeasurementDefinition> nestedDefs = nestedService.iterator().next().getMetricDefinitions(); + Set<ResourceType> nestedServices = service1.getChildResourceTypes(); + assert nestedServices.size() == 1 : "Expected 1 nested service of 'service1' in v1"; + Set<MeasurementDefinition> nestedDefs = nestedServices.iterator().next().getMetricDefinitions(); assert nestedDefs.size() == 1 : "Expected 1 definition within 'nestedService' in v1"; MeasurementDefinition defThree = nestedDefs.iterator().next(); int definitionId = defThree.getId(); // get the id of the definition "Three" and save it for later use @@ -166,9 +184,28 @@ public class UpdateResourceTypeSubsystemTest extends UpdateSubsytemTestBase { assert defs2.size() == 1 : "I was expecting 1 definition at platform level in v2"; assert DisplayType.SUMMARY == defs2.iterator().next().getDisplayType() : "Display type should be SUMMARY in v2";
+ ResourceCriteria resourceCriteria = new ResourceCriteria(); + resourceCriteria.setStrict(true); + resourceCriteria.addFilterResourceKey("foo-myPlatform"); + resourceCriteria.fetchChildResources(true); + Resource platform2Resource = getResource(resourceCriteria); + assert platform2Resource != null : "Expected to find platform Resource in db."; + // two children in v2 Set<ResourceType> platformChildren2 = platform2.getChildResourceTypes(); - assert platformChildren2.size() == 2 : "Expected 2 direct child services of platform in v2"; + assert platformChildren2.size() == 2 : "Expected 2 direct child service types of platform in v2"; + + Set<Resource> platform2ChildResources = platform2Resource.getChildResources(); + assert platform2ChildResources.size() == 2 : "Expected 2 direct child services of platform in v2"; + boolean foundMovedResource = false; + for (Resource childResource : platform2ChildResources) { + assert childResource.getChildResources().isEmpty() : "Expected child Resource " + childResource + " to have no children"; + if (childResource.getResourceKey().equals("foo-nestedOne")) { + foundMovedResource = true; + } + } + assert foundMovedResource : "Expected 'foo-nestedOne' Resource to have been moved directly under platform Resource"; + for (ResourceType type : platformChildren2) { String typeName = type.getName(); assert type.getMetricDefinitions().size() == 1 : "Expected one definition for " + typeName + " in v2"; @@ -186,7 +223,7 @@ public class UpdateResourceTypeSubsystemTest extends UpdateSubsytemTestBase { * latter is a different story. We probably should cascade that anyway. */ assert three.getId() == definitionId : "Expected the id of 'Three' to be " + definitionId - + " but it was " + three.getId() + " in v2"; + + ", but it was " + three.getId() + " in v2"; } else if (typeName.equals("service1")) { // check that the nested service is gone Set<ResourceType> childrenOfService = type.getChildResourceTypes(); diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateSubsytemTestBase.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateSubsytemTestBase.java index 6b5c627..205108d 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateSubsytemTestBase.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateSubsytemTestBase.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -22,6 +22,7 @@ import java.io.FileNotFoundException; import java.net.URL; import java.util.List; import java.util.Set; +import java.util.UUID;
import javax.ejb.EJB; import javax.persistence.EntityManager; @@ -82,12 +83,14 @@ public class UpdateSubsytemTestBase extends AbstractEJB3Test {
protected static ResourceMetadataManagerLocal metadataManager; protected static ResourceTypeManagerLocal resourceTypeManager; + protected static ResourceManagerLocal resourceManager;
@BeforeSuite protected void init() { try { metadataManager = LookupUtil.getResourceMetadataManager(); resourceTypeManager = LookupUtil.getResourceTypeManager(); + resourceManager = LookupUtil.getResourceManager(); } catch (Throwable t) { // Catch RuntimeExceptions and Errors and dump their stack trace, because Surefire will completely swallow them // and throw a cryptic NPE (see http://jira.codehaus.org/browse/SUREFIRE-157)! @@ -146,6 +149,28 @@ public class UpdateSubsytemTestBase extends AbstractEJB3Test { } }
+ protected Resource createResource(String resourceKey, String name, ResourceType type) { + Resource resource = new Resource(resourceKey, name, type); + resource.setUuid(UUID.randomUUID().toString()); + resource.setInventoryStatus(InventoryStatus.COMMITTED); + return resource; + } + + protected Resource getResource(ResourceCriteria resourceCriteria) { + Subject overlord = LookupUtil.getSubjectManager().getOverlord(); + + PageList<Resource> results = resourceManager + .findResourcesByCriteria(overlord, resourceCriteria); + if (results.size() == 0) { + return null; + } else if (results.size() == 1) { + return results.get(0); + } else { + throw new IllegalStateException("Found more than one Resource with criteria " + resourceCriteria + + "."); + } + } + protected String getSubsystemDirectory() { return "."; }
commit f99914e64b5d110b9b1944b4fd5798219711ab22 Author: Ian P. Springer <ips@jetengine.(none)> Date: Fri May 21 16:46:58 2010 -0400
oops, forgot to update current schema version in pom to 2.87 (cherry picked from commit b71faa29cafc4e4737184f7b8a348091748bd29f)
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index b2b0b7e..eb5d6ea 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -22,7 +22,7 @@
<properties> <scm.module.path>modules/core/dbutils/</scm.module.path> - <db.schema.version>2.85</db.schema.version> + <db.schema.version>2.87</db.schema.version> </properties>
<dependencies>
commit 42c11a370fcb8ddce0b5e278d3e036508ad1b083 Author: Ian P. Springer <ips@jetengine.(none)> Date: Fri May 21 16:45:43 2010 -0400
use schema version 2.87, rather than 2.86, for adding unique constraint to rhq_resource_type name+plugin index, since Mazz has already claimed 2.86; fix compile errors in JBossCacheComponent and JBossCacheDetailComponent caused by my previous checkin; turn down logging verbosity in ResourceMetadataManagerBean (cherry picked from commit 10d7bf099a310e9be9d93637299d67265e29aa2f)
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index 31a7b40..6ec7660 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -2920,7 +2920,8 @@ </schema-directSQL> </schemaSpec>
- <schemaSpec version="2.86"> + + <schemaSpec version="2.87"> <schema-directSQL> <statement desc="Make RHQ_RES_TYPE_IDX_PLG_NAME index unique"> DROP INDEX RHQ_RES_TYPE_IDX_PLG_NAME ; diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerLocal.java index cbd364b..b4b7d55 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerLocal.java @@ -65,7 +65,9 @@ public interface SubjectManagerLocal { Subject getOverlord();
/** - * @see SubjectManagerRemote#findAllSubjects + * Returns a paged list of all Subjects. + * + * @param pageControl the page control that specifies which page of the result set to return and how sort it */ PageList<Subject> findAllSubjects(PageControl pageControl);
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java index fa31afe..e49c8f3 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java @@ -92,6 +92,7 @@ import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal; * @author Greg Hinkle * @author Heiko W. Rupp * @author John Mazzitelli + * @author Ian Springer */ @Stateless @javax.annotation.Resource(name = "RHQ_DS", mappedName = RHQConstants.DATASOURCE_JNDI_NAME) @@ -312,14 +313,14 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal
if (existingPlugin != null) { Plugin obsolete = AgentPluginDescriptorUtil.determineObsoletePlugin(plugin, existingPlugin); - if (obsolete == existingPlugin) { // yes use == for reference equality + if (obsolete == existingPlugin) { // yes, use == for reference equality newOrUpdated = true; } plugin.setId(existingPlugin.getId()); plugin.setEnabled(existingPlugin.isEnabled()); }
- // If this is a brand new plugin, it gets "updated" too - which ends up being a simple persist. + // If this is a brand new plugin, it gets "updated" too. if (newOrUpdated) { if (plugin.getDisplayName() == null) { plugin.setDisplayName(plugin.getName()); @@ -347,7 +348,7 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal
// TODO GH: JBNADM-1310/JBNADM-1630 - Push updated plugins to running agents and have them reboot their PCs // We probably want to be smart about this - perhaps have the agents periodically poll their server to see - // if there are new plugins and if so download them - this of course would be configurable/disablable + // if there are new plugins and if so download them - this of course would be configurable/disableable
return typesUpdated; } @@ -392,7 +393,7 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal * @param id the id of the plugin whose content is being updated * @param file the plugin file whose content will be streamed to the database * - * @throws Exception + * @throws Exception on failure to update the plugin's content */ private void streamPluginFileContentToDatabase(int id, File file) throws Exception { Connection conn = null; @@ -424,7 +425,8 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal private void updateTypes(Set<ResourceType> rootResourceTypes) throws Exception { // Iterate the resource types breadth-first, so all platform types get added before any server types or platform // service types. This way, we'll be able to set all of the platform types as parents of the server types and - // platform service types. + // platform service types. It's also helpful for other types with multiple "runs-inside" parent types (e.g + // Hibernate Entities), since it ensures the parent types will get persisted prior to the child types. for (ResourceType rootResourceType : rootResourceTypes) { updateType(rootResourceType); } @@ -544,7 +546,7 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal }
private void mergeExistingType(ResourceType resourceType, ResourceType existingType) { - log.info("Merging type [" + resourceType + "] + into existing type [" + existingType + "]..."); + log.debug("Merging type [" + resourceType + "] + into existing type [" + existingType + "]...");
// Make sure to first add/update any subcategories on the parent before trying to update children. // Otherwise, the children may try to save themselves with subcategories which wouldn't exist yet. @@ -648,7 +650,7 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal
private void updateParentResourceTypes(ResourceType newType, ResourceType existingType) { Set<ResourceType> newParentTypes = newType.getParentResourceTypes(); - log.info("Setting parent types on type: " + ((existingType != null) ? existingType : newType ) + log.debug("Setting parent types on type: " + ((existingType != null) ? existingType : newType ) + " to [" + newParentTypes + "]..."); newType.setParentResourceTypes(new HashSet<ResourceType>()); Set<ResourceType> originalExistingParentTypes = new HashSet<ResourceType>(); @@ -663,7 +665,8 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal ResourceType.QUERY_FIND_BY_NAME_AND_PLUGIN).setParameter("name", newParentType.getName()) .setParameter("plugin", newParentType.getPlugin()).getSingleResult(); ResourceType type = (existingType != null) ? existingType : newType; - log.info("Adding type [" + type + "] as child of type [" + realParentType + "]..."); + log.info("Adding type [" + toConciseString(type) + "] as child of type [" + + toConciseString(realParentType) + "]..."); realParentType.addChildResourceType(type); } } catch (NoResultException nre) { @@ -673,7 +676,8 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal }
for (ResourceType obsoleteParentType : originalExistingParentTypes) { - log.info("Removing type [" + existingType + "] from parent type [" + obsoleteParentType + "]..."); + log.info("Removing type [" + toConciseString(existingType) + "] from parent type [" + + toConciseString(obsoleteParentType) + "]..."); obsoleteParentType.removeChildResourceType(existingType); moveResourcesToNewParent(existingType, obsoleteParentType, newParentTypes); } @@ -681,6 +685,10 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal entityManager.flush(); }
+ private static String toConciseString(ResourceType type) { + return (type != null) ? (type.getPlugin() + ":" + type.getName() + "(id=" + type.getId() + ")") : "null"; + } + private void moveResourcesToNewParent(ResourceType existingType, ResourceType obsoleteParentType, Set<ResourceType> newParentTypes) { Subject overlord = subjectManager.getOverlord(); ResourceCriteria criteria = new ResourceCriteria(); @@ -703,6 +711,8 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal for (Resource childResource : resource.getChildResources()) { if (childResource.getResourceType().equals(newParentType)) { // We found a child to be the new parent of our orphaned Resource. + // TODO: Check if there are are multiple children of the new parent type. If so, + // log an error and don't move the resource. newParent = childResource; break newParentTypes; } @@ -714,7 +724,7 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal } newParent.addChildResource(resource); } else { - log.warn("We were unable to move " + resource + " from invalid parent " + resource.getParentResource() + log.debug("We were unable to move " + resource + " from invalid parent " + resource.getParentResource() + " to a new valid parent with one of the following types: " + newParentTypes); } } @@ -735,7 +745,6 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal }
private List<ResourceSubCategory> getAllSubcategories(ResourceSubCategory cat) { - List<ResourceSubCategory> result = new ArrayList<ResourceSubCategory>();
if (cat.getChildSubCategories() != null) { @@ -750,7 +759,6 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal
/** Update the <event> tags */ private void updateEventDefinitions(ResourceType newType, ResourceType existingType) { - Set<EventDefinition> newEventDefs = newType.getEventDefinitions(); // Loop over the newEventDefs and set the resourceTypeId, so equals() will work for (EventDefinition def : newEventDefs) { @@ -1284,7 +1292,6 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal existingType.setPackageExtraPropertiesDefinition(null); } } - }
/** diff --git a/modules/plugins/jboss-cache-v3/src/main/java/org/rhq/plugins/jbosscache3/JBossCacheComponent.java b/modules/plugins/jboss-cache-v3/src/main/java/org/rhq/plugins/jbosscache3/JBossCacheComponent.java index 24b3acc..17a2b1e 100644 --- a/modules/plugins/jboss-cache-v3/src/main/java/org/rhq/plugins/jbosscache3/JBossCacheComponent.java +++ b/modules/plugins/jboss-cache-v3/src/main/java/org/rhq/plugins/jbosscache3/JBossCacheComponent.java @@ -25,6 +25,7 @@ package org.rhq.plugins.jbosscache3;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.jetbrains.annotations.NotNull; import org.mc4j.ems.connection.EmsConnection; import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.measurement.AvailabilityType; @@ -49,9 +50,12 @@ public class JBossCacheComponent implements
private String beanName;
- public void start(ResourceContext<ProfileServiceComponent> context) + private ResourceContext<ProfileServiceComponent> resourceContext; + + public void start(ResourceContext<ProfileServiceComponent> context) throws InvalidPluginConfigurationException, Exception {
+ resourceContext = context; parentComp = context.getParentResourceComponent();
Configuration configuration = context.getPluginConfiguration(); @@ -80,4 +84,9 @@ public class JBossCacheComponent implements public EmsConnection getEmsConnection() { return parentComp.getEmsConnection(); } + + @NotNull + public ResourceContext<ProfileServiceComponent> getResourceContext() { + return resourceContext; + } } diff --git a/modules/plugins/jboss-cache-v3/src/main/java/org/rhq/plugins/jbosscache3/JBossCacheDetailComponent.java b/modules/plugins/jboss-cache-v3/src/main/java/org/rhq/plugins/jbosscache3/JBossCacheDetailComponent.java index b23e404..844da14 100644 --- a/modules/plugins/jboss-cache-v3/src/main/java/org/rhq/plugins/jbosscache3/JBossCacheDetailComponent.java +++ b/modules/plugins/jboss-cache-v3/src/main/java/org/rhq/plugins/jbosscache3/JBossCacheDetailComponent.java @@ -26,6 +26,7 @@ import java.util.Set;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.jetbrains.annotations.NotNull; import org.mc4j.ems.connection.EmsConnection; import org.mc4j.ems.connection.bean.EmsBean; import org.mc4j.ems.connection.bean.attribute.EmsAttribute; @@ -59,10 +60,12 @@ public class JBossCacheDetailComponent implements MeasurementFacet, public ProfileServiceComponent parentComponent; private String beanName; private final Log log = LogFactory.getLog(this.getClass()); + private ResourceContext<ProfileServiceComponent> resourceContext;
- public void start(ResourceContext<ProfileServiceComponent> context) + public void start(ResourceContext<ProfileServiceComponent> context) throws InvalidPluginConfigurationException, Exception {
+ resourceContext = context; parentComponent = context.getParentResourceComponent(); EmsConnection connection = getEmsConnection();
@@ -100,7 +103,12 @@ public class JBossCacheDetailComponent implements MeasurementFacet, return parentComponent.getConnection(); }
- public void getValues(MeasurementReport report, + @NotNull + public ResourceContext<ProfileServiceComponent> getResourceContext() { + return resourceContext; + } + + public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception { EmsConnection connection = getEmsConnection();
@@ -125,7 +133,7 @@ public class JBossCacheDetailComponent implements MeasurementFacet, .toString())); } } catch (Exception e) { - log.error(" Failure to collect measurement data for metric " + log.error("Failure to collect measurement data for metric " + metricName + " from bean " + detailComponent.getBeanName(), e); } @@ -151,7 +159,7 @@ public class JBossCacheDetailComponent implements MeasurementFacet, new PropertySimple(OperationResult.SIMPLE_OPERATION_RESULT_NAME, String.valueOf(obj))); } } catch (Exception e) { - log.error(" Failure to invoke operation " + name + " on bean " + log.error("Failure to invoke operation " + name + " on bean " + beanName, e); } return result;
commit e62ab7fc4227ad5597252f7365380dcce92fd456 Author: Ian P. Springer <ips@jetengine.(none)> Date: Mon May 24 11:23:54 2010 -0400
fix conflict
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 c1457f0..b9c97f2 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 @@ -1,6 +1,6 @@ /* * Jopr Management Platform -* Copyright (C) 2005-2009 Red Hat, Inc. +* Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -68,8 +68,12 @@ import org.rhq.plugins.jbossas5.util.JnpConfig; import org.jboss.on.common.jbossas.JBossASDiscoveryUtils;
/** - * A Resource discovery component for JBoss AS, 5.2.0.Beta1 or later, and JBoss EAP and SOA-P, 5.0.0.Beta or later, - * Servers. + * A Resource discovery component for JBoss AS Server Resources, which include the following: + * + * JBoss AS, 5.2.0.Beta1 and later + * JBoss EAP, 5.0.0.Beta and later + * JBoss EWP, 5.0.0.CR1 and later + * JBoss SOA-P, 5.0.0.Beta and later * * @author Ian Springer * @author Mark Spritzler @@ -84,39 +88,31 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom private static final String JAVA_HOME_ENV_VAR = "JAVA_HOME";
private static final Map<JBossProductType, ComparableVersion> MINIMUM_PRODUCT_VERSIONS = new HashMap(3); - - private static final List<String> CLIENT_JARS = Arrays.asList( - // NOTE: The jbossall-client.jar aggregates a whole bunch of other jars from the client dir via its - // MANIFEST.MF Class-Path. - "client/jbossall-client.jar", - "client/trove.jar", - "client/javassist.jar", - "common/lib/jboss-security-aspects.jar", - "lib/jboss-managed.jar", - "lib/jboss-metatype.jar", -<<<<<<< HEAD - "lib/jboss-dependency.jar" - ); - - private static final List<String> AS6_CLIENT_JARS = new ArrayList<String>(CLIENT_JARS); - static { MINIMUM_PRODUCT_VERSIONS.put(JBossProductType.AS, new ComparableVersion("5.2.0.Beta1")); MINIMUM_PRODUCT_VERSIONS.put(JBossProductType.EAP, new ComparableVersion("5.0.0.Beta")); MINIMUM_PRODUCT_VERSIONS.put(JBossProductType.EWP, new ComparableVersion("5.0.0.CR1")); MINIMUM_PRODUCT_VERSIONS.put(JBossProductType.SOA, new ComparableVersion("5.0.0.Beta")); + } + + private static final List<String> CLIENT_JARS = Arrays.asList( + // NOTE: The jbossall-client.jar aggregates a whole bunch of other jars from the client dir via its + // MANIFEST.MF Class-Path. + "client/jbossall-client.jar", + "client/trove.jar", + "client/javassist.jar", + "common/lib/jboss-security-aspects.jar", + "lib/jboss-managed.jar", + "lib/jboss-metatype.jar", + "lib/jboss-dependency.jar" + );
+ private static final List<String> AS6_CLIENT_JARS = new ArrayList<String>(CLIENT_JARS); + static { // The below jars are required for JBoss AS 6.0 M1, M2, and M3. AS6_CLIENT_JARS.add("lib/jboss-classpool.jar"); AS6_CLIENT_JARS.add("lib/jboss-classpool-scoped.jar"); } -======= - "lib/jboss-dependency.jar", - // The below jars are required for JBoss AS 6.0 M1, M2, and M3. - //"lib/jboss-classpool.jar", - //"lib/jboss-classpool-scoped.jar" - }; ->>>>>>> 2e1a8be... * add support for moving resourcetypes to new locations in the type hierarchy, as well as moving any existing resources of those types (https://bugzilla.redhat.com/show_bug.cgi?id=577055)
private final Log log = LogFactory.getLog(this.getClass());
commit f74b22044b6946864c92c30322c8a07351f8981d Author: Ian P. Springer <ips@jetengine.(none)> Date: Mon May 24 11:17:32 2010 -0400
* add support for moving resourcetypes to new locations in the type hierarchy, as well as moving any existing resources of those types (https://bugzilla.redhat.com/show_bug.cgi?id=577055) * in jboss-as-5 plugin, add new JBoss Messaging singleton type and move existing Topic and Queue types under that type (https://jira.jboss.org/browse/EMBJOPR-303) * turn off PERSIST and MERGE cascading on ResourceType.childResources to give metadata update code a greater level of control * refactor metadata updateTypes() code ** iterate types breadth-first, rather than depth-first ** explicitly update child resources of new resources, since PERSIST cascading is now disabled ** stop using exceptions for code flow * add unique constraint to name+plugin index on RHQ_RESOURCE_TYPE table in dbsetup and dbupgrade scripts * remove bogus Hibernate hints on named query in ResourceType entity (cherry picked from commit 2e1a8be116717c33c91114cb0dd9ac9f254acf10)
Conflicts:
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml index 964c975..7c51ef7 100644 --- a/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml +++ b/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml @@ -25,7 +25,7 @@ <column name="PLUGIN_CONFIG_DEF_ID" type="INTEGER" references="RHQ_CONFIG_DEF(ID)"/> <column name="RES_CONFIG_DEF_ID" type="INTEGER" references="RHQ_CONFIG_DEF(ID)"/>
- <index name="RHQ_RES_TYPE_IDX_PLG_NAME"> + <index name="RHQ_RES_TYPE_IDX_PLG_NAME" unique="true"> <field ref="NAME"/> <field ref="PLUGIN"/> </index> diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index fe8720c..31a7b40 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -2920,6 +2920,15 @@ </schema-directSQL> </schemaSpec>
+ <schemaSpec version="2.86"> + <schema-directSQL> + <statement desc="Make RHQ_RES_TYPE_IDX_PLG_NAME index unique"> + DROP INDEX RHQ_RES_TYPE_IDX_PLG_NAME ; + CREATE UNIQUE INDEX RHQ_RES_TYPE_IDX_PLG_NAME ON RHQ_RESOURCE_TYPE (name, plugin) + </statement> + </schema-directSQL> + </schemaSpec> + </dbupgrade> </target> </project> diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java index d27a7e5..8f2b158 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java @@ -30,6 +30,7 @@ import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.InventoryStatus; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceCategory; +import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.domain.util.PageOrdering;
import java.util.Arrays; @@ -56,6 +57,7 @@ public class ResourceCriteria extends Criteria { private String filterPluginName; // needs overrides private Integer filterParentResourceId; // needs overrides private String filterParentResourceName; // needs overrides + private Integer filterParentResourceTypeId; // needs overrides private String filterAgentName; // needs overrides private AvailabilityType filterCurrentAvailability; // needs overrides private Long filterStartItime; @@ -104,6 +106,7 @@ public class ResourceCriteria extends Criteria { filterOverrides.put("pluginName", "resourceType.plugin like ?"); filterOverrides.put("parentResourceId", "parentResource.id = ?"); filterOverrides.put("parentResourceName", "parentResource.name like ?"); + filterOverrides.put("parentResourceTypeId", "parentResource.resourceType.id = ?"); filterOverrides.put("agentName", "agent.name like ?"); filterOverrides.put("currentAvailability", "currentAvailability.availabilityType = ?"); filterOverrides.put("startItime", "itime >= ?"); @@ -171,6 +174,10 @@ public class ResourceCriteria extends Criteria { this.filterParentResourceName = filterParentResourceName; }
+ public void addFilterParentResourceTypeId(int filterParentResourceTypeId) { + this.filterParentResourceTypeId = filterParentResourceTypeId; + } + public void addFilterAgentName(String filterAgentName) { this.filterAgentName = filterAgentName; } diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java index 510a729..150266f 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java @@ -356,7 +356,7 @@ import org.rhq.core.domain.util.Summary; @NamedQuery(name = Resource.QUERY_FIND_BY_PARENT_AND_KEY, hints = { @QueryHint(name = "cacheable", value = "true") }, query = "" // + "SELECT r " // + " FROM Resource AS r " // - + " WHERE (:parent = r.parentResource OR :parent IS NULL) " // + + " WHERE (:parent = r.parentResource OR (:parent IS NULL AND r.parentResource IS NULL)) " // + " AND r.resourceKey = :key " // + " AND r.resourceType.plugin = :plugin " // + " AND r.resourceType.name = :typeName"), diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java index 9a779ba..06cbc47 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java @@ -22,10 +22,6 @@ */ package org.rhq.core.domain.resource;
-import java.io.Externalizable; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; import java.io.Serializable; import java.util.ArrayList; import java.util.HashSet; @@ -87,8 +83,7 @@ import org.rhq.core.domain.util.Summary; query = "SELECT rt FROM ResourceType AS rt WHERE LOWER(rt.name) = LOWER(:name)"), @NamedQuery(name = ResourceType.QUERY_FIND_BY_PLUGIN, query = "SELECT rt FROM ResourceType AS rt WHERE rt.plugin = :plugin"), @NamedQuery(name = ResourceType.QUERY_FIND_BY_NAME_AND_PLUGIN, // TODO: QUERY: names are case-sensitive - hints = { @QueryHint(name = "org.hibernate.able", value = "true"), - @QueryHint(name = "org.hibernate.Region", value = "metadata") }, query = "SELECT rt FROM ResourceType AS rt WHERE LOWER(rt.name) = LOWER(:name) AND rt.plugin = :plugin"), + query = "SELECT rt FROM ResourceType AS rt WHERE LOWER(rt.name) = LOWER(:name) AND rt.plugin = :plugin"), @NamedQuery(name = ResourceType.QUERY_FIND_ALL, query = "SELECT rt FROM ResourceType AS rt"), @NamedQuery(name = ResourceType.QUERY_FIND_BY_PARENT_AND_NAME, // TODO: QUERY: Not looking up by the full key, get rid of this query query = "SELECT rt FROM ResourceType AS rt WHERE :parent MEMBER OF rt.parentResourceTypes AND rt.name = :name"), @@ -319,14 +314,15 @@ public class ResourceType implements Serializable, Comparable<ResourceType> { @Column(name = "MTIME") private Long mtime;
- @ManyToMany(mappedBy = "parentResourceTypes", cascade = CascadeType.ALL) + @ManyToMany(mappedBy = "parentResourceTypes", cascade = { CascadeType.REFRESH, CascadeType.REMOVE }) @OrderBy //@Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL) private Set<ResourceType> childResourceTypes;
@ManyToMany(cascade = CascadeType.PERSIST) // persist so self-injecting plugins work - @JoinTable(name = "RHQ_RESOURCE_TYPE_PARENTS", joinColumns = { @JoinColumn(name = "RESOURCE_TYPE_ID") }, inverseJoinColumns = { @JoinColumn(name = "PARENT_RESOURCE_TYPE_ID") }) + @JoinTable(name = "RHQ_RESOURCE_TYPE_PARENTS", joinColumns = { @JoinColumn(name = "RESOURCE_TYPE_ID") }, + inverseJoinColumns = { @JoinColumn(name = "PARENT_RESOURCE_TYPE_ID") }) @OrderBy //@Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL) private Set<ResourceType> parentResourceTypes; diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java index 4e2ce11..c2c3ccd 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java @@ -142,8 +142,8 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe // For performance tracking long start = System.currentTimeMillis();
- log.info("Merging packages for resource ID [" + resourceId + "]. Package count [" - + report.getDeployedPackages().size() + "]"); + log.debug("Merging [" + report.getDeployedPackages().size() + "] packages for Resource with id [" + + resourceId + "]...");
// Load the resource and its installed packages Resource resource = entityManager.find(Resource.class, resourceId); @@ -322,7 +322,7 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe } }
- log.info("Finished merging " + report.getDeployedPackages().size() + " packages in " + log.debug("Finished merging [" + report.getDeployedPackages().size() + "] packages in " + (System.currentTimeMillis() - start) + "ms"); }
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java index 9c90dcb..cded63b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java @@ -143,7 +143,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal, DiscoveryBossRemot mergeResource(root, Resource.ROOT, knownAgent); }
- // do NOT delete this flush/clear - it greatly improves performance + // Do NOT delete this flush+clear - it greatly improves performance. entityManager.flush(); entityManager.clear();
@@ -558,14 +558,19 @@ public class DiscoveryBossBean implements DiscoveryBossLocal, DiscoveryBossRemot * or if the agent didn't know about it to begin with (id was 0). */ ResourceType resourceType = resource.getResourceType(); - existingResource = resourceManager.getResourceByParentAndKey(subjectManager.getOverlord(), resource - .getParentResource(), resource.getResourceKey(), resourceType.getPlugin(), resourceType.getName()); + Resource parent = resource; + while (parent != null && existingResource == null) { + parent = parent.getParentResource(); + existingResource = resourceManager.getResourceByParentAndKey(subjectManager.getOverlord(), parent, + resource.getResourceKey(), resourceType.getPlugin(), resourceType.getName()); + } + if (existingResource != null) { - // we found it, reset the id to what it should be + // We found it - reset the id to what it should be. resource.setId(existingResource.getId()); log.debug(idLogMsg + ": Found resource already in inventory with specified business key"); } else { - log.debug(idLogMsg + ": Unable to find the agent-reported resource by id and business key."); + log.debug(idLogMsg + ": Unable to find the agent-reported resource by id or business key.");
if (resource.getId() != 0) { // existingResource is still null at this point, the resource does not exist in inventory. @@ -588,6 +593,34 @@ public class DiscoveryBossBean implements DiscoveryBossLocal, DiscoveryBossRemot private void updatePreviouslyInventoriedResource(Resource resource, Resource existingResource, Resource parentResource) throws InvalidInventoryReportException { assert (parentResource == null) || (parentResource.getId() != 0); + + ResourceType existingResourceParentType = (existingResource.getParentResource() != null) + ? existingResource.getParentResource().getResourceType() : null; + ResourceType resourceParentType = (resource.getParentResource() != null) + ? resource.getParentResource().getResourceType() : null; + Set<ResourceType> validParentTypes = existingResource.getResourceType().getParentResourceTypes(); + if (validParentTypes != null && !validParentTypes.isEmpty() && + !validParentTypes.contains(existingResourceParentType)) { + // The existing Resource has an invalid parent ResourceType. This may be because its ResourceType was moved + // to a new parent ResourceType, but its new parent was not yet discovered at the time of the type move. See + // if the Resource reported by the Agent has a valid parent type, and, if so, update the existing Resource's + // parent to that type. + + if (validParentTypes.contains(resourceParentType)) { + if (existingResource.getParentResource() != null) { + existingResource.getParentResource().removeChildResource(existingResource); + } + if (resource.getParentResource() != null) { + parentResource = getExistingResource(resource.getParentResource()); + parentResource.addChildResource(existingResource); + } + existingResource.setParentResource(resource.getParentResource()); + } else { + log.debug("Existing Resource " + existingResource + " has invalid parent type (" + + existingResourceParentType + ") and so does plugin-reported Resource " + resource + " (" + + resourceParentType + ") - valid parent types are [" + validParentTypes + "]."); + } + }
// The below block is for Resources that were created via the RHQ GUI, whose descriptions will be null. if (existingResource.getDescription() == null && resource.getDescription() != null) { @@ -620,8 +653,14 @@ public class DiscoveryBossBean implements DiscoveryBossLocal, DiscoveryBossRemot
private boolean initResourceTypes(Resource resource) { ResourceType resourceType; - resourceType = this.resourceTypeManager.getResourceTypeByNameAndPlugin(subjectManager.getOverlord(), resource - .getResourceType().getName(), resource.getResourceType().getPlugin()); + try { + resourceType = this.resourceTypeManager.getResourceTypeByNameAndPlugin(subjectManager.getOverlord(), resource + .getResourceType().getName(), resource.getResourceType().getPlugin()); + } catch (RuntimeException e) { + log.error("Failed to lookup Resource type [" + resource.getResourceType() + "] for reported Resource [" + + resource + "] - this should not have happened."); + return false; + } if (resourceType == null) { log.error("Reported resource [" + resource + "] has an unknown type [" + resource.getResourceType() + "]. The Agent most likely has a plugin named '" + resource.getResourceType().getPlugin() diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java index ddb5a54..fa31afe 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -83,6 +83,7 @@ import org.rhq.enterprise.server.event.EventManagerLocal; import org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerLocal; import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerLocal; import org.rhq.enterprise.server.resource.ResourceManagerLocal; +import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal;
/** * This class manages the metadata for resources. Plugins are registered against this bean so that their metadata can be @@ -121,6 +122,9 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal private ResourceManagerLocal resourceManager;
@EJB + private ResourceTypeManagerLocal resourceTypeManager; + + @EJB private EventManagerLocal eventManager;
@EJB @@ -336,7 +340,7 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal } if (newOrUpdated || forceUpdate) { // Only merge the plugin's ResourceTypes into the DB if the plugin is new or updated or we were forced to - updateTypes(plugin.getName(), rootResourceTypes); + updateTypes(rootResourceTypes); typesUpdated = true; } } @@ -385,7 +389,7 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal * This will assume the MD5 in the database is already correct, so this * method will not take the time to calculate the MD5 again. * - * @param name the name of the plugin whose content is being updated + * @param id the id of the plugin whose content is being updated * @param file the plugin file whose content will be streamed to the database * * @throws Exception @@ -398,7 +402,6 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal FileInputStream fis = new FileInputStream(file);
try { - conn = this.dataSource.getConnection(); ps = conn.prepareStatement("UPDATE " + Plugin.TABLE_NAME + " SET CONTENT = ? WHERE ID = ?"); ps.setBinaryStream(1, new BufferedInputStream(fis), (int) file.length()); @@ -418,10 +421,16 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal return; }
- private void updateTypes(String pluginName, Set<ResourceType> rootResourceTypes) throws Exception { + private void updateTypes(Set<ResourceType> rootResourceTypes) throws Exception { + // Iterate the resource types breadth-first, so all platform types get added before any server types or platform + // service types. This way, we'll be able to set all of the platform types as parents of the server types and + // platform service types. for (ResourceType rootResourceType : rootResourceTypes) { updateType(rootResourceType); } + for (ResourceType rootResourceType : rootResourceTypes) { + updateTypes(rootResourceType.getChildResourceTypes()); + } }
@SuppressWarnings("unchecked") @@ -493,6 +502,7 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal } }
+ private void removeFromParents(ResourceType typeToBeRemoved) { // Wrap in new HashSet to avoid ConcurrentModificationExceptions. Set<ResourceType> parents = new HashSet<ResourceType>(typeToBeRemoved.getParentResourceTypes()); @@ -503,187 +513,209 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal
@SuppressWarnings("unchecked") private void updateType(ResourceType resourceType) { + entityManager.flush(); + + // see if there is already an existing type that we need to update + if (log.isDebugEnabled()) { + log.debug("Updating resource type [" + resourceType.getName() + "] from plugin [" + + resourceType.getPlugin() + "]..."); + } + + ResourceType existingType; try { - entityManager.flush(); + existingType = resourceTypeManager.getResourceTypeByNameAndPlugin(resourceType.getName(), + resourceType.getPlugin()); + } catch (NonUniqueResultException nure) { + log.debug("Found more than one existing ResourceType for " + resourceType); + // TODO: Delete the redundant ResourceTypes to get the DB into a valid state. + throw new IllegalStateException(nure); + }
- // see if there is already an existing type that we need to update - if (log.isDebugEnabled()) { - log.debug("Updating resource type [" + resourceType.getName() + "] from plugin [" - + resourceType.getPlugin() + "]..."); - } + // Connect the parent types if they exist, which they should. + // We'll do this no matter if the resourceType exists or not - but we use existing vs. resourceType appropriately + // This is to support the case when an existing type gets a new parent resource type in <runs-inside> + updateParentResourceTypes(resourceType, existingType);
- Query q = entityManager.createNamedQuery(ResourceType.QUERY_FIND_BY_NAME_AND_PLUGIN); - q.setParameter("name", resourceType.getName()).setParameter("plugin", resourceType.getPlugin()); - List<ResourceType> findTypeByNameAndPlugin = q.getResultList(); + if (existingType == null) { + persistNewType(resourceType); + } else { + mergeExistingType(resourceType, existingType); + } + }
- ResourceType existingType = null; - if (findTypeByNameAndPlugin.size() == 1) { - existingType = findTypeByNameAndPlugin.get(0); - } + private void mergeExistingType(ResourceType resourceType, ResourceType existingType) { + log.info("Merging type [" + resourceType + "] + into existing type [" + existingType + "]...");
- // Connect the parent types if they exist which they should - // We'll do this no matter if the resourceType exists or not - but we use existing vs. resourceType appropriately - // This is to support the case when an existing type gets a new parent resource type in <runs-inside> - updateParentResourceTypes(resourceType, existingType); + // Make sure to first add/update any subcategories on the parent before trying to update children. + // Otherwise, the children may try to save themselves with subcategories which wouldn't exist yet. + updateChildSubCategories(resourceType, existingType);
- if (findTypeByNameAndPlugin.size() == 0) { - throw new NoResultException(); // falls into the catch block down below. TODO refactor this stuff - } + entityManager.flush();
- // XXX: I do not think the code in this if-block is valid - see RHQ-1086 - I think it should be removed - // see what we have. Default is 0 or 1. When hot deploying and moving a RT 2 can happen - if (findTypeByNameAndPlugin.size() > 1) { - // No Unique result. List what we have and bail out if more than 2 results - if (log.isDebugEnabled()) { - for (ResourceType rType : findTypeByNameAndPlugin) { - log.debug("updateType: found: " + rType); - } - } + // even though we've updated our child types to use new subcategory references, its still + // not safe to delete the old sub categories yet, because we haven't yet deleted all of the old + // child types which may still be referencing these sub categories
- if (findTypeByNameAndPlugin.size() != 2) { - throw new IllegalArgumentException("We only expected two results here, but got " - + findTypeByNameAndPlugin.size()); - } + // Update the rest of these related resources + updatePluginConfiguration(resourceType, existingType); + entityManager.flush();
- // two results - see if one is us, then the other must be the existing type that we are looking for - Iterator<ResourceType> iter = findTypeByNameAndPlugin.iterator(); - ResourceType rt1 = iter.next(); - ResourceType rt2 = iter.next(); - if (rt1.equals(resourceType)) { - existingType = rt2; - } else if (rt2.equals(resourceType)) { - existingType = rt1; - } else { - throw new IllegalArgumentException("Existing ResourceType not found for " + resourceType); - } - } + updateResourceConfiguration(resourceType, existingType);
- // Type exists now, (if it didn't exist we'd fall through to the NSRE catch block and cascade persist everything + updateMeasurementDefinitions(resourceType, existingType);
- // first add/update any subcategories on the parent before trying to update children - // if we didn't do this the children may try to save themselves with subcategories which - // wouldn't exist yet - updateChildSubCategories(resourceType, existingType); + updateContentDefinitions(resourceType, existingType);
- // update children next - for (ResourceType childType : resourceType.getChildResourceTypes()) { - updateType(childType); - } - entityManager.flush(); - - // even though we've updated our child types to use new subcategory references, its still - // not safe to delete the old sub categories yet, because we haven't yet deleted all of the old - // child types which may still be referencing these sub categories - - // Update the rest of these related resources - updatePluginConfiguration(resourceType, existingType); - entityManager.flush(); - - updateResourceConfiguration(resourceType, existingType); - - updateMeasurementDefinitions(resourceType, existingType); - - updateContentDefinitions(resourceType, existingType); - - updateOperationDefinitions(resourceType, existingType); - - updateProcessScans(resourceType, existingType); - - updateEventDefinitions(resourceType, existingType); - - // Update the type itself - existingType.setDescription(resourceType.getDescription()); - existingType.setCreateDeletePolicy(resourceType.getCreateDeletePolicy()); - existingType.setCreationDataType(resourceType.getCreationDataType()); - existingType.setSingleton(resourceType.isSingleton()); - existingType.setSupportsManualAdd(resourceType.isSupportsManualAdd()); - - /* - * We need to be careful updating the subcategory. If it is not null and the same ("equals") - * to the new one, we need to copy over the attributes, as the existing will be kept and - * the new one not persisted. Otherwise, we can just use the new one. - */ - ResourceSubCategory oldSubCat = existingType.getSubCategory(); - ResourceSubCategory newSubCat = resourceType.getSubCategory(); - if (oldSubCat != null && oldSubCat.equals(newSubCat)) { - // Subcategory hasn't changed - nothing to do (call to addAndUpdateChildSubCategories() - // above already took care of any modifications to the ResourceSubCategorys themselves). - } else if (newSubCat == null) { - if (oldSubCat != null) { - log.debug("Metadata update: Subcategory of ResourceType [" + resourceType.getName() - + "] changed from " + oldSubCat + " to " + newSubCat); - existingType.setSubCategory(null); - } - } else { - // New subcategory is non-null and not equal to the old subcategory. - ResourceSubCategory existingSubCat = SubCategoriesMetadataParser.findSubCategoryOnResourceTypeAncestor( - existingType, newSubCat.getName()); - if (existingSubCat == null) - throw new IllegalStateException("Resource type [" + resourceType.getName() + "] in plugin [" - + resourceType.getPlugin() + "] has a subcategory (" + newSubCat.getName() - + ") which was not defined as a child subcategory of one of its ancestor resource types."); - log.debug("Metadata update: Subcategory of ResourceType [" + resourceType.getName() + "] changed from " - + oldSubCat + " to " + existingSubCat); - existingType.setSubCategory(existingSubCat); - } + updateOperationDefinitions(resourceType, existingType);
- existingType = entityManager.merge(existingType); - entityManager.flush(); - } catch (NoResultException nre) { - /* - * If the type didn't exist then we'll persist here which will cascade through - * all child types as well as plugin and resource configs and their delegate types and - * metric and operation definitions and their dependent types - * - * But first do some validity checking - */ - - // Check if the subcategories as children of resourceType are valid - // Those are the subtacegories we offer for children of us - checkForValidSubcategories(resourceType.getChildSubCategories()); - - // Check if we have a subcategory attached that needs to be linked to one of the parents - // This is a subcategory of our parent where we are supposed to be grouped in. - linkSubCategoryToParents(resourceType); - - if (log.isDebugEnabled()) - log.debug("Persisting new ResourceType: " + resourceType); - entityManager.persist(resourceType); - } catch (NonUniqueResultException nure) { - log.debug("Found more than one existing ResourceType for " + resourceType); - throw new IllegalStateException(nure); + updateProcessScans(resourceType, existingType); + + updateEventDefinitions(resourceType, existingType); + + // Update the type itself + existingType.setDescription(resourceType.getDescription()); + existingType.setCreateDeletePolicy(resourceType.getCreateDeletePolicy()); + existingType.setCreationDataType(resourceType.getCreationDataType()); + existingType.setSingleton(resourceType.isSingleton()); + existingType.setSupportsManualAdd(resourceType.isSupportsManualAdd()); + + // We need to be careful updating the subcategory. If it is not null and the same ("equals") + // to the new one, we need to copy over the attributes, as the existing will be kept and + // the new one not persisted. Otherwise, we can just use the new one. + ResourceSubCategory oldSubCat = existingType.getSubCategory(); + ResourceSubCategory newSubCat = resourceType.getSubCategory(); + if (oldSubCat != null && oldSubCat.equals(newSubCat)) { + // Subcategory hasn't changed - nothing to do (call to addAndUpdateChildSubCategories() + // above already took care of any modifications to the ResourceSubCategories themselves). + } else if (newSubCat == null) { + if (oldSubCat != null) { + log.debug("Metadata update: Subcategory of ResourceType [" + resourceType.getName() + + "] changed from " + oldSubCat + " to " + newSubCat); + existingType.setSubCategory(null); + } + } else { + // New subcategory is non-null and not equal to the old subcategory. + ResourceSubCategory existingSubCat = SubCategoriesMetadataParser.findSubCategoryOnResourceTypeAncestor( + existingType, newSubCat.getName()); + if (existingSubCat == null) + throw new IllegalStateException("Resource type [" + resourceType.getName() + "] in plugin [" + + resourceType.getPlugin() + "] has a subcategory (" + newSubCat.getName() + + ") which was not defined as a child subcategory of one of its ancestor resource types."); + log.debug("Metadata update: Subcategory of ResourceType [" + resourceType.getName() + "] changed from " + + oldSubCat + " to " + existingSubCat); + existingType.setSubCategory(existingSubCat); } + + existingType = entityManager.merge(existingType); + entityManager.flush(); }
- private void linkSubCategoryToParents(ResourceType resourceType) { + private void persistNewType(ResourceType resourceType) { + log.info("Persisting new type [" + resourceType + "]..."); + // If the type didn't exist then we'll persist here which will cascade through + // all child types as well as plugin and resource configs and their delegate types and + // metric and operation definitions and their dependent types, + // but first do some validity checking. + + // Check if the subcategories as children of resourceType are valid + // Those are the subcategories we offer for children of us + checkForValidSubcategories(resourceType.getChildSubCategories());
- if (resourceType.getSubCategory() == null) + // Check if we have a subcategory attached that needs to be linked to one of the parents + // This is a subcategory of our parent where we are supposed to be grouped in. + linkSubCategoryToParents(resourceType); + + entityManager.persist(resourceType); + entityManager.flush(); + } + + private void linkSubCategoryToParents(ResourceType resourceType) { + if (resourceType.getSubCategory() == null) { return; // Nothing to do + }
ResourceSubCategory mySubCategory = resourceType.getSubCategory(); ResourceSubCategory existingCat = SubCategoriesMetadataParser.findSubCategoryOnResourceTypeAncestor( resourceType, mySubCategory.getName()); - if (existingCat != null) + if (existingCat != null) { resourceType.setSubCategory(existingCat); - else + } else { throw new IllegalStateException("Subcategory " + mySubCategory.getName() + " defined on resource type " + resourceType.getName() + " in plugin " + resourceType.getPlugin() + " is not defined in a parent type"); - + } }
- private void updateParentResourceTypes(ResourceType resourceType, ResourceType existingType) { - Set<ResourceType> types = new HashSet<ResourceType>(resourceType.getParentResourceTypes()); - resourceType.setParentResourceTypes(new HashSet<ResourceType>()); - for (ResourceType resourceTypeParent : types) { + private void updateParentResourceTypes(ResourceType newType, ResourceType existingType) { + Set<ResourceType> newParentTypes = newType.getParentResourceTypes(); + log.info("Setting parent types on type: " + ((existingType != null) ? existingType : newType ) + + " to [" + newParentTypes + "]..."); + newType.setParentResourceTypes(new HashSet<ResourceType>()); + Set<ResourceType> originalExistingParentTypes = new HashSet<ResourceType>(); + if (existingType != null) { + originalExistingParentTypes.addAll(existingType.getParentResourceTypes()); + } + for (ResourceType newParentType : newParentTypes) { try { - ResourceType realParentType = (ResourceType) entityManager.createNamedQuery( - ResourceType.QUERY_FIND_BY_NAME_AND_PLUGIN).setParameter("name", resourceTypeParent.getName()) - .setParameter("plugin", resourceTypeParent.getPlugin()).getSingleResult(); - realParentType.addChildResourceType(existingType != null ? existingType : resourceType); + boolean parentNew = existingType == null || !originalExistingParentTypes.remove(newParentType) ; + if (parentNew) { + ResourceType realParentType = (ResourceType) entityManager.createNamedQuery( + ResourceType.QUERY_FIND_BY_NAME_AND_PLUGIN).setParameter("name", newParentType.getName()) + .setParameter("plugin", newParentType.getPlugin()).getSingleResult(); + ResourceType type = (existingType != null) ? existingType : newType; + log.info("Adding type [" + type + "] as child of type [" + realParentType + "]..."); + realParentType.addChildResourceType(type); + } } catch (NoResultException nre) { - throw new RuntimeException("Couldn't persist type [" + resourceType - + "] because parent wasn't already persisted [" + resourceTypeParent + "]"); + throw new RuntimeException("Couldn't persist type [" + newType + + "] because parent [" + newParentType + "] wasn't already persisted."); + } + } + + for (ResourceType obsoleteParentType : originalExistingParentTypes) { + log.info("Removing type [" + existingType + "] from parent type [" + obsoleteParentType + "]..."); + obsoleteParentType.removeChildResourceType(existingType); + moveResourcesToNewParent(existingType, obsoleteParentType, newParentTypes); + } + + entityManager.flush(); + } + + private void moveResourcesToNewParent(ResourceType existingType, ResourceType obsoleteParentType, Set<ResourceType> newParentTypes) { + Subject overlord = subjectManager.getOverlord(); + ResourceCriteria criteria = new ResourceCriteria(); + criteria.addFilterResourceTypeId(existingType.getId()); + criteria.addFilterParentResourceTypeId(obsoleteParentType.getId()); + List<Resource> resources = resourceManager.findResourcesByCriteria(overlord, criteria); + for (Resource resource : resources) { + Resource newParent = null; + newParentTypes: + for (ResourceType newParentType : newParentTypes) { + Resource ancestorResource = resource.getParentResource(); + while (ancestorResource != null) { + if (ancestorResource.getResourceType().equals(newParentType)) { + // We found an ancestor to be the new parent of our orphaned Resource. + newParent = ancestorResource; + break newParentTypes; + } + ancestorResource = ancestorResource.getParentResource(); + } + for (Resource childResource : resource.getChildResources()) { + if (childResource.getResourceType().equals(newParentType)) { + // We found a child to be the new parent of our orphaned Resource. + newParent = childResource; + break newParentTypes; + } + } + } + if (newParent != null) { + if (resource.getParentResource() != null) { + resource.getParentResource().removeChildResource(resource); + } + newParent.addChildResource(resource); + } else { + log.warn("We were unable to move " + resource + " from invalid parent " + resource.getParentResource() + + " to a new valid parent with one of the following types: " + newParentTypes); } } } diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateResourceTypeSubsystemTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateResourceTypeSubsystemTest.java index 646c661..bda11e9 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateResourceTypeSubsystemTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateResourceTypeSubsystemTest.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -18,7 +18,6 @@ */ package org.rhq.enterprise.server.resource.metadata.test;
-import java.util.Iterator; import java.util.Set;
import javax.persistence.EntityManager; @@ -31,7 +30,7 @@ import org.rhq.core.domain.measurement.MeasurementDefinition; import org.rhq.core.domain.resource.ResourceType;
/** - * Note, plugins are registered in new transactions. for tests, this means + * Note, plugins are registered in new transactions. For tests, this means * you can't do everything in a trans and roll back at the end. You must clean up manually. */ public class UpdateResourceTypeSubsystemTest extends UpdateSubsytemTestBase { @@ -44,7 +43,7 @@ public class UpdateResourceTypeSubsystemTest extends UpdateSubsytemTestBase { /** * See if deletion of a resource type just works * - * @throws Exception + * @throws Exception on error */ @Test public void testResourceTypeDeletion() throws Exception { @@ -113,16 +112,18 @@ public class UpdateResourceTypeSubsystemTest extends UpdateSubsytemTestBase { try { cleanupTest(); } catch (Exception e) { - System.out.println("CANNNOT CLEAN UP TEST: " + this.getClass().getSimpleName() + System.out.println("CANNOT CLEAN UP TEST: " + this.getClass().getSimpleName() + ".testResourceTypeDeletion"); } } }
- // TODO: Fix ResourceType move in the code and then re-enable this test. - //@Test - public void testMoveResoureType() throws Exception { - System.out.println("testUpdatePlugin2 --- start"); + @Test + /** + * Tests moving a resource type to a new parent resource type. + */ + public void testMoveResourceType() throws Exception { + System.out.println("testMoveResourceType --- start"); try { registerPlugin("update2-v1_0.xml"); ResourceType platform1 = getResourceType("myPlatform"); @@ -149,7 +150,7 @@ public class UpdateResourceTypeSubsystemTest extends UpdateSubsytemTestBase { int definitionId = defThree.getId(); // get the id of the definition "Three" and save it for later use getTransactionManager().rollback();
- System.out.println("testUpdatePlugin2 -- done with the first plugin version"); + System.out.println("testMoveResourceType -- done with the first plugin version");
/* * The nested service got pulled out and put under platform @@ -168,9 +169,7 @@ public class UpdateResourceTypeSubsystemTest extends UpdateSubsytemTestBase { // two children in v2 Set<ResourceType> platformChildren2 = platform2.getChildResourceTypes(); assert platformChildren2.size() == 2 : "Expected 2 direct child services of platform in v2"; - Iterator<ResourceType> iter = platformChildren2.iterator(); - while (iter.hasNext()) { - ResourceType type = iter.next(); + for (ResourceType type : platformChildren2) { String typeName = type.getName(); assert type.getMetricDefinitions().size() == 1 : "Expected one definition for " + typeName + " in v2"; if (typeName.equals("nestedOne")) // The moved one @@ -178,23 +177,21 @@ public class UpdateResourceTypeSubsystemTest extends UpdateSubsytemTestBase { Set<MeasurementDefinition> defs3 = type.getMetricDefinitions(); MeasurementDefinition three = defs3.iterator().next(); assert three.getDisplayName().equals("Three") : "Expected the nestedOne to have a metric withDisplayName Three in v2, but it was " - + three.getDisplayName(); + + three.getDisplayName(); assert three.getDisplayType() == DisplayType.SUMMARY : "Expected three to be SUMMARY in v2";
/* * TODO check here if the Definition is the one from above which got moved. this should be the case. - * Else we would loose all measurment schedules (and disociate them from measurement data. But the - * later is a different story. We probably should cascade that anyway. + * Else we would loose all measurement schedules (and disassociate them from measurement data. But the + * latter is a different story. We probably should cascade that anyway. */ - System.out.println("Expected the id of 'Three' to be " + definitionId + " but it was " - + three.getId() + " in v2"); assert three.getId() == definitionId : "Expected the id of 'Three' to be " + definitionId - + " but it was " + three.getId() + " in v2"; + + " but it was " + three.getId() + " in v2"; } else if (typeName.equals("service1")) { // check that the nested service is gone Set<ResourceType> childrenOfService = type.getChildResourceTypes(); assert childrenOfService.size() == 0 : "No children of 'service1' expected in v2, but found: " - + childrenOfService.size(); + + childrenOfService.size(); } else { assert true == false : "We found an unknown type with name " + typeName; } @@ -209,23 +206,23 @@ public class UpdateResourceTypeSubsystemTest extends UpdateSubsytemTestBase { cleanupTest(); } catch (Exception e) { System.out - .println("CANNNOT CLEAN UP TEST: " + this.getClass().getSimpleName() + ".testMoveResoureType"); + .println("CANNOT CLEAN UP TEST: " + this.getClass().getSimpleName() + ".testMoveResourceType"); } }
- System.out.println("testUpdatePlugin2 --- end"); + System.out.println("testMoveResourceType --- end"); }
@Test public void testDuplicateResourceType() throws Exception { System.out.println("= testDuplicateResourceType"); try { - System.out.println(" A stack trace coming out of this is expected"); + System.out.println("NOTE: A stack trace coming out of this is expected."); registerPlugin("duplicateResourceType.xml"); getResourceType("ops"); assert false : "We should not have hit this line"; } catch (Exception e) { - ; // We expect an exception to come out of the ResourceMetadataManager + // ignore - We expect an exception to come out of the ResourceMetadataManager } finally { if (Status.STATUS_NO_TRANSACTION != getTransactionManager().getStatus()) { getTransactionManager().rollback(); @@ -233,7 +230,7 @@ public class UpdateResourceTypeSubsystemTest extends UpdateSubsytemTestBase { try { cleanupTest(); } catch (Exception e) { - System.out.println("CANNNOT CLEAN UP TEST: " + this.getClass().getSimpleName() + System.out.println("CANNOT CLEAN UP TEST: " + this.getClass().getSimpleName() + ".testDuplicateResourceType"); } } diff --git a/modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml b/modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml index 559e38d..143984d 100644 --- a/modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml +++ b/modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml @@ -9,7 +9,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.B04</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> @@ -24,7 +24,7 @@ <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/jopr/tools/jbas5-plugin-descriptor-gen/</developerConnection> </scm>
- <properties> + <properties> <jbossas.version>6.0.0.M1</jbossas.version> </properties>
@@ -58,15 +58,30 @@ <dependency> <groupId>${rhq.groupId}</groupId> <artifactId>rhq-core-domain</artifactId> - <version>${rhq.version}</version> + <version>${project.version}</version> </dependency>
<dependency> <groupId>${rhq.groupId}</groupId> <artifactId>rhq-core-client-api</artifactId> - <version>${rhq.version}</version> + <version>${project.version}</version> </dependency>
+ <dependency> + <groupId>javax.persistence</groupId> + <artifactId>persistence-api</artifactId> + <version>1.0</version> + <scope>provided</scope> <!-- by JBossAS --> + </dependency> + + <dependency> + <groupId>hibernate-annotations</groupId> + <artifactId>hibernate-annotations</artifactId> + <!-- NOTE: The version is defined in the root POM's dependencyManagemen +t section. --> + <scope>provided</scope> <!-- by JBossAS --> + </dependency> + <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> diff --git a/modules/jopr/tools/jbas5-plugin-descriptor-gen/src/main/java/org/jboss/jopr/tool/jbas5/PluginDescriptorGenerator.java b/modules/jopr/tools/jbas5-plugin-descriptor-gen/src/main/java/org/jboss/jopr/tool/jbas5/PluginDescriptorGenerator.java index a4df7ba..7551e42 100644 --- a/modules/jopr/tools/jbas5-plugin-descriptor-gen/src/main/java/org/jboss/jopr/tool/jbas5/PluginDescriptorGenerator.java +++ b/modules/jopr/tools/jbas5-plugin-descriptor-gen/src/main/java/org/jboss/jopr/tool/jbas5/PluginDescriptorGenerator.java @@ -105,8 +105,8 @@ public class PluginDescriptorGenerator public static void main(String[] args) throws Exception { String namingURL = "jnp://127.0.0.1:1099/"; - String principal = null; - String credentials = null; + String principal = "admin"; + String credentials = "admin"; ProfileServiceConnectionProvider connectionProvider = new RemoteProfileServiceConnectionProvider(namingURL, principal, credentials); ProfileServiceConnection connection = connectionProvider.connect(); diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/AbstractManagedComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/AbstractManagedComponent.java index b436302..bde5b37 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/AbstractManagedComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/AbstractManagedComponent.java @@ -47,7 +47,7 @@ public abstract class AbstractManagedComponent implements ProfileServiceComponen return; }
- protected ResourceContext<ProfileServiceComponent> getResourceContext() + public ResourceContext<ProfileServiceComponent> getResourceContext() { return this.resourceContext; } diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java index 739d833..e4a0ec9 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java @@ -102,6 +102,7 @@ import org.rhq.plugins.jbossas5.connection.RemoteProfileServiceConnectionProvide import org.rhq.plugins.jbossas5.deploy.Deployer; import org.rhq.plugins.jbossas5.deploy.LocalDeployer; import org.rhq.plugins.jbossas5.deploy.RemoteDeployer; +import org.rhq.plugins.jbossas5.helper.CreateChildResourceFacetDelegate; import org.rhq.plugins.jbossas5.helper.JBossAS5ConnectionTypeDescriptor; import org.rhq.plugins.jbossas5.helper.JmxConnectionHelper; import org.rhq.plugins.jbossas5.helper.InPluginControlActionFacade; @@ -122,8 +123,6 @@ import com.jboss.jbossnetwork.product.jbpm.handlers.ControlActionFacade; public class ApplicationServerComponent implements ResourceComponent, ProfileServiceComponent, CreateChildResourceFacet, MeasurementFacet, ConfigurationFacet, ProgressListener, ContentFacet, OperationFacet {
- private static final String MANAGED_PROPERTY_GROUP = "managedPropertyGroup"; - private static final Pattern METRIC_NAME_PATTERN = Pattern.compile("(.*)\|(.*)\|(.*)\|(.*)");
public static final Map<String, String> NEW_PROPERTY_NAMES = new HashMap<String, String>(); @@ -142,6 +141,7 @@ public class ApplicationServerComponent implements ResourceComponent, ProfileSer private ApplicationServerContentFacetDelegate contentFacetDelegate; private ApplicationServerOperationsDelegate operationDelegate; private LogFileEventResourceComponentHelper logFileEventDelegate; + private CreateChildResourceFacetDelegate createChildResourceDelegate;
private AvailabilityCollectorRunnable availCollector;
@@ -205,6 +205,8 @@ public class ApplicationServerComponent implements ResourceComponent, ProfileSer this.contentFacetDelegate = new ApplicationServerContentFacetDelegate(workflowManager, configPath, resourceContext.getContentContext());
+ this.createChildResourceDelegate = new CreateChildResourceFacetDelegate(this); + // prepare to perform async avail checking Configuration pc = resourceContext.getPluginConfiguration(); String availCheckPeriodProp = pc.getSimpleValue(ApplicationServerPluginConfigurationProperties.AVAIL_CHECK_PERIOD_CONFIG_PROP, null); @@ -330,13 +332,7 @@ public class ApplicationServerComponent implements ResourceComponent, ProfileSer // CreateChildResourceFacet --------------------------------------------
public CreateResourceReport createResource(CreateResourceReport createResourceReport) { - // ProfileServiceFactory.refreshCurrentProfileView(); - ResourceType resourceType = createResourceReport.getResourceType(); - if (resourceType.getCreationDataType() == ResourceCreationDataType.CONTENT) - createContentBasedResource(createResourceReport, resourceType); - else - createConfigurationBasedResource(createResourceReport, resourceType); - return createResourceReport; + return this.createChildResourceDelegate.createResource(createResourceReport); }
// ProgressListener -------------------------------------------- @@ -426,117 +422,6 @@ public class ApplicationServerComponent implements ResourceComponent, ProfileSer } }
- private void handleMiscManagedProperties(Collection<PropertyDefinition> managedPropertyGroup, - Map<String, ManagedProperty> managedProperties, Configuration pluginConfiguration) { - for (PropertyDefinition propertyDefinition : managedPropertyGroup) { - String propertyKey = propertyDefinition.getName(); - Property property = pluginConfiguration.get(propertyKey); - ManagedProperty managedProperty = managedProperties.get(propertyKey); - if (managedProperty != null && property != null) { - PropertyAdapter propertyAdapter = PropertyAdapterFactory.getPropertyAdapter(managedProperty - .getMetaType()); - propertyAdapter.populateMetaValueFromProperty(property, managedProperty.getValue(), propertyDefinition); - } - } - } - - private static String getComponentName(Configuration pluginConfig, Configuration resourceConfig) { - PropertySimple componentNameProp = - pluginConfig.getSimple(ManagedComponentComponent.Config.COMPONENT_NAME_PROPERTY); - if (componentNameProp == null || componentNameProp.getStringValue() == null) { - throw new IllegalStateException("Property [" + ManagedComponentComponent.Config.COMPONENT_NAME_PROPERTY - + "] is not defined in the default plugin configuration."); - } - String componentNamePropName = componentNameProp.getStringValue(); - PropertySimple propToUseAsComponentName = resourceConfig.getSimple(componentNamePropName); - if (propToUseAsComponentName == null) { - throw new IllegalStateException("Property [" + componentNamePropName - + "] is not defined in user-specified initial Resource configuration."); - } - return propToUseAsComponentName.getStringValue(); - } - - private void createConfigurationBasedResource(CreateResourceReport createResourceReport, ResourceType resourceType) { - Configuration defaultPluginConfig = getDefaultPluginConfiguration(resourceType); - Configuration resourceConfig = createResourceReport.getResourceConfiguration(); - String componentName = getComponentName(defaultPluginConfig, resourceConfig); - ComponentType componentType = ConversionUtils.getComponentType(resourceType); - ManagementView managementView = getConnection().getManagementView(); - if (ManagedComponentUtils.isManagedComponent(managementView, componentName, componentType)) { - createResourceReport.setStatus(CreateResourceStatus.FAILURE); - createResourceReport.setErrorMessage("A " + resourceType.getName() + " named '" + componentName - + "' already exists."); - return; - } - - // The PC doesn't use the Resource name or key for anything, but set them anyway to make it happy. - createResourceReport.setResourceName(componentName); - createResourceReport.setResourceKey(componentName); - - PropertySimple templateNameProperty = defaultPluginConfig - .getSimple(ManagedComponentComponent.Config.TEMPLATE_NAME); - String templateName = templateNameProperty.getStringValue(); - - DeploymentTemplateInfo template; - try { - template = managementView.getTemplate(templateName); - Map<String, ManagedProperty> managedProperties = template.getProperties(); - Map<String, PropertySimple> customProps = ResourceComponentUtils.getCustomProperties(defaultPluginConfig); - - if (log.isDebugEnabled()) - log.debug("BEFORE CREATE:\n" + DebugUtils.convertPropertiesToString(template)); - ConversionUtils.convertConfigurationToManagedProperties(managedProperties, resourceConfig, resourceType, - customProps); - if (log.isDebugEnabled()) - log.debug("AFTER CREATE:\n" + DebugUtils.convertPropertiesToString(template)); - - ConfigurationDefinition pluginConfigDef = resourceType.getPluginConfigurationDefinition(); - Collection<PropertyDefinition> managedPropertyGroup = pluginConfigDef - .getPropertiesInGroup(MANAGED_PROPERTY_GROUP); - handleMiscManagedProperties(managedPropertyGroup, managedProperties, defaultPluginConfig); - log.debug("Applying template [" + templateName + "] to create ManagedComponent of type [" + componentType - + "]..."); - try { - managementView.applyTemplate(componentName, template); - managementView.process(); - createResourceReport.setStatus(CreateResourceStatus.SUCCESS); - } catch (Exception e) { - log.error("Unable to apply template [" + templateName + "] to create ManagedComponent of type " - + componentType + ".", e); - createResourceReport.setStatus(CreateResourceStatus.FAILURE); - createResourceReport.setException(e); - } - } catch (NoSuchDeploymentException e) { - log.error("Unable to find template [" + templateName + "].", e); - createResourceReport.setStatus(CreateResourceStatus.FAILURE); - createResourceReport.setException(e); - } catch (Exception e) { - log.error("Unable to process create request", e); - createResourceReport.setStatus(CreateResourceStatus.FAILURE); - createResourceReport.setException(e); - } - } - - private void createContentBasedResource(CreateResourceReport createResourceReport, ResourceType resourceType) { - getDeployer().deploy(createResourceReport, resourceType); - } - - private Deployer getDeployer() { - ProfileServiceConnection profileServiceConnection = getConnection(); - if (runningEmbedded()) { - return new LocalDeployer(profileServiceConnection); - } else { - return new RemoteDeployer(profileServiceConnection, this.resourceContext); - } - } - - private static Configuration getDefaultPluginConfiguration(ResourceType resourceType) { - ConfigurationTemplate pluginConfigDefaultTemplate = resourceType.getPluginConfigurationDefinition() - .getDefaultTemplate(); - return (pluginConfigDefaultTemplate != null) ? pluginConfigDefaultTemplate.createConfiguration() - : new Configuration(); - } - @NotNull private JBossASPaths getJBossASPaths() { Configuration pluginConfiguration = this.resourceContext.getPluginConfiguration(); @@ -594,6 +479,7 @@ public class ApplicationServerComponent implements ResourceComponent, ProfileSer return propValue; }
+ @NotNull public ResourceContext getResourceContext() { return this.resourceContext; } 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 c5eb7a9..c1457f0 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 @@ -94,6 +94,7 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom "common/lib/jboss-security-aspects.jar", "lib/jboss-managed.jar", "lib/jboss-metatype.jar", +<<<<<<< HEAD "lib/jboss-dependency.jar" );
@@ -109,6 +110,13 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom AS6_CLIENT_JARS.add("lib/jboss-classpool.jar"); AS6_CLIENT_JARS.add("lib/jboss-classpool-scoped.jar"); } +======= + "lib/jboss-dependency.jar", + // The below jars are required for JBoss AS 6.0 M1, M2, and M3. + //"lib/jboss-classpool.jar", + //"lib/jboss-classpool-scoped.jar" + }; +>>>>>>> 2e1a8be... * add support for moving resourcetypes to new locations in the type hierarchy, as well as moving any existing resources of those types (https://bugzilla.redhat.com/show_bug.cgi?id=577055)
private final Log log = LogFactory.getLog(this.getClass());
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerPluginConfigurationProperties.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerPluginConfigurationProperties.java index c1bf979..c87a82f 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerPluginConfigurationProperties.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerPluginConfigurationProperties.java @@ -26,21 +26,21 @@ package org.rhq.plugins.jbossas5; * @author Ian Springer */ public class ApplicationServerPluginConfigurationProperties { - static final String SERVER_NAME = "serverName"; - static final String NAMING_URL = "namingURL"; - static final String PRINCIPAL = "principal"; - static final String CREDENTIALS = "credentials"; - static final String HOME_DIR = "homeDir"; - static final String SERVER_HOME_DIR = "serverHomeDir"; - static final String JAVA_HOME = "javaHome"; - static final String BIND_ADDRESS = "bindAddress"; - static final String START_SCRIPT_CONFIG_PROP = "startScript"; - static final String SHUTDOWN_SCRIPT_CONFIG_PROP = "shutdownScript"; - static final String SHUTDOWN_MBEAN_CONFIG_PROP = "shutdownMBeanName"; - static final String SHUTDOWN_MBEAN_OPERATION_CONFIG_PROP = "shutdownMBeanOperation"; - static final String SHUTDOWN_METHOD_CONFIG_PROP = "shutdownMethod"; - static final String SCRIPT_PREFIX_CONFIG_PROP = "scriptPrefix"; - static final String AVAIL_CHECK_PERIOD_CONFIG_PROP = "availabilityCheckPeriod"; + public static final String SERVER_NAME = "serverName"; + public static final String NAMING_URL = "namingURL"; + public static final String PRINCIPAL = "principal"; + public static final String CREDENTIALS = "credentials"; + public static final String HOME_DIR = "homeDir"; + public static final String SERVER_HOME_DIR = "serverHomeDir"; + public static final String JAVA_HOME = "javaHome"; + public static final String BIND_ADDRESS = "bindAddress"; + public static final String START_SCRIPT_CONFIG_PROP = "startScript"; + public static final String SHUTDOWN_SCRIPT_CONFIG_PROP = "shutdownScript"; + public static final String SHUTDOWN_MBEAN_CONFIG_PROP = "shutdownMBeanName"; + public static final String SHUTDOWN_MBEAN_OPERATION_CONFIG_PROP = "shutdownMBeanOperation"; + public static final String SHUTDOWN_METHOD_CONFIG_PROP = "shutdownMethod"; + public static final String SCRIPT_PREFIX_CONFIG_PROP = "scriptPrefix"; + public static final String AVAIL_CHECK_PERIOD_CONFIG_PROP = "availabilityCheckPeriod";
private ApplicationServerPluginConfigurationProperties() { } diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/JBossMessagingComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/JBossMessagingComponent.java new file mode 100644 index 0000000..af47587 --- /dev/null +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/JBossMessagingComponent.java @@ -0,0 +1,70 @@ +/* + * RHQ Management Platform + * Copyright (C) 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, 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.jbossas5; + +import org.rhq.core.domain.measurement.AvailabilityType; +import org.rhq.core.domain.measurement.MeasurementReport; +import org.rhq.core.domain.measurement.MeasurementScheduleRequest; +import org.rhq.core.pluginapi.inventory.CreateChildResourceFacet; +import org.rhq.core.pluginapi.inventory.CreateResourceReport; +import org.rhq.core.pluginapi.inventory.ResourceContext; +import org.rhq.core.pluginapi.measurement.MeasurementFacet; +import org.rhq.plugins.jbossas5.helper.CreateChildResourceFacetDelegate; + +import java.util.Set; + +/** + * The ResourceComponent for the singleton JBoss Messaging ResourceType, which supports creation of two child + * ResourceTypes - Queue and Topic. + * + * @author Ian Springer + */ +public class JBossMessagingComponent extends ManagedComponentComponent + implements CreateChildResourceFacet, MeasurementFacet { + private CreateChildResourceFacetDelegate createChildResourceDelegate; + + public AvailabilityType getAvailability() { + return super.getAvailability(); + } + + public void start(ResourceContext resourceContext) throws Exception { + super.start(resourceContext); + this.createChildResourceDelegate = new CreateChildResourceFacetDelegate(this); + } + + public void stop() { + super.stop(); + } + + // MeasurementFacet --------------------------------------------------- + + public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) throws Exception { + super.getValues(report, requests); + } + + // CreateChildResourceFacet -------------------------------------------- + + public CreateResourceReport createResource(CreateResourceReport createResourceReport) { + return this.createChildResourceDelegate.createResource(createResourceReport); + } +} \ No newline at end of file diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/JBossMessagingDiscoveryComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/JBossMessagingDiscoveryComponent.java new file mode 100644 index 0000000..a88ac44 --- /dev/null +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/JBossMessagingDiscoveryComponent.java @@ -0,0 +1,55 @@ +/* + * RHQ Management Platform + * Copyright (C) 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, 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.jbossas5; + +import org.jboss.managed.api.ManagedComponent; +import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; +import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; +import org.rhq.plugins.jbossas5.util.ManagedComponentUtils; + +import java.util.Set; + +/** + * The ResourceDiscoveryComponent for the singleton JBoss Messaging ResourceType. + * + * @author Ian Springer + */ +public class JBossMessagingDiscoveryComponent extends ManagedComponentDiscoveryComponent<ApplicationServerComponent> { + private static final String DEFAULT_RESOURCE_NAME = "JBoss Messaging"; + + @Override + public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<ApplicationServerComponent> discoveryContext) + throws Exception { + return super.discoverResources(discoveryContext); + } + + @Override + protected String getResourceName(ManagedComponent component) { + return DEFAULT_RESOURCE_NAME; + } + + @Override + protected String getResourceVersion(ManagedComponent component) { + return (String)ManagedComponentUtils.getSimplePropertyValue(component, "providerVersion"); + } +} diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/JBossWebComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/JBossWebComponent.java index 6aec8be..9ac7274 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/JBossWebComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/JBossWebComponent.java @@ -22,6 +22,7 @@ */ package org.rhq.plugins.jbossas5;
+import org.jetbrains.annotations.NotNull; import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.pluginapi.inventory.ResourceContext; import org.rhq.plugins.jbossas5.connection.ProfileServiceConnection; @@ -51,6 +52,11 @@ public class JBossWebComponent implements ProfileServiceComponent<ProfileService return AvailabilityType.UP; }
+ @NotNull + public ResourceContext<ProfileServiceComponent> getResourceContext() { + return this.resourceContext; + } + public ProfileServiceConnection getConnection() { return this.resourceContext.getParentResourceComponent().getConnection(); diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentDiscoveryComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentDiscoveryComponent.java index 4ee766f..a0a62ea 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentDiscoveryComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentDiscoveryComponent.java @@ -1,150 +1,169 @@ -/* -* Jopr Management Platform -* Copyright (C) 2005-2009 Red Hat, Inc. -* All rights reserved. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License, 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.jbossas5; - -import java.util.HashSet; -import java.util.Set; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.jboss.deployers.spi.management.ManagementView; -import org.jboss.managed.api.ComponentType; -import org.jboss.managed.api.ManagedComponent; -import org.rhq.core.domain.configuration.PropertySimple; -import org.rhq.core.domain.resource.ResourceType; -import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; -import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent; -import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; -import org.rhq.plugins.jbossas5.util.ConversionUtils; - -/** - * Discovery component for ManagedComponents exposed by the JBoss AS 5.x Profile Service that will be represented as - * child Resources of the JBoss AS Resource. - * - * @author Jason Dobies - * @author Mark Spritzer - * @author Ian Springer - */ -public class ManagedComponentDiscoveryComponent<P extends ProfileServiceComponent> implements - ResourceDiscoveryComponent<P> { - private final Log log = LogFactory.getLog(this.getClass()); - - public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<P> discoveryContext) - throws Exception { - ResourceType resourceType = discoveryContext.getResourceType(); - log.trace("Discovering " + resourceType.getName() + " Resources..."); - - ManagementView managementView = discoveryContext.getParentResourceComponent().getConnection() - .getManagementView(); - // TODO (ips): Only refresh the ManagementView *once* per runtime discovery scan, rather than every time this - // method is called. Do this by providing a runtime scan id in the ResourceDiscoveryContext. - managementView.load(); - - ComponentType componentType = getComponentType(discoveryContext); - Set<ManagedComponent> components; - try { - components = managementView.getComponentsForType(componentType); - } catch (Exception e) { - throw new IllegalStateException("Failed to get component types for " + resourceType + ".", e); - } - - Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>(components.size()); - /* Create a resource for each managed component found. We know all managed components will be of a - type we're interested in, so we can just add them all. There may be need for multiple iterations - over lists retrieved from different component types, but that is possible through the current API. - */ - for (ManagedComponent component : components) { - if (accept(discoveryContext, component)) { - String resourceName = getResourceName(component); - if (resourceName == null) { - resourceName = component.getName(); - } - String resourceKey = getResourceKey(component); - if (resourceKey == null) { - resourceKey = component.getName(); - } - String version = null; // (ips) I don't think there's anything generic we can do here. - - DiscoveredResourceDetails resource = new DiscoveredResourceDetails(resourceType, resourceKey, - resourceName, version, resourceType.getDescription(), discoveryContext - .getDefaultPluginConfiguration(), null); - - resource.getPluginConfiguration().put( - new PropertySimple(ManagedComponentComponent.Config.COMPONENT_NAME, resourceKey)); - - discoveredResources.add(resource); - } - } - - log.trace("Discovered " + discoveredResources.size() + " " + resourceType.getName() + " Resources."); - return discoveredResources; - } - - protected ComponentType getComponentType(ResourceDiscoveryContext<P> discoveryContext) { - ResourceType resourceType = discoveryContext.getResourceType(); - return ConversionUtils.getComponentType(resourceType); - } - - /** - * Subclasses can override this method if they don't want to use the ManagedComponent name as the initial - * Resource name. - * - * @param component the ManagedComponent being discovered - * @return the name to be assigned to the corresponding Resource - */ - protected String getResourceName(ManagedComponent component) { - return component.getName(); - } - - /** - * Return the unique resource key for the component. - * If you override this method, make sure to override - * {@link ManagedComponentComponent#getManagedComponent()} method as well - * because the return value of this method is used as the component name - * ({@link ManagedComponentComponent#getComponentName()}). - * - * @param component the component to uniquely identify - * @return the unique identifier for the component - */ - protected String getResourceKey(ManagedComponent component) { - return component.getName(); - } - - /** - * This method is called during {@link #discoverResources(ResourceDiscoveryContext)} to determine - * whether given component that has been found in the management view by this component's configured - * component type is applicable in the discovery context. - * <p> - * Because the Profile Service doesn't always provide the components in a hierarchy we present the resources - * we need this method to filter the components into their appropriate places. - * <p> - * This default implementation always returns true. - * - * @param discoveryContext the current discovery context - * @param component the discovered component - * @return true if the component logically belongs in the context, false otherwise. - */ - protected boolean accept(ResourceDiscoveryContext<P> discoveryContext, ManagedComponent component) { - return true; - } -} +/* +* Jopr 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, 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.jbossas5; + +import java.util.HashSet; +import java.util.Set; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.jboss.deployers.spi.management.ManagementView; +import org.jboss.managed.api.ComponentType; +import org.jboss.managed.api.ManagedComponent; +import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; +import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent; +import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; +import org.rhq.plugins.jbossas5.util.ConversionUtils; + +/** + * Discovery component for ManagedComponents exposed by the JBoss AS 5.x Profile Service that will be represented as + * child Resources of the JBoss AS Resource. + * + * @author Jason Dobies + * @author Mark Spritzer + * @author Ian Springer + */ +public class ManagedComponentDiscoveryComponent<P extends ProfileServiceComponent> implements + ResourceDiscoveryComponent<P> { + private final Log log = LogFactory.getLog(this.getClass()); + + public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<P> discoveryContext) + throws Exception { + ResourceType resourceType = discoveryContext.getResourceType(); + log.trace("Discovering " + resourceType.getName() + " Resources..."); + + ManagementView managementView = discoveryContext.getParentResourceComponent().getConnection() + .getManagementView(); + // TODO (ips): Only refresh the ManagementView *once* per runtime discovery scan, rather than every time this + // method is called. Do this by providing a runtime scan id in the ResourceDiscoveryContext. + managementView.load(); + + ComponentType componentType = getComponentType(discoveryContext); + Set<ManagedComponent> components; + try { + components = managementView.getComponentsForType(componentType); + } catch (Exception e) { + throw new IllegalStateException("Failed to get component types for " + resourceType + ".", e); + } + if (resourceType.isSingleton() && components.size() > 1) { + throw new IllegalStateException("Discovered multiple [" + componentType + + "] managed components during [" + resourceType + + "] discovery, but expected to find no more than one - components were: " + components); + } + + Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>(components.size()); + /* Create a resource for each managed component found. We know all managed components will be of a + type we're interested in, so we can just add them all. There may be need for multiple iterations + over lists retrieved from different component types, but that is possible through the current API. + */ + for (ManagedComponent component : components) { + if (accept(discoveryContext, component)) { + String resourceName = getResourceName(component); + if (resourceName == null) { + resourceName = component.getName(); + } + String resourceKey = getResourceKey(component); + if (resourceKey == null) { + resourceKey = component.getName(); + } + + String version = getResourceVersion(component); + + DiscoveredResourceDetails resource = new DiscoveredResourceDetails(resourceType, resourceKey, + resourceName, version, resourceType.getDescription(), discoveryContext + .getDefaultPluginConfiguration(), null); + + resource.getPluginConfiguration().put( + new PropertySimple(ManagedComponentComponent.Config.COMPONENT_NAME, resourceKey)); + + discoveredResources.add(resource); + } + } + + log.trace("Discovered " + discoveredResources.size() + " " + resourceType.getName() + " Resources."); + return discoveredResources; + } + + protected ComponentType getComponentType(ResourceDiscoveryContext<P> discoveryContext) { + ResourceType resourceType = discoveryContext.getResourceType(); + return ConversionUtils.getComponentType(resourceType); + } + + /** + * Subclasses can override this method if they don't want to use the ManagedComponent name as the initial + * Resource name. + * + * @param component the ManagedComponent being discovered + * + * @return the name to be assigned to the corresponding Resource + */ + protected String getResourceName(ManagedComponent component) { + return component.getName(); + } + + /** + * Return the unique resource key for the component. + * If you override this method, make sure to override + * {@link ManagedComponentComponent#getManagedComponent()} method as well + * because the return value of this method is used as the component name + * ({@link ManagedComponentComponent#getComponentName()}). + * + * @param component the component to uniquely identify + * + * @return the unique identifier for the component + */ + protected String getResourceKey(ManagedComponent component) { + return component.getName(); + } + + /** + * Subclasses can override this method if they want the discovered ManagedComponent to have a version. + * + * @param component the ManagedComponent being discovered + * + * @return the version to be assigned to the corresponding Resource + */ + protected String getResourceVersion(ManagedComponent component) { + return null; + } + + /** + * This method is called during {@link #discoverResources(ResourceDiscoveryContext)} to determine + * whether given component that has been found in the management view by this component's configured + * component type is applicable in the discovery context. + * <p> + * Because the Profile Service doesn't always provide the components in a hierarchy we present the resources + * we need this method to filter the components into their appropriate places. + * <p> + * This default implementation always returns true. + * + * @param discoveryContext the current discovery context + * @param component the discovered component + * @return true if the component logically belongs in the context, false otherwise. + */ + protected boolean accept(ResourceDiscoveryContext<P> discoveryContext, ManagedComponent component) { + return true; + } +} diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/PlatformComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/PlatformComponent.java index 1560520..2c8e6d9 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/PlatformComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/PlatformComponent.java @@ -16,6 +16,7 @@ import org.jboss.managed.api.ManagedProperty; import org.jboss.metatype.api.types.MetaType; import org.jboss.metatype.api.values.MetaValue; import org.jboss.profileservice.spi.NoSuchDeploymentException; +import org.jetbrains.annotations.NotNull; import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.measurement.DataType; @@ -44,7 +45,6 @@ import org.mc4j.ems.connection.EmsConnection; public class PlatformComponent implements ProfileServiceComponent<ProfileServiceComponent>, MeasurementFacet, OperationFacet, ConfigurationFacet { - private final Log log = LogFactory.getLog(this.getClass()); private ResourceContext<ProfileServiceComponent> context; private String deployName; @@ -59,11 +59,15 @@ public class PlatformComponent implements }
public void stop() { - // TODO Auto-generated method stub - + return; }
- public ProfileServiceConnection getConnection() { + @NotNull + public ResourceContext<ProfileServiceComponent> getResourceContext() { + return this.context; + } + + public ProfileServiceConnection getConnection() { ApplicationServerComponent component = (ApplicationServerComponent) context .getParentResourceComponent(); return component.getConnection(); @@ -272,5 +276,4 @@ public class PlatformComponent implements } return null; } - } diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ProfileServiceComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ProfileServiceComponent.java index f08f143..4e13a96 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ProfileServiceComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ProfileServiceComponent.java @@ -22,9 +22,11 @@ */ package org.rhq.plugins.jbossas5;
+import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable;
import org.rhq.core.pluginapi.inventory.ResourceComponent; +import org.rhq.core.pluginapi.inventory.ResourceContext; import org.rhq.plugins.jbossas5.connection.ProfileServiceConnection; import org.rhq.plugins.jmx.JMXComponent;
@@ -34,4 +36,7 @@ import org.rhq.plugins.jmx.JMXComponent; public interface ProfileServiceComponent<T extends ResourceComponent> extends ResourceComponent<T>, JMXComponent<T> { @Nullable ProfileServiceConnection getConnection(); + + @NotNull + ResourceContext<T> getResourceContext(); } diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/CreateChildResourceFacetDelegate.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/CreateChildResourceFacetDelegate.java new file mode 100644 index 0000000..c03b435 --- /dev/null +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/CreateChildResourceFacetDelegate.java @@ -0,0 +1,180 @@ +package org.rhq.plugins.jbossas5.helper; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.jboss.deployers.spi.management.ManagementView; +import org.jboss.managed.api.ComponentType; +import org.jboss.managed.api.DeploymentTemplateInfo; +import org.jboss.managed.api.ManagedProperty; +import org.jboss.profileservice.spi.NoSuchDeploymentException; +import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.domain.configuration.Property; +import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; +import org.rhq.core.domain.configuration.definition.ConfigurationTemplate; +import org.rhq.core.domain.configuration.definition.PropertyDefinition; +import org.rhq.core.domain.resource.CreateResourceStatus; +import org.rhq.core.domain.resource.ResourceCreationDataType; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.pluginapi.inventory.CreateChildResourceFacet; +import org.rhq.core.pluginapi.inventory.CreateResourceReport; +import org.rhq.plugins.jbossas5.ApplicationServerPluginConfigurationProperties; +import org.rhq.plugins.jbossas5.ManagedComponentComponent; +import org.rhq.plugins.jbossas5.ProfileServiceComponent; +import org.rhq.plugins.jbossas5.adapter.api.PropertyAdapter; +import org.rhq.plugins.jbossas5.adapter.api.PropertyAdapterFactory; +import org.rhq.plugins.jbossas5.connection.ProfileServiceConnection; +import org.rhq.plugins.jbossas5.deploy.Deployer; +import org.rhq.plugins.jbossas5.deploy.LocalDeployer; +import org.rhq.plugins.jbossas5.deploy.RemoteDeployer; +import org.rhq.plugins.jbossas5.util.ConversionUtils; +import org.rhq.plugins.jbossas5.util.DebugUtils; +import org.rhq.plugins.jbossas5.util.ManagedComponentUtils; +import org.rhq.plugins.jbossas5.util.ResourceComponentUtils; + +import java.util.Collection; +import java.util.Map; + +/** + * @author Ian Springer + */ +public class CreateChildResourceFacetDelegate implements CreateChildResourceFacet { + private static final String MANAGED_PROPERTY_GROUP = "managedPropertyGroup"; + + private final Log log = LogFactory.getLog(this.getClass()); + + private ProfileServiceComponent component; + + public CreateChildResourceFacetDelegate(ProfileServiceComponent component) { + this.component = component; + } + + public CreateResourceReport createResource(CreateResourceReport createResourceReport) { + // ProfileServiceFactory.refreshCurrentProfileView(); + ResourceType resourceType = createResourceReport.getResourceType(); + if (resourceType.getCreationDataType() == ResourceCreationDataType.CONTENT) + createContentBasedResource(createResourceReport, resourceType); + else + createConfigurationBasedResource(createResourceReport, resourceType); + return createResourceReport; + } + + void createConfigurationBasedResource(CreateResourceReport createResourceReport, ResourceType resourceType) { + Configuration defaultPluginConfig = getDefaultPluginConfiguration(resourceType); + Configuration resourceConfig = createResourceReport.getResourceConfiguration(); + String componentName = getComponentName(defaultPluginConfig, resourceConfig); + ComponentType componentType = ConversionUtils.getComponentType(resourceType); + ManagementView managementView = this.component.getConnection().getManagementView(); + if (ManagedComponentUtils.isManagedComponent(managementView, componentName, componentType)) { + createResourceReport.setStatus(CreateResourceStatus.FAILURE); + createResourceReport.setErrorMessage("A " + resourceType.getName() + " named '" + componentName + + "' already exists."); + return; + } + + // The PC doesn't use the Resource name or key for anything, but set them anyway to make it happy. + createResourceReport.setResourceName(componentName); + createResourceReport.setResourceKey(componentName); + + PropertySimple templateNameProperty = defaultPluginConfig + .getSimple(ManagedComponentComponent.Config.TEMPLATE_NAME); + String templateName = templateNameProperty.getStringValue(); + + DeploymentTemplateInfo template; + try { + template = managementView.getTemplate(templateName); + Map<String, ManagedProperty> managedProperties = template.getProperties(); + Map<String, PropertySimple> customProps = ResourceComponentUtils.getCustomProperties(defaultPluginConfig); + + if (log.isDebugEnabled()) + log.debug("BEFORE CREATE:\n" + DebugUtils.convertPropertiesToString(template)); + ConversionUtils.convertConfigurationToManagedProperties(managedProperties, resourceConfig, resourceType, + customProps); + if (log.isDebugEnabled()) + log.debug("AFTER CREATE:\n" + DebugUtils.convertPropertiesToString(template)); + + ConfigurationDefinition pluginConfigDef = resourceType.getPluginConfigurationDefinition(); + Collection<PropertyDefinition> managedPropertyGroup = pluginConfigDef + .getPropertiesInGroup(MANAGED_PROPERTY_GROUP); + handleMiscManagedProperties(managedPropertyGroup, managedProperties, defaultPluginConfig); + log.debug("Applying template [" + templateName + "] to create ManagedComponent of type [" + componentType + + "]..."); + try { + managementView.applyTemplate(componentName, template); + managementView.process(); + createResourceReport.setStatus(CreateResourceStatus.SUCCESS); + } catch (Exception e) { + log.error("Unable to apply template [" + templateName + "] to create ManagedComponent of type " + + componentType + ".", e); + createResourceReport.setStatus(CreateResourceStatus.FAILURE); + createResourceReport.setException(e); + } + } catch (NoSuchDeploymentException e) { + log.error("Unable to find template [" + templateName + "].", e); + createResourceReport.setStatus(CreateResourceStatus.FAILURE); + createResourceReport.setException(e); + } catch (Exception e) { + log.error("Unable to process create request", e); + createResourceReport.setStatus(CreateResourceStatus.FAILURE); + createResourceReport.setException(e); + } + } + + private void createContentBasedResource(CreateResourceReport createResourceReport, ResourceType resourceType) { + getDeployer().deploy(createResourceReport, resourceType); + } + + private static String getComponentName(Configuration pluginConfig, Configuration resourceConfig) { + PropertySimple componentNameProp = + pluginConfig.getSimple(ManagedComponentComponent.Config.COMPONENT_NAME_PROPERTY); + if (componentNameProp == null || componentNameProp.getStringValue() == null) { + throw new IllegalStateException("Property [" + ManagedComponentComponent.Config.COMPONENT_NAME_PROPERTY + + "] is not defined in the default plugin configuration."); + } + String componentNamePropName = componentNameProp.getStringValue(); + PropertySimple propToUseAsComponentName = resourceConfig.getSimple(componentNamePropName); + if (propToUseAsComponentName == null) { + throw new IllegalStateException("Property [" + componentNamePropName + + "] is not defined in user-specified initial Resource configuration."); + } + return propToUseAsComponentName.getStringValue(); + } + + + private Deployer getDeployer() { + ProfileServiceConnection profileServiceConnection = this.component.getConnection(); + if (runningEmbedded()) { + return new LocalDeployer(profileServiceConnection); + } else { + return new RemoteDeployer(profileServiceConnection, this.component.getResourceContext()); + } + } + + private boolean runningEmbedded() { + Configuration pluginConfiguration = this.component.getResourceContext().getPluginConfiguration(); + String namingUrl = pluginConfiguration.getSimpleValue(ApplicationServerPluginConfigurationProperties.NAMING_URL, + null); + return namingUrl == null; + } + + private static Configuration getDefaultPluginConfiguration(ResourceType resourceType) { + ConfigurationTemplate pluginConfigDefaultTemplate = resourceType.getPluginConfigurationDefinition() + .getDefaultTemplate(); + return (pluginConfigDefaultTemplate != null) ? pluginConfigDefaultTemplate.createConfiguration() + : new Configuration(); + } + + private void handleMiscManagedProperties(Collection<PropertyDefinition> managedPropertyGroup, + Map<String, ManagedProperty> managedProperties, Configuration pluginConfiguration) { + for (PropertyDefinition propertyDefinition : managedPropertyGroup) { + String propertyKey = propertyDefinition.getName(); + Property property = pluginConfiguration.get(propertyKey); + ManagedProperty managedProperty = managedProperties.get(propertyKey); + if (managedProperty != null && property != null) { + PropertyAdapter propertyAdapter = PropertyAdapterFactory.getPropertyAdapter(managedProperty + .getMetaType()); + propertyAdapter.populateMetaValueFromProperty(property, managedProperty.getValue(), propertyDefinition); + } + } + } +} diff --git a/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml index 27d2b76..b6bfdd9 100644 --- a/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml @@ -1600,653 +1600,670 @@
</service>
- <service name="Queue" - class="JmsDestinationComponent" - createDeletePolicy="both" - subCategory="JMS Destinations" - discovery="JmsDestinationDiscoveryComponent">
- <plugin-configuration> - <c:simple-property name="componentType" default="JMSDestination" readOnly="true"/> - <c:simple-property name="componentSubtype" default="Queue" readOnly="true"/> + <service name="JBoss Messaging" + class="JBossMessagingComponent" + subCategory="Resources" + discovery="JBossMessagingDiscoveryComponent" + description="the JBoss Messaging JMS provider" + singleton="true"> + + <plugin-configuration> + <c:simple-property name="componentType" default="JMS" readOnly="true"/> + <c:simple-property name="componentSubtype" default="ServerPeer" readOnly="true"/> <c:simple-property name="componentName" readOnly="true"/> - <c:simple-property name="templateName" default="QueueTemplate" readOnly="true"/> - <c:simple-property name="componentNameProperty" default="JNDIName" readOnly="true"> - <c:description> - The name of the Resource configuration property whose value should be used as the - underlying ManagedComponent name when creating a new Resource of this type. - </c:description> - </c:simple-property> - <c:group name="managedPropertyGroup" displayName="managedPropertyGroup" hiddenByDefault="true"> - <c:simple-property name="jms-type" default="queue"/> - <c:map-property name="customProperties" - description="Maps a list of custom property names to the the fully qualified class names of the org.rhq.plugins.jbossas5.adapter.api.PropertyAdapter implementations that should be used for those properties."> - <c:simple-property name="securityConfig" - default="org.rhq.plugins.jbossas5.adapter.impl.configuration.custom.JMSSecurityConfigAdapter"/> - </c:map-property> - </c:group> - </plugin-configuration> + </plugin-configuration>
- &destinationOperations; - - <operation name="listAllMessages" displayName="List All Messages" description="List all messages for the specified selector"> - <parameters> - <c:simple-property required="false" name="arg#0" displayName="selector"/> - </parameters> - <results> - <c:notes>List all messages with selector</c:notes> - <c:list-property name="result"> - <c:map-property required="false" name="element"> - <c:simple-property required="false" name="JMSCorrelationID"/> - <c:simple-property required="false" name="JMSMessageID"/> - <c:simple-property type="long" required="false" name="JMSTimestamp"/> - </c:map-property> - </c:list-property> - </results> - </operation> - - <operation name="listDurableMessages" displayName="List Durable Messages" description="List all durable messages for the specified selector"> - <parameters> - <c:simple-property required="false" name="arg#0" displayName="selector"/> - </parameters> - <results> - <c:notes>List all durable messages using a selector</c:notes> - <c:list-property name="result"> - <c:map-property required="false" name="element"> - <c:simple-property required="false" name="JMSCorrelationID"/> - <c:simple-property required="false" name="JMSMessageID"/> - <c:simple-property type="long" required="false" name="JMSTimestamp"/> - </c:map-property> - </c:list-property> - </results> - </operation> - - <operation name="listNonDurableMessages" displayName="List Non Durable Messages" description="List all non durable messages for the specified selector"> - <parameters> - <c:simple-property required="false" name="arg#0" displayName="selector"/> - </parameters> - <results> - <c:notes>List all non durable messages using a selector</c:notes> - <c:list-property name="result"> - <c:map-property required="false" name="element"> - <c:simple-property required="false" name="JMSCorrelationID"/> - <c:simple-property required="false" name="JMSMessageID"/> - <c:simple-property type="long" required="false" name="JMSTimestamp"/> - </c:map-property> - </c:list-property> - </results> - </operation> - - <operation name="listMessageCounterAsHTML" displayName="List Message Counter As HTML" description="Get the message counter as HTML"> - <results> - <c:notes>Get the message counter as HTML</c:notes> - <c:simple-property name="result" type="longString"/> - </results> - </operation> - - <operation name="listMessageCounterHistoryAsHTML" displayName="List Message Counter History As HTML" description="Get the message counter history as HTML"> - <results> - <c:notes>Get the message counter history as HTML</c:notes> - <c:simple-property name="result" type="longString"/> - </results> - </operation> - - <operation name="resetMessageCounter" displayName="Reset Message Counter" description="Reset the message counter"/> - - <operation name="resetMessageCounterHistory" displayName="Reset Message Counter History" description="Reset the message counter history"/> + <service name="Queue" + class="JmsDestinationComponent" + createDeletePolicy="both" + discovery="JmsDestinationDiscoveryComponent" + description="a JMS queue">
- &managedObjectMetrics; + <plugin-configuration> + <c:simple-property name="componentType" default="JMSDestination" readOnly="true"/> + <c:simple-property name="componentSubtype" default="Queue" readOnly="true"/> + <c:simple-property name="componentName" readOnly="true"/> + <c:simple-property name="templateName" default="QueueTemplate" readOnly="true"/> + <c:simple-property name="componentNameProperty" default="JNDIName" readOnly="true"> + <c:description> + The name of the Resource configuration property whose value should be used as the + underlying ManagedComponent name when creating a new Resource of this type. + </c:description> + </c:simple-property> + <c:group name="managedPropertyGroup" displayName="managedPropertyGroup" hiddenByDefault="true"> + <c:simple-property name="jms-type" default="queue"/> + <c:map-property name="customProperties" + description="Maps a list of custom property names to the the fully qualified class names of the org.rhq.plugins.jbossas5.adapter.api.PropertyAdapter implementations that should be used for those properties."> + <c:simple-property name="securityConfig" + default="org.rhq.plugins.jbossas5.adapter.impl.configuration.custom.JMSSecurityConfigAdapter"/> + </c:map-property> + </c:group> + </plugin-configuration>
- <!-- Traits --> + &destinationOperations;
- <metric property="createdProgrammatically" displayType="summary" - defaultOn="true" defaultInterval="600000" dataType="trait" category="performance" - description="Was this queue created programmatically? If Yes, the queue will not survive a restart of the application server. If No, the queue was created via a deployment XML file."/> + <operation name="listAllMessages" displayName="List All Messages" description="List all messages for the specified selector"> + <parameters> + <c:simple-property required="false" name="arg#0" displayName="selector"/> + </parameters> + <results> + <c:notes>List all messages with selector</c:notes> + <c:list-property name="result"> + <c:map-property required="false" name="element"> + <c:simple-property required="false" name="JMSCorrelationID"/> + <c:simple-property required="false" name="JMSMessageID"/> + <c:simple-property type="long" required="false" name="JMSTimestamp"/> + </c:map-property> + </c:list-property> + </results> + </operation>
- <!-- NOTE: We have to make this a trait rather than a resource config prop due to a bug in JBMESSAGING - (see https://jira.jboss.org/jira/browse/JBAS-6721). --> - <metric property="messageCounterHistoryDayLimit" - defaultOn="true" defaultInterval="600000" dataType="trait" category="performance" - description="This queue's message counter history day limit - <0: unlimited, =0: history disabled, >0: maximum day count"/> + <operation name="listDurableMessages" displayName="List Durable Messages" description="List all durable messages for the specified selector"> + <parameters> + <c:simple-property required="false" name="arg#0" displayName="selector"/> + </parameters> + <results> + <c:notes>List all durable messages using a selector</c:notes> + <c:list-property name="result"> + <c:map-property required="false" name="element"> + <c:simple-property required="false" name="JMSCorrelationID"/> + <c:simple-property required="false" name="JMSMessageID"/> + <c:simple-property type="long" required="false" name="JMSTimestamp"/> + </c:map-property> + </c:list-property> + </results> + </operation>
- <!-- Numerics --> + <operation name="listNonDurableMessages" displayName="List Non Durable Messages" description="List all non durable messages for the specified selector"> + <parameters> + <c:simple-property required="false" name="arg#0" displayName="selector"/> + </parameters> + <results> + <c:notes>List all non durable messages using a selector</c:notes> + <c:list-property name="result"> + <c:map-property required="false" name="element"> + <c:simple-property required="false" name="JMSCorrelationID"/> + <c:simple-property required="false" name="JMSMessageID"/> + <c:simple-property type="long" required="false" name="JMSTimestamp"/> + </c:map-property> + </c:list-property> + </results> + </operation>
- <metric property="consumerCount" measurementType="dynamic" displayType="summary" displayName="Consumer Count" - defaultOn="true" defaultInterval="60000" dataType="measurement" category="throughput" - description="The number of consumers on the queue"/> + <operation name="listMessageCounterAsHTML" displayName="List Message Counter As HTML" description="Get the message counter as HTML"> + <results> + <c:notes>Get the message counter as HTML</c:notes> + <c:simple-property name="result" type="longString"/> + </results> + </operation>
- <metric property="deliveringCount" measurementType="dynamic" displayType="detail" displayName="Delivering Count" - defaultOn="true" defaultInterval="60000" dataType="measurement" category="throughput" - description="The number of messages currently being delivered"/> + <operation name="listMessageCounterHistoryAsHTML" displayName="List Message Counter History As HTML" description="Get the message counter history as HTML"> + <results> + <c:notes>Get the message counter history as HTML</c:notes> + <c:simple-property name="result" type="longString"/> + </results> + </operation>
- <metric property="messageCount" measurementType="dynamic" displayType="summary" displayName="Message Count" - defaultOn="true" defaultInterval="60000" dataType="measurement" category="throughput" - description="The number of messages in the queue"/> + <operation name="resetMessageCounter" displayName="Reset Message Counter" description="Reset the message counter"/>
- <metric property="scheduledMessageCount" measurementType="dynamic" displayType="detail" displayName="Scheduled Message Count" - defaultOn="true" defaultInterval="60000" dataType="measurement" category="throughput" - description="The number of scheduled messages in the queue"/> + <operation name="resetMessageCounterHistory" displayName="Reset Message Counter History" description="Reset the message counter history"/>
- <metric property="messageStatistics.count" measurementType="dynamic" displayType="detail" displayName="Count" - defaultOn="true" defaultInterval="60000" dataType="measurement" category="utilization" - description="The total message count since startup or last counter reset"/> + &managedObjectMetrics;
- <metric property="messageStatistics.countDelta" measurementType="dynamic" displayType="detail" displayName="Count Delta" - defaultOn="true" defaultInterval="60000" dataType="measurement" category="utilization" - description="The message count delta since last method call"/> + <!-- Traits -->
- <metric property="messageStatistics.depth" measurementType="dynamic" displayType="detail" displayName="Depth" - defaultOn="true" defaultInterval="60000" dataType="measurement" category="utilization" - description="The current message count of pending messages within the queue waiting for dispatch"/> + <metric property="createdProgrammatically" displayType="summary" + defaultOn="true" defaultInterval="600000" dataType="trait" category="performance" + description="Was this queue created programmatically? If Yes, the queue will not survive a restart of the application server. If No, the queue was created via a deployment XML file."/>
- <metric property="messageStatistics.depthDelta" measurementType="dynamic" displayType="detail" displayName="Depth Delta" - defaultOn="true" defaultInterval="60000" dataType="measurement" category="utilization" - description="The message count delta of pending messages since last method call"/> + <!-- NOTE: We have to make this a trait rather than a resource config prop due to a bug in JBMESSAGING + (see https://jira.jboss.org/jira/browse/JBAS-6721). --> + <metric property="messageCounterHistoryDayLimit" + defaultOn="true" defaultInterval="600000" dataType="trait" category="performance" + description="This queue's message counter history day limit - <0: unlimited, =0: history disabled, >0: maximum day count"/>
- <metric property="messageStatistics.timeLastUpdate" measurementType="dynamic" displayType="detail" displayName="Time Last Update" - defaultOn="true" defaultInterval="60000" dataType="measurement" category="utilization" - description="The timestamp of the last message add"/> + <!-- Numerics -->
- <resource-configuration> + <metric property="consumerCount" measurementType="dynamic" displayType="summary" displayName="Consumer Count" + defaultOn="true" defaultInterval="60000" dataType="measurement" category="throughput" + description="The number of consumers on the queue"/>
- <!-- See: https://anonsvn.jboss.org/repos/jbossas/trunk/messaging/src/main/org/jboss/jms/server/destination/QueueServiceMO.java --> + <metric property="deliveringCount" measurementType="dynamic" displayType="detail" displayName="Delivering Count" + defaultOn="true" defaultInterval="60000" dataType="measurement" category="throughput" + description="The number of messages currently being delivered"/>
- <c:simple-property required="true" name="name" readOnly="true" - description="The name of this queue (e.g. 'MyQueue')."/> + <metric property="messageCount" measurementType="dynamic" displayType="summary" displayName="Message Count" + defaultOn="true" defaultInterval="60000" dataType="measurement" category="throughput" + description="The number of messages in the queue"/>
- <c:simple-property required="true" name="JNDIName" readOnly="true" - description="This queue's JNDI name (e.g. '/queue/MyQueue')."/> + <metric property="scheduledMessageCount" measurementType="dynamic" displayType="detail" displayName="Scheduled Message Count" + defaultOn="true" defaultInterval="60000" dataType="measurement" category="throughput" + description="The number of scheduled messages in the queue"/>
- <c:simple-property type="boolean" required="false" name="clustered" readOnly="true" defaultValue="false"> - <c:description> - Is this queue clustered? For an existing queue, this property is read-only. If not specified - when creating a new queue, the default value is false. - </c:description> - </c:simple-property> + <metric property="messageStatistics.count" measurementType="dynamic" displayType="detail" displayName="Count" + defaultOn="true" defaultInterval="60000" dataType="measurement" category="utilization" + description="The total message count since startup or last counter reset"/>
- <c:simple-property type="integer" required="false" name="downCacheSize" defaultValue="2000"> - <c:description> - When paging messages to storage from a subscription, they first go into a "Down Cache" before - being written to storage. This enables the write to occur as a single operation, thus aiding - performance. This setting determines the maximum number of messages that the Down Cache will hold - before they are flushed to storage. - Updates to this property will not go into effect until the queue has been restarted. - The default value is 2000. - </c:description> - <c:constraint> - <c:integer-constraint minimum="1"/> - </c:constraint> - </c:simple-property> + <metric property="messageStatistics.countDelta" measurementType="dynamic" displayType="detail" displayName="Count Delta" + defaultOn="true" defaultInterval="60000" dataType="measurement" category="utilization" + description="The message count delta since last method call"/>
- <c:simple-property type="integer" required="false" name="fullSize" defaultValue="200000"> - <c:description> - The maximum number of messages for the queue held in memory at any one time. - The actual queue can hold many more messages than this, but these are paged to and from - storage as necessary, as messages are added or consumed. - Updates to this property will not go into effect until the queue has been restarted. - The default value is 200000. - </c:description> - <c:constraint> - <c:integer-constraint minimum="1"/> - </c:constraint> - </c:simple-property> + <metric property="messageStatistics.depth" measurementType="dynamic" displayType="detail" displayName="Depth" + defaultOn="true" defaultInterval="60000" dataType="measurement" category="utilization" + description="The current message count of pending messages within the queue waiting for dispatch"/>
- <c:simple-property type="integer" required="false" name="maxDeliveryAttempts" defaultValue="-1"> - <c:description> - The number of delivery attempts before a message to a subscriber of this queue is moved to the - DLQ. The default value is 10. A value of -1 indicates the default value should be used. - </c:description> - <c:constraint> - <c:integer-constraint minimum="-1"/> - </c:constraint> - </c:simple-property> + <metric property="messageStatistics.depthDelta" measurementType="dynamic" displayType="detail" displayName="Depth Delta" + defaultOn="true" defaultInterval="60000" dataType="measurement" category="utilization" + description="The message count delta of pending messages since last method call"/>
- <c:simple-property type="integer" required="false" name="maxSize" defaultValue="-1"> - <c:description> - The maximum number of messages this queue can hold before they are dropped. - A value of -1 means there is no maximum. The default value is -1. - </c:description> - <c:constraint> - <c:integer-constraint minimum="-1"/> - </c:constraint> - </c:simple-property> + <metric property="messageStatistics.timeLastUpdate" measurementType="dynamic" displayType="detail" displayName="Time Last Update" + defaultOn="true" defaultInterval="60000" dataType="measurement" category="utilization" + description="The timestamp of the last message add"/>
- <c:simple-property type="integer" required="false" name="pageSize" defaultValue="2000"> - <c:description> - When loading messages from a subscription, this is the maximum number of messages to - pre-load in one operation. Must be less than Full Size and greater than or equal to Down Cache Size. - Updates to this property will not go into effect until the queue has been restarted. - The default value is 2000. - </c:description> - <c:constraint> - <c:integer-constraint minimum="1"/> - </c:constraint> - </c:simple-property> + <resource-configuration>
- <c:simple-property type="long" required="false" name="redeliveryDelay" units="milliseconds" defaultValue="-1"> - <c:description> - The delay in milliseconds before a rolled back or recovered message is redelivered. - Set to 0 to disable redelivery. The default value is 0. A value of -1 indicates the default value should be used. - </c:description> - <c:constraint> - <c:integer-constraint minimum="-1"/> - </c:constraint> - </c:simple-property> + <!-- See: https://anonsvn.jboss.org/repos/jbossas/trunk/messaging/src/main/org/jboss/jms/server/destination/QueueServiceMO.java -->
- <c:simple-property required="false" name="DLQ"> - <c:description> - The JMX ObjectName of the dead letter queue (DLQ) for this queue (e.g. - "jboss.messaging.destination:service=Queue,name=PrivateDLQ") - overrides the default DLQ on the - server peer. - </c:description> - <c:constraint> - <c:regex-constraint expression="[^:]+:.+"/> - </c:constraint> - </c:simple-property> + <c:simple-property required="true" name="name" readOnly="true" + description="The name of this queue (e.g. 'MyQueue')."/>
- <c:simple-property required="false" name="expiryQueue"> - <c:description> - The JMX ObjectName of the expiry queue for this queue (e.g. - "jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue") - overrides the default - expiry queue on the server peer. - </c:description> - <c:constraint> - <c:regex-constraint expression="[^:]+:.+"/> - </c:constraint> - </c:simple-property> + <c:simple-property required="true" name="JNDIName" readOnly="true" + description="This queue's JNDI name (e.g. '/queue/MyQueue')."/>
- <c:simple-property required="false" name="serverPeer"> - <c:description> - The JMX ObjectName of the server peer this queue was deployed on (e.g. - "jboss.messaging:service=ServerPeer"). Updates to this property will not go into effect until - the queue has been restarted. - </c:description> - <c:constraint> - <c:regex-constraint expression="[^:]+:.+"/> - </c:constraint> - </c:simple-property> + <c:simple-property type="boolean" required="false" name="clustered" readOnly="true" defaultValue="false"> + <c:description> + Is this queue clustered? For an existing queue, this property is read-only. If not specified + when creating a new queue, the default value is false. + </c:description> + </c:simple-property>
- <c:list-property name="securityConfig" max="4" min="2" - displayName="Security Configurations" - description="This element specifies a XML fragment which describes the access control list to be used by the SecurityManager to authorize client operations against the destination. The content model is the same as for the SecurityManager SecurityConf attribute."> - <c:map-property name="role" - displayName="Security Configuration Attributes" - description="These are the attributes that define the role name, and if the role is allowed to read, write or create Messages on this Queue"> - <c:simple-property name="name" - displayName="Name" - description="Name of the Security Role. e.g. Guest" - summary="true" - required="true"/> - <c:simple-property name="read" - displayName="Read" - description="Is this role allowed to read messages?" - summary="true" - required="false" - type="boolean"/> - <c:simple-property name="write" - displayName="Write" - description="Is this role allowed to write messages?" - summary="true" - required="false" - type="boolean"/> - <c:simple-property name="create" - displayName="Create" - description="Is this role allowed to create messages?" - summary="true" - required="false" - type="boolean"/> - </c:map-property> + <c:simple-property type="integer" required="false" name="downCacheSize" defaultValue="2000"> + <c:description> + When paging messages to storage from a subscription, they first go into a "Down Cache" before + being written to storage. This enables the write to occur as a single operation, thus aiding + performance. This setting determines the maximum number of messages that the Down Cache will hold + before they are flushed to storage. + Updates to this property will not go into effect until the queue has been restarted. + The default value is 2000. + </c:description> + <c:constraint> + <c:integer-constraint minimum="1"/> + </c:constraint> + </c:simple-property>
- </c:list-property> + <c:simple-property type="integer" required="false" name="fullSize" defaultValue="200000"> + <c:description> + The maximum number of messages for the queue held in memory at any one time. + The actual queue can hold many more messages than this, but these are paged to and from + storage as necessary, as messages are added or consumed. + Updates to this property will not go into effect until the queue has been restarted. + The default value is 200000. + </c:description> + <c:constraint> + <c:integer-constraint minimum="1"/> + </c:constraint> + </c:simple-property>
- </resource-configuration> + <c:simple-property type="integer" required="false" name="maxDeliveryAttempts" defaultValue="-1"> + <c:description> + The number of delivery attempts before a message to a subscriber of this queue is moved to the + DLQ. The default value is 10. A value of -1 indicates the default value should be used. + </c:description> + <c:constraint> + <c:integer-constraint minimum="-1"/> + </c:constraint> + </c:simple-property>
- <help> - <![CDATA[ - <p>The message counter metrics will not be collected by default. In order - for these metrics to be collected for all Topics and Queues for a given application server instance, - go to the instance's JMX Console, and invoke the - <tt>enableMessageCounters</tt> operation on the <tt>jboss.messaging:service=ServerPeer</tt> MBean. - To ensure the message counters are still enabled when the application server is restarted, - edit that instance's <tt>deploy/messaging/messaging-service.xml</tt> file and set the - <tt>EnableMessageCounters</tt> attribute to "true".</p> - ]]> - </help> + <c:simple-property type="integer" required="false" name="maxSize" defaultValue="-1"> + <c:description> + The maximum number of messages this queue can hold before they are dropped. + A value of -1 means there is no maximum. The default value is -1. + </c:description> + <c:constraint> + <c:integer-constraint minimum="-1"/> + </c:constraint> + </c:simple-property>
- </service> + <c:simple-property type="integer" required="false" name="pageSize" defaultValue="2000"> + <c:description> + When loading messages from a subscription, this is the maximum number of messages to + pre-load in one operation. Must be less than Full Size and greater than or equal to Down Cache Size. + Updates to this property will not go into effect until the queue has been restarted. + The default value is 2000. + </c:description> + <c:constraint> + <c:integer-constraint minimum="1"/> + </c:constraint> + </c:simple-property>
- <service name="Topic" - class="JmsDestinationComponent" - createDeletePolicy="both" - subCategory="JMS Destinations" - discovery="JmsDestinationDiscoveryComponent"> + <c:simple-property type="long" required="false" name="redeliveryDelay" units="milliseconds" defaultValue="-1"> + <c:description> + The delay in milliseconds before a rolled back or recovered message is redelivered. + Set to 0 to disable redelivery. The default value is 0. A value of -1 indicates the default value should be used. + </c:description> + <c:constraint> + <c:integer-constraint minimum="-1"/> + </c:constraint> + </c:simple-property>
- <plugin-configuration> - <c:simple-property name="componentType" default="JMSDestination" readOnly="true"/> - <c:simple-property name="componentSubtype" default="Topic" readOnly="true"/> - <c:simple-property name="componentName" readOnly="true"/> - <c:simple-property name="templateName" default="TopicTemplate" readOnly="true"/> - <c:simple-property name="componentNameProperty" default="JNDIName" readOnly="true"> - <c:description> - The name of the Resource configuration property whose value should be used as the - underlying ManagedComponent name when creating a new Resource of this type. - </c:description> - </c:simple-property> - <c:group name="managedPropertyGroup" displayName="managedPropertyGroup" hiddenByDefault="true"> - <c:simple-property name="jms-type" default="topic"/> - <c:map-property name="customProperties" - description="Maps a list of custom property names to the the fully qualified class names of the org.rhq.plugins.jbossas5.adapter.api.PropertyAdapter implementations that should be used for those properties."> - <c:simple-property name="securityConfig" - default="org.rhq.plugins.jbossas5.adapter.impl.configuration.custom.JMSSecurityConfigAdapter"/> - </c:map-property> - </c:group> - </plugin-configuration> + <c:simple-property required="false" name="DLQ"> + <c:description> + The JMX ObjectName of the dead letter queue (DLQ) for this queue (e.g. + "jboss.messaging.destination:service=Queue,name=PrivateDLQ") - overrides the default DLQ on the + server peer. + </c:description> + <c:constraint> + <c:regex-constraint expression="[^:]+:.+"/> + </c:constraint> + </c:simple-property>
- &destinationOperations; - - <operation name="listAllMessages" displayName="List All Messages" description="List all messages for the specified subscription with the specified selector"> - <parameters> - <c:simple-property required="false" name="arg#0" displayName="subscriptionID"/> - <c:simple-property required="false" name="arg#1" displayName="selector"/> - </parameters> - <results> - <c:notes>List all messages for the specified subscription with the specified selector</c:notes> - <c:list-property name="result"> - <c:map-property required="false" name="element"> - <c:simple-property required="false" name="JMSCorrelationID"/> - <c:simple-property required="false" name="JMSMessageID"/> - <c:simple-property type="long" required="false" name="JMSTimestamp"/> - </c:map-property> - </c:list-property> - </results> - </operation> - - <operation name="listDurableMessages" displayName="List Durable Messages" description="List all durable messages for the specified subscription with the specified selector"> - <parameters> - <c:simple-property required="false" name="arg#0" displayName="subscriptionID"/> - <c:simple-property required="false" name="arg#1" displayName="selector"/> - </parameters> - <results> - <c:notes>List all durable messages for the specified subscription with the specified selector</c:notes> - <c:list-property name="result"> - <c:map-property required="false" name="element"> - <c:simple-property required="false" name="JMSCorrelationID"/> - <c:simple-property required="false" name="JMSMessageID"/> - <c:simple-property type="long" required="false" name="JMSTimestamp"/> - </c:map-property> - </c:list-property> - </results> - </operation> - - <operation name="listNonDurableMessages" displayName="List Non Durable Messages" description="List all non durable messages for the specified subscription with the specified selector"> - <parameters> - <c:simple-property required="false" name="arg#0" displayName="subscriptionID"/> - <c:simple-property required="false" name="arg#1" displayName="selector"/> - </parameters> - <results> - <c:notes>List all non durable messages for the specified subscription with the specified selector</c:notes> - <c:list-property name="result"> - <c:map-property required="false" name="element"> - <c:simple-property required="false" name="JMSCorrelationID"/> - <c:simple-property required="false" name="JMSMessageID"/> - <c:simple-property type="long" required="false" name="JMSTimestamp"/> - </c:map-property> - </c:list-property> - </results> - </operation> - - <operation name="listAllSubscriptions" displayName="List All Subscriptions" - description="Return all subscriptions for the topic"> - <results> - <c:notes>Return all subscriptions for the topic</c:notes> - &subscriptionsResultProperty; - </results> - </operation> - - <operation name="listAllSubscriptionsAsHTML" displayName="List All Subscriptions As HTML" - description="Return all subscriptions for the topic as HTML"> - <results> - <c:notes>Return all subscriptions for the topic as HTML</c:notes> - <c:simple-property name="result" type="longString"/> - </results> - </operation> - - <operation name="listDurableSubscriptions" displayName="List Durable Subscriptions" - description="Return all durable subscriptions for the topic"> - <results> - <c:notes>Return all durable subscriptions for the topic</c:notes> - &subscriptionsResultProperty; - </results> - </operation> - - <operation name="listDurableSubscriptionsAsHTML" displayName="List Durable Subscriptions As HTML" - description="Return all durable subscriptions for the topic as HTML"> - <results> - <c:notes>Return all durable subscriptions for the topic as HTML</c:notes> - <c:simple-property name="result" type="longString"/> - </results> - </operation> - - <operation name="listNonDurableSubscriptions" displayName="List Non-Durable Subscriptions" - description="Return all non-durable subscriptions for the topic"> - <results> - <c:notes>Return all non-durable subscriptions for the topic</c:notes> - &subscriptionsResultProperty; - </results> - </operation> - - <operation name="listNonDurableSubscriptionsAsHTML" displayName="List Non-Durable Subscriptions As HTML" - description="Return all non-durable subscriptions for the topic as HTML"> - <results> - <c:notes>Return all non-durable subscriptions for the topic as HTML</c:notes> - <c:simple-property name="result" type="longString"/> - </results> - </operation> + <c:simple-property required="false" name="expiryQueue"> + <c:description> + The JMX ObjectName of the expiry queue for this queue (e.g. + "jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue") - overrides the default + expiry queue on the server peer. + </c:description> + <c:constraint> + <c:regex-constraint expression="[^:]+:.+"/> + </c:constraint> + </c:simple-property>
- &managedObjectMetrics; + <c:simple-property required="false" name="serverPeer"> + <c:description> + The JMX ObjectName of the server peer this queue was deployed on (e.g. + "jboss.messaging:service=ServerPeer"). Updates to this property will not go into effect until + the queue has been restarted. + </c:description> + <c:constraint> + <c:regex-constraint expression="[^:]+:.+"/> + </c:constraint> + </c:simple-property> + + <c:list-property name="securityConfig" max="4" min="2" + displayName="Security Configurations" + description="This element specifies a XML fragment which describes the access control list to be used by the SecurityManager to authorize client operations against the destination. The content model is the same as for the SecurityManager SecurityConf attribute."> + <c:map-property name="role" + displayName="Security Configuration Attributes" + description="These are the attributes that define the role name, and if the role is allowed to read, write or create Messages on this Queue"> + <c:simple-property name="name" + displayName="Name" + description="Name of the Security Role. e.g. Guest" + summary="true" + required="true"/> + <c:simple-property name="read" + displayName="Read" + description="Is this role allowed to read messages?" + summary="true" + required="false" + type="boolean"/> + <c:simple-property name="write" + displayName="Write" + description="Is this role allowed to write messages?" + summary="true" + required="false" + type="boolean"/> + <c:simple-property name="create" + displayName="Create" + description="Is this role allowed to create messages?" + summary="true" + required="false" + type="boolean"/> + </c:map-property> + + </c:list-property>
- <!-- Traits --> + </resource-configuration>
- <metric property="createdProgrammatically" displayType="summary" - defaultOn="true" defaultInterval="600000" dataType="trait" category="performance" - description="Was this topic created programmatically? If Yes, the topic will not survive a restart of the application server. If No, the topic was created via a deployment XML file."/> + <help> + <![CDATA[ + <p>The message counter metrics will not be collected by default. In order + for these metrics to be collected for all Topics and Queues for a given application server instance, + go to the instance's JMX Console, and invoke the + <tt>enableMessageCounters</tt> operation on the <tt>jboss.messaging:service=ServerPeer</tt> MBean. + To ensure the message counters are still enabled when the application server is restarted, + edit that instance's <tt>deploy/messaging/messaging-service.xml</tt> file and set the + <tt>EnableMessageCounters</tt> attribute to "true".</p> + ]]> + </help>
- <!-- NOTE: We have to make this a trait rather than a resource config prop due to a bug in JBMESSAGING - (see https://jira.jboss.org/jira/browse/JBAS-6721). --> - <metric property="messageCounterHistoryDayLimit" - defaultOn="true" defaultInterval="600000" dataType="trait" category="performance" - description="This topic's message counter history day limit - <0: unlimited, =0: history disabled, >0: maximum day count"/> + </service>
- <!-- Numerics --> + + <service name="Topic" + class="JmsDestinationComponent" + createDeletePolicy="both" + discovery="JmsDestinationDiscoveryComponent" + description="a JMS topic">
- <metric property="allMessageCount" measurementType="dynamic" displayType="summary" displayName="All Message Count" - defaultOn="true" defaultInterval="60000" dataType="measurement" category="throughput" - description="The count of all messages in all subscriptions to this topic"/> + <plugin-configuration> + <c:simple-property name="componentType" default="JMSDestination" readOnly="true"/> + <c:simple-property name="componentSubtype" default="Topic" readOnly="true"/> + <c:simple-property name="componentName" readOnly="true"/> + <c:simple-property name="templateName" default="TopicTemplate" readOnly="true"/> + <c:simple-property name="componentNameProperty" default="JNDIName" readOnly="true"> + <c:description> + The name of the Resource configuration property whose value should be used as the + underlying ManagedComponent name when creating a new Resource of this type. + </c:description> + </c:simple-property> + <c:group name="managedPropertyGroup" displayName="managedPropertyGroup" hiddenByDefault="true"> + <c:simple-property name="jms-type" default="topic"/> + <c:map-property name="customProperties" + description="Maps a list of custom property names to the the fully qualified class names of the org.rhq.plugins.jbossas5.adapter.api.PropertyAdapter implementations that should be used for those properties."> + <c:simple-property name="securityConfig" + default="org.rhq.plugins.jbossas5.adapter.impl.configuration.custom.JMSSecurityConfigAdapter"/> + </c:map-property> + </c:group> + </plugin-configuration>
- <metric property="allSubscriptionsCount" measurementType="dynamic" displayType="summary" displayName="All Subscriptions Count" - defaultOn="true" defaultInterval="60000" dataType="measurement" category="throughput" - description="The count of all subscriptions to this topic"/> + &destinationOperations;
- <metric property="durableMessageCount" measurementType="dynamic" displayType="detail" displayName="Durable Message Count" - defaultOn="true" defaultInterval="60000" dataType="measurement" category="throughput" - description="The count of all messages for all durable subscriptions to this topic"/> + <operation name="listAllMessages" displayName="List All Messages" description="List all messages for the specified subscription with the specified selector"> + <parameters> + <c:simple-property required="false" name="arg#0" displayName="subscriptionID"/> + <c:simple-property required="false" name="arg#1" displayName="selector"/> + </parameters> + <results> + <c:notes>List all messages for the specified subscription with the specified selector</c:notes> + <c:list-property name="result"> + <c:map-property required="false" name="element"> + <c:simple-property required="false" name="JMSCorrelationID"/> + <c:simple-property required="false" name="JMSMessageID"/> + <c:simple-property type="long" required="false" name="JMSTimestamp"/> + </c:map-property> + </c:list-property> + </results> + </operation>
- <metric property="durableSubscriptionsCount" measurementType="dynamic" displayType="detail" displayName="Durable Subscriptions Count" - defaultOn="true" defaultInterval="60000" dataType="measurement" category="throughput" - description="The count of all durable subscriptions to this topic"/> + <operation name="listDurableMessages" displayName="List Durable Messages" description="List all durable messages for the specified subscription with the specified selector"> + <parameters> + <c:simple-property required="false" name="arg#0" displayName="subscriptionID"/> + <c:simple-property required="false" name="arg#1" displayName="selector"/> + </parameters> + <results> + <c:notes>List all durable messages for the specified subscription with the specified selector</c:notes> + <c:list-property name="result"> + <c:map-property required="false" name="element"> + <c:simple-property required="false" name="JMSCorrelationID"/> + <c:simple-property required="false" name="JMSMessageID"/> + <c:simple-property type="long" required="false" name="JMSTimestamp"/> + </c:map-property> + </c:list-property> + </results> + </operation>
- <metric property="nonDurableMessageCount" measurementType="dynamic" displayType="detail" displayName="Non Durable Message Count" - defaultOn="true" defaultInterval="60000" dataType="measurement" category="throughput" - description="The count of all messages in all non durable subscriptions to this topic"/> + <operation name="listNonDurableMessages" displayName="List Non Durable Messages" description="List all non durable messages for the specified subscription with the specified selector"> + <parameters> + <c:simple-property required="false" name="arg#0" displayName="subscriptionID"/> + <c:simple-property required="false" name="arg#1" displayName="selector"/> + </parameters> + <results> + <c:notes>List all non durable messages for the specified subscription with the specified selector</c:notes> + <c:list-property name="result"> + <c:map-property required="false" name="element"> + <c:simple-property required="false" name="JMSCorrelationID"/> + <c:simple-property required="false" name="JMSMessageID"/> + <c:simple-property type="long" required="false" name="JMSTimestamp"/> + </c:map-property> + </c:list-property> + </results> + </operation>
- <metric property="nonDurableSubscriptionsCount" measurementType="dynamic" displayType="detail" displayName="Non Durable Subscriptions Count" - defaultOn="true" defaultInterval="60000" dataType="measurement" category="throughput" - description="The count of all non durable subscriptions to this topic"/> + <operation name="listAllSubscriptions" displayName="List All Subscriptions" + description="Return all subscriptions for the topic"> + <results> + <c:notes>Return all subscriptions for the topic</c:notes> + &subscriptionsResultProperty; + </results> + </operation>
- <resource-configuration> + <operation name="listAllSubscriptionsAsHTML" displayName="List All Subscriptions As HTML" + description="Return all subscriptions for the topic as HTML"> + <results> + <c:notes>Return all subscriptions for the topic as HTML</c:notes> + <c:simple-property name="result" type="longString"/> + </results> + </operation>
- <!-- See: https://anonsvn.jboss.org/repos/jbossas/trunk/messaging/src/main/org/jboss/jms/server/destination/TopicServiceMO.java --> + <operation name="listDurableSubscriptions" displayName="List Durable Subscriptions" + description="Return all durable subscriptions for the topic"> + <results> + <c:notes>Return all durable subscriptions for the topic</c:notes> + &subscriptionsResultProperty; + </results> + </operation>
- <c:simple-property required="true" name="name" readOnly="true" - description="The name of this topic (e.g. 'MyTopic')."/> + <operation name="listDurableSubscriptionsAsHTML" displayName="List Durable Subscriptions As HTML" + description="Return all durable subscriptions for the topic as HTML"> + <results> + <c:notes>Return all durable subscriptions for the topic as HTML</c:notes> + <c:simple-property name="result" type="longString"/> + </results> + </operation>
- <c:simple-property required="true" name="JNDIName" readOnly="true" - description="This topic's JNDI name (e.g. '/topic/MyTopic')"/> + <operation name="listNonDurableSubscriptions" displayName="List Non-Durable Subscriptions" + description="Return all non-durable subscriptions for the topic"> + <results> + <c:notes>Return all non-durable subscriptions for the topic</c:notes> + &subscriptionsResultProperty; + </results> + </operation>
- <c:simple-property type="boolean" required="false" name="clustered" readOnly="true" defaultValue="false"> - <c:description> - Is this topic clustered? For an existing topic, this property is read-only. If not specified - when creating a new topic, the default value is false. - </c:description> - </c:simple-property> + <operation name="listNonDurableSubscriptionsAsHTML" displayName="List Non-Durable Subscriptions As HTML" + description="Return all non-durable subscriptions for the topic as HTML"> + <results> + <c:notes>Return all non-durable subscriptions for the topic as HTML</c:notes> + <c:simple-property name="result" type="longString"/> + </results> + </operation>
- <c:simple-property type="integer" required="false" name="downCacheSize" defaultValue="2000"> - <c:description> - When paging messages to storage from a subscription, they first go into a "Down Cache" before - being written to storage. This enables the write to occur as a single operation, thus aiding - performance. This setting determines the maximum number of messages that the Down Cache will hold - before they are flushed to storage. - Updates to this property will not go into effect until the topic has been restarted. - The default value is 2000. - </c:description> - <c:constraint> - <c:integer-constraint minimum="1"/> - </c:constraint> - </c:simple-property> + &managedObjectMetrics;
- <c:simple-property type="integer" required="false" name="fullSize" defaultValue="200000"> - <c:description> - The maximum number of messages held by the topic subscriptions in memory at any one time. - The actual subscription can hold many more messages than this, but these are paged to and from - storage as necessary, as messages are added or consumed. - Updates to this property will not go into effect until the topic has been restarted. - The default value is 200000. - </c:description> - <c:constraint> - <c:integer-constraint minimum="1"/> - </c:constraint> - </c:simple-property> + <!-- Traits -->
- <c:simple-property type="integer" required="false" name="maxDeliveryAttempts" defaultValue="-1"> - <c:description> - The number of delivery attempts before a message to a subscriber of this topic is moved to the - DLQ. The default value is 10. A value of -1 indicates the default value should be used. - </c:description> - <c:constraint> - <c:integer-constraint minimum="-1"/> - </c:constraint> - </c:simple-property> + <metric property="createdProgrammatically" displayType="summary" + defaultOn="true" defaultInterval="600000" dataType="trait" category="performance" + description="Was this topic created programmatically? If Yes, the topic will not survive a restart of the application server. If No, the topic was created via a deployment XML file."/>
- <c:simple-property type="integer" required="false" name="maxSize" defaultValue="-1"> - <c:description> - The maximum number of messages this topic can hold before they are dropped. - A value of -1 means there is no maximum. The default value is -1. - </c:description> - <c:constraint> - <c:integer-constraint minimum="-1"/> - </c:constraint> - </c:simple-property> + <!-- NOTE: We have to make this a trait rather than a resource config prop due to a bug in JBMESSAGING + (see https://jira.jboss.org/jira/browse/JBAS-6721). --> + <metric property="messageCounterHistoryDayLimit" + defaultOn="true" defaultInterval="600000" dataType="trait" category="performance" + description="This topic's message counter history day limit - <0: unlimited, =0: history disabled, >0: maximum day count"/>
- <c:simple-property type="integer" required="false" name="pageSize" defaultValue="2000"> - <c:description> - When loading messages from a subscription, this is the maximum number of messages to - pre-load in one operation. Must be less than Full Size and greater than or equal to Down Cache Size. - Updates to this property will not go into effect until the topic has been restarted. - The default value is 2000. - </c:description> - <c:constraint> - <c:integer-constraint minimum="1"/> - </c:constraint> - </c:simple-property> + <!-- Numerics -->
- <c:simple-property type="long" required="false" name="redeliveryDelay" units="milliseconds" defaultValue="-1"> - <c:description> - The delay in milliseconds before a rolled back or recovered message is redelivered. - Set to 0 to disable redelivery. The default value is 0. A value of -1 indicates the default value should be used. - </c:description> - <c:constraint> - <c:integer-constraint minimum="-1"/> - </c:constraint> - </c:simple-property> + <metric property="allMessageCount" measurementType="dynamic" displayType="summary" displayName="All Message Count" + defaultOn="true" defaultInterval="60000" dataType="measurement" category="throughput" + description="The count of all messages in all subscriptions to this topic"/>
- <c:simple-property required="false" name="DLQ"> - <c:description> - The JMX ObjectName of the dead letter queue (DLQ) for this topic (e.g. - "jboss.messaging.destination:service=Queue,name=PrivateDLQ") - overrides the default DLQ on the - server peer. - </c:description> - <c:constraint> - <c:regex-constraint expression="[^:]+:.+"/> - </c:constraint> - </c:simple-property> + <metric property="allSubscriptionsCount" measurementType="dynamic" displayType="summary" displayName="All Subscriptions Count" + defaultOn="true" defaultInterval="60000" dataType="measurement" category="throughput" + description="The count of all subscriptions to this topic"/>
- <c:simple-property required="false" name="expiryQueue"> - <c:description> - The JMX ObjectName of the expiry queue for this topic (e.g. - "jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue") - overrides the default - expiry queue on the server peer. - </c:description> - <c:constraint> - <c:regex-constraint expression="[^:]+:.+"/> - </c:constraint> - </c:simple-property> + <metric property="durableMessageCount" measurementType="dynamic" displayType="detail" displayName="Durable Message Count" + defaultOn="true" defaultInterval="60000" dataType="measurement" category="throughput" + description="The count of all messages for all durable subscriptions to this topic"/>
- <c:simple-property required="false" name="serverPeer"> - <c:description> - The JMX ObjectName of the server peer this topic was deployed on (e.g. - "jboss.messaging:service=ServerPeer"). Updates to this property will not go into effect until - the topic has been restarted. - </c:description> - <c:constraint> - <c:regex-constraint expression="[^:]+:.+"/> - </c:constraint> - </c:simple-property> + <metric property="durableSubscriptionsCount" measurementType="dynamic" displayType="detail" displayName="Durable Subscriptions Count" + defaultOn="true" defaultInterval="60000" dataType="measurement" category="throughput" + description="The count of all durable subscriptions to this topic"/>
- <c:list-property name="securityConfig" max="4" min="2" - displayName="Security Configurations" - description="This element specifies a XML fragment which describes the access control list to be used by the SecurityManager to authorize client operations against the destination. The content model is the same as for the SecurityManager SecurityConf attribute."> - <c:map-property name="role" - displayName="Security Configuration Attributes" - description="These are the attributes that define the role name, and if the role is allowed to read, write or create Messages on this Queue"> - <c:simple-property name="name" - displayName="Name" - description="Name of the Security Role. e.g. Guest" - summary="true" - required="true"/> - <c:simple-property name="read" - displayName="Read" - description="Is this role allowed to read messages?" - summary="true" - required="false" - type="boolean"/> - <c:simple-property name="write" - displayName="Write" - description="Is this role allowed to write messages?" - summary="true" - required="false" - type="boolean"/> - <c:simple-property name="create" - displayName="Create" - description="Is this role allowed to create messages?" - summary="true" - required="false" - type="boolean"/> - </c:map-property> - </c:list-property> + <metric property="nonDurableMessageCount" measurementType="dynamic" displayType="detail" displayName="Non Durable Message Count" + defaultOn="true" defaultInterval="60000" dataType="measurement" category="throughput" + description="The count of all messages in all non durable subscriptions to this topic"/>
- </resource-configuration> + <metric property="nonDurableSubscriptionsCount" measurementType="dynamic" displayType="detail" displayName="Non Durable Subscriptions Count" + defaultOn="true" defaultInterval="60000" dataType="measurement" category="throughput" + description="The count of all non durable subscriptions to this topic"/> + + <resource-configuration> + + <!-- See: https://anonsvn.jboss.org/repos/jbossas/trunk/messaging/src/main/org/jboss/jms/server/destination/TopicServiceMO.java --> + + <c:simple-property required="true" name="name" readOnly="true" + description="The name of this topic (e.g. 'MyTopic')."/> + + <c:simple-property required="true" name="JNDIName" readOnly="true" + description="This topic's JNDI name (e.g. '/topic/MyTopic')"/> + + <c:simple-property type="boolean" required="false" name="clustered" readOnly="true" defaultValue="false"> + <c:description> + Is this topic clustered? For an existing topic, this property is read-only. If not specified + when creating a new topic, the default value is false. + </c:description> + </c:simple-property> + + <c:simple-property type="integer" required="false" name="downCacheSize" defaultValue="2000"> + <c:description> + When paging messages to storage from a subscription, they first go into a "Down Cache" before + being written to storage. This enables the write to occur as a single operation, thus aiding + performance. This setting determines the maximum number of messages that the Down Cache will hold + before they are flushed to storage. + Updates to this property will not go into effect until the topic has been restarted. + The default value is 2000. + </c:description> + <c:constraint> + <c:integer-constraint minimum="1"/> + </c:constraint> + </c:simple-property> + + <c:simple-property type="integer" required="false" name="fullSize" defaultValue="200000"> + <c:description> + The maximum number of messages held by the topic subscriptions in memory at any one time. + The actual subscription can hold many more messages than this, but these are paged to and from + storage as necessary, as messages are added or consumed. + Updates to this property will not go into effect until the topic has been restarted. + The default value is 200000. + </c:description> + <c:constraint> + <c:integer-constraint minimum="1"/> + </c:constraint> + </c:simple-property> + + <c:simple-property type="integer" required="false" name="maxDeliveryAttempts" defaultValue="-1"> + <c:description> + The number of delivery attempts before a message to a subscriber of this topic is moved to the + DLQ. The default value is 10. A value of -1 indicates the default value should be used. + </c:description> + <c:constraint> + <c:integer-constraint minimum="-1"/> + </c:constraint> + </c:simple-property> + + <c:simple-property type="integer" required="false" name="maxSize" defaultValue="-1"> + <c:description> + The maximum number of messages this topic can hold before they are dropped. + A value of -1 means there is no maximum. The default value is -1. + </c:description> + <c:constraint> + <c:integer-constraint minimum="-1"/> + </c:constraint> + </c:simple-property>
- <help> - <![CDATA[ - <p>The message counter metrics will not be collected by default. In order - for these metrics to be collected for all Topics and Queues for a given application server instance, - go to the instance's JMX Console, and invoke the - <tt>enableMessageCounters</tt> operation on the <tt>jboss.messaging:service=ServerPeer</tt> MBean. - To ensure the message counters are still enabled when the application server is restarted, - edit that instance's <tt>deploy/messaging/messaging-service.xml</tt> file and set the - <tt>EnableMessageCounters</tt> attribute to "true".</p> - ]]> - </help> + <c:simple-property type="integer" required="false" name="pageSize" defaultValue="2000"> + <c:description> + When loading messages from a subscription, this is the maximum number of messages to + pre-load in one operation. Must be less than Full Size and greater than or equal to Down Cache Size. + Updates to this property will not go into effect until the topic has been restarted. + The default value is 2000. + </c:description> + <c:constraint> + <c:integer-constraint minimum="1"/> + </c:constraint> + </c:simple-property> + + <c:simple-property type="long" required="false" name="redeliveryDelay" units="milliseconds" defaultValue="-1"> + <c:description> + The delay in milliseconds before a rolled back or recovered message is redelivered. + Set to 0 to disable redelivery. The default value is 0. A value of -1 indicates the default value should be used. + </c:description> + <c:constraint> + <c:integer-constraint minimum="-1"/> + </c:constraint> + </c:simple-property> + + <c:simple-property required="false" name="DLQ"> + <c:description> + The JMX ObjectName of the dead letter queue (DLQ) for this topic (e.g. + "jboss.messaging.destination:service=Queue,name=PrivateDLQ") - overrides the default DLQ on the + server peer. + </c:description> + <c:constraint> + <c:regex-constraint expression="[^:]+:.+"/> + </c:constraint> + </c:simple-property> + + <c:simple-property required="false" name="expiryQueue"> + <c:description> + The JMX ObjectName of the expiry queue for this topic (e.g. + "jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue") - overrides the default + expiry queue on the server peer. + </c:description> + <c:constraint> + <c:regex-constraint expression="[^:]+:.+"/> + </c:constraint> + </c:simple-property> + + <c:simple-property required="false" name="serverPeer"> + <c:description> + The JMX ObjectName of the server peer this topic was deployed on (e.g. + "jboss.messaging:service=ServerPeer"). Updates to this property will not go into effect until + the topic has been restarted. + </c:description> + <c:constraint> + <c:regex-constraint expression="[^:]+:.+"/> + </c:constraint> + </c:simple-property> + + <c:list-property name="securityConfig" max="4" min="2" + displayName="Security Configurations" + description="This element specifies a XML fragment which describes the access control list to be used by the SecurityManager to authorize client operations against the destination. The content model is the same as for the SecurityManager SecurityConf attribute."> + <c:map-property name="role" + displayName="Security Configuration Attributes" + description="These are the attributes that define the role name, and if the role is allowed to read, write or create Messages on this Queue"> + <c:simple-property name="name" + displayName="Name" + description="Name of the Security Role. e.g. Guest" + summary="true" + required="true"/> + <c:simple-property name="read" + displayName="Read" + description="Is this role allowed to read messages?" + summary="true" + required="false" + type="boolean"/> + <c:simple-property name="write" + displayName="Write" + description="Is this role allowed to write messages?" + summary="true" + required="false" + type="boolean"/> + <c:simple-property name="create" + displayName="Create" + description="Is this role allowed to create messages?" + summary="true" + required="false" + type="boolean"/> + </c:map-property> + </c:list-property> + + </resource-configuration> + + <help> + <![CDATA[ + <p>The message counter metrics will not be collected by default. In order + for these metrics to be collected for all Topics and Queues for a given application server instance, + go to the instance's JMX Console, and invoke the + <tt>enableMessageCounters</tt> operation on the <tt>jboss.messaging:service=ServerPeer</tt> MBean. + To ensure the message counters are still enabled when the application server is restarted, + edit that instance's <tt>deploy/messaging/messaging-service.xml</tt> file and set the + <tt>EnableMessageCounters</tt> attribute to "true".</p> + ]]> + </help> + + </service>
</service>
commit f50fcffea0dfe866b3a038f2e6044737d3ba0637 Author: Joseph Marques joseph@redhat.com Date: Mon May 24 02:55:38 2010 -0400
BZ-586068: fix error preventing GWT-compilation from succeeding
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java index f087ff7..ecb0cd8 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java @@ -18,11 +18,10 @@ */ package org.rhq.core.domain.measurement.composite;
+import java.io.Serializable; + import org.rhq.core.domain.measurement.MeasurementDataNumeric1H; import org.rhq.core.domain.measurement.MeasurementUnits; -import org.rhq.core.server.MeasurementConverter; - -import java.io.Serializable;
/** * Composite that holds information about an oob @@ -161,11 +160,12 @@ public class MeasurementOOBComposite implements Serializable { } }
+ /* public String getFormattedBaseband() { String min = MeasurementConverter.format(blMin, units, true); String max = MeasurementConverter.format(blMax, units, true);
- String result = min + ", " + max ; + String result = min + ", " + max;
return result; } @@ -173,6 +173,7 @@ public class MeasurementOOBComposite implements Serializable { public String getFormattedOutlier() { return MeasurementConverter.format(outlier, units, true); } + */
@Override public String toString() {
commit 3df5374cb486373c33c7c785675072fce2b1ecd1 Author: Joseph Marques joseph@redhat.com Date: Sat May 22 03:29:05 2010 -0400
cosmetic fix to the display items on the menubar's subitems
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml index f892b13..285807a 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml @@ -126,7 +126,7 @@ </rich:menuGroup>
ui:remove***** Resources > SAVED SEARCHES *****</ui:remove> - <rich:menuGroup value="Saved Searches" icon="/images/bookmark.png"> + <rich:menuGroup value="Resource Saved Searches" icon="/images/bookmark.png"> <c:forEach var="savedSearch" items="#{UserPreferencesUIBean.savedSearches}"> <c:if test="#{savedSearch.searchSubsystem.name == 'RESOURCE'}"> <rich:menuItem submitMode="none" @@ -248,8 +248,8 @@ </c:forEach> </rich:menuGroup>
- ui:remove***** Resources > SAVED SEARCHES *****</ui:remove> - <rich:menuGroup value="Saved Searches" icon="/images/bookmark.png"> + ui:remove***** Groups > SAVED SEARCHES *****</ui:remove> + <rich:menuGroup value="Group Saved Searches" icon="/images/bookmark.png"> <c:forEach var="savedSearch" items="#{UserPreferencesUIBean.savedSearches}"> <c:if test="#{savedSearch.searchSubsystem.name == 'GROUP'}"> <rich:menuItem submitMode="none"
commit a17f8553564f703e41decf3a75d9294903282bfe Author: Joseph Marques joseph@redhat.com Date: Sat May 22 03:25:41 2010 -0400
BZ-577853 - initial implementation for GWT-based group search
group search * write GroupSearchAssist for availability, category, type, plugin, name * write GroupSearchTranslator for availability, category, type, plugin, name * fix browserGroups.xhtml to leverage the new GWT-based SearchBar * pass the correct parameters to GWT-based SearchBar
saved searches * add Groups > Saved Searches to the menu bar * fully parameterize the loading routine for saved searches based off of search context/subsystem
misc * dynamically determine the "welcome message" that renders inside the search bar by default * fixed criteria query generator to properly generate queries that ONLY have search expressions and no other filters set
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/SavedSearchCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/SavedSearchCriteria.java index 213f6c2..a810df1 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/SavedSearchCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/SavedSearchCriteria.java @@ -38,7 +38,7 @@ public class SavedSearchCriteria extends Criteria { public static final long serialVersionUID = 1L;
private Integer filterId; - private SearchSubsystem filterContext; + private SearchSubsystem filterSearchSubsystem; private String filterName; private String filterDescription; private String filterPattern; @@ -73,8 +73,8 @@ public class SavedSearchCriteria extends Criteria { this.filterId = filterId; }
- public void addFilterSearchContext(SearchSubsystem filterContext) { - this.filterContext = filterContext; + public void addFilterSearchSubsystem(SearchSubsystem filterSearchSubsystem) { + this.filterSearchSubsystem = filterSearchSubsystem; }
public void addFilterName(String filterName) { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/search/SavedSearch.java b/modules/core/domain/src/main/java/org/rhq/core/domain/search/SavedSearch.java index 147942b..7f43ffa 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/search/SavedSearch.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/search/SavedSearch.java @@ -71,7 +71,7 @@ public class SavedSearch implements Serializable {
@Column(name = "CONTEXT", nullable = false) @Enumerated(EnumType.STRING) - private SearchSubsystem context; + private SearchSubsystem searchSubsystem;
@Column(name = "NAME") private String name; @@ -104,7 +104,7 @@ public class SavedSearch implements Serializable {
public SavedSearch(SearchSubsystem context, String name, String pattern, Subject subject) { // call setters to go through parameter validation - setContext(context); + setSearchSubsystem(context); setPattern(pattern); setSubject(subject); setName(name); // name can be null, to allow for saving searches quickly @@ -123,15 +123,15 @@ public class SavedSearch implements Serializable { this.id = id; }
- public SearchSubsystem getContext() { - return context; + public SearchSubsystem getSearchSubsystem() { + return searchSubsystem; }
- private void setContext(SearchSubsystem context) { - if (context == null) { - throw new IllegalArgumentException("All saved searches must be bound to a SearchContext"); + private void setSearchSubsystem(SearchSubsystem searchSubsystem) { + if (searchSubsystem == null) { + throw new IllegalArgumentException("All saved searches must be bound to a SearchSubsystem"); } - this.context = context; + this.searchSubsystem = searchSubsystem; }
public String getName() { @@ -206,7 +206,7 @@ public class SavedSearch implements Serializable { final int prime = 31; int result = 1; result = (prime * result) + subjectId; - result = (prime * result) + context.hashCode(); + result = (prime * result) + searchSubsystem.hashCode(); result = (prime * result) + ((name == null) ? 0 : name.hashCode()); result = (prime * result) + pattern.hashCode(); return result; @@ -228,7 +228,7 @@ public class SavedSearch implements Serializable { return false; }
- if (context != other.context) { + if (searchSubsystem != other.searchSubsystem) { return false; }
@@ -251,7 +251,7 @@ public class SavedSearch implements Serializable { public String toString() { return "SavedSearch [" // + "id=" + id // - + ", context=" + context // + + ", searchSubsystem=" + searchSubsystem // + ", description=" + description // + ", global=" + global // + ", lastComputeTime=" + lastComputeTime // diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java index 75cfbd8..388b27a 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java @@ -59,7 +59,8 @@ import org.rhq.enterprise.gui.coregui.client.search.suggest.SuggestTextBox; */ public class SearchBar {
- public static final String DEFAULT_SEARCH_TEXT = "search for resources"; + public String welcomeMessage; + public static final String DEFAULT_PATTERN_NAME = "name your pattern";
private static final String IMAGE_DIR = "/coregui/images/search/"; @@ -88,7 +89,7 @@ public class SearchBar {
private final SearchGWTServiceAsync searchService = GWTServiceLookup.getSearchService();
- private final SavedSearchManager savedSearchManager = new SavedSearchManager(this); + private final SavedSearchManager savedSearchManager; private SearchSubsystem searchSubsystem;
public static boolean existsOnPage() { @@ -110,13 +111,20 @@ public class SearchBar { } });
- String searchSubsystem = searchBarElement.getAttribute("searchSubsystemName"); - this.searchSubsystem = (SearchSubsystem.valueOf(searchSubsystem.toUpperCase())); + String searchSubsystem = searchBarElement.getAttribute("searchSubsystem"); + setSearchSubsystem(SearchSubsystem.valueOf(searchSubsystem.toUpperCase())); }
public SearchBar() { System.out.println("Loading SearchBar...");
+ // in the future, will be instantiated directly from a higher-level widget + if (existsOnPage()) { + loadAdditionalDataFromDivAttributes(); + } + + savedSearchManager = new SavedSearchManager(this); + RootPanel.get("patternFieldContainer").add(autoCompletePatternField); RootPanel.get("patternFieldSuggestionsContainer").add(autoCompletePatternField.getSuggestionComponent()); autoCompletePatternField.hideInitialSuggestions(); @@ -134,10 +142,6 @@ public class SearchBar { setupArrowImage(); setupSavedSearches();
- // in the future, will be instantiated directly from a higher-level widget - if (existsOnPage()) { - loadAdditionalDataFromDivAttributes(); - } // presume the enclosing page logic loads results without a button click }
@@ -145,17 +149,28 @@ public class SearchBar { return savedSearchManager; }
+ public void setSearchSubsystem(SearchSubsystem searchSubsystem) { + this.searchSubsystem = searchSubsystem; + + this.welcomeMessage = "search for " + searchSubsystem.getName().toLowerCase() + "s"; + this.autoCompletePatternField.setText(welcomeMessage); + } + public SearchSubsystem getSearchSubsystem() { return searchSubsystem; }
+ public String getWelcomeMessage() { + return welcomeMessage; + } + public void executeSearch() { String searchTerms = autoCompletePatternField.getText().toLowerCase().trim(); executeSearch(searchTerms); }
public void executeSearch(String searchTerms) { - if (searchTerms.equals(DEFAULT_SEARCH_TEXT)) { + if (searchTerms.equals(welcomeMessage)) { searchTerms = ""; }
@@ -189,7 +204,6 @@ public class SearchBar { }
private void setupAutoCompletingPatternField() { - autoCompletePatternField.setText(DEFAULT_SEARCH_TEXT); autoCompletePatternField.getElement().setId("patternField"); autoCompletePatternField.addStyleName("patternField");
@@ -315,7 +329,7 @@ public class SearchBar { @Override public void onClick(ClickEvent event) { // clear default search text if necessary - if (autoCompletePatternField.getText().equals(DEFAULT_SEARCH_TEXT)) { + if (autoCompletePatternField.getText().equals(welcomeMessage)) { autoCompletePatternField.setValue("", true); } savedSearchesPanel.hide(); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java index eb5e919..17bca44 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java @@ -150,6 +150,7 @@ public class SavedSearchManager { Subject currentUser = SearchGUI.getSessionSubject(); SavedSearchCriteria criteria = new SavedSearchCriteria(); criteria.addFilterSubjectId(currentUser.getId()); + criteria.addFilterSearchSubsystem(searchBar.getSearchSubsystem()); searchService.findSavedSearchesByCriteria(criteria, new AsyncCallback<List<SavedSearch>>() {
@Override diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox.java index 0b5d877..01db575 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox.java @@ -34,7 +34,6 @@ import com.google.gwt.user.client.ui.PopupPanel; import com.google.gwt.user.client.ui.ScrollPanel; import com.google.gwt.user.client.ui.TextBox;
-import org.rhq.core.domain.search.SearchSubsystem; import org.rhq.core.domain.search.SearchSuggestion; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync; @@ -167,7 +166,7 @@ public class SuggestTextBox extends TextBox {
@Override public void onFocus(FocusEvent event) { - if (getText().equals(SearchBar.DEFAULT_SEARCH_TEXT)) { + if (getText().equals(searchBar.getWelcomeMessage())) { setText(""); } // send a 'fake' key, this will rerender PopupPanel with the new completion list @@ -249,7 +248,7 @@ public class SuggestTextBox extends TextBox { String text = this.getText();
searchService.getSuggestions( // - SearchSubsystem.RESOURCE, // replace with appropriate subsystem somehow extracted from the context + searchBar.getSearchSubsystem(), // text, // this.getCursorPos(), // new SearchSuggestionCallback(keyCode)); diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java index aad85f1..0846cdd 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java @@ -1,8 +1,5 @@ package org.rhq.enterprise.gui.inventory.browse;
-import java.util.ArrayList; -import java.util.List; - import javax.faces.application.FacesMessage; import javax.faces.model.DataModel;
@@ -13,7 +10,6 @@ import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.criteria.ResourceGroupCriteria; import org.rhq.core.domain.resource.group.GroupCategory; import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite; -import org.rhq.core.domain.search.SearchSuggestion; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; import org.rhq.core.gui.util.FacesContextUtility; @@ -29,9 +25,11 @@ public class BrowseGroupsUIBean extends PagedDataTableUIBean {
public static final String MANAGED_BEAN_NAME = "BrowseGroupsUIBean";
- private String filter; + private String search; private GroupCategory category;
+ private ResourceGroupManagerLocal groupManager = LookupUtil.getResourceGroupManager(); + public BrowseGroupsUIBean() { String subtab = FacesContextUtility.getOptionalRequestParameter("subtab", "").toLowerCase(); if (subtab.equals("compatible")) { @@ -40,15 +38,17 @@ public class BrowseGroupsUIBean extends PagedDataTableUIBean { category = GroupCategory.MIXED; }
- filter = FacesContextUtility.getOptionalRequestParameter("filter"); + /* + search = FacesContextUtility.getOptionalRequestParameter("search"); + */ }
- public String getFilter() { - return filter; + public String getSearch() { + return this.search; }
- public void setFilter(String filter) { - this.filter = filter; + public void setSearch(String search) { + this.search = search; }
public GroupCategory getCategory() { @@ -63,8 +63,6 @@ public class BrowseGroupsUIBean extends PagedDataTableUIBean { return dataModel; }
- private ResourceGroupManagerLocal groupManager = LookupUtil.getResourceGroupManager(); - private class ResultsDataModel extends PagedListDataModel<ResourceGroupComposite> {
public ResultsDataModel(PageControlView view, String beanName) { @@ -72,13 +70,13 @@ public class BrowseGroupsUIBean extends PagedDataTableUIBean { }
public PageList<ResourceGroupComposite> fetchPage(PageControl pc) { - String filter = getFilter(); + String search = getSearch(); GroupCategory category = getCategory();
ResourceGroupCriteria criteria = new ResourceGroupCriteria(); criteria.setPageControl(pc); - if (filter != null && !filter.equals("")) { - criteria.addFilterName(filter); + if (search != null && !search.trim().equals("")) { + criteria.setSearchExpression(search); } criteria.addFilterGroupCategory(category);
@@ -88,15 +86,6 @@ public class BrowseGroupsUIBean extends PagedDataTableUIBean { } }
- public List<SearchSuggestion> autocomplete(Object suggest) { - String currentInputText = (String) suggest; - - List<SearchSuggestion> suggestions = new ArrayList<SearchSuggestion>(); - - // offer suggestions based on currentInputText - return suggestions; - } - public String deleteSelectedGroups() { try { Subject subject = getSubject(); diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml index 8e016de..f892b13 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml @@ -128,7 +128,7 @@ ui:remove***** Resources > SAVED SEARCHES *****</ui:remove> <rich:menuGroup value="Saved Searches" icon="/images/bookmark.png"> <c:forEach var="savedSearch" items="#{UserPreferencesUIBean.savedSearches}"> - <c:if test="#{savedSearch.context.name == 'RESOURCE'}"> + <c:if test="#{savedSearch.searchSubsystem.name == 'RESOURCE'}"> <rich:menuItem submitMode="none" icon="/images/icons/Flag_#{savedSearch.global ? 'yellow' : 'blue'}_16.png" onclick="window.location = '/rhq/inventory/browseResources.xhtml?subtab=all&searchId=#{savedSearch.id}'"> @@ -247,6 +247,21 @@ </c:if> </c:forEach> </rich:menuGroup> + + ui:remove***** Resources > SAVED SEARCHES *****</ui:remove> + <rich:menuGroup value="Saved Searches" icon="/images/bookmark.png"> + <c:forEach var="savedSearch" items="#{UserPreferencesUIBean.savedSearches}"> + <c:if test="#{savedSearch.searchSubsystem.name == 'GROUP'}"> + <rich:menuItem submitMode="none" + icon="/images/icons/Flag_#{savedSearch.global ? 'yellow' : 'blue'}_16.png" + onclick="window.location = '/rhq/inventory/browseGroups.xhtml?subtab=all&searchId=#{savedSearch.id}'"> + <h:outputText value="#{savedSearch.name}" /> + <h:outputText value=" (#{savedSearch.resultCount})" + rendered="#{not empty savedSearch.resultCount}" /> + </rich:menuItem> + </c:if> + </c:forEach> + </rich:menuGroup>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml index f43cff1..6afdbd4 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml @@ -10,7 +10,7 @@ xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E
- <div class="searchBarContainer #{searchButtonId} #{searchSubsystem}" + <div class="searchBarContainer" searchButtonId="#{searchButtonId}" searchSubsystem="#{searchSubsystem}" id="searchBar"> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml index 70d9821..892a9cd 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml @@ -30,44 +30,31 @@
<a4j:keepAlive beanName="BrowseGroupsUIBean"/>
+ a4j:form + <a4j:jsFunction name="applySearchFilter"> + <a4j:actionparam name="param1" assignTo="#{BrowseGroupsUIBean.search}" /> + </a4j:jsFunction> + </a4j:form> <h:form id="browseGroupsForm"> <input type="hidden" name="subtab" value="${param.subtab}"/>
<p/> - <h:panelGroup> - <h:outputLabel for="filter" value="Search: " /> - <h:inputText id="filter" value="#{BrowseGroupsUIBean.filter}" - onkeypress="return ignoreEnterKey(event);" - style="width: 600px;" /> - ui:remove - <rich:suggestionbox id="suggest" for="filter" - tokens=",[]" - width="600" height="400" - border="1" cellpadding="1" cellspacing="1" - minChars="0" - first="0" rows="10" - frequency="0.1" - var="suggestItem" - fetchValue="#{suggestItem.value}" - suggestionAction="#{BrowseGroupsUIBean.autocomplete}" - nothingLabel="Start typing for simple text matches" - usingSuggestObjects="true" - eventsQueue="groupSearchSuggestions" - ignoreDupResponses="true" - rendered="false"> <!-- disable until auto-completer is added --> - <h:column> - <h:outputText value="#{suggestItem.label}" /> - </h:column> - </rich:suggestionbox> - </ui:remove> - rich:spacer/ - <a4j:commandButton value="GO" + <h:panelGrid columns="3"> + <h:outputText value="Search: " /> + <ui:include src="/rhq/common/searchInterface.xhtml"> + <ui:param name="searchButtonId" value="browseGroupsForm:searchButtonJSF" /> + <ui:param name="searchSubsystem" value="GROUP" /> + </ui:include> + + <a4j:commandButton id="searchButtonJSF" value="GO" reRender="browseGroupsDataTable, browseGroupsDataTableScroller" + status="commonStatus" actionListener="#{BrowseGroupsUIBean.clearDataModel}" - styleClass="buttonmed"> + styleClass="buttonmed" + onclick="applySearchFilter(getElementCrossBrowser('patternField').value);"> <s:defaultAction/> </a4j:commandButton> - </h:panelGroup> + </h:panelGrid> <p/>
<h:panelGrid columns="1" width="100%"> diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java index 91676d0..d42f529 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java @@ -59,7 +59,7 @@ public class SavedSearchResultCountRecalculationJob extends AbstractStatefulJob long totalMillis = 0; for (SavedSearch next : staleSavedSearches) { try { - if (next.getContext() == SearchSubsystem.RESOURCE) { + if (next.getSearchSubsystem() == SearchSubsystem.RESOURCE) { ResourceCriteria criteria = new ResourceCriteria(); criteria.setSearchExpression(next.getPattern());
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java new file mode 100644 index 0000000..1db1100 --- /dev/null +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java @@ -0,0 +1,81 @@ +package org.rhq.enterprise.server.search.assist; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.rhq.core.domain.measurement.AvailabilityType; +import org.rhq.core.domain.resource.ResourceCategory; +import org.rhq.core.domain.search.SearchSubsystem; + +public class GroupSearchAssistant extends AbstractSearchAssistant { + + private static final List<String> parameterizedContexts; + private static final List<String> simpleContexts; + + static { + parameterizedContexts = Collections.emptyList(); + simpleContexts = Collections.unmodifiableList(Arrays.asList("availability", "category", "type", "plugin", + "name")); + } + + public SearchSubsystem getSearchSubsystem() { + return SearchSubsystem.GROUP; + } + + @Override + public String getPrimarySimpleContext() { + return "name"; + } + + @Override + public List<String> getSimpleContexts() { + return simpleContexts; + } + + @Override + public List<String> getParameterizedContexts() { + return parameterizedContexts; + } + + @Override + public List<String> getParameters(String context, String filter) { + return Collections.emptyList(); + } + + @Override + public List<String> getValues(String context, String param, String filter) { + if (context.equals("availability")) { + return filter(AvailabilityType.class, filter); + + } else if (context.equals("category")) { + return filter(ResourceCategory.class, filter); + + } else if (context.equals("type")) { + return execute("" // + + "SELECT DISTINCT type.name " // + + " FROM ResourceType type " // + + add(" WHERE LOWER(type.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + " ORDER BY type.name "); + + } else if (context.equals("plugin")) { + return execute("" // + + "SELECT DISTINCT type.plugin " // + + " FROM ResourceType type " // + + add(" WHERE LOWER(type.plugin) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + " ORDER BY type.plugin "); + + } else if (context.equals("name")) { + return execute("" // + + "SELECT DISTINCT rg.name " // + + " FROM ResourceGroup rg " // + + add(" WHERE LOWER(rg.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + " ORDER BY rg.name "); + + } else { + return Collections.emptyList(); + + } + } + +} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java index abd7b1e..05ad883 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java @@ -10,6 +10,8 @@ public class SearchAssistantFactory { public static SearchAssistant getAssistant(SearchSubsystem searchContext) { if (searchContext == SearchSubsystem.RESOURCE) { return new ResourceSearchAssistant(); + } else if (searchContext == SearchSubsystem.GROUP) { + return new GroupSearchAssistant(); } else { throw new IllegalArgumentException("No SearchAssistant found for SearchSubsystem[" + searchContext + "]"); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java index e6e5f2a..38fadd1 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java @@ -483,7 +483,7 @@ public class SearchAssistManager {
SavedSearchCriteria criteria = new SavedSearchCriteria(); criteria.addFilterSubjectId(subject.getId()); - criteria.addFilterSearchContext(searchSubsystem); + criteria.addFilterSearchSubsystem(searchSubsystem); if (expression.equals("") == false) { criteria.addFilterName(expression); } @@ -510,7 +510,7 @@ public class SearchAssistManager {
SavedSearchCriteria criteria = new SavedSearchCriteria(); criteria.addFilterGlobal(true); - criteria.addFilterSearchContext(searchSubsystem); + criteria.addFilterSearchSubsystem(searchSubsystem); if (expression.equals("") == false) { criteria.addFilterName(expression); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java new file mode 100644 index 0000000..a754f43 --- /dev/null +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java @@ -0,0 +1,67 @@ +package org.rhq.enterprise.server.search.translation; + +import org.rhq.enterprise.server.search.translation.antlr.RHQLAdvancedTerm; +import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator; +import org.rhq.enterprise.server.search.translation.jpql.SearchFragment; +import org.rhq.enterprise.server.search.translation.jpql.SearchFragmentType; + +public class GroupSearchTranslator extends AbstractSearchTranslator { + + public SearchFragment getSearchFragment(String alias, RHQLAdvancedTerm term) { + String path = term.getPath(); + RHQLComparisonOperator op = term.getOperator(); + String param = term.getParam(); + + String filter = term.getValue(); + + if (path.equals("availability")) { + if (op == RHQLComparisonOperator.NOT_NULL || op == RHQLComparisonOperator.NULL) { + return new SearchFragment(SearchFragmentType.WHERE_CLAUSE, "true"); + } + + String numericAvailabilityFragment = null; + if (op == RHQLComparisonOperator.EQUALS || op == RHQLComparisonOperator.EQUALS_STRICT) { + numericAvailabilityFragment = " = "; + } else { + numericAvailabilityFragment = " != "; + } + + if (filter.equalsIgnoreCase("up")) { + numericAvailabilityFragment += "1"; + } else { + numericAvailabilityFragment += "0"; + } + + return new SearchFragment( // + SearchFragmentType.PRIMARY_KEY_SUBQUERY, "SELECT rg.id" // + + " FROM ResourceGroup rg " // + + " WHERE ( SELECT AVG( iavail.availabilityType ) " // + + " FROM rg.explicitResources ires " // + + " JOIN ires.currentAvailability iavail ) " + numericAvailabilityFragment); + + } else if (path.equals("category")) { + return new SearchFragment(SearchFragmentType.WHERE_CLAUSE, // + getJPQLForString(alias + ".resourceType.category", op, filter)); + + } else if (path.equals("type")) { + return new SearchFragment(SearchFragmentType.WHERE_CLAUSE, // + getJPQLForString(alias + ".resourceType.name", op, filter)); + + } else if (path.equals("plugin")) { + return new SearchFragment(SearchFragmentType.WHERE_CLAUSE, // + getJPQLForString(alias + ".resourceType.plugin", op, filter)); + + } else if (path.equals("name")) { + return new SearchFragment(SearchFragmentType.WHERE_CLAUSE, // + getJPQLForString(alias + ".name", op, filter)); + + } else { + if (param == null) { + throw new IllegalArgumentException("No search fragment available for " + path); + } else { + throw new IllegalArgumentException("No search fragment available for " + path + "[" + param + "]"); + } + } + } + +} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/SearchTranslatorFactory.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/SearchTranslatorFactory.java index ee8ecda..10ad8f5 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/SearchTranslatorFactory.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/SearchTranslatorFactory.java @@ -10,6 +10,8 @@ public class SearchTranslatorFactory { public static SearchTranslator getTranslator(SearchSubsystem searchContext) { if (searchContext == SearchSubsystem.RESOURCE) { return new ResourceSearchTranslator(); + } else if (searchContext == SearchSubsystem.GROUP) { + return new GroupSearchTranslator(); } throw new IllegalArgumentException("No SearchTranslator found for SearchContext[" + searchContext + "]"); } 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 2272f12..73f1baf 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 @@ -206,7 +206,7 @@ public final class CriteriaQueryGenerator { }
Map<String, Object> filterFields = getFilterFields(criteria); - if (filterFields.size() > 0 || authorizationJoinFragment != null) { + if (filterFields.size() > 0 || authorizationJoinFragment != null || searchExpressionWhereClause != null) { results.append("WHERE "); }
commit a87c2c8db5aaadac9e7cf17137f8aea1c7821fe5 Author: Joseph Marques joseph@redhat.com Date: Sat May 22 00:52:51 2010 -0400
BZ-577853 - refactor SearchBar component so it can be reused for other SearchSubsystems
* get rid of static/singleton pattern * have SearchBar manage creation of all other services/managers/widgets * as necessary, instantitate children with a reference to their enclosing SearchBar
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java index 13f4e29..15a125c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java @@ -33,9 +33,8 @@ import org.rhq.enterprise.gui.coregui.client.search.SearchBar; public class SearchGUI implements EntryPoint {
public static SearchGUI singleton = new SearchGUI(); - public SearchBar searchBar; - private static Subject sessionSubject; + private SearchBar searchBar;
private SearchGUI() { } @@ -54,7 +53,7 @@ public class SearchGUI implements EntryPoint { }
public void buildSearchGUI() { - searchBar = SearchBar.get(); // TODO: SearchBar is a singleton right now, that restriction needs to be removed + searchBar = new SearchBar(); }
private static void portalWarLogin() { @@ -79,4 +78,8 @@ public class SearchGUI implements EntryPoint { public static Subject getSessionSubject() { return sessionSubject; } + + public SearchBar getSearchBar() { + return searchBar; + } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java index 8a38ed1..75cfbd8 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java @@ -46,6 +46,7 @@ import com.google.gwt.user.client.ui.TextBox;
import org.rhq.core.domain.criteria.SavedSearchCriteria; import org.rhq.core.domain.search.SavedSearch; +import org.rhq.core.domain.search.SearchSubsystem; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.search.favorites.SavedSearchGrid; @@ -72,7 +73,7 @@ public class SearchBar {
public static final String TRASH = IMAGE_DIR + "trash.png";
- private final SuggestTextBox autoCompletePatternField; + private final SuggestTextBox autoCompletePatternField = new SuggestTextBox(this); private final TextBox patternNameField = new TextBox(); private final Label patternNameLabel = new Label();
@@ -80,33 +81,46 @@ public class SearchBar { private final Image arrowImage = new Image(ARROW_WHITE_URL);
private final PopupPanel savedSearchesPanel = new PopupPanel(true); - private final SavedSearchGrid savedSearches = new SavedSearchGrid(); + private final SavedSearchGrid savedSearches = new SavedSearchGrid(this);
private String currentSearch = ""; private long lastNameFieldBlurTime = 0;
- private final SavedSearchManager savedSearchManager = SavedSearchManager.get(); private final SearchGWTServiceAsync searchService = GWTServiceLookup.getSearchService();
- public static SearchBar singleton; + private final SavedSearchManager savedSearchManager = new SavedSearchManager(this); + private SearchSubsystem searchSubsystem;
- public static SearchBar get() { - if (singleton == null) { - singleton = new SearchBar(); - } - return singleton; + public static boolean existsOnPage() { + return getSearchBarElement() != null; }
- public static boolean existsOnPage() { - return DOM.getElementById("searchBar") != null; + private static Element getSearchBarElement() { + return DOM.getElementById("searchBar"); }
- private SearchBar() { - System.out.println("Loading SearchBar..."); + public void loadAdditionalDataFromDivAttributes() { + Element searchBarElement = getSearchBarElement();
- autoCompletePatternField = new SuggestTextBox("patternFieldSuggestionsContainer"); + String searchButtonId = searchBarElement.getAttribute("searchButtonId"); + DOM.setEventListener(DOM.getElementById(searchButtonId), new EventListener() { + @Override + public void onBrowserEvent(Event event) { + executeSearch(); + } + }); + + String searchSubsystem = searchBarElement.getAttribute("searchSubsystemName"); + this.searchSubsystem = (SearchSubsystem.valueOf(searchSubsystem.toUpperCase())); + } + + public SearchBar() { + System.out.println("Loading SearchBar...");
RootPanel.get("patternFieldContainer").add(autoCompletePatternField); + RootPanel.get("patternFieldSuggestionsContainer").add(autoCompletePatternField.getSuggestionComponent()); + autoCompletePatternField.hideInitialSuggestions(); + RootPanel.get("patternNameFieldContainer").add(patternNameField); RootPanel.get("patternNameLabelContainer").add(patternNameLabel); RootPanel.get("starImageContainer").add(starImage); @@ -119,11 +133,22 @@ public class SearchBar { setupStarImage(); setupArrowImage(); setupSavedSearches(); - setupSearchButton();
+ // in the future, will be instantiated directly from a higher-level widget + if (existsOnPage()) { + loadAdditionalDataFromDivAttributes(); + } // presume the enclosing page logic loads results without a button click }
+ public SavedSearchManager getSavedSearchManager() { + return savedSearchManager; + } + + public SearchSubsystem getSearchSubsystem() { + return searchSubsystem; + } + public void executeSearch() { String searchTerms = autoCompletePatternField.getText().toLowerCase().trim(); executeSearch(searchTerms); @@ -218,27 +243,6 @@ public class SearchBar { savedSearches.setPatternSelectionHandler(handler); }
- private void setupSearchButton() { - Element searchButtonContainerElement = DOM.getElementById("searchButtonContainer"); - String searchButtonElementId = searchButtonContainerElement.getClassName().split(" ")[0]; // yeah, it's hacky - - Element searchButtonElement = DOM.getElementById(searchButtonElementId); - if (searchButtonElement == null) { - return; - } - - DOM.setEventListener(searchButtonElement, new EventListener() { - @Override - public void onBrowserEvent(Event event) { - executeSearch(); - } - }); - - //searchButton.addStyleName("searchButton"); - //SearchButtonEventHandler handler = new SearchButtonEventHandler(); - //searchButton.addClickHandler(handler); - } - private void turnNameFieldIntoLabel() { String pattern = autoCompletePatternField.getValue(); String name = patternNameField.getText(); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java index 76c4ad6..3c02aa4 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java @@ -33,6 +33,7 @@ import org.rhq.enterprise.gui.coregui.client.search.SearchBar; public class SavedSearchGrid extends Grid {
private PatternSelectionHandler patternSelectionHandler; + private SearchBar searchBar;
public interface PatternSelectionHandler { public void handleSelection(int rowIndex, int columnIndex, String patternName); @@ -57,15 +58,16 @@ public class SavedSearchGrid extends Grid { } }
- private static SavedSearchManager manager = SavedSearchManager.get(); + public SavedSearchGrid(SearchBar searchBar) { + super(0, 2); // assume no rows to start, but we'll always have 2 columns
- public SavedSearchGrid() { - super(count(), 2); setRowFormatter(new SavedSearchRowFormatter()); sinkEvents(Event.ONMOUSEOVER | Event.ONMOUSEOUT | Event.ONCLICK); setCellSpacing(0); setCellPadding(5); setStyleName("savedSearchesGrid"); + + this.searchBar = searchBar; }
@Override @@ -115,14 +117,14 @@ public class SavedSearchGrid extends Grid { }
public void updateModel() { - List<String> names = manager.getPatternNamesMRU(); + List<String> names = searchBar.getSavedSearchManager().getPatternNamesMRU();
clear(true); resizeRows(names.size());
for (int i = 0; i < names.size(); i++) { String name = names.get(i); - String pattern = manager.getPatternByName(name); + String pattern = searchBar.getSavedSearchManager().getPatternByName(name); setHTML(i, 0, stylize(name, pattern)); setHTML(i, 1, trashify()); } @@ -138,8 +140,8 @@ public class SavedSearchGrid extends Grid { return "<div name="action"> </div>"; }
- private static int count() { - return manager.getSavedSearchCount(); + private int count() { + return searchBar.getSavedSearchManager().getSavedSearchCount(); }
public String getSelectedItem() { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java index 3365be7..eb5e919 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java @@ -29,10 +29,10 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.criteria.SavedSearchCriteria; import org.rhq.core.domain.search.SavedSearch; -import org.rhq.core.domain.search.SearchSubsystem; import org.rhq.enterprise.gui.coregui.client.SearchGUI; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.search.SearchBar; import org.rhq.enterprise.gui.coregui.client.search.SearchLogger;
/** @@ -43,16 +43,13 @@ public class SavedSearchManager { private final SearchGWTServiceAsync searchService = GWTServiceLookup.getSearchService();
private LinkedHashMap<String, SavedSearch> savedSearches = new LinkedHashMap<String, SavedSearch>(); - private static SavedSearchManager singleton = new SavedSearchManager(); + private SearchBar searchBar;
- public SavedSearchManager() { + public SavedSearchManager(SearchBar searchBar) { + this.searchBar = searchBar; load(); }
- public synchronized static SavedSearchManager get() { - return singleton; - } - public synchronized String getPatternByName(String name) { SavedSearch savedSearch = savedSearches.get(name); if (savedSearch == null) { @@ -64,7 +61,7 @@ public class SavedSearchManager { public synchronized void updatePatternByName(final String name, final String pattern) { SavedSearch savedSearch = savedSearches.get(name); if (savedSearch == null) { // created case - final SavedSearch newSavedSearch = new SavedSearch(SearchSubsystem.RESOURCE, name, pattern, SearchGUI + final SavedSearch newSavedSearch = new SavedSearch(searchBar.getSearchSubsystem(), name, pattern, SearchGUI .getSessionSubject()); searchService.createSavedSearch(newSavedSearch, new AsyncCallback<Integer>() {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestResultsListBox.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestResultsListBox.java index d010b30..3748e97 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestResultsListBox.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestResultsListBox.java @@ -20,7 +20,6 @@ package org.rhq.enterprise.gui.coregui.client.search.suggest;
import java.util.ArrayList; import java.util.Arrays; -import java.util.Comparator; import java.util.List;
import com.google.gwt.dom.client.Document; @@ -30,34 +29,14 @@ import com.google.gwt.user.client.ui.ListBox;
import org.rhq.core.domain.search.SearchSuggestion; import org.rhq.core.domain.search.SearchSuggestion.Kind; -import org.rhq.enterprise.gui.coregui.client.search.SearchLogger;
public class SuggestResultsListBox extends ListBox { public static final String FOOTER_MESSAGE = "Start typing for more simple text matches";
- private List<SearchSuggestion> searchSuggestions; - private SuggestionItemComparator suggestionItemComparator; + private List<SearchSuggestion> searchSuggestions = new ArrayList<SearchSuggestion>();
private final List<String> OPERATORS = Arrays.asList("!==", "!=", "==", "=");
- public SuggestResultsListBox() { - this.searchSuggestions = new ArrayList<SearchSuggestion>(); - - this.suggestionItemComparator = new SuggestionItemComparator(); - } - - class SuggestionItemComparator implements Comparator<SearchSuggestion> { - public int compare(SearchSuggestion first, SearchSuggestion second) { - try { - return first.getValue().toLowerCase().compareTo(second.getValue().toLowerCase()); - } catch (Throwable t) { - SearchLogger.debug("Error sorting suggestions '" + first.getValue() + "' '" + second.getValue() + "': " - + t.getMessage()); - } - return 0; - } - }; - public void setErrorMessage(String error) { this.searchSuggestions.clear(); this.searchSuggestions.add(new SearchSuggestion(Kind.InstructionalTextComment, error)); @@ -69,9 +48,6 @@ public class SuggestResultsListBox extends ListBox { }
public int render(int maxSuggestions, int maxResultsShown) { - // sorting is done on the server-side - //Collections.sort(searchSuggestions, suggestionItemComparator); - clear(); int addedResults = 0;
@@ -86,7 +62,6 @@ public class SuggestResultsListBox extends ListBox { }
appendSuggestItem(next); - //appendSuggestItem(next.getLabel(), prefix, className, next.getStartIndex(), next.getEndIndex()); addedResults++; }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox.java index 438c163..0b5d877 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox.java @@ -31,7 +31,6 @@ import com.google.gwt.event.dom.client.KeyUpEvent; import com.google.gwt.event.dom.client.KeyUpHandler; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.PopupPanel; -import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.ScrollPanel; import com.google.gwt.user.client.ui.TextBox;
@@ -40,7 +39,6 @@ import org.rhq.core.domain.search.SearchSuggestion; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.search.SearchBar; -import org.rhq.enterprise.gui.coregui.client.search.favorites.SavedSearchManager;
public class SuggestTextBox extends TextBox {
@@ -48,12 +46,15 @@ public class SuggestTextBox extends TextBox { protected ScrollPanel choicesScrollPanel = new ScrollPanel(); protected SuggestResultsListBox choices = new SuggestResultsListBox();
+ private SearchBar searchBar; + private SearchGWTServiceAsync searchService = GWTServiceLookup.getSearchService();
- public SuggestTextBox(String rootPanelID) { + public SuggestTextBox(SearchBar searchBar) { super(); + this.searchBar = searchBar; setupTextBox(); - setupChoicesPopup(rootPanelID); + setupChoicesPopup(); setupChoicesListBox(); }
@@ -64,14 +65,14 @@ public class SuggestTextBox extends TextBox { this.addFocusHandler(handler); }
- public void setupChoicesPopup(String rootPanelID) { + public void setupChoicesPopup() { choicesPopup.removeStyleName("gwt-PopupPanel"); choicesPopup.addStyleName("suggestPanel"); choicesPopup.add(choices); + }
- RootPanel.get(rootPanelID).add(choicesPopup); - show(); - hide(); + public PopupPanel getSuggestionComponent() { + return choicesPopup; }
public void setupChoicesListBox() { @@ -82,6 +83,11 @@ public class SuggestTextBox extends TextBox { choices.addClickHandler(handler); }
+ public void hideInitialSuggestions() { + show(); + hide(); + } + public boolean isSuggestionListShowing() { return isDisplayed(); } @@ -122,9 +128,9 @@ public class SuggestTextBox extends TextBox {
// if this is a saved search pattern completion, execute that search immediately System.out.println("just completed to '" + this.getValue() + "'"); - String patternValue = SavedSearchManager.get().getPatternByName(this.getValue()); + String patternValue = searchBar.getSavedSearchManager().getPatternByName(this.getValue()); if (patternValue != null) { - SearchBar.get().executeSearch(this.getValue()); + searchBar.executeSearch(this.getValue()); } else { // send a 'fake' key, this will rerender PopupPanel with the new completion list handleKeyCode(0); diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml index 98a35b1..f43cff1 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml @@ -10,7 +10,10 @@ xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E
- <div class="searchBarContainer" id="searchBar"> + <div class="searchBarContainer #{searchButtonId} #{searchSubsystem}" + searchButtonId="#{searchButtonId}" + searchSubsystem="#{searchSubsystem}" + id="searchBar"> <div class="searchBarBackgroundContainer"> <div class="searchBarComponentsContainer"> <div class="searchBarComponentLHS" id="patternFieldContainer"></div> @@ -23,7 +26,7 @@ </div> </div> </div> - <div class="#{searchButtonId} searchBarButtonContainer" id="searchButtonContainer"></div> + <div class="searchBarButtonContainer" id="searchButtonContainer"></div> <div style="position: absolute;" id="patternFieldSuggestionsContainer"></div> <div style="position: absolute; width: 800px;" id="savedSearchesContainer"></div> <br style="clear: both;" /> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml index abd0489..571d93d 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml @@ -43,6 +43,7 @@ <h:outputText value="Search: " /> <ui:include src="/rhq/common/searchInterface.xhtml"> <ui:param name="searchButtonId" value="browseResourcesForm:searchButtonJSF" /> + <ui:param name="searchSubsystem" value="RESOURCE" /> </ui:include>
<a4j:commandButton id="searchButtonJSF" value="GO" diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java index 1c31930..cf9acf7 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java @@ -51,10 +51,10 @@ public class SearchTranslationManager { this.translator = SearchTranslatorFactory.getTranslator(this.context); this.assistant = SearchAssistantFactory.getAssistant(this.context);
- ANTLRStringStream input = new ANTLRStringStream(expression); // Create an input character stream from standard in + ANTLRStringStream input = new ANTLRStringStream(this.expression); // Create an input character stream from standard in this.lexer = new RHQLLexer(input); // Create an echoLexer that feeds from that stream
- CommonTokenStream tokens = new CommonTokenStream(lexer); // Create a stream of tokens fed by the lexer + CommonTokenStream tokens = new CommonTokenStream(this.lexer); // Create a stream of tokens fed by the lexer this.parser = new RHQLParser(tokens); // Create a parser that feeds off the token stream
this.adaptor = new RHQLNodeAdaptor();
commit 817a233c148bf742f94a623016e1b94ee9e993b7 Author: Joseph Marques joseph@redhat.com Date: Fri May 21 20:48:54 2010 -0400
add missing interface
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/antlr/RHQLTerm.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/antlr/RHQLTerm.java new file mode 100644 index 0000000..013bc08 --- /dev/null +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/antlr/RHQLTerm.java @@ -0,0 +1,5 @@ +package org.rhq.enterprise.server.search.translation.antlr; + +public interface RHQLTerm { + +}
commit 8701f1d8a65a592953d4617c294559670e5ea2d4 Author: Joseph Marques joseph@redhat.com Date: Fri May 21 20:27:06 2010 -0400
BZ-562434 - finish up the translation routine for simple text searches
* convert simple text terms into advanced terms for the primarySimpleContext
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/antlr/RHQLAdvancedTerm.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/antlr/RHQLAdvancedTerm.java index 2d435df..abe36f2 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/antlr/RHQLAdvancedTerm.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/antlr/RHQLAdvancedTerm.java @@ -36,4 +36,4 @@ public class RHQLAdvancedTerm implements RHQLTerm { public String getValue() { return value; } -} +} \ No newline at end of file
commit 5207360b0c339375ab78d9f7b86ec73c3c9850cc Author: Joseph Marques joseph@redhat.com Date: Fri May 21 20:24:15 2010 -0400
BZ-562434 - finish up the translation routine for simple text searches
* convert simple text terms into advanced terms for the primarySimpleContext
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml index ddb8f3b..abd0489 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml @@ -50,7 +50,7 @@ status="commonStatus" actionListener="#{BrowseResourcesUIBean.clearDataModel}" styleClass="buttonmed" - onclick="applySearchFilter(getElementCrossBrowser('patternField'));"> + onclick="applySearchFilter(getElementCrossBrowser('patternField').value);"> <s:defaultAction/> </a4j:commandButton> </h:panelGrid> diff --git a/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g b/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g index 6816a1e..517bece 100644 --- a/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g +++ b/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g @@ -75,11 +75,11 @@ tokens { */
searchExpression - : conditionalExpression { /* System.out.println($conditionalExpression.tree.toStringTree()); */ } + : conditionalExpression ;
conditionalExpression - : conds+=conditionalFactor ( WS+ ( 'or' | '|' ) WS+ conds+=conditionalFactor )* -> { $conds.size() == 1 }? ^($conds) + : conds+=conditionalFactor ( WS+ ( '|' ) WS+ conds+=conditionalFactor )* -> { $conds.size() == 1 }? ^($conds) -> ^(OR conditionalFactor+) ; // use rewrite predicates to eliminate superfluous 'or' node if only one child
@@ -136,7 +136,7 @@ boundedValue ; // consume until we find a whitespace char or ']' to terminate the current phrase
openEndedvalue - : ~( '(' | ')' | WS )* + : ~( '|' ) ~( '(' | ')' | WS )* ; // consume until we find a whitespace char to ')' terminate the current phrase, or '(' begin the next phrase
comparisonOperator @@ -149,7 +149,7 @@ comparisonOperator /* * lexical elements */ - + ID : 'a'..'z' | 'A'..'Z' ; diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java index a459d87..c35edc0 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java @@ -27,6 +27,10 @@ public abstract class AbstractSearchAssistant implements SearchAssistant { this.maxResultCount = maxResultCount; }
+ public String getPrimarySimpleContext() { + return null; + } + public List<String> getSimpleContexts() { return Collections.emptyList(); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java index d0721eb..476d219 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java @@ -24,6 +24,11 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant { }
@Override + public String getPrimarySimpleContext() { + return "name"; + } + + @Override public List<String> getSimpleContexts() { return simpleContexts; } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistant.java index 4314e06..afac3f6 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistant.java @@ -8,6 +8,8 @@ public interface SearchAssistant {
SearchSubsystem getSearchSubsystem();
+ String getPrimarySimpleContext(); + List<String> getSimpleContexts();
List<String> getParameterizedContexts(); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java new file mode 100644 index 0000000..abd7b1e --- /dev/null +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java @@ -0,0 +1,17 @@ +package org.rhq.enterprise.server.search.assist; + +import org.rhq.core.domain.search.SearchSubsystem; + +public class SearchAssistantFactory { + private SearchAssistantFactory() { + // force use of static methods only + } + + public static SearchAssistant getAssistant(SearchSubsystem searchContext) { + if (searchContext == SearchSubsystem.RESOURCE) { + return new ResourceSearchAssistant(); + } else { + throw new IllegalArgumentException("No SearchAssistant found for SearchSubsystem[" + searchContext + "]"); + } + } +} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java index a52159a..e6e5f2a 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java @@ -17,8 +17,8 @@ import org.rhq.core.domain.search.SearchSuggestion; import org.rhq.core.domain.search.SearchSuggestion.Kind; import org.rhq.core.domain.util.PageOrdering; import org.rhq.enterprise.server.search.SavedSearchManagerLocal; -import org.rhq.enterprise.server.search.assist.AbstractSearchAssistant; -import org.rhq.enterprise.server.search.assist.ResourceSearchAssistant; +import org.rhq.enterprise.server.search.assist.SearchAssistant; +import org.rhq.enterprise.server.search.assist.SearchAssistantFactory; import org.rhq.enterprise.server.util.LookupUtil;
public class SearchAssistManager { @@ -309,15 +309,10 @@ public class SearchAssistManager { public SearchAssistManager(Subject subject, SearchSubsystem searchSubsystem) { this.subject = subject; this.searchSubsystem = searchSubsystem; - }
- protected AbstractSearchAssistant getSearchAssistant() { - if (searchSubsystem == SearchSubsystem.RESOURCE) { - return new ResourceSearchAssistant(); - } else { - throw new IllegalArgumentException("No SearchAssistant found for SearchSubsystem[" + searchSubsystem + "]"); - } + protected SearchAssistant getSearchAssistant() { + return SearchAssistantFactory.getAssistant(searchSubsystem); }
private List<String> getAllContexts() { @@ -349,7 +344,7 @@ public class SearchAssistManager { }
public List<SearchSuggestion> getSimpleSuggestions(String expression, int caretPos) { - AbstractSearchAssistant completor = getSearchAssistant(); + SearchAssistant completor = getSearchAssistant();
debug("getSimpleSuggestions: START");
@@ -366,25 +361,16 @@ public class SearchAssistManager { * would hold it's current value, which in this case we'll extract and use as the simple value match */ String parsedTerm = parsed.context; - List<SearchSuggestion> results = new ArrayList<SearchSuggestion>(); - for (String nextContext : completor.getSimpleContexts()) { - - debug("getSimpleSuggestions: suggesting value completions for a simple context [" + nextContext + "]"); - List<String> valueSuggestions = pad(""", completor.getValues(nextContext, null, parsedTerm), """); + String primarySimpleContext = completor.getPrimarySimpleContext(); + debug("getSimpleSuggestions: suggesting value completions for a simple context [" + primarySimpleContext + "]");
- List<SearchSuggestion> suggestions = convert(valueSuggestions, parsed, parsedTerm, Kind.Simple); - results.addAll(suggestions); - } - Collections.sort(results); - if (results.size() > completor.getMaxResultCount()) { - return results.subList(0, completor.getMaxResultCount()); - } else { - return results; - } + List<String> valueSuggestions = pad(""", completor.getValues(primarySimpleContext, null, parsedTerm), """); + List<SearchSuggestion> suggestions = convert(valueSuggestions, parsed, parsedTerm, Kind.Simple); + return suggestions; }
public List<SearchSuggestion> getAdvancedSuggestions(String expression, int caretPos) { - AbstractSearchAssistant completor = getSearchAssistant(); + SearchAssistant completor = getSearchAssistant();
debug("getAdvancedSuggestions: START"); SearchTermAssistant assistant = new SearchTermAssistant(expression, caretPos); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java index 812bc57..1c31930 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java @@ -13,9 +13,13 @@ import org.rhq.core.domain.search.SearchSubsystem; import org.rhq.enterprise.server.search.RHQLLexer; import org.rhq.enterprise.server.search.RHQLParser; import org.rhq.enterprise.server.search.antlr.RHQLNodeAdaptor; +import org.rhq.enterprise.server.search.assist.SearchAssistant; +import org.rhq.enterprise.server.search.assist.SearchAssistantFactory; import org.rhq.enterprise.server.search.translation.SearchTranslator; import org.rhq.enterprise.server.search.translation.SearchTranslatorFactory; +import org.rhq.enterprise.server.search.translation.antlr.RHQLAdvancedTerm; import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator; +import org.rhq.enterprise.server.search.translation.antlr.RHQLSimpleTerm; import org.rhq.enterprise.server.search.translation.antlr.RHQLTerm; import org.rhq.enterprise.server.search.translation.antlr.RHQLTreeOperator; import org.rhq.enterprise.server.search.translation.jpql.SearchFragment; @@ -26,6 +30,7 @@ public class SearchTranslationManager { private SearchSubsystem context; private String expression; private SearchTranslator translator; + private SearchAssistant assistant;
private RHQLLexer lexer; private RHQLParser parser; @@ -44,6 +49,7 @@ public class SearchTranslationManager { this.expression = expression;
this.translator = SearchTranslatorFactory.getTranslator(this.context); + this.assistant = SearchAssistantFactory.getAssistant(this.context);
ANTLRStringStream input = new ANTLRStringStream(expression); // Create an input character stream from standard in this.lexer = new RHQLLexer(input); // Create an echoLexer that feeds from that stream @@ -103,7 +109,16 @@ public class SearchTranslationManager { first = false; }
- SearchFragment searchFragment = translator.getSearchFragment(alias, nextTerm); + RHQLAdvancedTerm advancedTerm = null; + if (nextTerm instanceof RHQLSimpleTerm) { + RHQLSimpleTerm simpleTerm = (RHQLSimpleTerm) nextTerm; + advancedTerm = new RHQLAdvancedTerm(null, assistant.getPrimarySimpleContext(), null, + RHQLComparisonOperator.EQUALS, simpleTerm.getValue()); + } else { + advancedTerm = (RHQLAdvancedTerm) nextTerm; + } + + SearchFragment searchFragment = translator.getSearchFragment(alias, advancedTerm); String jpqlFragment = searchFragment.getFragment(); if (searchFragment.getType() == SearchFragmentType.PRIMARY_KEY_SUBQUERY) { jpqlFragment = " " + alias + ".id IN (" + jpqlFragment + ")"; @@ -120,11 +135,19 @@ public class SearchTranslationManager { public static List<RHQLTerm> getFromAST(CommonTree tree) { List<RHQLTerm> terms = new ArrayList<RHQLTerm>();
- CommonTree contextTree = (CommonTree) tree.getChild(0); + // simple text match + if (tree.getToken().getType() == RHQLLexer.IDENT) { + String value = PrintUtils.collapseStringChildren(tree); + RHQLTerm nextTerm = new RHQLSimpleTerm(value); + terms.add(nextTerm); + return terms; + }
+ // advanced query match String lineage = null; String path = null; String param = null; + CommonTree contextTree = (CommonTree) tree.getChild(0); for (int childIndex = 0; childIndex < contextTree.getChildCount(); childIndex++) { CommonTree child = (CommonTree) contextTree.getChild(childIndex); if (child.getToken().getType() == RHQLLexer.LINEAGE) { @@ -147,7 +170,7 @@ public class SearchTranslationManager { int type = tree.getToken().getType(); RHQLComparisonOperator operator = getComparisonOperatorFromTokenType(type, value);
- RHQLTerm nextTerm = new RHQLTerm(lineage, path, param, operator, value); + RHQLTerm nextTerm = new RHQLAdvancedTerm(lineage, path, param, operator, value); terms.add(nextTerm); } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java index 1b1565c..db4269c 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java @@ -1,14 +1,14 @@ package org.rhq.enterprise.server.search.translation;
import org.rhq.core.domain.measurement.AvailabilityType; +import org.rhq.enterprise.server.search.translation.antlr.RHQLAdvancedTerm; import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator; -import org.rhq.enterprise.server.search.translation.antlr.RHQLTerm; import org.rhq.enterprise.server.search.translation.jpql.SearchFragment; import org.rhq.enterprise.server.search.translation.jpql.SearchFragmentType;
public class ResourceSearchTranslator extends AbstractSearchTranslator {
- public SearchFragment getSearchFragment(String alias, RHQLTerm term) { + public SearchFragment getSearchFragment(String alias, RHQLAdvancedTerm term) { String path = term.getPath(); RHQLComparisonOperator op = term.getOperator(); String param = term.getParam(); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/SearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/SearchTranslator.java index eca293f..4febbe8 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/SearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/SearchTranslator.java @@ -1,9 +1,9 @@ package org.rhq.enterprise.server.search.translation;
-import org.rhq.enterprise.server.search.translation.antlr.RHQLTerm; +import org.rhq.enterprise.server.search.translation.antlr.RHQLAdvancedTerm; import org.rhq.enterprise.server.search.translation.jpql.SearchFragment;
public interface SearchTranslator {
- public SearchFragment getSearchFragment(String alias, RHQLTerm term); + public SearchFragment getSearchFragment(String alias, RHQLAdvancedTerm term); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/antlr/RHQLAdvancedTerm.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/antlr/RHQLAdvancedTerm.java new file mode 100644 index 0000000..2d435df --- /dev/null +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/antlr/RHQLAdvancedTerm.java @@ -0,0 +1,39 @@ +package org.rhq.enterprise.server.search.translation.antlr; + +public class RHQLAdvancedTerm implements RHQLTerm { + private final String lineage; + private final String path; + private final String param; + + private final RHQLComparisonOperator operator; + + private final String value; + + public RHQLAdvancedTerm(String lineage, String path, String param, RHQLComparisonOperator operator, String value) { + this.lineage = lineage; + this.path = path; + this.param = param; + this.operator = operator; + this.value = value; + } + + public String getLineage() { + return lineage; + } + + public String getPath() { + return path; + } + + public String getParam() { + return param; + } + + public RHQLComparisonOperator getOperator() { + return operator; + } + + public String getValue() { + return value; + } +} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/antlr/RHQLSimpleTerm.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/antlr/RHQLSimpleTerm.java new file mode 100644 index 0000000..f60fe65 --- /dev/null +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/antlr/RHQLSimpleTerm.java @@ -0,0 +1,13 @@ +package org.rhq.enterprise.server.search.translation.antlr; + +public class RHQLSimpleTerm implements RHQLTerm { + private final String value; + + public RHQLSimpleTerm(String value) { + this.value = value; + } + + public String getValue() { + return value; + } +} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/antlr/RHQLTerm.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/antlr/RHQLTerm.java deleted file mode 100644 index 687607d..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/antlr/RHQLTerm.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.rhq.enterprise.server.search.translation.antlr; - -public class RHQLTerm { - private final String lineage; - private final String path; - private final String param; - - private final RHQLComparisonOperator operator; - - private final String value; - - public RHQLTerm(String lineage, String path, String param, RHQLComparisonOperator operator, String value) { - this.lineage = lineage; - this.path = path; - this.param = param; - this.operator = operator; - this.value = value; - } - - public String getLineage() { - return lineage; - } - - public String getPath() { - return path; - } - - public String getParam() { - return param; - } - - public RHQLComparisonOperator getOperator() { - return operator; - } - - public String getValue() { - return value; - } -} diff --git a/modules/enterprise/server/jar/src/main/resources/single-line-rhql.txt b/modules/enterprise/server/jar/src/main/resources/single-line-rhql.txt index 265071b..25746f8 100644 --- a/modules/enterprise/server/jar/src/main/resources/single-line-rhql.txt +++ b/modules/enterprise/server/jar/src/main/resources/single-line-rhql.txt @@ -46,12 +46,6 @@ context[param] != null (context[param] != null)
-# single-pair parenthetical combinations -# simple expression, 'or' boolean operator -context = value1 or context = value2 -(context = value1) or context = value2 -context = value1 or (context = value2) -(context = value1) or (context = value2)
# single-pair parenthetical combinations # simple expression, '|' boolean operator (meaning 'or') @@ -69,14 +63,6 @@ context = value (context = value) (context = value) (context = value)
-# double-pair parenthetical combinations -# simple expression, 'or' boolean operator -((context = value1 or context = value2)) -((context = value1) or context = value2) -((context = value1)) or context = value2 -(context = value1) or (context = value2) -(context = value1 or (context = value2)) -context = value1 or ((context = value2))
# double-pair parenthetical combinations # simple expression, '|' boolean operator (meaning 'or') diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/RHQLTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/RHQLTest.java index e2f3fcb..26d122c 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/RHQLTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/RHQLTest.java @@ -41,6 +41,8 @@ import org.testng.annotations.AfterSuite; import org.testng.annotations.BeforeSuite; import org.testng.annotations.Test;
+import org.rhq.enterprise.server.search.RHQLParser.searchExpression_return; + /** * Test harness to verify correctness of RHQL grammar * @@ -66,7 +68,8 @@ public class RHQLTest extends AssertJUnit { RHQLLexer lexer = new RHQLLexer(input); // Create an echoLexer that feeds from that stream CommonTokenStream tokens = new CommonTokenStream(lexer); // Create a stream of tokens fed by the lexer RHQLParser parser = new RHQLParser(tokens); // Create a parser that feeds off the token stream - parser.searchExpression(); // Begin parsing at 'searchExpression' rule + searchExpression_return parseResults = parser.searchExpression(); // Begin parsing at 'searchExpression' rule + System.out.println(parseResults.tree.toStringTree()); // Print result return TestResult.SUCCESS; } catch (Throwable t) { return TestResult.FAILURE;
commit 9189cf82995c28beac1d5f060417015ce670157c Author: Joseph Marques joseph@redhat.com Date: Fri May 21 19:07:29 2010 -0400
bring back the feature to auto-fresh resource/group counts in the inventory browser tab headers
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/layout/main.xhtml index 24c4a72..ceb1d3e 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/layout/main.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/layout/main.xhtml @@ -28,15 +28,13 @@ <ui:define name="summary"></ui:define>
<ui:define name="tabBar"> - ui:remove + a4j:region <h:form> <a4j:poll interval="60000" timeout="5000" reRender="browserTabBarPanel" status="commonStatus" /> </h:form> </a4j:region> - </ui:remove> -
<onc:tabBar id="browserTabBarPanel" selectedTabName="#{selectedTabName}" > <onc:tab name="Resources"
commit 19a5b91156442e37c3196b1aed1e07f2c2938924 Author: Joseph Marques joseph@redhat.com Date: Fri May 21 17:11:46 2010 -0400
BZ-577853 - second cut of GWT-based search bar functionality:
* fixed ViewExpiredException by NOT calling j_security_check.do from SearchGUI, which causes session invalidation and re-login
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java index faeeab0..13f4e29 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java @@ -19,11 +19,6 @@ package org.rhq.enterprise.gui.coregui.client;
import com.google.gwt.core.client.EntryPoint; -import com.google.gwt.http.client.Request; -import com.google.gwt.http.client.RequestBuilder; -import com.google.gwt.http.client.RequestCallback; -import com.google.gwt.http.client.RequestException; -import com.google.gwt.http.client.Response; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.widgets.Label;
@@ -39,7 +34,7 @@ public class SearchGUI implements EntryPoint {
public static SearchGUI singleton = new SearchGUI(); public SearchBar searchBar; - + private static Subject sessionSubject;
private SearchGUI() { @@ -63,23 +58,6 @@ public class SearchGUI implements EntryPoint { }
private static void portalWarLogin() { - RequestBuilder b = new RequestBuilder(RequestBuilder.GET, - "/j_security_check.do?j_username=rhqadmin&j_password=rhqadmin"); - try { - b.setCallback(new RequestCallback() { - public void onResponseReceived(Request request, Response response) { - System.out.println("Portal-War logged in"); - } - - public void onError(Request request, Throwable exception) { - System.out.println("Portal-War login failed"); - } - }); - b.send(); - } catch (RequestException e) { - e.printStackTrace(); - } - SubjectGWTServiceAsync subjectService = SubjectGWTServiceAsync.Util.getInstance();
subjectService.login("rhqadmin", "rhqadmin", new AsyncCallback<Subject>() { @@ -97,7 +75,7 @@ public class SearchGUI implements EntryPoint { } }); } - + public static Subject getSessionSubject() { return sessionSubject; } diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java index dabf0a5..f6d1290 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java @@ -1,9 +1,6 @@ package org.rhq.enterprise.gui.inventory.browse;
-import java.util.List; - import javax.faces.application.FacesMessage; -import javax.faces.component.html.HtmlInputText; import javax.faces.model.DataModel;
import org.apache.commons.logging.Log; @@ -13,8 +10,6 @@ import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.criteria.ResourceCriteria; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.resource.composite.ResourceComposite; -import org.rhq.core.domain.search.SearchSubsystem; -import org.rhq.core.domain.search.SearchSuggestion; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; import org.rhq.core.gui.util.FacesContextUtility; @@ -25,8 +20,6 @@ import org.rhq.enterprise.gui.common.paging.PageControlView; import org.rhq.enterprise.gui.common.paging.ResourceNameDisambiguatingPagedListDataModel; import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility; import org.rhq.enterprise.server.resource.ResourceManagerLocal; -import org.rhq.enterprise.server.search.execution.SearchAssistManager; -import org.rhq.enterprise.server.util.HibernatePerformanceMonitor; import org.rhq.enterprise.server.util.LookupUtil;
public class BrowseResourcesUIBean extends PagedDataTableUIBean { @@ -35,7 +28,6 @@ public class BrowseResourcesUIBean extends PagedDataTableUIBean { public static final String MANAGED_BEAN_NAME = "BrowseResourcesUIBean";
private String search; - private HtmlInputText searchInput; private ResourceCategory category;
private ResourceManagerLocal resourceManager = LookupUtil.getResourceManager(); @@ -134,24 +126,4 @@ public class BrowseResourcesUIBean extends PagedDataTableUIBean { private String[] getSelectedItems() { return FacesContextUtility.getRequest().getParameterValues("selectedItems"); } - - SearchAssistManager searchAssist = new SearchAssistManager(getSubject(), SearchSubsystem.RESOURCE); - - public List<SearchSuggestion> autocomplete(Object suggest) { - String currentInputText = (String) suggest; - - // assume caret at the end of the input - long id = HibernatePerformanceMonitor.get().start(); - List<SearchSuggestion> suggestions = searchAssist.getSuggestions(currentInputText, currentInputText.length()); - HibernatePerformanceMonitor.get().stop(id, "ResourceSuggestions"); - return suggestions; - } - - public HtmlInputText getSearchInput() { - return searchInput; - } - - public void setSearchInput(HtmlInputText searchInput) { - this.searchInput = searchInput; - } } diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml index 4972201..ddb8f3b 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml @@ -31,7 +31,7 @@ <a4j:keepAlive beanName="BrowseResourcesUIBean"/>
a4j:form - <a4j:jsFunction name="extractSearchFilter"> + <a4j:jsFunction name="applySearchFilter"> <a4j:actionparam name="param1" assignTo="#{BrowseResourcesUIBean.search}" /> </a4j:jsFunction> </a4j:form> @@ -39,60 +39,6 @@ <input type="hidden" name="subtab" value="${param.subtab}" />
<p/> - <h:panelGroup> - <h:outputLabel for="search" value="Search: " /> - <h:inputText id="search" - binding="#{BrowseResourcesUIBean.searchInput}" - value="#{BrowseResourcesUIBean.search}" - onkeypress="return ignoreEnterKey(event);" - style="width: 600px;"> - ui:remove - <a4j:support event="onfocus" reRender="suggest" - disableDefault="true" status="commonStatus" limitToList="true" - ajaxSingle="true" oncomplete="#{rich:component('suggest')}.show(event, {})"/> - </ui:remove> - </h:inputText> - <rich:suggestionbox id="suggest" for="search" - width="600" height="400" - border="1" cellpadding="1" cellspacing="1" - minChars="0" - first="0" rows="10" - frequency="0" - var="suggestItem" - fetchValue="#{suggestItem.value}" - selfRendered="true" - suggestionAction="#{BrowseResourcesUIBean.autocomplete}" - nothingLabel="Start typing for simple text matches" - usingSuggestObjects="true" - eventsQueue="resourceSearchSuggestions" - ignoreDupResponses="true" - rendered="true"> - <h:column width="10%"> - <h:outputText value="#{suggestItem.kind.displayName}" style="font-variant: small-caps; color: gray;" - rendered="#{suggestItem.kind.name eq 'Simple'}" /> - <h:outputText value="#{suggestItem.kind.displayName}" style="font-variant: small-caps; " - rendered="#{suggestItem.kind.name eq 'Advanced'}" /> - <h:outputText value="#{suggestItem.kind.displayName}" style="font-variant: small-caps; color: yellow" - rendered="#{suggestItem.kind.name eq 'AdvancedOperator'}" /> - <h:outputText value="#{suggestItem.kind.displayName}" style="font-variant: small-caps; color: green;" - rendered="#{suggestItem.kind.name eq 'UserSavedSearch'}" /> - <h:outputText value="#{suggestItem.kind.displayName}" style="font-variant: small-caps; color: orange;" - rendered="#{suggestItem.kind.name eq 'GlobalSavedSearch'}" /> - </h:column> - <h:column width="90%"> - <h:outputText value="#{suggestItem.label}" /> - </h:column> - </rich:suggestionbox> - rich:spacer/ - <a4j:commandButton value="GO" - reRender="browseResourcesDataTable, browseResourcesDataTableScroller" - status="commonStatus" - actionListener="#{BrowseResourcesUIBean.clearDataModel}" - styleClass="buttonmed"> - <s:defaultAction/> - </a4j:commandButton> - </h:panelGroup> - ui:remove <h:panelGrid columns="3"> <h:outputText value="Search: " /> <ui:include src="/rhq/common/searchInterface.xhtml"> @@ -104,11 +50,10 @@ status="commonStatus" actionListener="#{BrowseResourcesUIBean.clearDataModel}" styleClass="buttonmed" - onclick="extractSearchFilter(getElementCrossBrowser('patternField').value)"> + onclick="applySearchFilter(getElementCrossBrowser('patternField'));"> <s:defaultAction/> </a4j:commandButton> </h:panelGrid> - </ui:remove> <p/>
<h:panelGrid columns="1" width="100%"> diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java index 3d5393b..a52159a 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java @@ -599,6 +599,6 @@ public class SearchAssistManager { }
private void debug(String message) { - LOG.info(message); + LOG.debug(message); } }
commit 457218a94047b24443699df5fab3fc67031f884b Author: John Mazzitelli mazz@redhat.com Date: Fri May 21 15:39:13 2010 -0400
if failed to load in inventory.dat, clear out any inventory that might have been partially loaded, remove the inventory.dat (we rename it actually, in case we want to perform some post-failure analysis on it) and return as if there was no inventory.dat (thus making the agent start up as if it has no known inventory to start with)
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java index e309286..8944b99 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java @@ -1535,8 +1535,9 @@ public class InventoryManager extends AgentService implements ContainerService, private void loadFromDisk() { this.inventoryLock.writeLock().lock();
+ File file = null; try { - File file = new File(this.configuration.getDataDirectory(), "inventory.dat"); + file = new File(this.configuration.getDataDirectory(), "inventory.dat"); if (file.exists()) { long start = System.currentTimeMillis(); log.info("Loading inventory from data file [" + file + "]..."); @@ -1558,7 +1559,14 @@ public class InventoryManager extends AgentService implements ContainerService, + (System.currentTimeMillis() - start) + "ms]"); } } catch (Exception e) { - log.error("Could not load inventory from data file.", e); + this.platform = null; + this.resourceContainers.clear(); + if (file != null) { + file.renameTo(new File(file.getAbsolutePath() + ".invalid")); // move it out of the way if we can, retain it for later analysis + } + log.error( + "Could not load inventory from data file. The agent has lost knowledge of its previous inventory - " + + "it will resync its inventory once it can reconnect with a server.", e); } finally { this.inventoryLock.writeLock().unlock(); }
commit 1530276cf9237ac28569f649220c2e81ba7c7ed4 Author: John Mazzitelli mazz@redhat.com Date: Fri May 21 15:39:13 2010 -0400
if failed to load in inventory.dat, clear out any inventory that might have been partially loaded, remove the inventory.dat (we rename it actually, in case we want to perform some post-failure analysis on it) and return as if there was no inventory.dat (thus making the agent start up as if it has no known inventory to start with)
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java index e309286..8944b99 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java @@ -1535,8 +1535,9 @@ public class InventoryManager extends AgentService implements ContainerService, private void loadFromDisk() { this.inventoryLock.writeLock().lock();
+ File file = null; try { - File file = new File(this.configuration.getDataDirectory(), "inventory.dat"); + file = new File(this.configuration.getDataDirectory(), "inventory.dat"); if (file.exists()) { long start = System.currentTimeMillis(); log.info("Loading inventory from data file [" + file + "]..."); @@ -1558,7 +1559,14 @@ public class InventoryManager extends AgentService implements ContainerService, + (System.currentTimeMillis() - start) + "ms]"); } } catch (Exception e) { - log.error("Could not load inventory from data file.", e); + this.platform = null; + this.resourceContainers.clear(); + if (file != null) { + file.renameTo(new File(file.getAbsolutePath() + ".invalid")); // move it out of the way if we can, retain it for later analysis + } + log.error( + "Could not load inventory from data file. The agent has lost knowledge of its previous inventory - " + + "it will resync its inventory once it can reconnect with a server.", e); } finally { this.inventoryLock.writeLock().unlock(); }
commit aeebeea6b406adbcfbb9fa246df7aa56564eb5c5 Merge: 18c8f56... dc9a555... Author: John Sanda jsanda@redhat.com Date: Fri May 21 15:28:46 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 18c8f561255db46b53584314d75cdb0ea2cdc241 Author: John Sanda jsanda@redhat.com Date: Fri May 21 15:27:08 2010 -0400
[BZ 586068] Removing GWT dependency
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java index 32271fe..f087ff7 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java @@ -18,9 +18,9 @@ */ package org.rhq.core.domain.measurement.composite;
-import org.rhq.core.domain.measurement.MeasurementConverterClient; import org.rhq.core.domain.measurement.MeasurementDataNumeric1H; import org.rhq.core.domain.measurement.MeasurementUnits; +import org.rhq.core.server.MeasurementConverter;
import java.io.Serializable;
@@ -162,9 +162,8 @@ public class MeasurementOOBComposite implements Serializable { }
public String getFormattedBaseband() { - - String min = MeasurementConverterClient.format(blMin, units, true); - String max = MeasurementConverterClient.format(blMax, units, true); + String min = MeasurementConverter.format(blMin, units, true); + String max = MeasurementConverter.format(blMax, units, true);
String result = min + ", " + max ;
@@ -172,7 +171,7 @@ public class MeasurementOOBComposite implements Serializable { }
public String getFormattedOutlier() { - return MeasurementConverterClient.format(outlier, units, true); + return MeasurementConverter.format(outlier, units, true); }
@Override diff --git a/modules/core/domain/src/test/java/org/rhq/core/domain/configuration/ResourceConfigurationUpdateIntegrationTest.java b/modules/core/domain/src/test/java/org/rhq/core/domain/configuration/ResourceConfigurationUpdateIntegrationTest.java new file mode 100644 index 0000000..c205f03 --- /dev/null +++ b/modules/core/domain/src/test/java/org/rhq/core/domain/configuration/ResourceConfigurationUpdateIntegrationTest.java @@ -0,0 +1,74 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * 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.domain.configuration; + +import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.ResourceCategory; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.domain.test.AbstractEJB3Test; +import org.testng.annotations.Test; + +import javax.persistence.EntityManager; + +public class ResourceConfigurationUpdateIntegrationTest extends AbstractEJB3Test { + + @Test + public void testUpdate() throws Exception { + try { + getTransactionManager().begin(); + EntityManager entityMgr = getEntityManager(); + + ResourceType resourceType = new ResourceType("Test Resource Type", "Test Plugin", ResourceCategory.PLATFORM, + null); + entityMgr.persist(resourceType); + entityMgr.flush(); + + Resource resource = new Resource("test-resource", "Test Resource", resourceType); + resource.setUuid("123456789"); + entityMgr.persist(resource); + entityMgr.flush(); + + Configuration configuration = new Configuration(); + + PropertyList listProperty = new PropertyList("listProperty"); + listProperty.add(new PropertySimple("x", 1)); + listProperty.add(new PropertySimple("x", 2)); + + configuration.put(listProperty); + + ResourceConfigurationUpdate configUpdate = new ResourceConfigurationUpdate(resource, configuration, + "tester"); + entityMgr.persist(configUpdate); + entityMgr.flush(); + + entityMgr.clear(); + + configUpdate = entityMgr.find(ResourceConfigurationUpdate.class, configUpdate.getId()); + entityMgr.flush(); + } finally { + getTransactionManager().rollback(); + } + } + +} diff --git a/modules/core/domain/src/test/java/org/rhq/core/domain/search/SavedSearchTest.java b/modules/core/domain/src/test/java/org/rhq/core/domain/search/SavedSearchTest.java new file mode 100644 index 0000000..d7dfc03 --- /dev/null +++ b/modules/core/domain/src/test/java/org/rhq/core/domain/search/SavedSearchTest.java @@ -0,0 +1,54 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * 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.domain.search; + +import org.rhq.core.domain.auth.Subject; +import org.rhq.core.domain.criteria.SavedSearchCriteria; +import org.rhq.core.domain.test.AbstractEJB3Test; +import org.testng.annotations.Test; + +import javax.persistence.EntityManager; +import java.util.List; + +public class SavedSearchTest extends AbstractEJB3Test { + + @Test + public void testInsert() throws Exception { + getTransactionManager().begin(); + EntityManager entityMgr = getEntityManager(); + try { + Subject subject = new Subject("searcher", true, true); + entityMgr.persist(subject); + + SavedSearch search = new SavedSearch(SearchSubsystem.RESOURCE, "test search", "test pattern", subject); + search.setGlobal(true); + entityMgr.persist(search); + entityMgr.flush(); + } + finally { + getTransactionManager().rollback(); + } + } + +}
commit dc9a55520695f9ef7ae77c7b2a3abe9c4b319105 Author: Joseph Marques joseph@redhat.com Date: Fri May 21 11:05:42 2010 -0400
BZ-577853 - add first cut of GWT-based search bar functionality:
search bar features * caret position-aware auto-completion * suggestion highlighting
back-end improvements * parameterized contexts (e.g. trait[foo]) now perform "LIKE '%foo%'" matches instead of exact * finished auto-completion algorithm for simple text searches * fixed authorized-related bugs in SavedSearchManager
gwt integration issues * added code so that CoreGUI only loads when visiting that webapp * added code so that SearchGUI only loads when the SearchBar is present on the page, regardless of webapp
cosmetic fixes * alphabetized servlet definitions in CoreGUI.gwt.xml * fixed indentation in coregui's web.xml
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java b/modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java index bef8a2c..aa02b08 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java @@ -30,11 +30,15 @@ public class SearchSuggestion implements Serializable, Comparable<SearchSuggesti } }
- private final Kind kind; - private final String value; - private final String label; - private final int startIndex; - private final int endIndex; + private Kind kind; + private String value; + private String label; + private int startIndex; + private int endIndex; + + public SearchSuggestion() { + // public ctor for GWT + }
public SearchSuggestion(Kind kind, String value) { this(kind, value, 0, 0); @@ -60,6 +64,10 @@ public class SearchSuggestion implements Serializable, Comparable<SearchSuggesti return kind; }
+ public void setKind(Kind kind) { + this.kind = kind; + } + public String getLabel() { return label; } @@ -81,7 +89,7 @@ public class SearchSuggestion implements Serializable, Comparable<SearchSuggesti if (kindComparision != 0) { return kindComparision; } - return label.compareTo(other.label); + return label.toLowerCase().compareTo(other.label.toLowerCase()); }
public String toString() { diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index c45e91f..c5615d3 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -219,7 +219,7 @@ <logLevel>INFO</logLevel> <runTarget>http://localhost:7080/coregui/CoreGUI.html</runTarget> <extraJvmArgs>-Xms1024M -Xmx1024M -XX:PermSize=256M -XX:MaxPermSize=256M</extraJvmArgs> - <localWorkers>2</localWorkers> + <localWorkers>4</localWorkers> <draftCompile>true</draftCompile> <buildOutputDirectory>target/gwtclasses</buildOutputDirectory> <hostedWebapp>target/hostedwar</hostedWebapp> diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml index 4faf4ff..e1e627b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml @@ -9,6 +9,7 @@ <inherits name='com.smartgwt.SmartGwt' /> <inherits name="com.smartgwt.tools.SmartGwtTools"/>
+ <inherits name='com.google.gwt.user.theme.standard.Standard'/> <!-- <inherits name="com.smartclient.theme.graphite.Graphite"/> --> @@ -25,13 +26,13 @@
<replace-with class="org.rhq.enterprise.gui.coregui.client.components.upload.DynamicCallbackFormImpl"> - <when-type-is class="org.rhq.enterprise.gui.coregui.client.components.upload.DynamicCallbackFormImpl"/> - </replace-with> + <when-type-is class="org.rhq.enterprise.gui.coregui.client.components.upload.DynamicCallbackFormImpl"/> + </replace-with>
- <replace-with class="org.rhq.enterprise.gui.coregui.client.components.upload.DynamicCallbackFormImplIE6"> - <when-type-is class="org.rhq.enterprise.gui.coregui.client.components.upload.DynamicCallbackFormImpl"/> - <when-property-is name="user.agent" value="ie6"/> - </replace-with> + <replace-with class="org.rhq.enterprise.gui.coregui.client.components.upload.DynamicCallbackFormImplIE6"> + <when-type-is class="org.rhq.enterprise.gui.coregui.client.components.upload.DynamicCallbackFormImpl"/> + <when-property-is name="user.agent" value="ie6"/> + </replace-with>
<!-- limit builds to your preferred browser --> @@ -44,21 +45,23 @@
<entry-point class='org.rhq.enterprise.gui.coregui.client.CoreGUI'/> + <entry-point class='org.rhq.enterprise.gui.coregui.client.SearchGUI'/>
- <servlet path="/RoleGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.RoleGWTServiceImpl"/> - <servlet path="/SubjectGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.SubjectGWTServiceImpl"/> - <servlet path="/ResourceGroupGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.ResourceGroupGWTServiceImpl"/> - <servlet path="/ResourceGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.ResourceGWTServiceImpl"/> + <servlet path="/AlertGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.AlertGWTServiceImpl"/> + <servlet path="/AuthorizationGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.AuthorizationGWTServiceImpl"/> + <servlet path="/AvailabilityGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.AvailabilityGWTServiceImpl"/> + <servlet path="/BundleGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.BundleGWTServiceImpl"/> <servlet path="/ConfigurationGwtService" class="org.rhq.enterprise.gui.coregui.server.gwt.ConfigurationGWTServiceImpl"/> - <servlet path="/ResourceTypeGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.ResourceTypeGWTServiceImpl"/> <servlet path="/MeasurementDataGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.MeasurementDataGWTServiceImpl"/> - <servlet path="/AlertGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.AlertGWTServiceImpl"/> <servlet path="/OperationGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.OperationGWTServiceImpl"/> - <servlet path="/BundleGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.BundleGWTServiceImpl"/> + <servlet path="/RemoteInstallGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.RemoteInstallGWTServiceImpl"/> <servlet path="/ResourceBossGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.ResourceBossGWTServiceImpl"/> - <servlet path="/AuthorizationGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.AuthorizationGWTServiceImpl"/> - <servlet path="/AvailabilityGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.AvailabilityGWTServiceImpl"/> + <servlet path="/ResourceGroupGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.ResourceGroupGWTServiceImpl"/> + <servlet path="/ResourceGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.ResourceGWTServiceImpl"/> + <servlet path="/ResourceTypeGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.ResourceTypeGWTServiceImpl"/> + <servlet path="/RoleGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.RoleGWTServiceImpl"/> + <servlet path="/SearchGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.SearchGWTServiceImpl"/> + <servlet path="/SubjectGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.SubjectGWTServiceImpl"/> <servlet path="/TagGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.TagGWTServiceImpl"/> - <servlet path="/RemoteInstallGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.RemoteInstallGWTServiceImpl"/>
</module> \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java index 60b4b4b..a39a8a1 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java @@ -1,10 +1,5 @@ package org.rhq.enterprise.gui.coregui.client;
-import java.util.Arrays; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; - import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; import com.google.gwt.event.logical.shared.ValueChangeEvent; @@ -67,6 +62,11 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { private static CoreGUI coreGUI;
public void onModuleLoad() { + if (GWT.getHostPageBaseURL().indexOf("/coregui/") == -1) { + System.out.println("Suppressing load of CoreGUI module"); + return; // suppress loading this module if not using the new GWT app + } + coreGUI = this;
if (!GWT.isScript()) { @@ -88,9 +88,8 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
messageCenter = new MessageCenter();
- RequestBuilder b = new RequestBuilder(RequestBuilder.GET, - "/j_security_check.do?j_username=rhqadmin&j_password=rhqadmin"); + "/j_security_check.do?j_username=rhqadmin&j_password=rhqadmin"); try { b.setCallback(new RequestCallback() { public void onResponseReceived(Request request, Response response) { @@ -106,7 +105,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. }
- SubjectGWTServiceAsync subjectService = SubjectGWTServiceAsync.Util.getInstance();
subjectService.login("rhqadmin", "rhqadmin", new AsyncCallback<Subject>() { @@ -131,7 +129,7 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { // HTMLPane menuPane = new HTMLPane(); // menuPane.setWidth100(); // menuPane.setHeight(26); - // menuPane.setContentsType(ContentsType.PAGE); + // //To change body of catch statement use File | Settings | File Templates. menuPane.setContentsType(ContentsType.PAGE); // menuPane.setContentsURL("/rhq/common/menu/menu.xhtml"); // menuPane.setZIndex(400000); // layout.addMember(menuPane); @@ -163,7 +161,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { History.fireCurrentHistoryState(); }
- public void onValueChange(ValueChangeEvent<String> stringValueChangeEvent) { System.out.println("Handling history event: " + stringValueChangeEvent.getValue()); currentViewPath = new ViewPath(stringValueChangeEvent.getValue()); @@ -172,7 +169,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
}
- public Canvas createContent(String breadcrumbName) { Canvas canvas;
@@ -202,7 +198,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { return messageCenter; }
- public static ErrorHandler getErrorHandler() { return errorHandler; } @@ -215,7 +210,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { return userPreferences; }
- public static void setSessionSubject(Subject subject) { GWTServiceLookup.registerSession(String.valueOf(subject.getSessionId()));
@@ -248,7 +242,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { breadCrumbTrailPane.refresh(currentViewPath); }
- private class RootCanvas extends VLayout implements BookmarkableView {
ViewId currentViewId; @@ -259,7 +252,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { setHeight100(); }
- public void renderView(ViewPath viewPath) { if (viewPath.isEnd()) { // default view diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java new file mode 100644 index 0000000..faeeab0 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java @@ -0,0 +1,104 @@ +/* + * RHQ Management Platform + * Copyright (C) 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; + +import com.google.gwt.core.client.EntryPoint; +import com.google.gwt.http.client.Request; +import com.google.gwt.http.client.RequestBuilder; +import com.google.gwt.http.client.RequestCallback; +import com.google.gwt.http.client.RequestException; +import com.google.gwt.http.client.Response; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.widgets.Label; + +import org.rhq.core.domain.auth.Subject; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.gwt.SubjectGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.search.SearchBar; + +/** + * @author Joseph Marques + */ +public class SearchGUI implements EntryPoint { + + public static SearchGUI singleton = new SearchGUI(); + public SearchBar searchBar; + + private static Subject sessionSubject; + + private SearchGUI() { + } + + public static SearchGUI get() { + return singleton; + } + + public void onModuleLoad() { + if (SearchBar.existsOnPage() == false) { + System.out.println("Suppressing load of SearchGUI module"); + return; + } + + portalWarLogin(); + } + + public void buildSearchGUI() { + searchBar = SearchBar.get(); // TODO: SearchBar is a singleton right now, that restriction needs to be removed + } + + private static void portalWarLogin() { + RequestBuilder b = new RequestBuilder(RequestBuilder.GET, + "/j_security_check.do?j_username=rhqadmin&j_password=rhqadmin"); + try { + b.setCallback(new RequestCallback() { + public void onResponseReceived(Request request, Response response) { + System.out.println("Portal-War logged in"); + } + + public void onError(Request request, Throwable exception) { + System.out.println("Portal-War login failed"); + } + }); + b.send(); + } catch (RequestException e) { + e.printStackTrace(); + } + + SubjectGWTServiceAsync subjectService = SubjectGWTServiceAsync.Util.getInstance(); + + subjectService.login("rhqadmin", "rhqadmin", new AsyncCallback<Subject>() { + public void onFailure(Throwable caught) { + System.out.println("Failed to login - cause: " + caught); + Label loginFailed = new Label("Failed to login - cause: " + caught); + loginFailed.draw(); + } + + public void onSuccess(Subject result) { + System.out.println("Logged in: " + result.getSessionId()); + GWTServiceLookup.registerSession(String.valueOf(result.getSessionId())); + SearchGUI.sessionSubject = result; + singleton.buildSearchGUI(); + } + }); + } + + public static Subject getSessionSubject() { + return sessionSubject; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java index 689c26f..9d173a2 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java @@ -96,6 +96,9 @@ public class GWTServiceLookup { return secure(RemoteInstallGWTServiceAsync.Util.getInstance()); }
+ public static SearchGWTServiceAsync getSearchService() { + return secure(SearchGWTServiceAsync.Util.getInstance()); + }
private static <T> T secure(Object sdt) { if (!(sdt instanceof ServiceDefTarget)) diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SearchGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SearchGWTService.java new file mode 100644 index 0000000..be00e9c --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SearchGWTService.java @@ -0,0 +1,50 @@ +/* + * 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.gwt; + +import java.util.List; + +import com.google.gwt.user.client.rpc.RemoteService; + +import org.rhq.core.domain.criteria.SavedSearchCriteria; +import org.rhq.core.domain.search.SavedSearch; +import org.rhq.core.domain.search.SearchSubsystem; +import org.rhq.core.domain.search.SearchSuggestion; + +/** + * @author Joseph Marques + */ +public interface SearchGWTService extends RemoteService { + + /* + * search suggestions + */ + List<SearchSuggestion> getSuggestions(SearchSubsystem searchSubsystem, String expression, int caretPosition); + + /* + * saved searches + */ + int createSavedSearch(SavedSearch savedSearch); + + void updateSavedSearch(SavedSearch savedSearch); + + void deleteSavedSearch(int savedSearchId); + + List<SavedSearch> findSavedSearchesByCriteria(SavedSearchCriteria criteria); +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java new file mode 100644 index 0000000..8a38ed1 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java @@ -0,0 +1,458 @@ +/* + * RHQ Management Platform + * Copyright (C) 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.search; + +import java.util.List; + +import com.google.gwt.event.dom.client.BlurEvent; +import com.google.gwt.event.dom.client.BlurHandler; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.event.dom.client.KeyCodes; +import com.google.gwt.event.dom.client.KeyPressEvent; +import com.google.gwt.event.dom.client.KeyPressHandler; +import com.google.gwt.event.dom.client.MouseOutEvent; +import com.google.gwt.event.dom.client.MouseOutHandler; +import com.google.gwt.event.dom.client.MouseOverEvent; +import com.google.gwt.event.dom.client.MouseOverHandler; +import com.google.gwt.event.logical.shared.CloseEvent; +import com.google.gwt.event.logical.shared.CloseHandler; +import com.google.gwt.user.client.DOM; +import com.google.gwt.user.client.Element; +import com.google.gwt.user.client.Event; +import com.google.gwt.user.client.EventListener; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.Image; +import com.google.gwt.user.client.ui.Label; +import com.google.gwt.user.client.ui.PopupPanel; +import com.google.gwt.user.client.ui.RootPanel; +import com.google.gwt.user.client.ui.TextBox; + +import org.rhq.core.domain.criteria.SavedSearchCriteria; +import org.rhq.core.domain.search.SavedSearch; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.search.favorites.SavedSearchGrid; +import org.rhq.enterprise.gui.coregui.client.search.favorites.SavedSearchManager; +import org.rhq.enterprise.gui.coregui.client.search.favorites.SavedSearchGrid.PatternSelectionHandler; +import org.rhq.enterprise.gui.coregui.client.search.suggest.SuggestTextBox; + +/** + * @author Joseph Marques + */ +public class SearchBar { + + public static final String DEFAULT_SEARCH_TEXT = "search for resources"; + public static final String DEFAULT_PATTERN_NAME = "name your pattern"; + + private static final String IMAGE_DIR = "/coregui/images/search/"; + + private static final String STAR_OFF_URL = IMAGE_DIR + "star1.png"; + private static final String STAR_ACTIVE_URL = IMAGE_DIR + "star2.png"; + private static final String STAR_ON_URL = IMAGE_DIR + "star3.png"; + + private static final String ARROW_WHITE_URL = IMAGE_DIR + "menu_arrow.png"; + private static final String ARROW_GRAY_URL = IMAGE_DIR + "menu_arrow_down.png"; + + public static final String TRASH = IMAGE_DIR + "trash.png"; + + private final SuggestTextBox autoCompletePatternField; + private final TextBox patternNameField = new TextBox(); + private final Label patternNameLabel = new Label(); + + private final Image starImage = new Image(STAR_OFF_URL); + private final Image arrowImage = new Image(ARROW_WHITE_URL); + + private final PopupPanel savedSearchesPanel = new PopupPanel(true); + private final SavedSearchGrid savedSearches = new SavedSearchGrid(); + + private String currentSearch = ""; + private long lastNameFieldBlurTime = 0; + + private final SavedSearchManager savedSearchManager = SavedSearchManager.get(); + private final SearchGWTServiceAsync searchService = GWTServiceLookup.getSearchService(); + + public static SearchBar singleton; + + public static SearchBar get() { + if (singleton == null) { + singleton = new SearchBar(); + } + return singleton; + } + + public static boolean existsOnPage() { + return DOM.getElementById("searchBar") != null; + } + + private SearchBar() { + System.out.println("Loading SearchBar..."); + + autoCompletePatternField = new SuggestTextBox("patternFieldSuggestionsContainer"); + + RootPanel.get("patternFieldContainer").add(autoCompletePatternField); + RootPanel.get("patternNameFieldContainer").add(patternNameField); + RootPanel.get("patternNameLabelContainer").add(patternNameLabel); + RootPanel.get("starImageContainer").add(starImage); + RootPanel.get("arrowImageContainer").add(arrowImage); + RootPanel.get("savedSearchesContainer").add(savedSearchesPanel); + + setupAutoCompletingPatternField(); + setupPatternNameField(); + setupPatternNameLabel(); + setupStarImage(); + setupArrowImage(); + setupSavedSearches(); + setupSearchButton(); + + // presume the enclosing page logic loads results without a button click + } + + public void executeSearch() { + String searchTerms = autoCompletePatternField.getText().toLowerCase().trim(); + executeSearch(searchTerms); + } + + public void executeSearch(String searchTerms) { + if (searchTerms.equals(DEFAULT_SEARCH_TEXT)) { + searchTerms = ""; + } + + SavedSearchCriteria criteria = new SavedSearchCriteria(); + criteria.addFilterName(searchTerms); + criteria.setCaseSensitive(true); + + searchService.findSavedSearchesByCriteria(criteria, new AsyncCallback<List<SavedSearch>>() { + + @Override + public void onSuccess(List<SavedSearch> result) { + if (result.size() == 1) { + process(result.get(0)); + } + + } + + private void process(SavedSearch savedSearch) { + autoCompletePatternField.setValue(savedSearch.getPattern(), true); + patternNameField.setValue(savedSearch.getName(), true); + currentSearch = ""; + turnNameFieldIntoLabel(); + } + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + } + }); + + } + + private void setupAutoCompletingPatternField() { + autoCompletePatternField.setText(DEFAULT_SEARCH_TEXT); + autoCompletePatternField.getElement().setId("patternField"); + autoCompletePatternField.addStyleName("patternField"); + + AutoCompletePatternFieldEventHandler handler = new AutoCompletePatternFieldEventHandler(); + autoCompletePatternField.addClickHandler(handler); + autoCompletePatternField.addKeyPressHandler(handler); + } + + private void setupPatternNameField() { + patternNameField.addStyleName("patternNameField"); + patternNameField.setVisible(false); + + PatternNameFieldEventHandler handler = new PatternNameFieldEventHandler(); + patternNameField.addKeyPressHandler(handler); + patternNameField.addClickHandler(handler); + patternNameField.addBlurHandler(handler); + } + + private void setupPatternNameLabel() { + patternNameLabel.addStyleName("patternNameLabel"); + patternNameLabel.setVisible(false); + + PatternNameLabelEventHandler handler = new PatternNameLabelEventHandler(); + patternNameLabel.addClickHandler(handler); + } + + private void setupStarImage() { + StarImageEventHandler handler = new StarImageEventHandler(); + starImage.addClickHandler(handler); + starImage.addMouseOverHandler(handler); + starImage.addMouseOutHandler(handler); + } + + private void setupArrowImage() { + ArrowImageEventHandler handler = new ArrowImageEventHandler(); + arrowImage.addClickHandler(handler); + } + + private void setupSavedSearches() { + savedSearchesPanel.add(savedSearches); + savedSearchesPanel.removeStyleName("gwt-PopupPanel"); + savedSearchesPanel.addStyleName("savedSearchesPanel"); + savedSearches.addStyleName("savedSearchesPanel"); + + // panel position will be re-calculated on down-arrow click + savedSearchesPanel.show(); + savedSearchesPanel.hide(); + + SavedSearchesEventHandler handler = new SavedSearchesEventHandler(); + savedSearchesPanel.addCloseHandler(handler); + savedSearches.setPatternSelectionHandler(handler); + } + + private void setupSearchButton() { + Element searchButtonContainerElement = DOM.getElementById("searchButtonContainer"); + String searchButtonElementId = searchButtonContainerElement.getClassName().split(" ")[0]; // yeah, it's hacky + + Element searchButtonElement = DOM.getElementById(searchButtonElementId); + if (searchButtonElement == null) { + return; + } + + DOM.setEventListener(searchButtonElement, new EventListener() { + @Override + public void onBrowserEvent(Event event) { + executeSearch(); + } + }); + + //searchButton.addStyleName("searchButton"); + //SearchButtonEventHandler handler = new SearchButtonEventHandler(); + //searchButton.addClickHandler(handler); + } + + private void turnNameFieldIntoLabel() { + String pattern = autoCompletePatternField.getValue(); + String name = patternNameField.getText(); + + if (name.equalsIgnoreCase(DEFAULT_PATTERN_NAME)) { + name = ""; + } + + savedSearchManager.removePatternByName(currentSearch); + + arrowImage.setVisible(true); + patternNameField.setVisible(false); + + if (name.equals("")) { + starImage.setUrl(STAR_OFF_URL); + } else { + savedSearchManager.updatePatternByName(name, pattern); + patternNameLabel.setVisible(true); + patternNameLabel.setText(elipse(name)); + starImage.setUrl(STAR_ON_URL); + } + currentSearch = name; + } + + private void turnNameLabelIntoField() { + String name = currentSearch; + patternNameField.setText(name); + patternNameField.setVisible(true); + patternNameLabel.setVisible(false); + patternNameField.setFocus(true); + } + + private String elipse(String data) { + if (data.length() > 14) { + return data.substring(0, 14) + "..."; + } + return data; + } + + /* + * Event Handlers + */ + + class AutoCompletePatternFieldEventHandler implements KeyPressHandler, ClickHandler { + @Override + public void onKeyPress(KeyPressEvent event) { + // hide pattern field/label, turn off star + patternNameLabel.setText(""); + patternNameLabel.setVisible(false); + patternNameField.setValue("", true); + patternNameField.setVisible(false); + currentSearch = ""; + starImage.setUrl(STAR_OFF_URL); + + // enter submits a search result under certain conditions, escape hides the suggestions drop-down + if (event.getCharCode() == KeyCodes.KEY_ENTER) { + boolean suggestionsHidden = !autoCompletePatternField.isSuggestionListShowing(); + boolean suggestionSelected = !suggestionsHidden && autoCompletePatternField.isItemSelected(); + if (suggestionsHidden || !suggestionSelected) { + executeSearch(); + autoCompletePatternField.hidePopup(); + } + } else if (event.getCharCode() == KeyCodes.KEY_ESCAPE) { + autoCompletePatternField.hidePopup(); + event.preventDefault(); + event.stopPropagation(); + } + } + + @Override + public void onClick(ClickEvent event) { + // clear default search text if necessary + if (autoCompletePatternField.getText().equals(DEFAULT_SEARCH_TEXT)) { + autoCompletePatternField.setValue("", true); + } + savedSearchesPanel.hide(); + } + } + + class PatternNameFieldEventHandler implements KeyPressHandler, ClickHandler, BlurHandler { + @Override + public void onKeyPress(KeyPressEvent event) { + if (event.getCharCode() == 13) { + SearchLogger.debug("key press pattern name field"); + turnNameFieldIntoLabel(); + } + } + + @Override + public void onClick(ClickEvent event) { + if (patternNameField.getText().equals(DEFAULT_PATTERN_NAME)) { + patternNameField.setValue("", false); + } + } + + @Override + public void onBlur(BlurEvent event) { + lastNameFieldBlurTime = System.currentTimeMillis(); + turnNameFieldIntoLabel(); + } + } + + class PatternNameLabelEventHandler implements ClickHandler { + @Override + public void onClick(ClickEvent event) { + turnNameLabelIntoField(); + } + } + + class StarImageEventHandler implements ClickHandler, MouseOverHandler, MouseOutHandler { + @Override + public void onClick(ClickEvent event) { + long diff = System.currentTimeMillis() - lastNameFieldBlurTime; + if (Math.abs(diff) < 750) { + /* + * This event propagation is annoying. If the threshold is set too low, then both + * the name field blur event and this star image click event fire...but the blur + * event fires first, which turns the star white. Then a click on a white star + * triggers edit mode, re-enabling the name field. However, setting the threshold + * too high will prevent the click event from being handled when the user naturally + * wants to click on the star in rapid succession within the threshold time frame. + * It is hoped that 750ms will strike a nice balance, and that most users will never + * experienced any oddities from this trade-off. + */ + return; + } + + if (starImage.getUrl().endsWith(STAR_ACTIVE_URL)) { + patternNameField.setText(DEFAULT_PATTERN_NAME); + patternNameField.setVisible(true); + patternNameField.selectAll(); + patternNameField.setFocus(true); + patternNameLabel.setVisible(false); + } else if (starImage.getUrl().endsWith(STAR_ON_URL)) { + starImage.setUrl(STAR_ACTIVE_URL); + patternNameField.setVisible(false); + patternNameLabel.setVisible(false); + savedSearchManager.removePatternByName(currentSearch); + } + } + + @Override + public void onMouseOver(MouseOverEvent event) { + if (starImage.getUrl().endsWith(STAR_OFF_URL)) { + starImage.setUrl(STAR_ACTIVE_URL); + + } + } + + @Override + public void onMouseOut(MouseOutEvent event) { + if (starImage.getUrl().endsWith(STAR_ACTIVE_URL) && !patternNameField.isVisible()) { + starImage.setUrl(STAR_OFF_URL); + } + } + } + + class ArrowImageEventHandler implements ClickHandler { + @Override + public void onClick(ClickEvent event) { + savedSearches.updateModel(); + int left = autoCompletePatternField.getAbsoluteLeft(); + int top = autoCompletePatternField.getAbsoluteTop() + autoCompletePatternField.getOffsetHeight(); + savedSearchesPanel.setPopupPosition(left, top + 5); + savedSearchesPanel.show(); + arrowImage.setUrl(ARROW_GRAY_URL); + } + } + + class SavedSearchesEventHandler implements CloseHandler<PopupPanel>, PatternSelectionHandler { + @Override + public void onClose(CloseEvent<PopupPanel> event) { + arrowImage.setUrl(ARROW_WHITE_URL); + } + + @Override + public void handleSelection(int rowIndex, int columnIndex, String patternName) { + if (columnIndex == 1) { + savedSearchManager.removePatternByName(patternName); + + if (currentSearch.equals(patternName)) { + currentSearch = ""; + patternNameField.setValue("", true); + patternNameField.setVisible(false); + patternNameLabel.setText(""); + patternNameLabel.setVisible(false); + autoCompletePatternField.setFocus(true); + starImage.setUrl(STAR_OFF_URL); + savedSearchesPanel.hide(); + } + + if (savedSearchManager.getSavedSearchCount() == 0) { + savedSearchesPanel.hide(); + } + + savedSearches.removeRow(rowIndex); + } else { + currentSearch = ""; + String patternValue = savedSearchManager.getPatternByName(patternName); + autoCompletePatternField.setValue(patternValue, true); + patternNameField.setValue(patternName, true); + SearchLogger.debug("search results change: [" + patternName + "," + patternValue + "]"); + turnNameFieldIntoLabel(); + savedSearchesPanel.hide(); + executeSearch(); + } + } + } + + class SearchButtonEventHandler implements ClickHandler { + @Override + public void onClick(ClickEvent event) { + executeSearch(); + } + } + +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchLogger.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchLogger.java new file mode 100644 index 0000000..f15dcc9 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchLogger.java @@ -0,0 +1,7 @@ +package org.rhq.enterprise.gui.coregui.client.search; + +public class SearchLogger { + public static void debug(String message) { + System.out.println(message); + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java new file mode 100644 index 0000000..76c4ad6 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java @@ -0,0 +1,154 @@ +/* + * RHQ Management Platform + * Copyright (C) 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.search.favorites; + +import java.util.List; + +import com.google.gwt.user.client.DOM; +import com.google.gwt.user.client.Element; +import com.google.gwt.user.client.Event; +import com.google.gwt.user.client.ui.Grid; + +import org.rhq.enterprise.gui.coregui.client.search.SearchBar; + +/** + * @author Joseph Marques + */ +public class SavedSearchGrid extends Grid { + + private PatternSelectionHandler patternSelectionHandler; + + public interface PatternSelectionHandler { + public void handleSelection(int rowIndex, int columnIndex, String patternName); + } + + public void setPatternSelectionHandler(PatternSelectionHandler handler) { + this.patternSelectionHandler = handler; + } + + class SavedSearchRowFormatter extends RowFormatter { + @Override + public String getStyleName(int row) { + if (row < count()) { + return " savedSearchesPanel-row"; + } + return ""; + } + + @Override + public String getStylePrimaryName(int row) { + return getStyleName(row); + } + } + + private static SavedSearchManager manager = SavedSearchManager.get(); + + public SavedSearchGrid() { + super(count(), 2); + setRowFormatter(new SavedSearchRowFormatter()); + sinkEvents(Event.ONMOUSEOVER | Event.ONMOUSEOUT | Event.ONCLICK); + setCellSpacing(0); + setCellPadding(5); + setStyleName("savedSearchesGrid"); + } + + @Override + public void onBrowserEvent(Event event) { + Element td = getEventTargetCell(event); + if (td == null) { + return; + } + Element tr = DOM.getParent(td); + Element table = DOM.getParent(tr); + switch (DOM.eventGetType(event)) { + case Event.ONCLICK: { + int columnIndex = DOM.getChildIndex(tr, td); + int rowIndex = DOM.getChildIndex(table, tr); + String text = getHTML(rowIndex, 0); + int startIndex = text.indexOf('>') + 1; + int endIndex = text.indexOf("</span>", startIndex); + String patternName = text.substring(startIndex, endIndex); + patternSelectionHandler.handleSelection(rowIndex, columnIndex, patternName); + if (columnIndex == 0) { + onRowOut(tr); + } + break; + } + case Event.ONMOUSEOVER: { + onRowOver(tr); + break; + } + case Event.ONMOUSEOUT: { + onRowOut(tr); + break; + } + } + } + + protected void onRowOut(Element row) { + Element actionCell = DOM.getChild(row, 1); + actionCell.setAttribute("style", ""); + row.setAttribute("style", "background-color: white;"); + } + + protected void onRowOver(Element row) { + Element actionCell = DOM.getChild(row, 1); + actionCell.setAttribute("style", "width: 24px; height: 24px; background: url(" + SearchBar.TRASH + + ") no-repeat center;"); + row.setAttribute("style", "background-color: #eeeeee;"); + } + + public void updateModel() { + List<String> names = manager.getPatternNamesMRU(); + + clear(true); + resizeRows(names.size()); + + for (int i = 0; i < names.size(); i++) { + String name = names.get(i); + String pattern = manager.getPatternByName(name); + setHTML(i, 0, stylize(name, pattern)); + setHTML(i, 1, trashify()); + } + setRowFormatter(new SavedSearchRowFormatter()); + } + + private static String stylize(String name, String pattern) { + return "<span class="savedSearchesPanel-top">" + name + "</span>" + "<br/>" + + "<span class="savedSearchesPanel-bottom">" + pattern + "</span>"; + } + + private static String trashify() { + return "<div name="action"> </div>"; + } + + private static int count() { + return manager.getSavedSearchCount(); + } + + public String getSelectedItem() { + return ""; + } + + public static void main(String[] args) { + Grid grid = new Grid(); + grid.clear(true); + + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java new file mode 100644 index 0000000..3365be7 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java @@ -0,0 +1,180 @@ +/* + * RHQ Management Platform + * Copyright (C) 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.search.favorites; + +import java.util.Collections; +import java.util.Comparator; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; + +import com.google.gwt.user.client.rpc.AsyncCallback; + +import org.rhq.core.domain.auth.Subject; +import org.rhq.core.domain.criteria.SavedSearchCriteria; +import org.rhq.core.domain.search.SavedSearch; +import org.rhq.core.domain.search.SearchSubsystem; +import org.rhq.enterprise.gui.coregui.client.SearchGUI; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.search.SearchLogger; + +/** + * @author Joseph Marques + */ +public class SavedSearchManager { + + private final SearchGWTServiceAsync searchService = GWTServiceLookup.getSearchService(); + + private LinkedHashMap<String, SavedSearch> savedSearches = new LinkedHashMap<String, SavedSearch>(); + private static SavedSearchManager singleton = new SavedSearchManager(); + + public SavedSearchManager() { + load(); + } + + public synchronized static SavedSearchManager get() { + return singleton; + } + + public synchronized String getPatternByName(String name) { + SavedSearch savedSearch = savedSearches.get(name); + if (savedSearch == null) { + return null; + } + return savedSearch.getPattern(); + } + + public synchronized void updatePatternByName(final String name, final String pattern) { + SavedSearch savedSearch = savedSearches.get(name); + if (savedSearch == null) { // created case + final SavedSearch newSavedSearch = new SavedSearch(SearchSubsystem.RESOURCE, name, pattern, SearchGUI + .getSessionSubject()); + searchService.createSavedSearch(newSavedSearch, new AsyncCallback<Integer>() { + + @Override + public void onFailure(Throwable caught) { + SearchLogger.debug("Error: created saved search [" + name + "] with pattern [" + pattern + "]: " + + caught.getMessage()); + } + + @Override + public void onSuccess(Integer result) { + newSavedSearch.setId(result); + savedSearches.put(name, newSavedSearch); + } + }); + + } else { // update case + searchService.updateSavedSearch(savedSearch, new AsyncCallback<Void>() { + + @Override + public void onFailure(Throwable caught) { + SearchLogger.debug("Error: updating saved search [" + name + "] with pattern [" + pattern + "]: " + + caught.getMessage()); + } + + @Override + public void onSuccess(Void result) { + SavedSearch savedSearch = savedSearches.remove(name); + savedSearch.setPattern(pattern); + savedSearches.put(name, savedSearch); + } + }); + } + } + + public synchronized List<String> getPatternNamesMRU() { + List<String> results = new LinkedList<String>(); + for (String name : savedSearches.keySet()) { + results.add(0, name); + } + return results; + } + + public synchronized void removePatternByName(final String name) { + SavedSearch savedSearch = savedSearches.get(name); + if (savedSearch == null) { + return; + } + searchService.deleteSavedSearch(savedSearch.getId(), new AsyncCallback<Void>() { + + @Override + public void onFailure(Throwable caught) { + SearchLogger.debug("Error: removing saved search [" + name + "]: " + caught.getMessage()); + } + + @Override + public void onSuccess(Void result) { + savedSearches.remove(name); + } + }); + } + + public synchronized void renamePattern(final String oldName, final String newName) { + SavedSearch savedSearch = savedSearches.get(oldName); + searchService.updateSavedSearch(savedSearch, new AsyncCallback<Void>() { + + @Override + public void onFailure(Throwable caught) { + SearchLogger.debug("Error: renaming saved search from [" + oldName + "] to [" + newName + "]: " + + caught.getMessage()); + } + + @Override + public void onSuccess(Void result) { + SavedSearch savedSearch = savedSearches.remove(oldName); + savedSearches.put(newName, savedSearch); + } + }); + } + + public synchronized int getSavedSearchCount() { + return savedSearches.size(); + } + + private synchronized void load() { + Subject currentUser = SearchGUI.getSessionSubject(); + SavedSearchCriteria criteria = new SavedSearchCriteria(); + criteria.addFilterSubjectId(currentUser.getId()); + searchService.findSavedSearchesByCriteria(criteria, new AsyncCallback<List<SavedSearch>>() { + + @Override + public void onSuccess(List<SavedSearch> result) { + savedSearches.clear(); + Collections.sort(result, new Comparator<SavedSearch>() { + + @Override + public int compare(SavedSearch first, SavedSearch second) { + return first.getName().compareTo(second.getName()); + } + }); + for (SavedSearch next : result) { + savedSearches.put(next.getName(), next); + } + } + + @Override + public void onFailure(Throwable caught) { + SearchLogger.debug("Error: loading saved searches: " + caught.getMessage()); + } + }); + } + +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestResultsListBox.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestResultsListBox.java new file mode 100644 index 0000000..d010b30 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestResultsListBox.java @@ -0,0 +1,182 @@ +/* + * RHQ Management Platform + * Copyright (C) 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.search.suggest; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.List; + +import com.google.gwt.dom.client.Document; +import com.google.gwt.dom.client.OptionElement; +import com.google.gwt.dom.client.SelectElement; +import com.google.gwt.user.client.ui.ListBox; + +import org.rhq.core.domain.search.SearchSuggestion; +import org.rhq.core.domain.search.SearchSuggestion.Kind; +import org.rhq.enterprise.gui.coregui.client.search.SearchLogger; + +public class SuggestResultsListBox extends ListBox { + public static final String FOOTER_MESSAGE = "Start typing for more simple text matches"; + + private List<SearchSuggestion> searchSuggestions; + private SuggestionItemComparator suggestionItemComparator; + + private final List<String> OPERATORS = Arrays.asList("!==", "!=", "==", "="); + + public SuggestResultsListBox() { + this.searchSuggestions = new ArrayList<SearchSuggestion>(); + + this.suggestionItemComparator = new SuggestionItemComparator(); + } + + class SuggestionItemComparator implements Comparator<SearchSuggestion> { + public int compare(SearchSuggestion first, SearchSuggestion second) { + try { + return first.getValue().toLowerCase().compareTo(second.getValue().toLowerCase()); + } catch (Throwable t) { + SearchLogger.debug("Error sorting suggestions '" + first.getValue() + "' '" + second.getValue() + "': " + + t.getMessage()); + } + return 0; + } + }; + + public void setErrorMessage(String error) { + this.searchSuggestions.clear(); + this.searchSuggestions.add(new SearchSuggestion(Kind.InstructionalTextComment, error)); + } + + public void setSearchSuggestions(List<SearchSuggestion> searchSuggestions) { + this.searchSuggestions.clear(); + this.searchSuggestions.addAll(searchSuggestions); + } + + public int render(int maxSuggestions, int maxResultsShown) { + // sorting is done on the server-side + //Collections.sort(searchSuggestions, suggestionItemComparator); + + clear(); + int addedResults = 0; + + if (searchSuggestions.size() == 0) { + appendFooter(FOOTER_MESSAGE); + addedResults++; + } + + for (SearchSuggestion next : searchSuggestions) { + if (addedResults == maxSuggestions) { + break; + } + + appendSuggestItem(next); + //appendSuggestItem(next.getLabel(), prefix, className, next.getStartIndex(), next.getEndIndex()); + addedResults++; + } + + setVisibleItemCount(Math.max(2, Math.min(maxResultsShown, addedResults))); + + return addedResults; + } + + private void appendFooter(String message) { + SelectElement select = getElement().cast(); + OptionElement option = Document.get().createOptionElement(); + + String style = "float: left; margin-left: 2px; font-style: italic; color: gray;"; + String footer = "<span style="" + style + "">" + message + "</span>"; + + style = "clear: both;"; + String floatClear = "<br style="" + style + "" />"; + + option.setDisabled(true); + option.setValue(FOOTER_MESSAGE); + option.setInnerHTML(footer + floatClear); + select.add(option, null); + } + + private void appendSuggestItem(SearchSuggestion item) { + String className = "suggestData "; + String prefix = ""; + + if (item.getKind() == SearchSuggestion.Kind.Simple) { + className += "suggestDataSimple"; + prefix = "text"; + } else if (item.getKind() == SearchSuggestion.Kind.Advanced) { + className += "suggestDataAdvanced"; + prefix = "query"; + } else if (item.getKind() == SearchSuggestion.Kind.GlobalSavedSearch + || item.getKind() == SearchSuggestion.Kind.UserSavedSearch) { + className += "suggestDataSavedSearch"; + prefix = "saved"; + } else { + } + + SelectElement select = getElement().cast(); + OptionElement option = Document.get().createOptionElement(); + option.setValue(item.getValue()); + String style = "font-variant: small-caps; font-weight: bold; font-size: 11px; float: left; margin-left: 2px;"; + int marginOffset = 20; + if (className.endsWith("suggestDataSavedSearch")) { + style += " color: green;"; + marginOffset += 2; + } else { + style += " color: gray;"; + if (className.endsWith("suggestDataSimple")) { + marginOffset += 8; + } + } + String decoratedPrefix = decorate(prefix, style); + String highlightedSuggestion = colorOperator(decorate(item.getLabel(), "background-color: yellow;", item + .getStartIndex(), item.getEndIndex())); + String decoratedSuffix = decorate(highlightedSuggestion, "float: left; margin-left: " + marginOffset + "px;"); + String floatClear = "<br style="clear: both;" />"; + + String innerHTML = decoratedPrefix + decoratedSuffix + floatClear; + option.setInnerHTML(innerHTML); + select.add(option, null); + } + + // TODO: fixing coloring strategy + private String colorOperator(String data) { + for (String operator : OPERATORS) { + int index = -1; + while ((index = data.indexOf(operator, index + 1)) != -1) { + if ((index - 5 >= 0) && data.substring(index - 5, index).equals("style") == false) { + break; + } + } + if (index != -1) { + return decorate(data, "color: blue;", index, index + operator.length()); + } + } + return data; + } + + private String decorate(String data, String style) { + return decorate(data, style, 0, data.length()); + } + + private String decorate(String data, String style, int startIndex, int endIndex) { + String before = data.substring(0, startIndex); + String highlight = data.substring(startIndex, endIndex); + String after = data.substring(endIndex); + return before + "<span style="" + style + "">" + highlight + "</span>" + after; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox.java new file mode 100644 index 0000000..438c163 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox.java @@ -0,0 +1,302 @@ +/* + * RHQ Management Platform + * Copyright (C) 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.search.suggest; + +import java.util.List; + +import com.google.gwt.event.dom.client.ChangeEvent; +import com.google.gwt.event.dom.client.ChangeHandler; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.event.dom.client.FocusEvent; +import com.google.gwt.event.dom.client.FocusHandler; +import com.google.gwt.event.dom.client.KeyCodes; +import com.google.gwt.event.dom.client.KeyUpEvent; +import com.google.gwt.event.dom.client.KeyUpHandler; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.PopupPanel; +import com.google.gwt.user.client.ui.RootPanel; +import com.google.gwt.user.client.ui.ScrollPanel; +import com.google.gwt.user.client.ui.TextBox; + +import org.rhq.core.domain.search.SearchSubsystem; +import org.rhq.core.domain.search.SearchSuggestion; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.search.SearchBar; +import org.rhq.enterprise.gui.coregui.client.search.favorites.SavedSearchManager; + +public class SuggestTextBox extends TextBox { + + protected PopupPanel choicesPopup = new PopupPanel(true); + protected ScrollPanel choicesScrollPanel = new ScrollPanel(); + protected SuggestResultsListBox choices = new SuggestResultsListBox(); + + private SearchGWTServiceAsync searchService = GWTServiceLookup.getSearchService(); + + public SuggestTextBox(String rootPanelID) { + super(); + setupTextBox(); + setupChoicesPopup(rootPanelID); + setupChoicesListBox(); + } + + public void setupTextBox() { + getElement().setAttribute("autocomplete", "off"); // we're producing completion suggestions, not the browser + SuggestTextBoxEventHandler handler = new SuggestTextBoxEventHandler(); + this.addKeyUpHandler(handler); + this.addFocusHandler(handler); + } + + public void setupChoicesPopup(String rootPanelID) { + choicesPopup.removeStyleName("gwt-PopupPanel"); + choicesPopup.addStyleName("suggestPanel"); + choicesPopup.add(choices); + + RootPanel.get(rootPanelID).add(choicesPopup); + show(); + hide(); + } + + public void setupChoicesListBox() { + choices.addStyleName("suggestPanel"); + + SuggestionResultsListBoxEventHandler handler = new SuggestionResultsListBoxEventHandler(); + choices.addChangeHandler(handler); + choices.addClickHandler(handler); + } + + public boolean isSuggestionListShowing() { + return isDisplayed(); + } + + public boolean isItemSelected() { + return (choices.getSelectedIndex() != -1); + } + + protected void complete() { + if (choices.getItemCount() > 0 && choices.getSelectedIndex() != -1) { + String currentText = this.getText().toLowerCase(); + String completion = choices.getValue(choices.getSelectedIndex()); + + int cursorPosition = this.getCursorPos(); + int previousWhitespaceIndex = cursorPosition; + if (cursorPosition != 0) { + while (--previousWhitespaceIndex > 0) { + if (this.getText().charAt(previousWhitespaceIndex) == ' ') { + previousWhitespaceIndex++; // put index right after found whitespace + break; + } + } + } + String before = this.getText().substring(0, previousWhitespaceIndex); + String after = this.getText().substring(cursorPosition); + this.setValue(before + completion + after); + + // TODO: this algo screws up when it does the indexOf search on just a single char from currentText + // use case is "availability=dow<enter>" -- is this still true, now that we're completing longer things for advanced search? + + if (currentText.equals(this.getText().toLowerCase())) { + this.setValue(currentText + completion, true); + } + } + + choices.clear(); + hide(); + + // if this is a saved search pattern completion, execute that search immediately + System.out.println("just completed to '" + this.getValue() + "'"); + String patternValue = SavedSearchManager.get().getPatternByName(this.getValue()); + if (patternValue != null) { + SearchBar.get().executeSearch(this.getValue()); + } else { + // send a 'fake' key, this will rerender PopupPanel with the new completion list + handleKeyCode(0); + } + } + + private void hide() { + choicesPopup.hide(); + } + + private void show() { + choicesPopup.show(); + } + + private boolean isDisplayed() { + return choicesPopup.isShowing(); + } + + public void hidePopup() { + handleKeyCode(KeyCodes.KEY_ESCAPE); + } + + class SuggestTextBoxEventHandler implements KeyUpHandler, FocusHandler { + @Override + public void onKeyUp(KeyUpEvent event) { + int keyCode = event.getNativeKeyCode(); + handleKeyCode(keyCode); + + if (keyCode == KeyCodes.KEY_TAB) { + event.stopPropagation(); + event.preventDefault(); + } + } + + @Override + public void onFocus(FocusEvent event) { + if (getText().equals(SearchBar.DEFAULT_SEARCH_TEXT)) { + setText(""); + } + // send a 'fake' key, this will rerender PopupPanel with the new completion list + handleKeyCode(1); + } + } + + class SuggestionResultsListBoxEventHandler implements ChangeHandler, ClickHandler { + @Override + public void onChange(ChangeEvent event) { + complete(); + } + + @Override + public void onClick(ClickEvent event) { + complete(); + } + } + + protected void handleKeyCode(int keyCode) { + if (keyCode == KeyCodes.KEY_TAB) { + this.setValue(this.getValue() + " "); + this.setCursorPos(this.getValue().length()); + this.setFocus(true); + return; + } + + if (keyCode == KeyCodes.KEY_DOWN) { + int selectedIndex = choices.getSelectedIndex(); + selectedIndex++; + if (selectedIndex >= choices.getItemCount()) { + selectedIndex = 0; + } + String value = choices.getValue(selectedIndex); + if (value.equals(SuggestResultsListBox.FOOTER_MESSAGE)) { + if (choices.getItemCount() == 1) { + selectedIndex = -1; // do not allow the disabled row to be selected via KEY_DOWN + } else { + selectedIndex++; + } + } + choices.setSelectedIndex(selectedIndex); + return; + } + + if (keyCode == KeyCodes.KEY_UP) { + int selectedIndex = choices.getSelectedIndex(); + selectedIndex--; + if (selectedIndex < 0) { + selectedIndex = choices.getItemCount() - 1; + } + String value = choices.getValue(selectedIndex); + if (value.equals(SuggestResultsListBox.FOOTER_MESSAGE)) { + if (choices.getItemCount() == 1) { + selectedIndex = -1; // do not allow the disabled row to be selected via KEY_UP + } else { + selectedIndex = choices.getItemCount() - 1; + } + } + choices.setSelectedIndex(selectedIndex); + return; + } + + if (keyCode == KeyCodes.KEY_ENTER) { + int selectedIndex = choices.getSelectedIndex(); + if (selectedIndex != -1) { + complete(); + } + return; + } + + if (keyCode == KeyCodes.KEY_ESCAPE) { + choices.clear(); + hide(); + return; + } + + hide(); + String text = this.getText(); + + searchService.getSuggestions( // + SearchSubsystem.RESOURCE, // replace with appropriate subsystem somehow extracted from the context + text, // + this.getCursorPos(), // + new SearchSuggestionCallback(keyCode)); + } + + class SearchSuggestionCallback implements AsyncCallback<List<SearchSuggestion>> { + + private int keyCode; + + public SearchSuggestionCallback(int keyCode) { + this.keyCode = keyCode; + } + + @Override + public void onFailure(Throwable caught) { + choices.setErrorMessage(caught.getMessage()); + commonHandler(); + } + + @Override + public void onSuccess(List<SearchSuggestion> result) { + choices.setSearchSuggestions(result); + commonHandler(); + } + + private void commonHandler() { + int suggestionCount = choices.render(100, 15); + if (suggestionCount == 0) { + return; + } + + choicesPopup.setPopupPosition(getAbsoluteLeft(), getAbsoluteTop() + getOffsetHeight() + 5); + show(); + + if (keyCode == 0) { + /* + if (choices.getItemCount() > 0) { + String value = choices.getValue(0); + if (value.equals(SuggestResultsListBox.FOOTER_MESSAGE)) { + if (choices.getItemCount() > 1) { + choices.setSelectedIndex(1); + } else { + choices.setSelectedIndex(-1); // nothing is selected if FOOTER_MESSAGE is the only suggestion + } + } else { + choices.setSelectedIndex(0); + } + } + */ + + setFocus(true); + } + } + + } +} \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java index b2d5009..6da2f0b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java @@ -30,11 +30,13 @@ public class ErrorHandler {
private ArrayList<String> errors = new ArrayList<String>();
- public void handleError(String message, Throwable t) { - -// SC.say(message); + public void handleError(String message) { + handleError(message, null); + }
- CoreGUI.getMessageCenter().notify(new Message(message, t.toString(), Message.Severity.Error)); + public void handleError(String message, Throwable t) { + Message errorMessage = new Message(message, (t == null) ? null : t.toString(), Message.Severity.Error); + CoreGUI.getMessageCenter().notify(errorMessage);
t.printStackTrace(); this.errors.add(message); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AbstractGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AbstractGWTServiceImpl.java index db3af54..6aaafdd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AbstractGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AbstractGWTServiceImpl.java @@ -18,19 +18,19 @@ */ package org.rhq.enterprise.gui.coregui.server.gwt;
-import org.rhq.core.domain.auth.Subject; -import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; -import org.rhq.enterprise.server.auth.SubjectManagerLocal; -import org.rhq.enterprise.server.util.HibernatePerformanceMonitor; -import org.rhq.enterprise.server.util.LookupUtil; - -import com.google.gwt.user.server.rpc.RemoteServiceServlet; +import java.io.IOException;
import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
-import java.io.IOException; +import com.google.gwt.user.server.rpc.RemoteServiceServlet; + +import org.rhq.core.domain.auth.Subject; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.server.auth.SubjectManagerLocal; +import org.rhq.enterprise.server.util.HibernatePerformanceMonitor; +import org.rhq.enterprise.server.util.LookupUtil;
/** * @author Greg Hinkle @@ -39,7 +39,6 @@ public abstract class AbstractGWTServiceImpl extends RemoteServiceServlet {
private ThreadLocal<Subject> sessionSubject = new ThreadLocal<Subject>();
- protected Subject getSessionSubject() { return sessionSubject.get(); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SearchGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SearchGWTServiceImpl.java new file mode 100644 index 0000000..b896698 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SearchGWTServiceImpl.java @@ -0,0 +1,68 @@ +/* + * 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.server.gwt; + +import java.util.List; + +import org.rhq.core.domain.criteria.SavedSearchCriteria; +import org.rhq.core.domain.search.SavedSearch; +import org.rhq.core.domain.search.SearchSubsystem; +import org.rhq.core.domain.search.SearchSuggestion; +import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTService; +import org.rhq.enterprise.gui.coregui.server.util.SerialUtility; +import org.rhq.enterprise.server.search.SavedSearchManagerLocal; +import org.rhq.enterprise.server.search.execution.SearchAssistManager; +import org.rhq.enterprise.server.util.LookupUtil; + +/** + * @author Joseph Marques + */ +public class SearchGWTServiceImpl extends AbstractGWTServiceImpl implements SearchGWTService { + + private SavedSearchManagerLocal savedSearchManager = LookupUtil.getSavedSearchManager(); + + @Override + public List<SearchSuggestion> getSuggestions(SearchSubsystem searchSubsystem, String expression, int caretPosition) { + SearchAssistManager searchAssistManager = new SearchAssistManager(getSessionSubject(), searchSubsystem); + List<SearchSuggestion> results = searchAssistManager.getSuggestions(expression, caretPosition); + return results; + } + + @Override + public int createSavedSearch(SavedSearch savedSearch) { + return savedSearchManager.createSavedSearch(getSessionSubject(), savedSearch); + } + + @Override + public void updateSavedSearch(SavedSearch savedSearch) { + savedSearchManager.updateSavedSearch(getSessionSubject(), savedSearch); + } + + @Override + public void deleteSavedSearch(int savedSearchId) { + savedSearchManager.deleteSavedSearch(getSessionSubject(), savedSearchId); + } + + @Override + public List<SavedSearch> findSavedSearchesByCriteria(SavedSearchCriteria criteria) { + return SerialUtility.prepare(savedSearchManager.findSavedSearchesByCriteria(getSessionSubject(), criteria), + "SearchService.findRolesByCriteria"); + } + +} \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml index 87b0f0e..45b8fc2 100644 --- a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml +++ b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml @@ -48,13 +48,10 @@ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI BundleGWTService</servlet-name> <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.BundleGWTServiceImpl</servlet-class> </servlet> - - <servlet> <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI FileUploadServlet</servlet-name> <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.FileUploadServlet</servlet-class> </servlet> - <servlet> <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI BundleFileUploadServlet</servlet-name> <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.BundleFileUploadServlet</servlet-class> @@ -63,26 +60,29 @@ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI UberBundleFileUploadServlet</servlet-name> <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.UberBundleFileUploadServlet</servlet-class> </servlet> - <servlet> - <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI ResourceBossGWTService</servlet-name> - <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.ResourceBossGWTServiceImpl</servlet-class> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI ResourceBossGWTService</servlet-name> + <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.ResourceBossGWTServiceImpl</servlet-class> </servlet> <servlet> - <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI AuthorizationGWTService</servlet-name> - <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.AuthorizationGWTServiceImpl</servlet-class> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI AuthorizationGWTService</servlet-name> + <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.AuthorizationGWTServiceImpl</servlet-class> </servlet> <servlet> - <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI AvailabilityGWTService</servlet-name> - <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.AvailabilityGWTServiceImpl</servlet-class> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI AvailabilityGWTService</servlet-name> + <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.AvailabilityGWTServiceImpl</servlet-class> </servlet> <servlet> - <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI TagGWTService</servlet-name> - <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.TagGWTServiceImpl</servlet-class> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI SearchGWTService</servlet-name> + <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.SearchGWTServiceImpl</servlet-class> </servlet> <servlet> - <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI RemoteInstallGWTService</servlet-name> - <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.RemoteInstallGWTServiceImpl</servlet-class> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI TagGWTService</servlet-name> + <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.TagGWTServiceImpl</servlet-class> + </servlet> + <servlet> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI RemoteInstallGWTService</servlet-name> + <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.RemoteInstallGWTServiceImpl</servlet-class> </servlet>
<servlet-mapping> @@ -137,12 +137,10 @@ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI UberBundleFileUploadServlet</servlet-name> <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/UberBundleFileUploadServlet</url-pattern> </servlet-mapping> - <servlet-mapping> <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI ResourceBossGWTService</servlet-name> <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/ResourceBossGWTService</url-pattern> </servlet-mapping> - <servlet-mapping> <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI AuthorizationGWTService</servlet-name> <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/AuthorizationGWTService</url-pattern> @@ -152,6 +150,10 @@ <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/AvailabilityGWTService</url-pattern> </servlet-mapping> <servlet-mapping> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI SearchGWTService</servlet-name> + <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/SearchGWTService</url-pattern> + </servlet-mapping> + <servlet-mapping> <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI TagGWTService</servlet-name> <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/TagGWTService</url-pattern> </servlet-mapping> diff --git a/modules/enterprise/gui/coregui/src/main/webapp/css/search.css b/modules/enterprise/gui/coregui/src/main/webapp/css/search.css new file mode 100644 index 0000000..e91c4d3 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/webapp/css/search.css @@ -0,0 +1,218 @@ + +input { + white-space: no-wrap; +} + +div { + margin-right: auto; + margin-left: auto; +} + +.searchButton { + display: block; + font-size: 13px; + white-space: nowrap; +} + + +/* + * + * pattern field items + * + */ + +.patternField { + font-size: 13px; + font-family: arial, sans-serif; + /*width: 785px;*/ + width: 675px; + padding: 0; + margin: 0; + border-style: none; +} + +.patternNameLabel { + background-color: rgb(192, 236, 207); + color: rgb(51, 106, 63); + font-weight: bold; + white-space: nowrap; + text-align: center; + border-style: none; + font-size: +} + +.patternNameField { + font-size: 11px; + color: green; + width: 125px; + white-space: no-wrap; + border-color: gray; + border-style: dotted; + border-width: thin; +} + + +/* + * + * search container elements + * + */ + +.searchBarContainer { + width: 800px; + position: relative; + background-color: rgb(233, 230, 225); + height: 34px; + vertical-align: bottom; +} + +.searchBarBackgroundContainer { + position: absolute; + top: 5px; + left: 5px; + background-color: white; + border-style: inset; + border-top-color: rgb(250, 250, 250); + border-left-color: rgb(250, 250, 250); + border-bottom-color: white; + border-right-color: white; + border-width: 2px; + padding: 0; + width: 785px; + height: 20px; +} + +.searchBarComponentsContainer { + width: 100%; + margin: 0; + padding: 0; +} + +.searchBarComponentLHS { + background-color: white; + float: left; + width: 200px; +} + +.searchBarComponentRHS { + background-color: white; + float: right; + padding-right: 5px; + padding-top: 2px; +} + +.searchBarButtonContainer { + float: right; + padding: 5px 5px 0 0; + margin: 0; +} + +/* + * + * saved search items + * + */ + +.savedSearchesPanel { + background-color: white; + border-style: none; + padding: 0; + margin: 0; + width: 785px; +} + +.savedSearchesPanel-row { + background-color: white; + border-style: none; + border-bottom-width: thin; + border-bottom-style: solid; + border-bottom-color: gray; + padding: 0px 0px 0px 0px; + margin: 0px 5px 0px 5px; + width: 785px; +} + +.savedSearchesGrid { + background-color: white; + border-style: solid; + border-width: thin; + border-color: buttonshadow; + padding: 0; + margin: 0; +} + +.savedSearchesPanel-top { + color: green; + position: relative; + padding: 0; + margin: 0; + top: 1px; +} + +.savedSearchesPanel-bottom { + font-size: 16px; + position: relative; + padding: 0; + margin: 0; + bottom: 1px; +} + +.x-grid3-row-over { + background-color: rgb(245, 245, 245); + color: white; +} + + +/* + * + * suggest items + * + */ + +.suggestPanel { + width: 785px; +} + +.suggestData { + background-color: white; +} + +.suggestDataSimple { + color: black; +} + +.suggestDataAdvanced { + color: blue; +} + +.suggestDataSavedSearch { + color: green; +} + + +/* + * + * Rounded Corners + * + */ + +div.rounded { + /* just a container for rounded2 div replacement algorithm */ +} +div.rounded2 { + width: 125px; + background: rgb(192, 236, 207) url(images/corner-upper-right-8.png) no-repeat top right; +} +div.rounded2 div { + background: url(images/corner-upper-left-8.png) no-repeat top left; +} +div.rounded2 div div { + background: url(images/corner-lower-right-8.png) no-repeat bottom right; +} +div.rounded2 div div div { + background: url(images/corner-lower-left-8.png) no-repeat bottom left; +} + +div.rounded2 div div div div { + background-image: none; +} diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/search/arrow-down-gray-no-border.png b/modules/enterprise/gui/coregui/src/main/webapp/images/search/arrow-down-gray-no-border.png new file mode 100644 index 0000000..15233e3 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/search/arrow-down-gray-no-border.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/search/arrow-down-white-no-border.png b/modules/enterprise/gui/coregui/src/main/webapp/images/search/arrow-down-white-no-border.png new file mode 100644 index 0000000..325dc24 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/search/arrow-down-white-no-border.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/search/corner-lower-left-8.png b/modules/enterprise/gui/coregui/src/main/webapp/images/search/corner-lower-left-8.png new file mode 100644 index 0000000..cc5b85d Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/search/corner-lower-left-8.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/search/corner-lower-right-8.png b/modules/enterprise/gui/coregui/src/main/webapp/images/search/corner-lower-right-8.png new file mode 100644 index 0000000..ecc8537 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/search/corner-lower-right-8.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/search/corner-upper-left-8.png b/modules/enterprise/gui/coregui/src/main/webapp/images/search/corner-upper-left-8.png new file mode 100644 index 0000000..191e27d Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/search/corner-upper-left-8.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/search/corner-upper-right-8.png b/modules/enterprise/gui/coregui/src/main/webapp/images/search/corner-upper-right-8.png new file mode 100644 index 0000000..64eaaf6 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/search/corner-upper-right-8.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/search/menu_arrow.png b/modules/enterprise/gui/coregui/src/main/webapp/images/search/menu_arrow.png new file mode 100644 index 0000000..3254ecf Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/search/menu_arrow.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/search/menu_arrow_down.png b/modules/enterprise/gui/coregui/src/main/webapp/images/search/menu_arrow_down.png new file mode 100644 index 0000000..f50c07f Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/search/menu_arrow_down.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/search/star1.png b/modules/enterprise/gui/coregui/src/main/webapp/images/search/star1.png new file mode 100644 index 0000000..9ac1f4f Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/search/star1.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/search/star2.png b/modules/enterprise/gui/coregui/src/main/webapp/images/search/star2.png new file mode 100644 index 0000000..d6684b2 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/search/star2.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/search/star3.png b/modules/enterprise/gui/coregui/src/main/webapp/images/search/star3.png new file mode 100644 index 0000000..0753f62 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/search/star3.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/search/trash.png b/modules/enterprise/gui/coregui/src/main/webapp/images/search/trash.png new file mode 100644 index 0000000..7ed5245 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/search/trash.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/js/search.js b/modules/enterprise/gui/coregui/src/main/webapp/js/search.js new file mode 100644 index 0000000..3f912f2 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/webapp/js/search.js @@ -0,0 +1,35 @@ +function roundedCorners() { + var divs = document.getElementsByTagName('div'); + var rounded_divs = []; + for (var i = 0; i < divs.length; i++) { + if (/\brounded\b/.exec(divs[i].className)) { + rounded_divs[rounded_divs.length] = divs[i]; + } + } + for (var i = 0; i < rounded_divs.length; i++) { + var original = rounded_divs[i]; + + /* Make it the inner div of the four */ + original.className = original.className.replace('rounded', ''); + //var originalId = original.id; + //original.id = null; + + /* Now create the outer-most div */ + var tr = document.createElement('div'); + //tr.id = originalId; + tr.className = 'rounded2'; + + /* Swap out the original (we'll put it back later) */ + original.parentNode.replaceChild(tr, original); + + /* Create the two other inner nodes */ + var tl = document.createElement('div'); + var br = document.createElement('div'); + + /* Now glue the nodes back in to the document */ + tr.appendChild(tl); + tl.appendChild(br); + br.appendChild(original); + } +} +window.onload = roundedCorners; diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java index e01a8f2..dabf0a5 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java @@ -13,7 +13,6 @@ import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.criteria.ResourceCriteria; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.resource.composite.ResourceComposite; -import org.rhq.core.domain.search.SavedSearch; import org.rhq.core.domain.search.SearchSubsystem; import org.rhq.core.domain.search.SearchSuggestion; import org.rhq.core.domain.util.PageControl; @@ -26,7 +25,6 @@ import org.rhq.enterprise.gui.common.paging.PageControlView; import org.rhq.enterprise.gui.common.paging.ResourceNameDisambiguatingPagedListDataModel; import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility; import org.rhq.enterprise.server.resource.ResourceManagerLocal; -import org.rhq.enterprise.server.search.SavedSearchManagerLocal; import org.rhq.enterprise.server.search.execution.SearchAssistManager; import org.rhq.enterprise.server.util.HibernatePerformanceMonitor; import org.rhq.enterprise.server.util.LookupUtil; @@ -41,7 +39,6 @@ public class BrowseResourcesUIBean extends PagedDataTableUIBean { private ResourceCategory category;
private ResourceManagerLocal resourceManager = LookupUtil.getResourceManager(); - private SavedSearchManagerLocal savedSearchManager = LookupUtil.getSavedSearchManager();
private static final IntExtractor<ResourceComposite> RESOURCE_ID_EXTRATOR = new IntExtractor<ResourceComposite>() { public int extract(ResourceComposite object) { @@ -59,6 +56,7 @@ public class BrowseResourcesUIBean extends PagedDataTableUIBean { category = ResourceCategory.SERVICE; }
+ /* String searchId = FacesContextUtility.getOptionalRequestParameter("searchId"); if (searchId != null) { SavedSearch savedSearch = savedSearchManager.getSavedSearchById(getSubject(), Integer.valueOf(searchId)); @@ -66,6 +64,7 @@ public class BrowseResourcesUIBean extends PagedDataTableUIBean { } else { search = FacesContextUtility.getOptionalRequestParameter("search"); } + */ }
public String getSearch() { @@ -155,5 +154,4 @@ public class BrowseResourcesUIBean extends PagedDataTableUIBean { public void setSearchInput(HtmlInputText searchInput) { this.searchInput = searchInput; } - } diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml new file mode 100644 index 0000000..98a35b1 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml @@ -0,0 +1,32 @@ + +<ui:composition xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <div class="searchBarContainer" id="searchBar"> + <div class="searchBarBackgroundContainer"> + <div class="searchBarComponentsContainer"> + <div class="searchBarComponentLHS" id="patternFieldContainer"></div> + + <div class="searchBarComponentRHS" id="arrowImageContainer"></div> + <div class="searchBarComponentRHS" id="starImageContainer"></div> + <div class="searchBarComponentRHS" id="patternNameFieldContainer"></div> + <div class="searchBarComponentRHS"> + <div id="patternNameLabelContainer" class="rounded"></div> + </div> + </div> + </div> + <div class="#{searchButtonId} searchBarButtonContainer" id="searchButtonContainer"></div> + <div style="position: absolute;" id="patternFieldSuggestionsContainer"></div> + <div style="position: absolute; width: 800px;" id="savedSearchesContainer"></div> + <br style="clear: both;" /> + </div> + +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml index 3a4c7ea..4972201 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml @@ -30,6 +30,11 @@
<a4j:keepAlive beanName="BrowseResourcesUIBean"/>
+ a4j:form + <a4j:jsFunction name="extractSearchFilter"> + <a4j:actionparam name="param1" assignTo="#{BrowseResourcesUIBean.search}" /> + </a4j:jsFunction> + </a4j:form> <h:form id="browseResourcesForm"> <input type="hidden" name="subtab" value="${param.subtab}" />
@@ -61,7 +66,7 @@ usingSuggestObjects="true" eventsQueue="resourceSearchSuggestions" ignoreDupResponses="true" - rendered="true"> <!-- disable until auto-completer is added --> + rendered="true"> <h:column width="10%"> <h:outputText value="#{suggestItem.kind.displayName}" style="font-variant: small-caps; color: gray;" rendered="#{suggestItem.kind.name eq 'Simple'}" /> @@ -87,6 +92,23 @@ <s:defaultAction/> </a4j:commandButton> </h:panelGroup> + ui:remove + <h:panelGrid columns="3"> + <h:outputText value="Search: " /> + <ui:include src="/rhq/common/searchInterface.xhtml"> + <ui:param name="searchButtonId" value="browseResourcesForm:searchButtonJSF" /> + </ui:include> + + <a4j:commandButton id="searchButtonJSF" value="GO" + reRender="browseResourcesDataTable, browseResourcesDataTableScroller" + status="commonStatus" + actionListener="#{BrowseResourcesUIBean.clearDataModel}" + styleClass="buttonmed" + onclick="extractSearchFilter(getElementCrossBrowser('patternField').value)"> + <s:defaultAction/> + </a4j:commandButton> + </h:panelGrid> + </ui:remove> <p/>
<h:panelGrid columns="1" width="100%"> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/layout/main.xhtml index 6ad9393..24c4a72 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/layout/main.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/layout/main.xhtml @@ -18,15 +18,24 @@
<ui:param name="defaultPageTitle" value="Inventory Browser"/>
+ <ui:define name="metaHeaders"> + <script type="text/javascript" language="javascript" + src="/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/org.rhq.enterprise.gui.coregui.CoreGUI.nocache.js"></script> + <script type="text/javascript" src="/coregui/js/search.js"></script> + <link href="/coregui/css/search.css" rel="stylesheet" type="text/css"/> + </ui:define> + <ui:define name="summary"></ui:define>
<ui:define name="tabBar"> + ui:remove a4j:region <h:form> <a4j:poll interval="60000" timeout="5000" reRender="browserTabBarPanel" status="commonStatus" /> </h:form> </a4j:region> + </ui:remove>
<onc:tabBar id="browserTabBarPanel" selectedTabName="#{selectedTabName}" > diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/test/gwt/facelet.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/test/gwt/facelet.xhtml new file mode 100644 index 0000000..fb4b602 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/test/gwt/facelet.xhtml @@ -0,0 +1,46 @@ +<?xml version="1.0"?> + +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:a4j="http://richfaces.org/a4j" + xmlns:onc="http://jboss.org/on/component" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + +<ui:composition template="/rhq/layout/main.xhtml"> + + <ui:define name="metaHeaders"> + <script type="text/javascript" language="javascript" + src="/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/org.rhq.enterprise.gui.coregui.CoreGUI.nocache.js"></script> + </ui:define> + + <ui:param name="pageTitle" value="Facelets-based inclusion of GWT functionality defined in CoreGUI WAR"/> + + <ui:define name="breadcrumbs"> + <h:outputText value="No Breadcrumbs"/> + </ui:define> + + <ui:define name="body"> + <form> + ui:remove + In the target GWT module, in this case CoreGUI, add code in a new EntryPoint which does: + + RootPanel testInputTextBox = RootPanel.get("testInputTextBox"); + if (testInputTextBox == null) { + return; // user isn't accessing the page where this element is located + } + testInputTextBox.add( ... ); // add whatever widgets you want + </ui:remove> + <div id="testInputTextBox" /> + </form> + </ui:define> + +</ui:composition> + +</html> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/test/gwt/simple.html b/modules/enterprise/gui/portal-war/src/main/webapp/test/gwt/simple.html new file mode 100644 index 0000000..bf06028 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/test/gwt/simple.html @@ -0,0 +1,36 @@ +<?xml version="1.0"?> + +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:a4j="http://richfaces.org/a4j" + xmlns:onc="http://jboss.org/on/component" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + +<head> + <script type="text/javascript" language="javascript" + src="/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/org.rhq.enterprise.gui.coregui.CoreGUI.nocache.js"></script> +</head> + +<body> + <form> + <!-- + In the target GWT module, in this case CoreGUI, add code in a new EntryPoint which does: + + RootPanel testInputTextBox = RootPanel.get("testInputTextBox"); + if (testInputTextBox == null) { + return; // user isn't accessing the page where this element is located + } + testInputTextBox.add( ... ); // add whatever widgets you want + --> + <div id="testInputTextBox" /> + </form> +</body> + +</html> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/test/iframe/inner.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/test/iframe/inner.xhtml new file mode 100644 index 0000000..0d324ad --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/test/iframe/inner.xhtml @@ -0,0 +1,36 @@ +<?xml version="1.0"?> + +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:a4j="http://richfaces.org/a4j" + xmlns:onc="http://jboss.org/on/component" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + +<head> +</head> + +<body> + <form> + <select> + <option>Cruel</option> + <option>Cruel</option> + <option>Cruel</option> + <option>Cruel</option> + <option>Cruel</option> + <option>Cruel</option> + <option>Cruel</option> + <option>Cruel</option> + <option>Cruel</option> + <option>Cruel</option> + </select> + </form> +</body> + +</html> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/test/iframe/outer.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/test/iframe/outer.xhtml new file mode 100644 index 0000000..cffbf14 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/test/iframe/outer.xhtml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> + +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:a4j="http://richfaces.org/a4j" + xmlns:onc="http://jboss.org/on/component" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + +<head> +</head> + +<body> + + Hello + <iframe src="/test/iframe/inner.xhtml" + style="border: solid; width: 100px; height: 50px;" /> + World + +</body> + +</html> \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java index db826de..91676d0 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java @@ -80,7 +80,8 @@ public class SavedSearchResultCountRecalculationJob extends AbstractStatefulJob // TODO: mark this saved search as "broken" so that future computation is suppressed for it errors++; LOG.error("Could not calculate result count for SavedSearch[name=" + next.getName() + ", pattern='" - + next.getPattern() + "']"); + + next.getPattern() + "']: " + t.getMessage()); + LOG.debug(t); } } if (updated > 0) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java index 1485197..32aa7cd 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java @@ -50,16 +50,17 @@ public class SavedSearchManagerBean implements SavedSearchManagerLocal /* local /** * @see SavedSearchManagerRemote#createSavedSearch(Subject, SavedSearch) */ - public void createSavedSearch(Subject subject, SavedSearch savedSearch) { + public int createSavedSearch(Subject subject, SavedSearch savedSearch) { validateManipulatePermission(subject, savedSearch); entityManager.persist(savedSearch); - return; + return savedSearch.getId(); }
/** * @see SavedSearchManagerRemote#updateSavedSearch(Subject, SavedSearch) */ public void updateSavedSearch(Subject subject, SavedSearch savedSearch) { + // this needs to prevent certains types of updates, be more sophisticated, etc validateManipulatePermission(subject, savedSearch); entityManager.merge(savedSearch); return; @@ -102,7 +103,7 @@ public class SavedSearchManagerBean implements SavedSearchManagerLocal /* local } // note: inventory managers can modify any saved search pattern, not just their own } else { - if (subject.equals(savedSearch.getSubject())) { + if (subject.getId() != savedSearch.getSubjectId() && !authorizationManager.isInventoryManager(subject)) { throw new PermissionException("Users without inventory manager permission " + "can only manipulate their own saved searches"); } @@ -111,7 +112,7 @@ public class SavedSearchManagerBean implements SavedSearchManagerLocal /* local
private void validateReadPermission(Subject subject, SavedSearch savedSearch) { if (!savedSearch.isGlobal()) { - if (subject.equals(savedSearch.getSubject())) { + if (subject.getId() != savedSearch.getSubjectId() && !authorizationManager.isInventoryManager(subject)) { throw new PermissionException("Users without inventory manager permission " + "can only view their own or global saved saved searches"); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerRemote.java index 6585739..64d4824 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerRemote.java @@ -52,7 +52,7 @@ public interface SavedSearchManagerRemote { * their own accounts. */ @WebMethod - public void createSavedSearch( // + public int createSavedSearch( // @WebParam(name = "subject") Subject subject, // @WebParam(name = "savedSearch") SavedSearch savedSearch);
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java index 8603946..a459d87 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java @@ -8,10 +8,15 @@ import java.util.Map;
import javax.persistence.Query;
+import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.rhq.enterprise.server.util.LookupUtil;
public abstract class AbstractSearchAssistant implements SearchAssistant {
+ private final Log log = LogFactory.getLog(SearchAssistant.class); + private int maxResultCount = 20;
public int getMaxResultCount() { @@ -51,6 +56,7 @@ public abstract class AbstractSearchAssistant implements SearchAssistant {
@SuppressWarnings("unchecked") protected final List<String> execute(String jpql) { + log.debug("Executing JPQL: " + jpql); Query query = LookupUtil.getEntityManager().createQuery(jpql); query.setMaxResults(maxResultCount); List<String> results = query.getResultList(); @@ -59,6 +65,7 @@ public abstract class AbstractSearchAssistant implements SearchAssistant {
@SuppressWarnings("unchecked") protected final Map<String, List<String>> executeMap(String jpql) { + log.debug("Executing Map JPQL: " + jpql); Query query = LookupUtil.getEntityManager().createQuery(jpql); List<Object[]> rawResults = query.getResultList(); Map<String, List<String>> results = new HashMap<String, List<String>>(); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java index 4deaa01..d0721eb 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java @@ -41,7 +41,7 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant { + " FROM ResourceType type " // + " JOIN type.pluginConfigurationDefinition.propertyDefinitions definition " // + add(" WHERE LOWER(definition.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // - + "ORDER BY definition.name "); + + " ORDER BY definition.name ");
} else if (context.equals("configuration")) { return execute("" // @@ -49,7 +49,7 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant { + " FROM ResourceType type " // + " JOIN type.resourceConfigurationDefinition.propertyDefinitions definition " // + add(" WHERE LOWER(definition.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // - + "ORDER BY definition.name "); + + " ORDER BY definition.name ");
} else if (context.equals("trait")) { return execute("" // @@ -57,7 +57,7 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant { + " FROM MeasurementDefinition definition " // + " WHERE definition.dataType = 1 " // + add(" AND LOWER(definition.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // - + "ORDER BY definition.name "); + + " ORDER BY definition.name ");
} else { return Collections.emptyList(); @@ -77,21 +77,21 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant { + "SELECT DISTINCT type.name " // + " FROM ResourceType type " // + add(" WHERE LOWER(type.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // - + "ORDER BY type.name "); + + " ORDER BY type.name ");
} else if (context.equals("plugin")) { return execute("" // + "SELECT DISTINCT type.plugin " // + " FROM ResourceType type " // + add(" WHERE LOWER(type.plugin) LIKE '%" + filter.toLowerCase() + "%'", filter) // - + "ORDER BY type.plugin "); + + " ORDER BY type.plugin ");
} else if (context.equals("name")) { return execute("" // + "SELECT DISTINCT res.name " // + " FROM Resource res " // + add(" WHERE LOWER(res.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // - + "ORDER BY res.name "); + + " ORDER BY res.name ");
} else if (context.equals("connection")) { return execute("" // @@ -99,9 +99,9 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant { + " FROM Resource res, PropertySimple simple " // + " JOIN res.pluginConfiguration.properties property " // + " WHERE simple.id = property.id " // - + " AND property.name = '" + param + "'" // + + " AND LOWER(property.name) LIKE '%" + param + "%'" // + add(" AND LOWER(property.stringValue) LIKE '%" + filter.toLowerCase() + "%'", filter) // - + "ORDER BY simple.stringValue "); + + " ORDER BY simple.stringValue ");
} else if (context.equals("configuration")) { return execute("" // @@ -109,18 +109,18 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant { + " FROM Resource res, PropertySimple simple " // + " JOIN res.resourceConfiguration.properties property " // + " WHERE simple.id = property.id " // - + " AND property.name = '" + param + "'" // + + " AND LOWER(property.name) LIKE '%" + param + "%'" // + add(" AND LOWER(property.stringValue) LIKE '%" + filter.toLowerCase() + "%'", filter) // - + "ORDER BY simple.stringValue "); + + " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) { return execute("" // + "SELECT trait.value " // + " FROM MeasurementDataTrait trait " // + " WHERE trait.schedule.definition.dataType = 1 " // - + " AND trait.schedule.definition.name = '" + param + "'" // + + " AND LOWER(trait.schedule.definition.name) LIKE '%" + param + "%'" // + add(" AND LOWER(trait.value) LIKE '%" + filter.toLowerCase() + "%'", filter) // - + "ORDER BY trait.value "); + + " ORDER BY trait.value ");
} else { return Collections.emptyList(); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java index 97f44dd..3d5393b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java @@ -19,7 +19,6 @@ import org.rhq.core.domain.util.PageOrdering; import org.rhq.enterprise.server.search.SavedSearchManagerLocal; import org.rhq.enterprise.server.search.assist.AbstractSearchAssistant; import org.rhq.enterprise.server.search.assist.ResourceSearchAssistant; -import org.rhq.enterprise.server.util.HibernatePerformanceMonitor; import org.rhq.enterprise.server.util.LookupUtil;
public class SearchAssistManager { @@ -182,6 +181,19 @@ public class SearchAssistManager { public String toString() { return null; } + + public String getExpressionWithReplacement(String replacement) { + StringBuilder builder = new StringBuilder(); + for (int i = 0; i < terms.size(); i++) { + if (i == currentTermIndex) { + builder.append(replacement); + } else { + builder.append(terms.get(i)); + } + builder.append(' '); + } + return builder.toString(); + } }
static class ParsedContext { @@ -264,6 +276,24 @@ public class SearchAssistManager { return new ParsedContext(context, param, operator, value); }
+ public boolean isSimple() { + if (operator != null) { + return false; // non-null operator implies an incomplete, advanced term + } + + if (param != null) { + return false; // non-null operator implies an incomplete, advanced term + } + + /* + * otherwise it's still possible that the user wants a simple text completion. + * + * note: it should not be necessary to check for non-null 'value' because operation/param would have + * had to be non-null first, which we've already verified by getting to here. + */ + return true; + } + public String toString() { StringBuilder buffer = new StringBuilder(); buffer.append(getClass().getSimpleName()).append("["); @@ -290,7 +320,7 @@ public class SearchAssistManager { } }
- public List<String> getAllContexts() { + private List<String> getAllContexts() { List<String> results = new ArrayList<String>(getSearchAssistant().getSimpleContexts()); for (String parameterized : getSearchAssistant().getParameterizedContexts()) { results.add(parameterized + "["); @@ -299,27 +329,50 @@ public class SearchAssistManager { }
public List<SearchSuggestion> getSuggestions(String expression, int caretPos) { - //List<SearchSuggestion> simple = getSimpleSuggestions(expression, caretPos); + if (expression == null) { + expression = ""; + } + + List<SearchSuggestion> simple = getSimpleSuggestions(expression, caretPos); List<SearchSuggestion> advanced = getAdvancedSuggestions(expression, caretPos); List<SearchSuggestion> userSavedSearches = getUserSavedSearchSuggestions(expression); - List<SearchSuggestion> globalSavedSearches = getGlobalSavedSearchSuggestions(expression); + //List<SearchSuggestion> globalSavedSearches = getGlobalSavedSearchSuggestions(expression);
List<SearchSuggestion> results = new ArrayList<SearchSuggestion>(); - //results.addAll(simple); + results.addAll(simple); results.addAll(advanced); results.addAll(userSavedSearches); - results.addAll(globalSavedSearches); + //results.addAll(globalSavedSearches); Collections.sort(results); + return results; }
public List<SearchSuggestion> getSimpleSuggestions(String expression, int caretPos) { AbstractSearchAssistant completor = getSearchAssistant();
+ debug("getSimpleSuggestions: START"); + + SearchTermAssistant assistant = new SearchTermAssistant(expression, caretPos); + String beforeCaret = assistant.getFragmentBeforeCaret(); + ParsedContext parsed = ParsedContext.get(beforeCaret); + + if (parsed.isSimple() == false) { + return Collections.emptyList(); + } + + /* + * if we know the ParsedContext object may represent a simple search term, then the 'context' attribute + * would hold it's current value, which in this case we'll extract and use as the simple value match + */ + String parsedTerm = parsed.context; List<SearchSuggestion> results = new ArrayList<SearchSuggestion>(); for (String nextContext : completor.getSimpleContexts()) { - String intermediateExpression = nextContext + "=" + expression; - List<SearchSuggestion> suggestions = getAdvancedSuggestions(intermediateExpression, caretPos); + + debug("getSimpleSuggestions: suggesting value completions for a simple context [" + nextContext + "]"); + List<String> valueSuggestions = pad(""", completor.getValues(nextContext, null, parsedTerm), """); + + List<SearchSuggestion> suggestions = convert(valueSuggestions, parsed, parsedTerm, Kind.Simple); results.addAll(suggestions); } Collections.sort(results); @@ -334,9 +387,7 @@ public class SearchAssistManager { AbstractSearchAssistant completor = getSearchAssistant();
debug("getAdvancedSuggestions: START"); - long id = HibernatePerformanceMonitor.get().start(); SearchTermAssistant assistant = new SearchTermAssistant(expression, caretPos); - HibernatePerformanceMonitor.get().stop(id, "SearchAssistant"); String[] tokens = assistant.getTerms().toArray(new String[0]); debug("" + tokens.length + " tokens are " + Arrays.asList(tokens));
@@ -370,30 +421,32 @@ public class SearchAssistManager { // check if this context is complete or not if (completor.getSimpleContexts().contains(parsed.context)) { debug("getAdvancedSuggestions: search term is simple context, wants operator"); - return convert(pad(parsed.context, comparisonOperators, "")); + return convert(pad(parsed.context, comparisonOperators, ""), parsed, parsed.context); } if (completor.getParameterizedContexts().contains(parsed.context)) { debug("getAdvancedSuggestions: search term is parameterized context, wants open bracket"); - return convert(Arrays.asList(parsed.context + "[")); + return convert(Arrays.asList(parsed.context + "["), parsed, parsed.context); }
debug("getAdvancedSuggestions: search term wants context completion"); List<String> startsWithContexts = new ArrayList<String>(); + String lowerCaseParsedContext = parsed.context.toLowerCase(); // contexts should already be lower-cased for (String context : completor.getSimpleContexts()) { - if (context.indexOf(parsed.context) != -1) { + if (context.indexOf(lowerCaseParsedContext) != -1) { startsWithContexts.add(context); } } for (String context : completor.getParameterizedContexts()) { - if (context.indexOf(parsed.context) != -1) { + if (context.indexOf(lowerCaseParsedContext) != -1) { startsWithContexts.add(context + "["); } } - return convert(startsWithContexts); + return convert(startsWithContexts, parsed, parsed.context); } case PARAM: debug("getAdvancedSuggestions: param state"); - return convert(pad(parsed.context + "[", completor.getParameters(parsed.context, parsed.param), "]")); + return convert(pad(parsed.context + "[", completor.getParameters(parsed.context, parsed.param), "]"), + parsed, parsed.param); case OPERATOR: debug("getAdvancedSuggestions: operator state"); if (comparisonOperators.contains(parsed.operator)) { @@ -428,10 +481,11 @@ public class SearchAssistManager { """); if (completor.getSimpleContexts().contains(parsed.context)) { debug("getAdvancedSuggestions: suggesting value completions for a simple context"); - return convert(pad(parsed.context + parsed.operator, valueSuggestions, "")); + return convert(pad(parsed.context + parsed.operator, valueSuggestions, ""), parsed, parsed.value); } else { debug("getAdvancedSuggestions: suggesting value completions for a parameterized context"); - return convert(pad(parsed.context + "[" + parsed.param + "]" + parsed.operator, valueSuggestions, "")); + return convert(pad(parsed.context + "[" + parsed.param + "]" + parsed.operator, valueSuggestions, ""), + parsed, parsed.value); } default: return Collections.emptyList(); @@ -439,10 +493,12 @@ public class SearchAssistManager { }
public List<SearchSuggestion> getUserSavedSearchSuggestions(String expression) { + expression = expression.trim().toLowerCase().replaceAll("\s+", " "); + SavedSearchCriteria criteria = new SavedSearchCriteria(); criteria.addFilterSubjectId(subject.getId()); criteria.addFilterSearchContext(searchSubsystem); - if (expression != null && expression.trim().equals("")) { + if (expression.equals("") == false) { criteria.addFilterName(expression); }
@@ -464,9 +520,12 @@ public class SearchAssistManager { }
public List<SearchSuggestion> getGlobalSavedSearchSuggestions(String expression) { + expression = expression.trim().toLowerCase().replaceAll("\s+", " "); + SavedSearchCriteria criteria = new SavedSearchCriteria(); criteria.addFilterGlobal(true); - if (expression != null && expression.trim().equals("")) { + criteria.addFilterSearchContext(searchSubsystem); + if (expression.equals("") == false) { criteria.addFilterName(expression); }
@@ -497,13 +556,40 @@ public class SearchAssistManager { }
private List<SearchSuggestion> convert(List<String> suggestions) { + return convert(suggestions, null, "", Kind.Advanced); + } + + private List<SearchSuggestion> convert(List<String> suggestions, ParsedContext parsed, String term) { + return convert(suggestions, parsed, term, Kind.Advanced); + } + + private List<SearchSuggestion> convert(List<String> suggestions, ParsedContext parsed, String term, Kind kind) { + int startIndex = getStartIndex(parsed); + term = term.toLowerCase(); List<SearchSuggestion> results = new ArrayList<SearchSuggestion>(suggestions.size()); for (String suggestion : suggestions) { - results.add(new SearchSuggestion(Kind.Advanced, suggestion)); + int index = suggestion.toLowerCase().indexOf(term, startIndex); + results.add(new SearchSuggestion(kind, suggestion, index, term.length())); } return results; }
+ private int getStartIndex(ParsedContext parsed) { + if (parsed == null) { + return 0; + } + switch (parsed.state) { + case PARAM: + return parsed.context.length(); + case OPERATOR: + return parsed.context.length() + (parsed.param != null ? parsed.param.length() : 0); + case VALUE: + return parsed.context.length() + (parsed.param != null ? parsed.param.length() : 0) + + parsed.operator.length(); + } + return 0; // case CONTEXT + } + private List<String> pad(String leftPad, List<String> data, String rightPad) { List<String> results = new ArrayList<String>(); for (String next : data) {
commit 9ddd31c129230f1c6a0a86dad741387beb0bf955 Merge: bf62e18... 395aa1d... Author: John Sanda jsanda@redhat.com Date: Fri May 21 09:38:51 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit bf62e186bc652d673d06e50df0f9cc03a61b3f94 Author: John Sanda jsanda@redhat.com Date: Fri May 21 09:37:34 2010 -0400
[BZ 581818] Updating javascript so that db connection properties are updated for oracle selection
diff --git a/modules/enterprise/gui/installer-war/src/main/webapp/start.jsp b/modules/enterprise/gui/installer-war/src/main/webapp/start.jsp index 3735dcd..c9aee8f 100644 --- a/modules/enterprise/gui/installer-war/src/main/webapp/start.jsp +++ b/modules/enterprise/gui/installer-war/src/main/webapp/start.jsp @@ -75,7 +75,7 @@ document.getElementById('propForm:databasedriverclass').value = 'org.postgresql.Driver'; document.getElementById('propForm:databasexadatasourceclass').value = 'org.postgresql.xa.PGXADataSource'; hideDiv('experimentalDbMsg'); - } else if (this.options[this.selectedIndex].value == 'Oracle10g') { + } else if (this.options[this.selectedIndex].value == 'Oracle') { document.getElementById('propForm:databaseconnectionurl').value = 'jdbc:oracle:thin:@127.0.0.1:1521:rhq'; document.getElementById('propForm:databasedriverclass').value = 'oracle.jdbc.driver.OracleDriver'; document.getElementById('propForm:databasexadatasourceclass').value = 'oracle.jdbc.xa.client.OracleXADataSource';
commit 395aa1d971576a1ca526a71da6a58c3c58253256 Author: John Mazzitelli mazz@redhat.com Date: Fri May 21 09:09:10 2010 -0400
BZ 536173 - there is now a backdoor system property you can set to override the 5s availability timeout - rhq.agent.plugins.availability-scan.timeout
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java index eac2016..d916bbc 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java @@ -51,7 +51,25 @@ import org.rhq.core.pluginapi.availability.AvailabilityFacet; * @author John Mazzitelli */ public class AvailabilityExecutor implements Runnable, Callable<AvailabilityReport> { - private static final int GET_AVAILABILITY_TIMEOUT = 5 * 1000; // 5 seconds + // the get-availability-timeout will rarely, if ever, want to be overridden. It will default to be 5 seconds + // and that's what it probably should always be. However, there may be a rare instance where someone wants + // to give this availability executor a bit more time to wait for the resource's availability response + // and is willing to live with the possible consequences (that being, delayed avail reports and possibly + // false-down alerts getting triggered). Rather than changing this timeout, people should be using + // the asynchronous-availability-check capabilities that are exposed to the plugins. Because we do not + // want to encourage people from changing this, we do not expose this "backdoor" system property as a + // standard plugin configuration setting/agent preference - if someone wants to do this, they must + // explicitly pass in -D to the JVM running the plugin container. + private static final int GET_AVAILABILITY_TIMEOUT; + static { + int timeout; + try { + timeout = Integer.parseInt(System.getProperty("rhq.agent.plugins.availability-scan.timeout", "5000")); + } catch (Throwable t) { + timeout = 5000; + } + GET_AVAILABILITY_TIMEOUT = timeout; + }
private final Log log = LogFactory.getLog(AvailabilityExecutor.class);
commit 6a55aafe591c04dfd2b9d89dffc52e7e7c9f4249 Author: John Mazzitelli mazz@redhat.com Date: Fri May 21 09:09:10 2010 -0400
BZ 536173 - there is now a backdoor system property you can set to override the 5s availability timeout - rhq.agent.plugins.availability-scan.timeout
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java index eac2016..d916bbc 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java @@ -51,7 +51,25 @@ import org.rhq.core.pluginapi.availability.AvailabilityFacet; * @author John Mazzitelli */ public class AvailabilityExecutor implements Runnable, Callable<AvailabilityReport> { - private static final int GET_AVAILABILITY_TIMEOUT = 5 * 1000; // 5 seconds + // the get-availability-timeout will rarely, if ever, want to be overridden. It will default to be 5 seconds + // and that's what it probably should always be. However, there may be a rare instance where someone wants + // to give this availability executor a bit more time to wait for the resource's availability response + // and is willing to live with the possible consequences (that being, delayed avail reports and possibly + // false-down alerts getting triggered). Rather than changing this timeout, people should be using + // the asynchronous-availability-check capabilities that are exposed to the plugins. Because we do not + // want to encourage people from changing this, we do not expose this "backdoor" system property as a + // standard plugin configuration setting/agent preference - if someone wants to do this, they must + // explicitly pass in -D to the JVM running the plugin container. + private static final int GET_AVAILABILITY_TIMEOUT; + static { + int timeout; + try { + timeout = Integer.parseInt(System.getProperty("rhq.agent.plugins.availability-scan.timeout", "5000")); + } catch (Throwable t) { + timeout = 5000; + } + GET_AVAILABILITY_TIMEOUT = timeout; + }
private final Log log = LogFactory.getLog(AvailabilityExecutor.class);
commit 49e72b33dbb715fb390cdcfe6c64ed727addaa8b Author: Simeon Pinder spinder@cacaphonix.conchfritter.com Date: Fri May 21 08:32:52 2010 -0400
BZ 586079: spelling changes.
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoAssociationsUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoAssociationsUIBean.java index d659c56..96a7e65 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoAssociationsUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoAssociationsUIBean.java @@ -77,10 +77,10 @@ public class RepoAssociationsUIBean extends PagedDataTableUIBean { manager.removeContentSourcesFromRepo(subject, repoId, contentSourceIds);
FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO, "Disassociated [" + contentSourceIds.length - + "] content sources from repo"); + + "] content sources from repository"); } catch (Exception e) { FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, - "Failed to disassociate one or more content sources from repo", e); + "Failed to disassociate one or more content sources from repository", e); } }
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoContentSourcesUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoContentSourcesUIBean.java index 2f3b989..4c93698 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoContentSourcesUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoContentSourcesUIBean.java @@ -55,10 +55,10 @@ public class RepoContentSourcesUIBean extends PagedDataTableUIBean { manager.removeContentSourcesFromRepo(subject, repoId, contentSourceIds);
FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO, "Disassociated [" + contentSourceIds.length - + "] content sources from repo"); + + "] content sources from repository"); } catch (Exception e) { FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, - "Failed to disassociate one or more content sources from repo", e); + "Failed to disassociate one or more content sources from repository", e); } }
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoDisassociationsUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoDisassociationsUIBean.java index 517da56..d42e19d 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoDisassociationsUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoDisassociationsUIBean.java @@ -55,10 +55,10 @@ public class RepoDisassociationsUIBean extends PagedDataTableUIBean { manager.addContentSourcesToRepo(subject, repoId, contentSourceIds);
FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO, "Associated [" + contentSourceIds.length - + "] content sources with repo"); + + "] content sources with repository"); } catch (Exception e) { FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, - "Failed to associate one or more content sources with repo", e); + "Failed to associate one or more content sources with repository", e); } }
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoResourcesUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoResourcesUIBean.java index 5521445..9c4093e 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoResourcesUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoResourcesUIBean.java @@ -20,6 +20,7 @@ package org.rhq.enterprise.gui.content;
import javax.faces.application.FacesMessage; import javax.faces.model.DataModel; + import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.util.PageControl; @@ -28,7 +29,6 @@ import org.rhq.core.gui.util.FacesContextUtility; import org.rhq.core.util.IntExtractor; import org.rhq.enterprise.gui.common.framework.PagedDataTableUIBean; import org.rhq.enterprise.gui.common.paging.PageControlView; -import org.rhq.enterprise.gui.common.paging.PagedListDataModel; import org.rhq.enterprise.gui.common.paging.ResourceNameDisambiguatingPagedListDataModel; import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility; import org.rhq.enterprise.server.content.RepoManagerLocal; @@ -42,7 +42,7 @@ public class RepoResourcesUIBean extends PagedDataTableUIBean { return r.getId(); } }; - + public RepoResourcesUIBean() { }
@@ -64,10 +64,10 @@ public class RepoResourcesUIBean extends PagedDataTableUIBean { }
FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO, "Unsubscribed [" + resourceIds.length - + "] resources from repo"); + + "] resources from repository"); } catch (Exception e) { FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, - "Failed to unsubscribe one or more resources from repo", e); + "Failed to unsubscribe one or more resources from repository", e); } }
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoSubscriptionsUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoSubscriptionsUIBean.java index 025d5f9..a628ed8 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoSubscriptionsUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoSubscriptionsUIBean.java @@ -48,7 +48,7 @@ public class RepoSubscriptionsUIBean extends PagedDataTableUIBean { return r.getId(); } }; - + public String deleteSelectedRepoSubscriptions() { Subject subject = EnterpriseFacesContextUtility.getSubject(); String[] selected = getSelectedRepoSubscriptions(); @@ -65,10 +65,10 @@ public class RepoSubscriptionsUIBean extends PagedDataTableUIBean { }
FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO, "Unsubscribed [" + resourceIds.length - + "] resources from repo"); + + "] resources from repository"); } catch (Exception e) { FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, - "Failed to unsubscribe one or more resources from repo", e); + "Failed to unsubscribe one or more resources from repository", e); } }
@@ -97,7 +97,7 @@ public class RepoSubscriptionsUIBean extends PagedDataTableUIBean { PageList<Resource> results = manager.findSubscribedResources(subject, id, pc); return results; } - + protected IntExtractor<Resource> getResourceIdExtractor() { return RESOURCE_ID_EXTRACTOR; } diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoUnsubscriptionsUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoUnsubscriptionsUIBean.java index 59b5a0a..a865a6e 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoUnsubscriptionsUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/content/RepoUnsubscriptionsUIBean.java @@ -18,7 +18,6 @@ */ package org.rhq.enterprise.gui.content;
- import javax.faces.application.FacesMessage; import javax.faces.model.DataModel;
@@ -48,7 +47,7 @@ public class RepoUnsubscriptionsUIBean extends PagedDataTableUIBean { return r.getId(); } }; - + public RepoUnsubscriptionsUIBean() { }
@@ -87,10 +86,10 @@ public class RepoUnsubscriptionsUIBean extends PagedDataTableUIBean { }
FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO, "Subscribed [" + resourceIds.length - + "] resources with repo"); + + "] resources with repository"); } catch (Exception e) { FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, - "Failed to subscribe one or more resources with repo", e); + "Failed to subscribe one or more resources with repository", e); } }
@@ -100,8 +99,7 @@ public class RepoUnsubscriptionsUIBean extends PagedDataTableUIBean { @Override public DataModel getDataModel() { if (dataModel == null) { - dataModel = new RepoUnsubscriptionsDataModel(PageControlView.RepoUnsubscriptionsList, - MANAGED_BEAN_NAME); + dataModel = new RepoUnsubscriptionsDataModel(PageControlView.RepoUnsubscriptionsList, MANAGED_BEAN_NAME); }
return dataModel; @@ -130,14 +128,14 @@ public class RepoUnsubscriptionsUIBean extends PagedDataTableUIBean { categoryEnum = ResourceCategory.valueOf(category); }
- PageList<Resource> results = manager.findAvailableResourcesForRepo(subject, repoId, search, - categoryEnum, pc); + PageList<Resource> results = manager.findAvailableResourcesForRepo(subject, repoId, search, categoryEnum, + pc);
//PageList<ResourceComposite> results = manager.findResourceComposites(subject, categoryEnum, null, null, search, pc);
return results; } - + protected IntExtractor<Resource> getResourceIdExtractor() { return RESOURCE_ID_EXTRACTOR; } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/DistributionManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/DistributionManagerBean.java index e931267..c273793 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/DistributionManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/DistributionManagerBean.java @@ -34,9 +34,9 @@ import org.apache.commons.logging.LogFactory; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.authz.Permission; import org.rhq.core.domain.content.Distribution; +import org.rhq.core.domain.content.DistributionFile; import org.rhq.core.domain.content.DistributionType; import org.rhq.core.domain.content.RepoDistribution; -import org.rhq.core.domain.content.DistributionFile; import org.rhq.enterprise.server.RHQConstants; import org.rhq.enterprise.server.authz.AuthorizationManagerLocal; import org.rhq.enterprise.server.authz.RequiredPermission; @@ -90,7 +90,7 @@ public class DistributionManagerBean implements DistributionManagerLocal, Distri
@RequiredPermission(Permission.MANAGE_INVENTORY) public void deleteDistributionMappingsForRepo(Subject user, int repoId) { - log.debug("User [" + user + "] is removing distribution tree mapping from repo [" + repoId + "]"); + log.debug("User [" + user + "] is removing distribution tree mapping from repository [" + repoId + "]");
entityManager.createNamedQuery(RepoDistribution.DELETE_BY_REPO_ID).setParameter("repoId", repoId) .executeUpdate(); @@ -170,8 +170,6 @@ public class DistributionManagerBean implements DistributionManagerLocal, Distri
}
- - /** * Returns a list of available distribution files for requested distribution * @param distId diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java index f78c7fc..9cd8584 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java @@ -640,7 +640,7 @@ public class RepoManagerBean implements RepoManagerLocal, RepoManagerRemote { public void removeContentSourcesFromRepo(Subject subject, int repoId, int[] contentSourceIds) throws RepoException { Repo repo = getRepo(subject, repoId);
- log.debug("User [" + subject + "] is removing content sources from repo [" + repo + "]"); + log.debug("User [" + subject + "] is removing content sources from repository [" + repo + "]");
Set<RepoContentSource> currentSet = repo.getRepoContentSources();
@@ -715,7 +715,7 @@ public class RepoManagerBean implements RepoManagerLocal, RepoManagerRemote { // make sure the user has permissions to unsubscribe this resource if (!authzManager.hasResourcePermission(subject, Permission.MANAGE_CONTENT, resourceId)) { throw new PermissionException("[" + subject - + "] does not have permission to unsubscribe this resource from repos"); + + "] does not have permission to unsubscribe this resource from repositories"); }
// find the resource - abort if it does not exist diff --git a/modules/enterprise/server/plugins/rhnhosted/src/main/java/org/rhq/enterprise/server/plugins/rhnhosted/RHNProvider.java b/modules/enterprise/server/plugins/rhnhosted/src/main/java/org/rhq/enterprise/server/plugins/rhnhosted/RHNProvider.java index bfad1a1..03e7ba6 100644 --- a/modules/enterprise/server/plugins/rhnhosted/src/main/java/org/rhq/enterprise/server/plugins/rhnhosted/RHNProvider.java +++ b/modules/enterprise/server/plugins/rhnhosted/src/main/java/org/rhq/enterprise/server/plugins/rhnhosted/RHNProvider.java @@ -220,7 +220,7 @@ public class RHNProvider implements ContentProvider, PackageSource, RepoSource, //helper.disconnect(); summary.markEnded(); report.setSummary(summary.toString()); - log.info("synchronizing with repo: " + helper + " finished\n" + summary); + log.info("synchronizing with repository: " + helper + " finished\n" + summary); } }
diff --git a/modules/enterprise/server/plugins/yum/src/main/java/org/rhq/enterprise/server/plugins/yum/RepoProvider.java b/modules/enterprise/server/plugins/yum/src/main/java/org/rhq/enterprise/server/plugins/yum/RepoProvider.java index 40c6656..f065ba7 100644 --- a/modules/enterprise/server/plugins/yum/src/main/java/org/rhq/enterprise/server/plugins/yum/RepoProvider.java +++ b/modules/enterprise/server/plugins/yum/src/main/java/org/rhq/enterprise/server/plugins/yum/RepoProvider.java @@ -134,7 +134,7 @@ public class RepoProvider implements ContentProvider, PackageSource { public void synchronizePackages(String repoName, PackageSyncReport report, Collection<ContentProviderPackageDetails> existingPackages) throws SyncException, InterruptedException { Summary summary = new Summary(reader); - log.info("synchronizing with repo: " + reader + " started"); + log.info("synchronizing with repository: " + reader + " started"); try { summary.markStarted(); repo = new Repo(reader); @@ -163,7 +163,7 @@ public class RepoProvider implements ContentProvider, PackageSource { repo.disconnect(); summary.markEnded(); report.setSummary(summary.toString()); - log.info("synchronizing with repo: " + reader + " finished\n" + summary); + log.info("synchronizing with repository: " + reader + " finished\n" + summary); } }
commit 740206d91112013b0c87a0d7c453b73f414db43a Merge: 2be8ee3... f9f46db... Author: Heiko W. Rupp hwr@redhat.com Date: Fri May 21 10:12:15 2010 +0200
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit f9f46db69bea5813d8ca98b1951a8176c4ec15c6 Author: Filip Drabek fdrabek@dhcp-lab-136.englab.brq.redhat.com Date: Thu May 20 20:59:22 2010 +0200
BZ 566235 - fixed the problem with timeouts on streaming.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java index 8601b51..d1e8dad 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java @@ -19,6 +19,7 @@ package org.rhq.enterprise.server.content;
import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -51,8 +52,6 @@ import javax.sql.DataSource;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.hibernate.lob.BlobImpl; -import org.hibernate.lob.SerializableBlob; import org.jboss.annotation.ejb.TransactionTimeout; import org.jboss.util.StringPropertyReplacer; import org.rhq.core.domain.auth.Subject; @@ -789,7 +788,7 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { throw new RuntimeException(t); } } - + @RequiredPermission(Permission.MANAGE_INVENTORY) @TransactionAttribute(TransactionAttributeType.REQUIRED) @TransactionTimeout(90 * 60) @@ -948,6 +947,184 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { return packageBits; }
+ private InputStream preloadPackageBits(PackageVersionContentSource pvcs) throws Exception{ + PackageVersionContentSourcePK pk = pvcs.getPackageVersionContentSourcePK(); + int contentSourceId = pk.getContentSource().getId(); + int packageVersionId = pk.getPackageVersion().getId(); + String packageVersionLocation = pvcs.getLocation(); + + ContentServerPluginContainer pc = ContentManagerHelper.getPluginContainer(); + InputStream bitsStream = pc.getAdapterManager().loadPackageBits(contentSourceId, packageVersionLocation); + + PackageVersion pv = entityManager.find(PackageVersion.class, packageVersionId); + + switch (pk.getContentSource().getDownloadMode()) { + case NEVER: { + return null; // no-op, our content source was told to never download package bits + } + + case DATABASE: { + log.debug("Downloading package bits to DB for package located at [" + packageVersionLocation + + "] on content source [" + contentSourceId + "]"); + File tempFile = File.createTempFile("JonContent", ""); + tempFile.deleteOnExit(); + OutputStream tempStream = new BufferedOutputStream(new FileOutputStream(tempFile)); + StreamUtil.copy(bitsStream, tempStream, true); + InputStream inp = new BufferedInputStream(new FileInputStream(tempFile)); + return inp; + } + + case FILESYSTEM: { + log.debug("Downloading package bits to filesystem for package located at [" + packageVersionLocation + + "] on content source [" + contentSourceId + "]"); + File outputFile = getPackageBitsLocalFileAndCreateParentDir(pv.getId(), pv.getFileName()); + log.info("OutPutFile is located at: " + outputFile); + boolean download = false; + + if (outputFile.exists()) { + // hmmm... it already exists, maybe we already have it? + // if the MD5's match, just ignore this download request and continue on + // If they are different we re-download + String expectedMD5 = (pv.getMD5() != null) ? pv.getMD5() : "<unspecified MD5>"; + String actualMD5 = MessageDigestGenerator.getDigestString(outputFile); + if (!expectedMD5.trim().toLowerCase().equals(actualMD5.toLowerCase())) { + log.error("Already have package bits for [" + pv + "] located at [" + outputFile + + "] but the MD5 hashcodes do not match. Expected MD5=[" + expectedMD5 + + "], Actual MD5=[" + actualMD5 + "] - redownloading package"); + download = true; + } else { + log.info("Asked to download package bits but we already have it at [" + outputFile + + "] with matching MD5 of [" + actualMD5 + "]"); + download = false; + } + } else { + download = true; + } + if (download) { + StreamUtil.copy(bitsStream, new FileOutputStream(outputFile), true); + bitsStream = null; + } + break; + } + + default: { + throw new IllegalStateException(" Unknown download mode - this is a bug, please report it: " + pvcs); + } + } + + return null; + } + + @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) + @TransactionTimeout(40 * 60) + private PackageBits preparePackageBits(Subject subject,InputStream bitsStream, PackageVersionContentSource pvcs) { + PackageVersionContentSourcePK pk = pvcs.getPackageVersionContentSourcePK(); + int contentSourceId = pk.getContentSource().getId(); + int packageVersionId = pk.getPackageVersion().getId(); + String packageVersionLocation = pvcs.getLocation(); + + PackageBits packageBits = null; + + try { + + Connection conn = null; + PreparedStatement ps = null; + PreparedStatement ps2 = null; + try { + packageBits = new PackageBits(); + + entityManager.persist(packageBits); + + PackageVersion pv = entityManager.find(PackageVersion.class, packageVersionId); + pv.setPackageBits(packageBits); + + entityManager.flush(); // push the new package bits row to the DB + + if (pk.getContentSource().getDownloadMode() == DownloadMode.DATABASE) { + packageBits = entityManager.find(PackageBits.class, packageBits.getId()); + //we need to save not null value so that we can in next step load the value as a Blob + // packageBits.setBits(new String("a").getBytes()); + packageBits.setBits(new String("a").getBytes()); + entityManager.merge(packageBits); + entityManager.flush(); + + conn = dataSource.getConnection(); + //we are loading the PackageBits saved in the previous step + //we need to lock the row which will be updated so we are using FOR UPDATE + ps = conn.prepareStatement("SELECT BITS FROM " + PackageBits.TABLE_NAME + " WHERE ID = ? FOR UPDATE"); + ps.setInt(1, packageBits.getId()); + ResultSet rs = ps.executeQuery(); + if (rs != null) { + while (rs.next()) { + + //We can not create a blob directly because BlobImpl from Hibernate is not acceptable + //for oracle and Connection.createBlob is not working on postgres. + //This blob will be not empty because we saved there a bytes from String("a"). + Blob blb = rs.getBlob(1); + + StreamUtil.copy(bitsStream, blb.setBinaryStream(1), false); + bitsStream.close(); + ps2 = conn.prepareStatement("UPDATE " + PackageBits.TABLE_NAME + " SET bits = ? where id = ?"); + ps2.setBlob(1, blb); + ps2.setInt(2, packageBits.getId()); + if (ps2.execute()) { + throw new Exception("Did not download the package bits to the DB for "); + } + ps2.close(); + } + } + ps.close(); + conn.close(); + + } else { + //CONTENT IS ALLREADY LOADED + } + } finally { + if (ps != null) { + try { + ps.close(); + } catch (Exception e) { + log.warn("Failed to close prepared statement for package bits [" + packageVersionLocation + + "] on content source [" + contentSourceId + "]"); + } + } + + if (ps2 != null) { + try { + ps2.close(); + } catch (Exception e) { + log.warn("Failed to close prepared statement for package bits [" + packageVersionLocation + + "] on content source [" + contentSourceId + "]"); + } + } + + if (conn != null) { + try { + conn.close(); + } catch (Exception e) { + log.warn("Failed to close connection for package bits [" + packageVersionLocation + + "] on content source [" + contentSourceId + "]"); + } + } + } + } catch (Throwable t) { + // put the cause in here using ThrowableUtil because it'll dump SQL nextException messages too + throw new RuntimeException("Did not download the package bits for [" + pvcs + "]. Cause: " + + ThrowableUtil.getAllMessages(t), t); + } finally { + if (bitsStream != null) { + try { + bitsStream.close(); + } catch (Exception e) { + log.warn("Failed to close stream to package bits located at [" + packageVersionLocation + + "] on content source [" + contentSourceId + "]"); + } + } + } + + return packageBits; + } + @TransactionAttribute(TransactionAttributeType.NEVER) public boolean internalSynchronizeContentSource(int contentSourceId) throws Exception { ContentServerPluginContainer pc = ContentManagerHelper.getPluginContainer(); @@ -1817,8 +1994,6 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { packageVersion.getId()); }
- @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) - @TransactionTimeout(90 * 60) public boolean downloadPackageBits(int resourceId, PackageDetailsKey packageDetailsKey){ Query query = entityManager.createNamedQuery(PackageVersion.QUERY_FIND_ID_BY_PACKAGE_DETAILS_KEY_AND_RES_ID); query.setParameter("packageName", packageDetailsKey.getName()); @@ -1887,8 +2062,9 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { // won't affect the time we are in in this method's tx (I hope that's how it works). // This is because this method itself may take a long time to send the data to the output stream // and we don't want out tx timing out due to the time it takes downloading. + InputStream stream = preloadPackageBits(pvcs); PackageBits bits = null; - bits = contentSourceManager.downloadPackageBits(subjectManager.getOverlord(), pvcs); + bits = preparePackageBits(subjectManager.getOverlord(),stream, pvcs); }catch(Exception e){ return false; }
commit 2be8ee3abce7d92aa5fc1f7f5801487c67175942 Merge: 29edb81... d5dca83... Author: Heiko W. Rupp hwr@redhat.com Date: Fri May 21 09:31:01 2010 +0200
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 6f37df32d02f63a02151bb50d7e1d9ef55ee67bf Author: John Mazzitelli mazz@redhat.com Date: Thu May 20 17:04:15 2010 -0400
update these to the new ant recipe syntax
diff --git a/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant1.zip b/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant1.zip index aa060d9..4d591cd 100644 Binary files a/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant1.zip and b/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant1.zip differ diff --git a/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant2.zip b/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant2.zip index 6f22cdb..f206b7e 100644 Binary files a/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant2.zip and b/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant2.zip differ
commit c5ce0fa915fc3e32952f4b532788a76f6976b168 Author: John Mazzitelli mazz@redhat.com Date: Thu May 20 16:38:39 2010 -0400
test boolean string using Boolean.valueOf to ensure a case-insentitive test
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java index 35d411e..f943c0d 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java @@ -140,7 +140,7 @@ public class BundleTask extends AbstractBundleTask { }
String dryRunString = (String) projectProps.get(DeployPropertyNames.DEPLOY_DRY_RUN); - boolean dryRun = (dryRunString != null) && dryRunString.equals(Boolean.TRUE.toString()); + boolean dryRun = Boolean.valueOf(dryRunString); getProject().setDryRun(dryRun);
log("Executing '" + deploymentPhase + "' phase for deployment '" + deploymentName + "' from bundle '" @@ -148,9 +148,9 @@ public class BundleTask extends AbstractBundleTask { switch (deploymentPhase) { case INSTALL: String revertString = (String) projectProps.get(DeployPropertyNames.DEPLOY_REVERT); - boolean revert = (revertString != null) && revertString.equals(Boolean.TRUE.toString()); + boolean revert = Boolean.valueOf(revertString); String cleanString = (String) projectProps.get(DeployPropertyNames.DEPLOY_CLEAN); - boolean clean = (cleanString != null) && cleanString.equals(Boolean.TRUE.toString()); + boolean clean = Boolean.valueOf(cleanString); deployment.install(revert, clean); break; case START:
commit 4d00c0196dcfb9d885700fb71c3bd65cc8a883a7 Merge: 0d03517... 5a43e74... Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 20 16:31:29 2010 -0400
Merge branch 'bundle' into bundle-jay
commit 0d03517542131acb11ca8a4230f0a1d3b5573822 Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 20 16:30:26 2010 -0400
cosmetic - remove obsolete code
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java index a0ecdf9..4b72dcf 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java @@ -859,20 +859,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot deployment.getBundleVersion().setBundle(bundle); deployment.getDestination().setBundle(bundle);
- // BundleVersion bundleVersion = entityManager - // .find(BundleVersion.class, deployment.getBundleVersion().getId()); - // Configuration config = entityManager.find(Configuration.class, deployment.getConfiguration().getId()); - // Bundle bundle = entityManager.find(Bundle.class, bundleVersion.getBundle().getId()); - // BundleType bundleType = entityManager.find(BundleType.class, bundle.getBundleType().getId()); - // ResourceType resourceType = entityManager.find(ResourceType.class, bundleType.getResourceType().getId()); - // bundleType.setResourceType(resourceType); - // bundle.setBundleType(bundleType); - // bundleVersion.setBundle(bundle); - - //deployment.setBundleVersion(bundleVersion); - //deployment.setConfiguration(config); resourceDeployment.setBundleDeployment(deployment); - //resourceDeployment.setResource(platform);
// now scrub the hibernate entity to make it a pojo suitable for sending to the client HibernateDetachUtility.nullOutUninitializedFields(resourceDeployment, SerializationType.SERIALIZATION);
commit 1a1ec35c45a6a26a60dcbeb10a6717396c9df091 Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 20 16:30:12 2010 -0400
Fix Exception catching and throwing issues for GWT service
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java index 43103a5..e48eb04 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java @@ -49,23 +49,21 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund private BundleManagerLocal bundleManager = LookupUtil.getBundleManager();
public BundleVersion createBundleVersionViaURL(String url) throws Exception { - BundleVersion results; try { - results = bundleManager.createBundleVersionViaURL(getSessionSubject(), url); + BundleVersion results = bundleManager.createBundleVersionViaURL(getSessionSubject(), url); + return SerialUtility.prepare(results, "createBundleVersionViaURL"); } catch (Exception e) { throw new RuntimeException(ThrowableUtil.getAllMessages(e)); } - return SerialUtility.prepare(results, "createBundleVersionViaURL"); }
public BundleVersion createBundleVersionViaRecipe(String recipe) throws Exception { - BundleVersion results; try { - results = bundleManager.createBundleVersionViaRecipe(getSessionSubject(), recipe); + BundleVersion results = bundleManager.createBundleVersionViaRecipe(getSessionSubject(), recipe); + return SerialUtility.prepare(results, "createBundleVersionViaRecipe"); } catch (Exception e) { throw new RuntimeException(ThrowableUtil.getAllMessages(e)); } - return SerialUtility.prepare(results, "createBundleVersionViaRecipe"); }
public BundleDeployment createBundleDeployment(int bundleVersionId, int bundleDestinationId, String name, @@ -75,7 +73,6 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund try { BundleDeployment result = bundleManager.createBundleDeployment(getSessionSubject(), bundleVersionId, bundleDestinationId, name, description, configuration); - return SerialUtility.prepare(result, "createBundleDeployment"); } catch (Exception e) { throw new Exception(ThrowableUtil.getAllMessages(e)); @@ -88,7 +85,6 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund try { BundleDestination result = bundleManager.createBundleDestination(getSessionSubject(), bundleId, name, description, deployDir, groupId); - return SerialUtility.prepare(result, "createBundleDestination"); } catch (Exception e) { throw new Exception(ThrowableUtil.getAllMessages(e)); @@ -96,13 +92,13 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund }
public BundleVersion createBundleVersion(int bundleId, String name, String version, String recipe) throws Exception { - BundleVersion results; try { - results = bundleManager.createBundleVersion(getSessionSubject(), bundleId, name, null, version, recipe); + BundleVersion results = bundleManager.createBundleVersion(getSessionSubject(), bundleId, name, null, + version, recipe); + return SerialUtility.prepare(results, "createBundleVersion"); } catch (Exception e) { throw new Exception(ThrowableUtil.getAllMessages(e)); } - return SerialUtility.prepare(results, "createBundleVersion"); }
public void deleteBundle(int bundleId) throws Exception { @@ -137,98 +133,114 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund } }
- public PageList<Bundle> findBundlesByCriteria(BundleCriteria criteria) throws Exception { + public ArrayList<BundleType> getAllBundleTypes() throws Exception { try { - PageList<Bundle> results = bundleManager.findBundlesByCriteria(getSessionSubject(), criteria); - return SerialUtility.prepare(results, "findBundlesByCriteria"); + ArrayList<BundleType> bundleTypes = new ArrayList<BundleType>(); + bundleTypes.addAll(bundleManager.getAllBundleTypes(getSessionSubject())); + return SerialUtility.prepare(bundleTypes, "getAllBundleTypes"); } catch (Exception e) { throw new RuntimeException(ThrowableUtil.getAllMessages(e)); } }
- public PageList<BundleVersion> findBundleVersionsByCriteria(BundleVersionCriteria criteria) throws Exception { + public HashMap<String, Boolean> getAllBundleVersionFilenames(int bundleVersionId) throws Exception { + HashMap<String, Boolean> results = new HashMap<String, Boolean>(); try { - PageList<BundleVersion> results = bundleManager.findBundleVersionsByCriteria(getSessionSubject(), criteria); - return SerialUtility.prepare(results, "findBundleVersionsByCriteria"); + results.putAll(bundleManager.getAllBundleVersionFilenames(getSessionSubject(), bundleVersionId)); } catch (Exception e) { throw new RuntimeException(ThrowableUtil.getAllMessages(e)); } + return SerialUtility.prepare(results, "getAllBundleVersionFilenames"); }
- public PageList<BundleWithLatestVersionComposite> findBundlesWithLatestVersionCompositesByCriteria( - BundleCriteria criteria) throws Exception { + public BundleDeployment scheduleBundleDeployment(int bundleDeploymentId, boolean isCleanDeployment) + throws Exception { try { - PageList<BundleWithLatestVersionComposite> results; - results = bundleManager.findBundlesWithLatestVersionCompositesByCriteria(getSessionSubject(), criteria); - return SerialUtility.prepare(results, "findBundlesWithLatestVersionCompositesByCriteria"); + BundleDeployment result = bundleManager.scheduleBundleDeployment(getSessionSubject(), bundleDeploymentId, + isCleanDeployment); + return SerialUtility.prepare(result, "scheduleBundleDeployment"); } catch (Exception e) { throw new RuntimeException(ThrowableUtil.getAllMessages(e)); } }
- public ArrayList<BundleType> getAllBundleTypes() throws Exception { + public BundleDeployment scheduleRevertBundleDeployment(int bundleDeploymentId, String deploymentName, + String deploymentDescription, boolean isCleanDeployment) throws Exception { try { - ArrayList<BundleType> bundleTypes = new ArrayList<BundleType>(); - bundleTypes.addAll(bundleManager.getAllBundleTypes(getSessionSubject())); - return SerialUtility.prepare(bundleTypes, "getBundleTypes"); + BundleDeployment result = bundleManager.scheduleRevertBundleDeployment(getSessionSubject(), + bundleDeploymentId, deploymentName, deploymentDescription, isCleanDeployment); + return SerialUtility.prepare(result, "scheduleRevertBundleDeployment"); } catch (Exception e) { throw new RuntimeException(ThrowableUtil.getAllMessages(e)); } }
- public HashMap<String, Boolean> getAllBundleVersionFilenames(int bundleVersionId) throws Exception { - HashMap<String, Boolean> results = new HashMap<String, Boolean>(); + public PageList<Bundle> findBundlesByCriteria(BundleCriteria criteria) throws Exception { try { - results.putAll(bundleManager.getAllBundleVersionFilenames(getSessionSubject(), bundleVersionId)); + PageList<Bundle> results = bundleManager.findBundlesByCriteria(getSessionSubject(), criteria); + return SerialUtility.prepare(results, "findBundlesByCriteria"); } catch (Exception e) { throw new RuntimeException(ThrowableUtil.getAllMessages(e)); } - return SerialUtility.prepare(results, "getAllBundleVersionFilenames"); }
- public BundleDeployment scheduleBundleDeployment(int bundleDeploymentId, boolean isCleanDeployment) - throws Exception { + public PageList<BundleDeployment> findBundleDeploymentsByCriteria(BundleDeploymentCriteria criteria) { try { - BundleDeployment result = bundleManager.scheduleBundleDeployment(getSessionSubject(), bundleDeploymentId, - isCleanDeployment); - return SerialUtility.prepare(result, "scheduleBundleDeployment"); + PageList<BundleDeployment> result = bundleManager.findBundleDeploymentsByCriteria(getSessionSubject(), + criteria); + return SerialUtility.prepare(result, "BundleService.findBundleDeploymentsByCriteria"); } catch (Exception e) { throw new RuntimeException(ThrowableUtil.getAllMessages(e)); } }
- public BundleDeployment scheduleRevertBundleDeployment(int bundleDeploymentId, String deploymentName, - String deploymentDescription, boolean isCleanDeployment) throws Exception { + public PageList<BundleDestination> findBundleDestinationsByCriteria(BundleDestinationCriteria criteria) { try { - BundleDeployment result = bundleManager.scheduleRevertBundleDeployment(getSessionSubject(), - bundleDeploymentId, deploymentName, deploymentDescription, isCleanDeployment); - return SerialUtility.prepare(result, "scheduleBundleDeployment"); + PageList<BundleDestination> result = bundleManager.findBundleDestinationsByCriteria(getSessionSubject(), + criteria); + return SerialUtility.prepare(result, "BundleService.findBundleDestinationsByCriteria"); } catch (Exception e) { throw new RuntimeException(ThrowableUtil.getAllMessages(e)); } }
- public PageList<BundleDeployment> findBundleDeploymentsByCriteria(BundleDeploymentCriteria criteria) { - return SerialUtility.prepare(bundleManager.findBundleDeploymentsByCriteria(getSessionSubject(), criteria), - "BundleService.findBundleDeploymentsByCriteria"); + public PageList<BundleFile> findBundleFilesByCriteria(BundleFileCriteria criteria) { + try { + PageList<BundleFile> result = bundleManager.findBundleFilesByCriteria(getSessionSubject(), criteria); + return SerialUtility.prepare(result, "BundleService.findBundleFilesByCriteria"); + } catch (Exception e) { + throw new RuntimeException(ThrowableUtil.getAllMessages(e)); + } }
public PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria( BundleResourceDeploymentCriteria criteria) { - return SerialUtility.prepare(bundleManager.findBundleResourceDeploymentsByCriteria(getSessionSubject(), - criteria), "BundleService.findBundleResourceDeploymentsByCriteria"); - + try { + PageList<BundleResourceDeployment> result = bundleManager.findBundleResourceDeploymentsByCriteria( + getSessionSubject(), criteria); + return SerialUtility.prepare(result, "BundleService.findBundleResourceDeploymentsByCriteria"); + } catch (Exception e) { + throw new RuntimeException(ThrowableUtil.getAllMessages(e)); + } }
- public PageList<BundleDestination> findBundleDestinationsByCriteria(BundleDestinationCriteria criteria) { - return SerialUtility.prepare(bundleManager.findBundleDestinationsByCriteria(getSessionSubject(), criteria), - "BundleService.findBundleDestinationsByCriteria"); - + public PageList<BundleVersion> findBundleVersionsByCriteria(BundleVersionCriteria criteria) throws Exception { + try { + PageList<BundleVersion> results = bundleManager.findBundleVersionsByCriteria(getSessionSubject(), criteria); + return SerialUtility.prepare(results, "findBundleVersionsByCriteria"); + } catch (Exception e) { + throw new RuntimeException(ThrowableUtil.getAllMessages(e)); + } }
- public PageList<BundleFile> findBundleFilesByCriteria(BundleFileCriteria criteria) { - return SerialUtility.prepare(bundleManager.findBundleFilesByCriteria(getSessionSubject(), criteria), - "BundleService.findBundleFilesByCriteria"); + public PageList<BundleWithLatestVersionComposite> findBundlesWithLatestVersionCompositesByCriteria( + BundleCriteria criteria) throws Exception { + try { + PageList<BundleWithLatestVersionComposite> results; + results = bundleManager.findBundlesWithLatestVersionCompositesByCriteria(getSessionSubject(), criteria); + return SerialUtility.prepare(results, "findBundlesWithLatestVersionCompositesByCriteria"); + } catch (Exception e) { + throw new RuntimeException(ThrowableUtil.getAllMessages(e)); + } } - } \ No newline at end of file
commit 4bd74850bab101f6e2359a6a4c92d88f85b4ee69 Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 20 16:29:30 2010 -0400
make it explicit that the ResourceSelector deals with Resource objects
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 9be9f03..015b377 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 @@ -28,17 +28,14 @@ import com.smartgwt.client.widgets.form.fields.TextItem; import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.resource.Resource; -import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDatasource; import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypePluginTreeDataSource; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeTreeDataSource; import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
/** * @author Greg Hinkle */ -public class ResourceSelector extends AbstractSelector { - +public class ResourceSelector extends AbstractSelector<Resource> {
private Integer requireTypeId;
@@ -55,7 +52,6 @@ public class ResourceSelector extends AbstractSelector { markForRedraw(); }
- protected DynamicForm getAvailableFilterForm() { DynamicForm availableFilterForm = new DynamicForm(); availableFilterForm.setNumCols(6); @@ -84,7 +80,7 @@ public class ResourceSelector extends AbstractSelector { return availableFilterForm; }
- protected RPCDataSource<?> getDataSource() { + protected RPCDataSource<Resource> getDataSource() { return new SelectedResourceDataSource(); }
commit 9fa3937a521e052d6455ce06aa9d7e535ff45934 Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 20 16:28:54 2010 -0400
Fix an issue with status and message reporting from the async deploy
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java index f5f3442..8f4af89 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java @@ -180,8 +180,11 @@ public class BundleManager extends AgentService implements BundleAgentService, B int facetMethodTimeout = 4 * 60 * 60 * 1000; // 4 hours is given to the bundle plugin to do its thing BundleFacet bundlePluginComponent = getBundleFacet(bundleHandlerResourceId, facetMethodTimeout); BundleDeployResult result = bundlePluginComponent.deployBundle(deployRequest); - if (!result.isSuccess()) { - response.setErrorMessage(result.getErrorMessage()); + if (result.isSuccess()) { + completeDeployment(resourceDeployment, BundleDeploymentStatus.SUCCESS, deploymentMessage); + } else { + completeDeployment(resourceDeployment, BundleDeploymentStatus.FAILURE, result + .getErrorMessage()); } completeDeployment(resourceDeployment, BundleDeploymentStatus.SUCCESS, deploymentMessage); } catch (InterruptedException ie) {
commit 5a43e7411b5490fee90e7218d31962a852d9a374 Author: John Mazzitelli mazz@redhat.com Date: Thu May 20 16:23:57 2010 -0400
send an audit message when file template plugin is cleaning a deployment
diff --git a/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java b/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java index cd8e940..0b96612 100644 --- a/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java +++ b/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java @@ -86,6 +86,9 @@ public class FileTemplateBundlePluginServerComponent implements ResourceComponen if (request.isCleanDeployment()) { File deployDir = new File(bundleDeployment.getDestination().getDeployDir()); if (deployDir.exists()) { + bundleManagerProvider.auditDeployment(resourceDeployment, "Cleaning Deployment", deployDir + .getAbsolutePath(), null, null, "The existing deployment found at [" + + deployDir.getAbsolutePath() + "] will be removed.", null); FileUtils.purge(deployDir, true); } }
commit 07ae94ea111ab0175d753dc7504d61a9e4a3f235 Author: Ian P. Springer <ips@jetengine.(none)> Date: Thu May 20 16:21:09 2010 -0400
add some TODOs
diff --git a/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java b/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java index ab444d8..b421ad1 100644 --- a/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java +++ b/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java @@ -39,6 +39,7 @@ import org.rhq.bundle.ant.DeployPropertyNames; import org.rhq.bundle.ant.LoggerAntBuildListener; import org.rhq.core.domain.bundle.BundleDeployment; import org.rhq.core.domain.bundle.BundleResourceDeployment; +import org.rhq.core.domain.bundle.BundleResourceDeploymentHistory; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.Property; @@ -108,7 +109,9 @@ public class AntBundlePluginComponent implements ResourceComponent, BundleFacet // add them as Ant properties so the Ant script can get their values. Properties antProps = createAntProperties(request); // TODO: Eventually the phase to be executed should be passed in by the PC when it calls us. + // TODO: Invoke STOP phase. antProps.setProperty(DeployPropertyNames.DEPLOY_PHASE, "INSTALL"); + // TODO: Invoke START phase.
List<BuildListener> buildListeners = new ArrayList(); LoggerAntBuildListener logger = new LoggerAntBuildListener(null, logFileOutput, Project.MSG_DEBUG); @@ -125,8 +128,8 @@ public class AntBundlePluginComponent implements ResourceComponent, BundleFacet // Send the diffs to the Server so it can store them as an entry in the deployment history. BundleManagerProvider bundleManagerProvider = request.getBundleManagerProvider(); DeployDifferences diffs = project.getDeployDifferences(); - bundleManagerProvider.auditDeployment(resourceDeployment, "Deployment Differences", bundleDeployment - .getName(), null, null, diffs.toString(), null); + bundleManagerProvider.auditDeployment(resourceDeployment, "Deployment Differences", null, + BundleResourceDeploymentHistory.Category.DEPLOY_STEP, null, diffs.toString(), null); } catch (Throwable t) { if (log.isDebugEnabled()) { try {
commit f5171aa18458fae39ed3b8a0a4e8ca6da988fdf9 Merge: 46023ae... 615681e... Author: Ian P. Springer <ips@jetengine.(none)> Date: Thu May 20 16:14:39 2010 -0400
Merge branch 'bundle' of ssh://git.fedorahosted.org/git/rhq/rhq into bundle
commit 615681e1b452369ae4660666f297a235e203d4e5 Author: John Mazzitelli mazz@redhat.com Date: Thu May 20 15:52:50 2010 -0400
add rhq.deploy.name as a out-of-box built-in property name for file template recipes (the ant recipes have this, too , just trying to keep up with the jones')
diff --git a/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java b/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java index 3342ef3..cd8e940 100644 --- a/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java +++ b/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java @@ -48,6 +48,9 @@ public class FileTemplateBundlePluginServerComponent implements ResourceComponen /** property that should always be available to scripts - it's the ID of the bundle deployment */ private static final String DEPLOY_ID = "rhq.deploy.id";
+ /** property that should always be available to scripts - it's the name of the bundle deployment */ + public static final String DEPLOY_NAME = "rhq.deploy.name"; + private final Log log = LogFactory.getLog(FileTemplateBundlePluginServerComponent.class);
private ResourceContext resourceContext; @@ -100,6 +103,7 @@ public class FileTemplateBundlePluginServerComponent implements ResourceComponen recipeContext.setReplacementVariableValues(bundleDeployment.getConfiguration()); recipeContext.addReplacementVariableValue(DEPLOY_DIR, bundleDeployment.getDestination().getDeployDir()); recipeContext.addReplacementVariableValue(DEPLOY_ID, Integer.toString(bundleDeployment.getId())); + recipeContext.addReplacementVariableValue(DEPLOY_NAME, bundleDeployment.getName());
parser.setReplaceReplacementVariables(true);
commit d5dca8319beb0f93ed1bf1679b6c05dc33dad01c Author: Filip Drabek fdrabek@dhcp-lab-136.englab.brq.redhat.com Date: Fri May 14 11:57:46 2010 +0200
BZ 555098 - new metrics for AS-4 ConnectionFactory.
diff --git a/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml index 5902c06..b49112f 100644 --- a/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml @@ -558,7 +558,37 @@ <c:simple-property name="descriptionTemplate" default="A JCA Connection Factory"/> <c:simple-property name="name" type="string" description="The name of this Connection Factory"/> </plugin-configuration> + + <metric property="AvailableConnectionCount" measurementType="dynamic" displayType="summary" + displayName="Available Connection Count" description="Number of available connections." + defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"/> + + <metric property="ConnectionCount" measurementType="dynamic" displayType="summary" + displayName="Connection Count" defaultOn="true" defaultInterval="60000" dataType="measurement" + category="performance"/> + + <metric property="ConnectionCreatedCount" measurementType="dynamic" displayType="detail" + displayName="Connection Created Count" defaultOn="true" defaultInterval="60000" + dataType="measurement" category="performance"/> + + <metric property="ConnectionDestroyedCount" measurementType="dynamic" displayType="detail" + displayName="Connection Destroyed Count" defaultOn="true" defaultInterval="60000" + dataType="measurement" category="performance"/> + + <metric property="InUseConnectionCount" measurementType="dynamic" displayType="detail" + displayName="In Use Connection Count" description="Mumber of connections currently in use." + defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"/>
+ <metric property="MaxConnectionsInUseCount" measurementType="dynamic" displayType="detail" + displayName="Max Connections In Use Count" description="Maximum number of maximum connections that have been in use." + defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"/> + + <metric property="MaxSize" measurementType="dynamic" displayType="detail" displayName="Max Size" + defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"/> + + <metric property="MinSize" measurementType="dynamic" displayType="detail" displayName="Min Size" + defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"/> + <resource-configuration>
<c:group name="connection" displayName="Connection Information"> @@ -883,7 +913,7 @@
</c:group> </resource-configuration> - + </service>
<service name="JBossMQ"
commit c7b4c35dfbd7158b4ec4bd3c795cd311acf6a987 Author: Filip Drabek fdrabek@dhcp-lab-136.englab.brq.redhat.com Date: Tue May 18 17:10:58 2010 +0200
BZ 576617 - [apache] ServerName is now readOnly.
diff --git a/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml index 94ee5d3..8aa4489 100644 --- a/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml @@ -125,7 +125,7 @@ '>
<!ENTITY ServerName ' - <c:simple-property name="ServerName" required="false"> + <c:simple-property name="ServerName" required="false" readOnly="true"> <c:description> Sets the request scheme, hostname and port that the server uses to identify itself. This is used when creating redirection URLs. If no ServerName is specified, then the server attempts to deduce the hostname by performing a reverse lookup on the IP address. If no port is specified in the ServerName, then the server will use the port from the incoming request. For optimal reliability and predictability, you should specify an explicit hostname and port using the ServerName directive.
commit 0c0efcd6f72b5798f7db7de655602e234b120144 Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 20 14:28:05 2010 -0400
More status display in the bundle screens error detail popups content and repo exposure
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml index 4faf4ff..6c6433c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml @@ -60,5 +60,7 @@ <servlet path="/AvailabilityGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.AvailabilityGWTServiceImpl"/> <servlet path="/TagGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.TagGWTServiceImpl"/> <servlet path="/RemoteInstallGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.RemoteInstallGWTServiceImpl"/> + <servlet path="/RepoGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.RepoGWTServiceImpl"/> + <servlet path="/ContentGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.ContentGWTServiceImpl"/>
</module> \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java index 77b1701..84a2a1f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java @@ -32,6 +32,8 @@ import org.rhq.enterprise.gui.coregui.client.ViewPath; import org.rhq.enterprise.gui.coregui.client.bundle.list.BundleView; import org.rhq.enterprise.gui.coregui.client.bundle.list.BundlesListView; import org.rhq.enterprise.gui.coregui.client.bundle.tree.BundleTreeView; +import org.rhq.enterprise.gui.coregui.client.content.repository.tree.ContentRepositoryTreeDataSource; +import org.rhq.enterprise.gui.coregui.client.content.repository.tree.ContentRepositoryTreeView;
/** * @author Greg Hinkle @@ -65,6 +67,8 @@ public class BundleTopView extends HLayout implements BookmarkableView { sectionStack.addSection(bundlesSection);
SectionStackSection repositoriesSection = new SectionStackSection("Repositories"); + ContentRepositoryTreeView repoTree = new ContentRepositoryTreeView(); + repositoriesSection.addItem(repoTree); sectionStack.addSection(repositoriesSection);
SectionStackSection providersSection = new SectionStackSection("Providers"); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentListView.java index 8438cec..3906118 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentListView.java @@ -22,13 +22,17 @@ */ package org.rhq.enterprise.gui.coregui.client.bundle.deployment;
+import java.util.HashMap; + import com.smartgwt.client.data.Criteria; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.grid.CellFormatter; +import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.bundle.Bundle; +import org.rhq.core.domain.bundle.BundleDeploymentStatus; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.enterprise.gui.coregui.client.components.table.Table;
@@ -80,6 +84,9 @@ public class BundleDeploymentListView extends VLayout { } });
+ + + addMember(table);
} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java index 4b9a853..60e0aab 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java @@ -43,6 +43,7 @@ import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; +import org.rhq.core.domain.bundle.BundleDeploymentStatus; import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.criteria.BundleCriteria; @@ -75,18 +76,23 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView {
private VLayout detail;
+ public BundleDeploymentView() { + setWidth100(); + setHeight100(); + setMargin(10); + } + private void viewBundleDeployment(BundleDeployment bundleDeployment, ViewId current) {
this.deployment = bundleDeployment; this.version = bundleDeployment.getBundleVersion(); this.bundle = bundleDeployment.getBundleVersion().getBundle();
- addMember(new BackButton("Back to Destination: " + deployment.getDestination().getName(),"Bundles/" + version.getBundle().getId() + "/destinations/" + deployment.getDestination().getId())); - + addMember(new BackButton("Back to Destination: " + deployment.getDestination().getName(), "Bundles/" + version.getBundle().getId() + "/destinations/" + deployment.getDestination().getId()));
addMember(new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/BundleDeployment_24.png") - + ""/> " + deployment.getName())); + + ""/> " + deployment.getName()));
DynamicForm form = new DynamicForm(); form.setNumCols(4); @@ -101,16 +107,16 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { TagEditorView tagEditor = new TagEditorView(version.getTags(), false, new TagsChangedCallback() { public void tagsChanged(HashSet<Tag> tags) { GWTServiceLookup.getTagService().updateBundleDeploymentTags(deployment.getId(), tags, - new AsyncCallback<Void>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to update bundle deployment's tags", caught); - } - - public void onSuccess(Void result) { - CoreGUI.getMessageCenter().notify( - new Message("Bundle Deployment Tags updated", Message.Severity.Info)); - } - }); + new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to update bundle deployment's tags", caught); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify( + new Message("Bundle Deployment Tags updated", Message.Severity.Info)); + } + }); } }); tagItem.setCanvas(tagEditor); @@ -147,10 +153,10 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { Table table = new Table("Deployment Machines");
- ListGridField resourceIcon = new ListGridField("resourceAvailabity"); - HashMap<String,String> icons = new HashMap<String, String>(); - icons.put("UP","types/Platform_up_16.png"); - icons.put("DOWN","types/Platform_down_16.png"); + ListGridField resourceIcon = new ListGridField("resourceAvailabity", ""); + HashMap<String, String> icons = new HashMap<String, String>(); + icons.put("UP", "types/Platform_up_16.png"); + icons.put("DOWN", "types/Platform_down_16.png"); resourceIcon.setValueIcons(icons); resourceIcon.setValueIconSize(16); resourceIcon.setCellFormatter(new CellFormatter() { @@ -169,6 +175,16 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { }); ListGridField resourceVersion = new ListGridField("resourceVersion", "Operating System"); ListGridField status = new ListGridField("status", "Status"); + HashMap<String, String> statusIcons = new HashMap<String, String>(); + statusIcons.put(BundleDeploymentStatus.IN_PROGRESS.name(), "subsystems/bundle/install-loader.gif"); + statusIcons.put(BundleDeploymentStatus.FAILURE.name(), "subsystems/bundle/Warning_11.png"); + statusIcons.put(BundleDeploymentStatus.MIXED.name(), "subsystems/bundle/Warning_11.png"); + statusIcons.put(BundleDeploymentStatus.WARN.name(), "subsystems/bundle/Warning_11.png"); + statusIcons.put(BundleDeploymentStatus.SUCCESS.name(), "subsystems/bundle/Ok_11.png"); + status.setValueIcons(statusIcons); + status.setValueIconHeight(11); + status.setWidth(80); +
table.getListGrid().setFields(resourceIcon, resource, resourceVersion, status);
@@ -194,9 +210,9 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { if (selectionEvent.getState()) {
BundleResourceDeployment bundleResourceDeployment = (BundleResourceDeployment) selectionEvent - .getRecord().getAttributeAsObject("entity"); + .getRecord().getAttributeAsObject("entity"); BundleResourceDeploymentHistoryListView detailView = new BundleResourceDeploymentHistoryListView( - bundleResourceDeployment); + bundleResourceDeployment);
detail.removeMembers(detail.getMembers()); detail.addMember(detailView); @@ -267,20 +283,20 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { criteria.fetchResource(true); criteria.fetchBundleDeployment(true); bundleService.findBundleResourceDeploymentsByCriteria(criteria, - new AsyncCallback<PageList<BundleResourceDeployment>>() { + new AsyncCallback<PageList<BundleResourceDeployment>>() {
- public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load deployment detail", caught); - } + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load deployment detail", caught); + }
- public void onSuccess(PageList<BundleResourceDeployment> result) { + public void onSuccess(PageList<BundleResourceDeployment> result) {
- deployment.setResourceDeployments(result); + deployment.setResourceDeployments(result);
- viewBundleDeployment(deployment, viewPath.getCurrent()); + viewBundleDeployment(deployment, viewPath.getCurrent());
- } - }); + } + });
} }); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java index c5e7952..ed474b1 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java @@ -23,13 +23,26 @@ package org.rhq.enterprise.gui.coregui.client.bundle.deployment;
import java.util.ArrayList; +import java.util.HashMap;
import com.smartgwt.client.types.ExpansionMode; +import com.smartgwt.client.types.TitleOrientation; +import com.smartgwt.client.widgets.Window; +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.AutoFitTextAreaItem; +import com.smartgwt.client.widgets.form.fields.ButtonItem; +import com.smartgwt.client.widgets.form.fields.StaticTextItem; +import com.smartgwt.client.widgets.form.fields.events.ClickEvent; +import com.smartgwt.client.widgets.form.fields.events.ClickHandler; +import com.smartgwt.client.widgets.grid.CellFormatter; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; +import com.smartgwt.client.widgets.grid.events.RecordClickEvent; +import com.smartgwt.client.widgets.grid.events.RecordClickHandler; import com.smartgwt.client.widgets.layout.VLayout;
+import org.rhq.core.domain.bundle.BundleDeploymentStatus; import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleResourceDeploymentHistory;
@@ -59,19 +72,83 @@ public class BundleResourceDeploymentHistoryListView extends VLayout { ListGridField message = new ListGridField("info", "Info"); ListGridField status = new ListGridField("status", "status");
+ HashMap<String, String> icons = new HashMap<String, String>(); + icons.put(BundleDeploymentStatus.IN_PROGRESS.name(), "subsystems/bundle/install-loader.gif"); + icons.put(BundleDeploymentStatus.FAILURE.name(), "subsystems/bundle/Warning_11.png"); + icons.put(BundleDeploymentStatus.MIXED.name(), "subsystems/bundle/Warning_11.png"); + icons.put(BundleDeploymentStatus.WARN.name(), "subsystems/bundle/Warning_11.png"); + icons.put(BundleDeploymentStatus.SUCCESS.name(), "subsystems/bundle/Ok_11.png"); + status.setValueIcons(icons); + status.setValueIconHeight(11); + status.setWidth(80); + grid.setCanExpandRecords(true); grid.setExpansionMode(ExpansionMode.DETAIL_FIELD); grid.setDetailField("message");
- grid.setFields(action, message, status); + ListGridField details = new ListGridField("attachment", "Details"); + details.setWidth(50); + details.setCellFormatter(new CellFormatter() { + public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { + return "<img src="images/subsystems/bundle/Details_11.png"/>"; + } + }); + details.addRecordClickHandler(new RecordClickHandler() { + public void onRecordClick(RecordClickEvent recordClickEvent) { + showDetails((ListGridRecord) recordClickEvent.getRecord()); + } + });
+ grid.setFields(action, message, status, details); grid.setData(buildRecords()); - addMember(grid);
}
+ + private void showDetails(ListGridRecord record) { + + DynamicForm form = new DynamicForm(); + + StaticTextItem action = new StaticTextItem("action", "Action"); + StaticTextItem info = new StaticTextItem("info", "Info"); + StaticTextItem category = new StaticTextItem("category", "Category"); + StaticTextItem message = new StaticTextItem("message", "Message"); + + + AutoFitTextAreaItem detail = new AutoFitTextAreaItem("attachement", "Detail"); + detail.setTitleOrientation(TitleOrientation.TOP); + detail.setColSpan(2); + + + ButtonItem close = new ButtonItem("close", "Close"); + + + form.setItems(action, info, category, message, detail, close); + + form.editRecord(record); + + + final Window window = new Window(); + window.setTitle("Install Details"); + window.setWidth(800); + window.setHeight(600); + window.setIsModal(true); + window.setShowModalMask(true); + window.setCanDragResize(true); + window.centerInPage(); + window.addItem(form); + window.show(); + + close.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + window.destroy(); + } + }); + } + + public ListGridRecord[] buildRecords() { ArrayList<ListGridRecord> records = new ArrayList<ListGridRecord>();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationDataSource.java index 234d242..4787e40 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationDataSource.java @@ -31,8 +31,12 @@ import com.smartgwt.client.data.fields.DataSourceIntegerField; import com.smartgwt.client.data.fields.DataSourceTextField; import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.core.domain.bundle.BundleDeployment; import org.rhq.core.domain.bundle.BundleDestination; +import org.rhq.core.domain.bundle.BundleVersion; +import org.rhq.core.domain.criteria.BundleDeploymentCriteria; import org.rhq.core.domain.criteria.BundleDestinationCriteria; +import org.rhq.core.domain.criteria.BundleVersionCriteria; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; @@ -64,8 +68,18 @@ public class BundleDestinationDataSource extends RPCDataSource<BundleDestination DataSourceTextField deployDir = new DataSourceTextField("deployDir", "Deploy Directory"); addField(deployDir);
+ DataSourceTextField latestDeploymentVersion = new DataSourceTextField("latestDeploymentVersion", "Last Deployed Version"); + addField(latestDeploymentVersion); + + DataSourceTextField latestDeploymentDate = new DataSourceTextField("latestDeploymentDate", "Last Deployment Date"); + addField(latestDeploymentDate); + + DataSourceTextField latestDeploymentStatus = new DataSourceTextField("latestDeploymentStatus", "Last Deployment Status"); + addField(latestDeploymentStatus); + }
+ @Override protected void executeFetch(final DSRequest request, final DSResponse response) { BundleDestinationCriteria criteria = new BundleDestinationCriteria(); @@ -79,22 +93,50 @@ public class BundleDestinationDataSource extends RPCDataSource<BundleDestination criteria.fetchGroup(true); criteria.fetchTags(true);
+ GWTServiceLookup.getBundleService().findBundleDestinationsByCriteria(criteria, new AsyncCallback<PageList<BundleDestination>>() { public void onFailure(Throwable caught) { CoreGUI.getErrorHandler().handleError("Failed to load bundle destinations",caught); }
- public void onSuccess(PageList<BundleDestination> result) { - response.setData(buildRecords(result)); - processResponse(request.getRequestId(), response); + public void onSuccess(final PageList<BundleDestination> result) { + + BundleVersionCriteria versionCriteria = new BundleVersionCriteria(); + if (request.getCriteria().getValues().containsKey("bundleId")) { + versionCriteria.addFilterBundleId(Integer.parseInt(request.getCriteria().getAttributeAsString("bundleId"))); + } + GWTServiceLookup.getBundleService().findBundleVersionsByCriteria(versionCriteria, new AsyncCallback<PageList<BundleVersion>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load bundle destination deployed version info",caught); + } + + public void onSuccess(PageList<BundleVersion> versions) { + + for (BundleDestination dest : result) { + + for (BundleDeployment dep : dest.getDeployments()) { + + for (BundleVersion version : versions) { + if (dep.getBundleVersion().getId() == version.getId()) { + dep.setBundleVersion(version); + } + } + } + } + + response.setData(buildRecords(result)); + processResponse(request.getRequestId(), response); + + } + }); } }); }
@Override public BundleDestination copyValues(ListGridRecord from) { - return null; // TODO: Implement this method. + return null; }
@Override @@ -114,6 +156,20 @@ public class BundleDestinationDataSource extends RPCDataSource<BundleDestination record.setAttribute("entity", from);
+ long last = 0; + for (BundleDeployment dep : from.getDeployments()) { + if (last < dep.getCtime()) { + last = dep.getCtime(); + + record.setAttribute("latestDeployment", dep); + record.setAttribute("latestDeploymentVersion", dep.getBundleVersion().getVersion()); + record.setAttribute("latestDeploymentDate", new Date(dep.getCtime())); + record.setAttribute("latestDeploymentStatus", dep.getStatus().name()); + + } + } + + return record; } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationListView.java index f850938..cffb484 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationListView.java @@ -22,11 +22,15 @@ */ package org.rhq.enterprise.gui.coregui.client.bundle.destination;
+import java.util.HashMap; + import com.smartgwt.client.data.Criteria; import com.smartgwt.client.widgets.grid.CellFormatter; +import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; import com.smartgwt.client.widgets.layout.VLayout;
+import org.rhq.core.domain.bundle.BundleDeploymentStatus; import org.rhq.enterprise.gui.coregui.client.components.table.Table;
/** @@ -61,7 +65,7 @@ public class BundleDestinationListView extends VLayout {
table.setDataSource(new BundleDestinationDataSource());
- table.getListGrid().getField("id").setWidth(25); + table.getListGrid().getField("id").setWidth(45); table.getListGrid().getField("name").setWidth("20%"); table.getListGrid().getField("name").setCellFormatter(new CellFormatter() { public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { @@ -70,11 +74,23 @@ public class BundleDestinationListView extends VLayout { });
- table.getListGrid().getField("description").setWidth("25%"); + table.getListGrid().getField("description").setWidth("15%"); //table.getListGrid().getField("bundleName").setWidth("20%"); table.getListGrid().hideField("bundleName"); - table.getListGrid().getField("groupName").setWidth("20%"); - table.getListGrid().getField("deployDir").setWidth("20%"); + table.getListGrid().getField("groupName").setWidth("15%"); + table.getListGrid().getField("deployDir").setWidth("15%"); + + ListGridField status = table.getListGrid().getField("latestDeploymentStatus"); + HashMap<String, String> statusIcons = new HashMap<String, String>(); + statusIcons.put(BundleDeploymentStatus.IN_PROGRESS.name(), "subsystems/bundle/install-loader.gif"); + statusIcons.put(BundleDeploymentStatus.FAILURE.name(), "subsystems/bundle/Warning_11.png"); + statusIcons.put(BundleDeploymentStatus.MIXED.name(), "subsystems/bundle/Warning_11.png"); + statusIcons.put(BundleDeploymentStatus.WARN.name(), "subsystems/bundle/Warning_11.png"); + statusIcons.put(BundleDeploymentStatus.SUCCESS.name(), "subsystems/bundle/Ok_11.png"); + status.setValueIcons(statusIcons); + status.setValueIconHeight(11); + status.setWidth(80); +
addMember(table); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java index 199d1b9..48d9b47 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java @@ -24,6 +24,7 @@ package org.rhq.enterprise.gui.coregui.client.bundle.destination;
import java.util.ArrayList; import java.util.Date; +import java.util.HashMap; import java.util.HashSet;
import com.google.gwt.user.client.rpc.AsyncCallback; @@ -42,6 +43,7 @@ import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; +import org.rhq.core.domain.bundle.BundleDeploymentStatus; import org.rhq.core.domain.bundle.BundleDestination; import org.rhq.core.domain.criteria.BundleDestinationCriteria; import org.rhq.core.domain.tagging.Tag; @@ -71,13 +73,20 @@ public class BundleDestinationView extends VLayout implements BookmarkableView {
private Canvas detail;
+ + public BundleDestinationView() { + setWidth100(); + setHeight100(); + setMargin(10); + } + private void viewBundleDestination(BundleDestination bundleDestination, ViewId current) {
this.destination = bundleDestination; this.bundle = bundleDestination.getBundle();
addMember(new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/BundleDestination_24.png") - + ""/> " + destination.getName())); + + ""/> " + destination.getName()));
DynamicForm form = new DynamicForm(); form.setNumCols(4); @@ -92,16 +101,16 @@ public class BundleDestinationView extends VLayout implements BookmarkableView { TagEditorView tagEditor = new TagEditorView(destination.getTags(), false, new TagsChangedCallback() { public void tagsChanged(HashSet<Tag> tags) { GWTServiceLookup.getTagService().updateBundleDestinationTags(destination.getId(), tags, - new AsyncCallback<Void>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to update bundle destination's tags", caught); - } - - public void onSuccess(Void result) { - CoreGUI.getMessageCenter().notify( - new Message("Bundle Destination Tags updated", Message.Severity.Info)); - } - }); + new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to update bundle destination's tags", caught); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify( + new Message("Bundle Destination Tags updated", Message.Severity.Info)); + } + }); } }); tagItem.setCanvas(tagEditor); @@ -156,7 +165,7 @@ public class BundleDestinationView extends VLayout implements BookmarkableView { name.setCellFormatter(new CellFormatter() { public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { return "<a href="#Bundles/Bundle/" + bundle.getId() + "/deployments/" - + listGridRecord.getAttribute("id") + "">" + o + "</a>"; + + listGridRecord.getAttribute("id") + "">" + o + "</a>"; } });
@@ -164,6 +173,16 @@ public class BundleDestinationView extends VLayout implements BookmarkableView { ListGridField description = new ListGridField("description", "Description"); ListGridField installDate = new ListGridField("installDate", "Install Date"); ListGridField status = new ListGridField("status", "Status"); + HashMap<String, String> statusIcons = new HashMap<String, String>(); + statusIcons.put(BundleDeploymentStatus.IN_PROGRESS.name(), "subsystems/bundle/install-loader.gif"); + statusIcons.put(BundleDeploymentStatus.FAILURE.name(), "subsystems/bundle/Warning_11.png"); + statusIcons.put(BundleDeploymentStatus.MIXED.name(), "subsystems/bundle/Warning_11.png"); + statusIcons.put(BundleDeploymentStatus.WARN.name(), "subsystems/bundle/Warning_11.png"); + statusIcons.put(BundleDeploymentStatus.SUCCESS.name(), "subsystems/bundle/Ok_11.png"); + status.setValueIcons(statusIcons); + status.setValueIconHeight(11); + status.setWidth(80); +
table.getListGrid().setFields(name, version, description, installDate, status);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java index 2dc985c..091ea7a 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java @@ -67,7 +67,7 @@ public class BundleView extends VLayout implements BookmarkableView { super(); setWidth100(); setHeight100(); -// setPadding(10); + setPadding(10); setOverflow(Overflow.AUTO); }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/content/repository/tree/ContentRepositoryTreeDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/content/repository/tree/ContentRepositoryTreeDataSource.java new file mode 100644 index 0000000..9b54565 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/content/repository/tree/ContentRepositoryTreeDataSource.java @@ -0,0 +1,111 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.content.repository.tree; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.data.DSRequest; +import com.smartgwt.client.data.DSResponse; +import com.smartgwt.client.data.DataSourceField; +import com.smartgwt.client.data.fields.DataSourceTextField; +import com.smartgwt.client.widgets.grid.ListGridRecord; +import com.smartgwt.client.widgets.tree.TreeNode; + +import org.rhq.core.domain.criteria.Criteria; +import org.rhq.core.domain.criteria.RepoCriteria; +import org.rhq.core.domain.util.PageList; +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.RepoGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; +import org.rhq.core.domain.content.Repo; + +/** + * @author Greg Hinkle + */ +public class ContentRepositoryTreeDataSource extends RPCDataSource<Repo> { + + private RepoGWTServiceAsync repoService = GWTServiceLookup.getRepoService(); + + + + public ContentRepositoryTreeDataSource() { + + DataSourceField idDataField = new DataSourceTextField("id", "ID"); + idDataField.setPrimaryKey(true); + + DataSourceTextField nameDataField = new DataSourceTextField("name", "Name"); + nameDataField.setCanEdit(false); + + DataSourceTextField descriptionDataField = new DataSourceTextField("description", "Description"); + descriptionDataField.setCanEdit(false); + + DataSourceTextField parentIdField = new DataSourceTextField("parentId", "Parent ID"); + parentIdField.setForeignKey("id"); + + setFields(idDataField, nameDataField, parentIdField); + } + + + @Override + protected void executeFetch(final DSRequest request, final DSResponse response) { + + + RepoCriteria criteria = new RepoCriteria(); + + + repoService.findReposByCriteria(criteria, new AsyncCallback<PageList<Repo>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load repositories",caught); + } + + public void onSuccess(PageList<Repo> result) { + response.setData(buildRecords(result)); + processResponse(request.getRequestId(), response); + } + }); + + } + + @Override + public Repo copyValues(ListGridRecord from) { + return null; // TODO: Implement this method. + } + + @Override + public ListGridRecord copyValues(Repo from) { + TreeNode record = new TreeNode(); + + record.setID(String.valueOf(from.getId())); + record.setName(from.getName()); + + record.setAttribute("id", from.getId()); + record.setAttribute("name", from.getName()); + record.setAttribute("description", from.getDescription()); + record.setAttribute("syncSchedule", from.getSyncSchedule()); + record.setAttribute("syncStatus", from.getSyncStatus()); + + record.setIsFolder(false); // don't attempt to load any children + + return record; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/content/repository/tree/ContentRepositoryTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/content/repository/tree/ContentRepositoryTreeView.java new file mode 100644 index 0000000..364fc67 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/content/repository/tree/ContentRepositoryTreeView.java @@ -0,0 +1,105 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.content.repository.tree; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.core.client.RunAsyncCallback; +import com.google.gwt.user.client.History; +import com.smartgwt.client.types.SelectionStyle; +import com.smartgwt.client.widgets.tree.TreeGrid; +import com.smartgwt.client.widgets.tree.TreeNode; +import com.smartgwt.client.widgets.tree.events.NodeClickEvent; +import com.smartgwt.client.widgets.tree.events.NodeClickHandler; + +import org.rhq.enterprise.gui.coregui.client.ViewId; +import org.rhq.enterprise.gui.coregui.client.ViewPath; +import org.rhq.enterprise.gui.coregui.client.bundle.tree.BundleTreeDataSource; + +/** + * @author Greg Hinkle + */ +public class ContentRepositoryTreeView extends TreeGrid { + + public ContentRepositoryTreeView() { + + setWidth100(); + setHeight100(); + + setWidth100(); + setHeight100(); + setShowRoot(true); + setAutoFetchData(true); + setAnimateFolders(false); + setSelectionType(SelectionStyle.SINGLE); + setShowRollOver(false); + setSortField("name"); + setShowHeader(false); + + setDataSource(new ContentRepositoryTreeDataSource()); + + addNodeClickHandler(new NodeClickHandler() { + public void onNodeClick(NodeClickEvent event) { + String path = event.getNode().getAttribute("id").replaceAll(":", "/"); + History.newItem("Bundles/Repository/" + path); + } + }); + } + + public void selectPath(ViewPath viewPath) { + + if (viewPath.viewsLeft() > 0) { + String key = ""; + for (ViewId view : viewPath.getViewPath().subList(2, viewPath.getViewPath().size())) { + if (key.length() > 0) + key += ":"; + + key += view.getPath(); + + TreeNode node = getTree().findById(key); + if (node != null) { + getTree().openFolder(node); + } + } + + final String finalKey = key; + GWT.runAsync(new RunAsyncCallback() { + public void onFailure(Throwable reason) { + + } + + public void onSuccess() { + TreeNode node = getTree().findById(finalKey); + if (node != null) { + deselectAllRecords(); + selectRecord(node); + } + } + }); + } else { + deselectAllRecords(); + selectRecord(0); + } + + + } +} \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ContentGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ContentGWTService.java new file mode 100644 index 0000000..f69a719 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ContentGWTService.java @@ -0,0 +1,38 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.gwt; + +import com.google.gwt.user.client.rpc.RemoteService; + +import org.rhq.core.domain.content.PackageVersion; +import org.rhq.core.domain.criteria.PackageVersionCriteria; +import org.rhq.core.domain.util.PageList; + +/** + * @author Greg Hinkle + */ +public interface ContentGWTService extends RemoteService { + + PageList<PackageVersion> findPackageVersionsByCriteria(PackageVersionCriteria criteria); + +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java index 689c26f..8dbdaa5 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java @@ -96,6 +96,14 @@ public class GWTServiceLookup { return secure(RemoteInstallGWTServiceAsync.Util.getInstance()); }
+ public static RepoGWTServiceAsync getRepoService() { + return secure(RepoGWTServiceAsync.Util.getInstance()); + } + + public static ContentGWTServiceAsync getContentService() { + return secure(ContentGWTServiceAsync.Util.getInstance()); + } +
private static <T> T secure(Object sdt) { if (!(sdt instanceof ServiceDefTarget)) diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RepoGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RepoGWTService.java new file mode 100644 index 0000000..50253c9 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RepoGWTService.java @@ -0,0 +1,39 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.gwt; + +import com.google.gwt.user.client.rpc.RemoteService; + +import org.rhq.core.domain.content.Repo; +import org.rhq.core.domain.criteria.RepoCriteria; +import org.rhq.core.domain.util.PageList; + +/** + * @author Greg Hinkle + */ +public interface RepoGWTService extends RemoteService { + + + PageList<Repo> findReposByCriteria(RepoCriteria criteria); + +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ContentGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ContentGWTServiceImpl.java new file mode 100644 index 0000000..91c45f8 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ContentGWTServiceImpl.java @@ -0,0 +1,50 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.server.gwt; + +import org.rhq.core.domain.content.PackageVersion; +import org.rhq.core.domain.criteria.PackageVersionCriteria; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.gwt.ContentGWTService; +import org.rhq.enterprise.gui.coregui.server.util.SerialUtility; +import org.rhq.enterprise.server.content.ContentManagerLocal; +import org.rhq.enterprise.server.util.LookupUtil; + +/** + * @author Greg Hinkle + */ +public class ContentGWTServiceImpl extends AbstractGWTServiceImpl implements ContentGWTService { + + + private ContentManagerLocal contentManager = LookupUtil.getContentManager(); + + + + public PageList<PackageVersion> findPackageVersionsByCriteria(PackageVersionCriteria criteria) { + return SerialUtility.prepare(contentManager.findPackageVersionsByCriteria(getSessionSubject(), criteria), + "ContentService.findPackageVersionsByCriteria"); + + } + + +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RepoGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RepoGWTServiceImpl.java new file mode 100644 index 0000000..45c2c5e --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RepoGWTServiceImpl.java @@ -0,0 +1,47 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.server.gwt; + +import org.rhq.core.domain.content.Repo; +import org.rhq.core.domain.criteria.RepoCriteria; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.gwt.RepoGWTService; +import org.rhq.enterprise.gui.coregui.server.util.SerialUtility; +import org.rhq.enterprise.server.content.RepoManagerLocal; +import org.rhq.enterprise.server.util.LookupUtil; + +/** + * @author Greg Hinkle + */ +public class RepoGWTServiceImpl extends AbstractGWTServiceImpl implements RepoGWTService { + + private RepoManagerLocal repoManager = LookupUtil.getRepoManagerLocal(); + + public PageList<Repo> findReposByCriteria(RepoCriteria criteria) { + return SerialUtility.prepare( + repoManager.findReposByCriteria(getSessionSubject(), criteria), + "ContentService.findReposByCriteria"); + } + + +} diff --git a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml index 9c7e0bc..dd4df53 100644 --- a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml +++ b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> - + <web-app xmlns="http://java.sun.com/xml/ns/javaee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" - version="2.5"> + version="2.5">
<servlet> <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI RoleGWTService</servlet-name> @@ -48,13 +48,10 @@ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI BundleGWTService</servlet-name> <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.BundleGWTServiceImpl</servlet-class> </servlet> - - <servlet> <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI FileUploadServlet</servlet-name> <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.FileUploadServlet</servlet-class> </servlet> - <servlet> <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI BundleFileUploadServlet</servlet-name> <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.BundleFileUploadServlet</servlet-class> @@ -63,28 +60,36 @@ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI BundleDistributionFileUploadServlet</servlet-name> <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.BundleDistributionFileUploadServlet</servlet-class> </servlet> - <servlet> - <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI ResourceBossGWTService</servlet-name> - <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.ResourceBossGWTServiceImpl</servlet-class> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI ResourceBossGWTService</servlet-name> + <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.ResourceBossGWTServiceImpl</servlet-class> </servlet> <servlet> - <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI AuthorizationGWTService</servlet-name> - <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.AuthorizationGWTServiceImpl</servlet-class> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI AuthorizationGWTService</servlet-name> + <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.AuthorizationGWTServiceImpl</servlet-class> </servlet> <servlet> - <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI AvailabilityGWTService</servlet-name> - <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.AvailabilityGWTServiceImpl</servlet-class> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI AvailabilityGWTService</servlet-name> + <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.AvailabilityGWTServiceImpl</servlet-class> </servlet> <servlet> - <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI TagGWTService</servlet-name> - <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.TagGWTServiceImpl</servlet-class> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI TagGWTService</servlet-name> + <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.TagGWTServiceImpl</servlet-class> </servlet> <servlet> - <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI RemoteInstallGWTService</servlet-name> - <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.RemoteInstallGWTServiceImpl</servlet-class> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI RemoteInstallGWTService</servlet-name> + <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.RemoteInstallGWTServiceImpl</servlet-class> + </servlet> + <servlet> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI RepoGWTService</servlet-name> + <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.RepoGWTServiceImpl</servlet-class> + </servlet> + <servlet> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI ContentGWTService</servlet-name> + <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.ContentGWTServiceImpl</servlet-class> </servlet>
+ <servlet-mapping> <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI RoleGWTService</servlet-name> <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/RoleGWTService</url-pattern> @@ -137,12 +142,10 @@ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI BundleDistributionFileUploadServlet</servlet-name> <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/BundleDistributionFileUploadServlet</url-pattern> </servlet-mapping> - <servlet-mapping> <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI ResourceBossGWTService</servlet-name> <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/ResourceBossGWTService</url-pattern> </servlet-mapping> - <servlet-mapping> <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI AuthorizationGWTService</servlet-name> <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/AuthorizationGWTService</url-pattern> @@ -159,4 +162,12 @@ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI RemoteInstallGWTService</servlet-name> <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/RemoteInstallGWTService</url-pattern> </servlet-mapping> + <servlet-mapping> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI RepoGWTService</servlet-name> + <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/RepoGWTService</url-pattern> + </servlet-mapping> + <servlet-mapping> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI ContentGWTService</servlet-name> + <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/ContentGWTService</url-pattern> + </servlet-mapping> </web-app> diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/Details_11.png b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/Details_11.png new file mode 100644 index 0000000..c9b87a5 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/Details_11.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/Ok_11.png b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/Ok_11.png new file mode 100644 index 0000000..41bd4d4 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/Ok_11.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/Warning_11.png b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/Warning_11.png new file mode 100644 index 0000000..44700c8 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/Warning_11.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/install-loader.gif b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/install-loader.gif new file mode 100644 index 0000000..388adc1 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/install-loader.gif differ
commit 18c686e46942d052b5dde216c96cb929d6aa0732 Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 20 14:26:58 2010 -0400
First cut of sharing the login session betwee portal war and coregui
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java index 4cde3ab..992b0c6 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java @@ -20,15 +20,15 @@ import com.smartgwt.client.util.KeyCallback; import com.smartgwt.client.util.Page; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Canvas; -import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.auth.Subject; +import org.rhq.core.domain.criteria.SubjectCriteria; +import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.admin.AdministrationView; import org.rhq.enterprise.gui.coregui.client.bundle.BundleTopView; import org.rhq.enterprise.gui.coregui.client.dashboard.DashboardsView; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; -import org.rhq.enterprise.gui.coregui.client.gwt.SubjectGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.inventory.resource.InventoryView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceView; import org.rhq.enterprise.gui.coregui.client.menu.MenuBarView; @@ -86,40 +86,71 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
messageCenter = new MessageCenter();
- RequestBuilder b = new RequestBuilder(RequestBuilder.GET, - "/j_security_check.do?j_username=rhqadmin&j_password=rhqadmin"); + + checkLoginStatus(); + + } + + + public static void checkLoginStatus() { + +// String sessionIdString = com.google.gwt.user.client.Cookies.getCookie("RHQ_Sesssion"); +// if (sessionIdString == null) { + + RequestBuilder b = new RequestBuilder(RequestBuilder.GET, "/sessionAccess"); try { b.setCallback(new RequestCallback() { - public void onResponseReceived(Request request, Response response) { - System.out.println("Portal-War logged in"); + public void onResponseReceived(final Request request, final Response response) { + String sessionIdString = response.getText(); + if (sessionIdString != null && sessionIdString.length() > 0) { + + int subjectId = Integer.parseInt(sessionIdString.split(":")[0]); + final int sessionId = Integer.parseInt(sessionIdString.split(":")[1]); + + Subject subject = new Subject(); + subject.setId(subjectId); + subject.setSessionId(sessionId); + + GWTServiceLookup.registerSession(String.valueOf(subject.getSessionId())); + + // look up real user prefs + + SubjectCriteria criteria = new SubjectCriteria(); + criteria.fetchConfiguration(true); + criteria.addFilterId(subjectId); + + + GWTServiceLookup.getSubjectService().findSubjectsByCriteria(criteria, new AsyncCallback<PageList<Subject>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load user's subject", caught); + } + + public void onSuccess(PageList<Subject> result) { + + Subject subject = result.get(0); + subject.setSessionId(sessionId); + setSessionSubject(subject); + System.out.println("Portal-War logged in"); + + } + }); + } else { + new LoginView().showLoginDialog(); + } }
public void onError(Request request, Throwable exception) { - System.out.println("Portal-War login failed"); + SC.say("Unable to determine login status, check server status"); } }); b.send(); } catch (RequestException e) { - e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. + SC.say("Unable to determine login status, check server status"); + e.printStackTrace(); } - - SubjectGWTServiceAsync subjectService = SubjectGWTServiceAsync.Util.getInstance(); - - subjectService.login("rhqadmin", "rhqadmin", new AsyncCallback<Subject>() { - public void onFailure(Throwable caught) { - System.out.println("Failed to login - cause: " + caught); - Label loginFailed = new Label("Failed to login - cause: " + caught); - loginFailed.draw(); - } - - public void onSuccess(Subject result) { - System.out.println("Logged in: " + result.getSessionId()); - setSessionSubject(result); - userPreferences = new UserPreferences(result); - } - }); }
+ private void buildCoreUI() { this.rootCanvas = new RootCanvas(); rootCanvas.setOverflow(Overflow.HIDDEN); @@ -159,6 +190,7 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { History.fireCurrentHistoryState(); }
+ public void onValueChange(ValueChangeEvent<String> stringValueChangeEvent) {
String event = URL.decodeComponent(stringValueChangeEvent.getValue()); @@ -167,9 +199,9 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { currentViewPath = new ViewPath(event);
rootCanvas.renderView(currentViewPath); - }
+ public Canvas createContent(String breadcrumbName) { Canvas canvas;
@@ -185,8 +217,8 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { canvas = new DashboardsView(); } else if (breadcrumbName.equals("Bundles")) { canvas = new BundleTopView(); - } else if (breadcrumbName.equals("LogOut")) { - canvas = new LoginView(); + /*} else if (breadcrumbName.equals("LogOut")) { + // canvas = new LoginView();*/ } else if (breadcrumbName.equals("Tag")) { canvas = new TaggedView(); } else { @@ -214,7 +246,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { }
public static void setSessionSubject(Subject subject) { - GWTServiceLookup.registerSession(String.valueOf(subject.getSessionId()));
// TODO this breaks because of reattach rules, bizarely even in queries. gonna switch out to non-subject include apis // Create a minimized session object for validation on requests 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 8f5e35a..6136c85 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 @@ -22,16 +22,26 @@ */ package org.rhq.enterprise.gui.coregui.client;
+import java.util.HashMap; + import com.google.gwt.http.client.Request; import com.google.gwt.http.client.RequestBuilder; import com.google.gwt.http.client.RequestCallback; import com.google.gwt.http.client.RequestException; import com.google.gwt.http.client.Response; import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.docs.Image; import com.smartgwt.client.types.Alignment; +import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.HTMLFlow; +import com.smartgwt.client.widgets.Img; import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.Window; 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.HeaderItem; import com.smartgwt.client.widgets.form.fields.PasswordItem; import com.smartgwt.client.widgets.form.fields.SubmitItem; import com.smartgwt.client.widgets.form.fields.TextItem; @@ -45,56 +55,76 @@ import org.rhq.enterprise.gui.coregui.client.gwt.SubjectGWTServiceAsync; /** * @author Greg Hinkle */ -public class LoginView extends VLayout { +public class LoginView {
- public LoginView() { - setWidth100(); - setHeight100(); - } + private Window window; + private DynamicForm form; + + public void showLoginDialog() { + + form = new DynamicForm(); + form.setMargin(10); + form.setShowInlineErrors(false);
- @Override - protected void onDraw() { - super.onDraw(); + CanvasItem logo = new CanvasItem(); + logo.setCanvas(new Img("header/rhq_logo_28px.png",80,28)); + logo.setShowTitle(false);
+ HeaderItem header = new HeaderItem(); + header.setValue("RHQ Login");
- final DynamicForm form = new DynamicForm();
- TextItem user = new TextItem("user","User"); - PasswordItem password = new PasswordItem("password","Password"); + TextItem user = new TextItem("user", "User"); + user.setRequired(true); + PasswordItem password = new PasswordItem("password", "Password"); + password.setRequired(true);
- final SubmitItem login = new SubmitItem("login","Login"); + final SubmitItem login = new SubmitItem("login", "Login"); login.setAlign(Alignment.CENTER); login.setColSpan(2);
- form.setFields(user,password,login); - - Window graphPopup = new Window(); - graphPopup.setTitle("RHQ Login"); - graphPopup.setWidth(400); - graphPopup.setHeight(400); - graphPopup.setIsModal(true); - graphPopup.setShowModalMask(true); - graphPopup.setCanDragResize(true); - graphPopup.centerInPage(); - graphPopup.addItem(form); - graphPopup.show(); - - login.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent clickEvent) { - login(form.getValueAsString("user"), form.getValueAsString("password")); + + form.setFields(logo, header, user, password, login); + + + window = new Window(); + window.setTitle("RHQ Login"); + window.setWidth(400); + window.setHeight(400); + window.setIsModal(true); + window.setShowModalMask(true); + window.setCanDragResize(true); + window.centerInPage(); + window.addItem(form); + window.show(); + + form.focusInItem(user); + + form.addSubmitValuesHandler(new SubmitValuesHandler() { + public void onSubmitValues(SubmitValuesEvent submitValuesEvent) { + if (form.validate()) { + login(form.getValueAsString("user"), form.getValueAsString("password")); + } } });
}
private void login(String user, String password) { + RequestBuilder b = new RequestBuilder(RequestBuilder.GET, - "/j_security_check.do?j_username=" + user + "&j_password=" + password ); + "/j_security_check.do?j_username=" + user + "&j_password=" + password); try { b.setCallback(new RequestCallback() { public void onResponseReceived(Request request, Response response) { - System.out.println("Portal-War logged in"); + if (response.getStatusCode() == 200) { + System.out.println("Portal-War logged in"); + window.destroy(); + CoreGUI.checkLoginStatus(); + } else { + form.setFieldErrors("user", "The username or password provided does not match our records.", true); + } }
public void onError(Request request, Throwable exception) { @@ -107,6 +137,7 @@ public class LoginView extends VLayout { }
+ /* SubjectGWTServiceAsync subjectService = SubjectGWTServiceAsync.Util.getInstance();
subjectService.login(user, password, new AsyncCallback<Subject>() { @@ -120,7 +151,7 @@ public class LoginView extends VLayout { System.out.println("Logged in: " + result.getSessionId()); CoreGUI.setSessionSubject(result);
- /* We can cache all metadata right here + *//* We can cache all metadata right here ResourceTypeRepository.Cache.getInstance().getResourceTypes( (Integer[]) null, EnumSet.allOf(ResourceTypeRepository.MetadataType.class), new ResourceTypeRepository.TypesLoadedCallback() { public void onTypesLoaded(HashMap<Integer, ResourceType> types) { @@ -128,8 +159,9 @@ public class LoginView extends VLayout { buildCoreUI(); } }); - */ + *//* } - }); + }); */ + } } 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 new file mode 100644 index 0000000..7eadda6 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java @@ -0,0 +1,75 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.authentication; + +import java.io.IOException; + +import javax.servlet.Servlet; +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletOutputStream; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.rhq.enterprise.gui.legacy.WebUser; +import org.rhq.enterprise.gui.legacy.util.SessionUtils; + +/** + * @author Greg Hinkle + */ +public class SessionAccessServlet extends HttpServlet { + + + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + + + HttpServletResponse response = (HttpServletResponse) resp; + HttpServletRequest request = (HttpServletRequest) req; + + //if a session does not already exist this call will create one + HttpSession session = request.getSession(); + + /* check if the user object is in the session. + * if not then the user is not validated and should be forwarded to the login page + */ + WebUser webUser = SessionUtils.getWebUser(session); + + if (webUser != null) { + + ServletOutputStream out = response.getOutputStream(); + + String output = + String.valueOf(webUser.getSubject().getId()) + ":" + + String.valueOf(webUser.getSessionId()); + + + out.write(output.getBytes()); + + } + } +} diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml index 4dac9ca..f560de1 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml @@ -328,6 +328,12 @@ <load-on-startup>1</load-on-startup> </servlet>
+ <servlet> + <servlet-name>sessionAccess</servlet-name> + <servlet-class>org.rhq.enterprise.gui.authentication.SessionAccessServlet</servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> + <!-- Servlet that serves the agent update binaries and version information --> <servlet> <servlet-name>AgentUpdateServlet</servlet-name> @@ -437,6 +443,13 @@ <url-pattern>/client/download</url-pattern> </servlet-mapping>
+ <servlet-mapping> + <servlet-name>sessionAccess</servlet-name> + <url-pattern>/sessionAccess</url-pattern> + </servlet-mapping> + + + <!-- The download servlet; this URI /downloads will effectively look like its pointing to rhq-downloads --> <servlet-mapping> <servlet-name>DownloadServlet</servlet-name>
commit ed4a47253353ff3873f63a342fba0c24e8b17dde Author: Greg Hinkle ghinkle@redhat.com Date: Tue May 18 15:55:20 2010 -0400
UI tweaks
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java index f93f66a..4b9a853 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java @@ -131,10 +131,10 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { addMember(form);
Table deployments = createDeploymentsTable(); - deployments.setHeight("*"); + deployments.setHeight("30%"); deployments.setShowResizeBar(true); deployments.setResizeBarTarget("next"); - addMember(createDeploymentsTable()); + addMember(deployments);
detail = new VLayout(); detail.setAutoHeight(); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java index 6baa38d..dd63fca 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java @@ -114,7 +114,7 @@ public class TagEditorView extends Layout { }
Layout layout = vertical ? new VLayout() : new HLayout(); - if (vertical) + if (!vertical) layout.setMembersMargin(8);
HTMLFlow title = new HTMLFlow("<b>Tags:</b>");
commit b1e2d17b6b4b934be4300c9b7447cd7eeec800f3 Author: Greg Hinkle ghinkle@redhat.com Date: Tue May 18 10:06:16 2010 -0400
Start to basic tag searching and filtering to match bundles and resources
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java new file mode 100644 index 0000000..22f911a --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java @@ -0,0 +1,35 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client; + +/** + * @author Greg Hinkle + */ +public class LinkManager { + + + public static String getResourceLink(int resourceId) { + + return "Resource/" + resourceId; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java index e579cbd..2dc985c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java @@ -67,7 +67,7 @@ public class BundleView extends VLayout implements BookmarkableView { super(); setWidth100(); setHeight100(); - setPadding(10); +// setPadding(10); setOverflow(Overflow.AUTO); }
@@ -82,7 +82,7 @@ public class BundleView extends VLayout implements BookmarkableView {
this.bundle = bundle;
- headerLabel = new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/Bundle_24.png") + ""/> " + bundle.getName()); + headerLabel = new HeaderLabel("subsystems/bundle/Bundle_24.png", bundle.getName());
TabSet tabs = new TabSet(); @@ -200,7 +200,7 @@ public class BundleView extends VLayout implements BookmarkableView { }); } }); - tagEditor.setAlwaysEdit(true); +// tagEditor.setAlwaysEdit(true); tagEditor.setVertical(true); layout.addMember(tagEditor);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java index 99261ba..f20d65e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java @@ -64,6 +64,18 @@ public class BundlesWithLatestVersionDataSource extends RPCDataSource<BundleWith
BundleCriteria criteria = new BundleCriteria(); criteria.setPageControl(getPageControl(request)); + if (request.getCriteria().getValues().get("tagNamespace") != null) { + criteria.addFilterTagNamespace((String) request.getCriteria().getValues().get("tagNamespace")); + } + + if (request.getCriteria().getValues().get("tagSemantic") != null) { + criteria.addFilterTagSemantic((String) request.getCriteria().getValues().get("tagSemantic")); + } + + if (request.getCriteria().getValues().get("tagName") != null) { + criteria.addFilterTagName((String) request.getCriteria().getValues().get("tagName")); + } +
bundleService.findBundlesWithLatestVersionCompositesByCriteria(criteria, new AsyncCallback<PageList<BundleWithLatestVersionComposite>>() { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/HeaderLabel.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/HeaderLabel.java index f4ddfc3..c5d432e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/HeaderLabel.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/HeaderLabel.java @@ -18,6 +18,7 @@ */ package org.rhq.enterprise.gui.coregui.client.components;
+ import com.smartgwt.client.widgets.HTMLFlow; import com.smartgwt.client.widgets.Label;
@@ -26,6 +27,10 @@ import com.smartgwt.client.widgets.Label; */ public class HeaderLabel extends HTMLFlow {
+ public HeaderLabel(String icon, String contents) { + this("<img src="" + getImgURL(icon) + ""/> " + contents); + } + public HeaderLabel(String contents) { super(contents); setHeight(60); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java index 965d402..6baa38d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java @@ -114,7 +114,8 @@ public class TagEditorView extends Layout { }
Layout layout = vertical ? new VLayout() : new HLayout(); - layout.setMembersMargin(8); + if (vertical) + layout.setMembersMargin(8);
HTMLFlow title = new HTMLFlow("<b>Tags:</b>"); title.setAutoWidth(); @@ -122,6 +123,7 @@ public class TagEditorView extends Layout {
for (final Tag tag : tags) { HLayout tagLayout = new HLayout(); + tagLayout.setHeight(18); //tagLayout.set
HTMLFlow tagString = new HTMLFlow(tag.toString()); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java index 3ad9e83..1f3695b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java @@ -103,12 +103,12 @@ public class DashboardsView extends VLayout {
StoredPortlet graph = new StoredPortlet("ghinkle (MAC OS X) CPU", GraphPortlet.KEY, 250); graph.setProperty("resourceId","10001"); - graph.setProperty("definitionId","10139"); + graph.setProperty("definitionId","10100"); col1.add(graph);
StoredPortlet graphTwo = new StoredPortlet("JBoss AS Txn / Min", GraphPortlet.KEY, 250); graphTwo.setProperty("resourceId","10003"); - graphTwo.setProperty("definitionId","10971"); + graphTwo.setProperty("definitionId","10916"); col1.add(graphTwo);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java index 9a04cdc..d640e55 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java @@ -36,7 +36,11 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTyp
import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.widgets.events.DoubleClickEvent; +import com.smartgwt.client.widgets.events.DoubleClickHandler; import com.smartgwt.client.widgets.grid.ListGridRecord; +import com.smartgwt.client.widgets.grid.events.RecordDoubleClickEvent; +import com.smartgwt.client.widgets.grid.events.RecordDoubleClickHandler; import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.menu.Menu; import com.smartgwt.client.widgets.menu.MenuButton; @@ -80,31 +84,25 @@ public class OperationHistoryView extends VLayout {
table.setDataSource(new OperationHistoryDataSource());
+ table.getListGrid().getField("id").setWidth(40); + table.getListGrid().getField("operationName").setWidth("*"); + table.getListGrid().getField("status").setWidth(100); + table.getListGrid().getField("startedTime").setWidth(120);
- table.addTableAction("Details", Table.SelectionEnablement.SINGLE,null, new TableAction() { - public void executeAction(ListGridRecord[] selection) { - ResourceOperationHistory history = (ResourceOperationHistory) selection[0].getAttributeAsObject("entity");
- ResourceOperationHistoryCriteria criteria = new ResourceOperationHistoryCriteria(); + table.getListGrid().addRecordDoubleClickHandler(new RecordDoubleClickHandler() { + public void onRecordDoubleClick(RecordDoubleClickEvent recordDoubleClickEvent) { + ResourceOperationHistory history = (ResourceOperationHistory) recordDoubleClickEvent.getRecord().getAttributeAsObject("entity");
- criteria.addFilterId(history.getId()); + showDetails(history); } + });
- criteria.fetchOperationDefinition(true); - criteria.fetchParameters(true); - criteria.fetchResults(true);
- GWTServiceLookup.getOperationService().findResourceOperationHistoriesByCriteria( - criteria, new AsyncCallback<PageList<ResourceOperationHistory>>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failure loading operation history", caught); - } + table.addTableAction("Details", Table.SelectionEnablement.SINGLE, null, new TableAction() { + public void executeAction(ListGridRecord[] selection) { + ResourceOperationHistory history = (ResourceOperationHistory) selection[0].getAttributeAsObject("entity");
- public void onSuccess(PageList<ResourceOperationHistory> result) { - ResourceOperationHistory item = result.get(0); - OperationDetailsView.displayDetailsDialog(item); - } - } - ); + showDetails(history); } });
@@ -127,7 +125,7 @@ public class OperationHistoryView extends VLayout { } });
- MenuButton operationsButton = new MenuButton("Run Operation",operationMenu); + MenuButton operationsButton = new MenuButton("Run Operation", operationMenu); operationsButton.setShowMenuBelow(false); table.addExtraWidget(operationsButton);
@@ -135,6 +133,29 @@ public class OperationHistoryView extends VLayout { addMember(table); }
+ private void showDetails(ResourceOperationHistory history) { + ResourceOperationHistoryCriteria criteria = new ResourceOperationHistoryCriteria(); + + criteria.addFilterId(history.getId()); + + criteria.fetchOperationDefinition(true); + criteria.fetchParameters(true); + criteria.fetchResults(true); + + GWTServiceLookup.getOperationService().findResourceOperationHistoriesByCriteria( + criteria, new AsyncCallback<PageList<ResourceOperationHistory>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failure loading operation history", caught); + } + + public void onSuccess(PageList<ResourceOperationHistory> result) { + ResourceOperationHistory item = result.get(0); + OperationDetailsView.displayDetailsDialog(item); + } + } + ); + } +
public static OperationHistoryView getResourceHistoryView(Resource resource) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java index 3d5eedc..8454bc4 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java @@ -33,6 +33,7 @@ import org.rhq.core.domain.criteria.TagCriteria; import org.rhq.core.domain.tagging.compsite.TagReportComposite; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
/** @@ -63,6 +64,8 @@ public class TagCloudView extends VLayout {
private void drawTags(PageList<TagReportComposite> tags) {
+ addMember(new HeaderLabel("Tag Cloud")); + long max = 0; long total = 0; for (TagReportComposite tag : tags) { diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css index 30c06fd..4b8b087 100644 --- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css +++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css @@ -54,7 +54,7 @@ a:hover {
.HeaderLabel { - height: 24px; + height: 35px; font-size: 11pt; font-weight: bold; color: #444444;
commit 9fde0e22bb851b2c19f32dcb670ec2759c9ed17d Author: Greg Hinkle ghinkle@redhat.com Date: Tue May 18 10:04:11 2010 -0400
display installed version
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java index 86eef5b..199d1b9 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java @@ -160,11 +160,12 @@ public class BundleDestinationView extends VLayout implements BookmarkableView { } });
+ ListGridField version = new ListGridField("version", "Version"); ListGridField description = new ListGridField("description", "Description"); ListGridField installDate = new ListGridField("installDate", "Install Date"); ListGridField status = new ListGridField("status", "Status");
- table.getListGrid().setFields(name, description, installDate, status); + table.getListGrid().setFields(name, version, description, installDate, status);
ArrayList<ListGridRecord> records = new ArrayList<ListGridRecord>(); for (BundleDeployment rd : destination.getDeployments()) {
commit 44635438d54b099c27d9de096e47290c69193ece Author: Greg Hinkle ghinkle@redhat.com Date: Tue May 18 10:03:43 2010 -0400
A basic complete for the resource search box... not integrated to *search*
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java index e1249f6..6e36377 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java @@ -18,14 +18,26 @@ */ package org.rhq.enterprise.gui.coregui.client.menu;
+import com.google.gwt.user.client.History; import com.google.gwt.user.client.ui.TextBox; +import com.smartgwt.client.types.Alignment; import com.smartgwt.client.types.FormLayoutType; +import com.smartgwt.client.types.ListGridFieldType; +import com.smartgwt.client.types.TextMatchStyle; import com.smartgwt.client.widgets.Window; import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.FormItemIfFunction; import com.smartgwt.client.widgets.form.fields.ButtonItem; +import com.smartgwt.client.widgets.form.fields.ComboBoxItem; +import com.smartgwt.client.widgets.form.fields.FormItem; import com.smartgwt.client.widgets.form.fields.SelectItem; import com.smartgwt.client.widgets.form.fields.SpacerItem; import com.smartgwt.client.widgets.form.fields.TextItem; +import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; +import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; +import com.smartgwt.client.widgets.grid.CellFormatter; +import com.smartgwt.client.widgets.grid.ListGridField; +import com.smartgwt.client.widgets.grid.ListGridRecord; import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.menu.Menu; import com.smartgwt.client.widgets.menu.MenuButton; @@ -34,6 +46,10 @@ import com.smartgwt.client.widgets.menu.MenuItemSeparator;
import java.util.LinkedHashMap;
+import org.rhq.enterprise.gui.coregui.client.LinkManager; +import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupsDataSource; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDatasource; + /** * @author Greg Hinkle */ @@ -49,41 +65,96 @@ public class SearchBarPane extends HLayout { protected void onDraw() { super.onDraw();
- DynamicForm form = new DynamicForm(); + final DynamicForm form = new DynamicForm(); form.setNumCols(6); -// form.setWidth100(); - - - - LinkedHashMap<String, String> values = new LinkedHashMap<String, String>(); - values.put("Resources", "Resources"); - values.put("Resources Groups", "Resources Groups"); - values.put("Bundles", "Bundles"); - values.put("Packages", "Package"); - values.put("Users", "Users"); - values.put("Roles", "Roles"); - + form.setColWidths("120", "140", "400");
- SelectItem searchType = new SelectItem("searchType", "Search"); + final SelectItem searchType = new SelectItem("searchType", "Search"); searchType.setWidth(120); - searchType.setValueMap(values); + searchType.setValueMap("Resources", "Resource Groups", "Bundles", "Packages", "Users", "Roles"); searchType.setValue("Resources");
+ ComboBoxItem resourceSearch = getResourceComboBox(); + resourceSearch.setShowIfCondition(new FormItemIfFunction() { + public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm) { + return form.getValueAsString("searchType").equals("Resources"); + } + }); + TextItem query = new TextItem("query"); - query.setLeft(210); - query.setWidth(400); query.setShowTitle(false);
ButtonItem search = new ButtonItem("Search", "Search"); search.setStartRow(false); search.setEndRow(false); search.setShowTitle(false); - search.setLeft(620); search.setIcon(Window.getImgURL("[SKIN]/actions/view.png"));
- - form.setItems(searchType, query, search, new SpacerItem()); + form.setItems(searchType, resourceSearch, search, new SpacerItem());
addMember(form); } + + + private ComboBoxItem getResourceComboBox() { + + final ComboBoxItem comboBox = new ComboBoxItem("query", "Query"); + comboBox.setWidth(400); + comboBox.setShowTitle(false); + comboBox.setHint("resource search"); + comboBox.setShowHintInField(true); + + comboBox.setOptionDataSource(new ResourceDatasource()); + + ListGridField nameField = new ListGridField("name", "Name", 250); + ListGridField descriptionField = new ListGridField("description", "Description"); + ListGridField typeNameField = new ListGridField("typeName", "Type", 130); + ListGridField pluginNameField = new ListGridField("pluginName", "Plugin", 100); + ListGridField categoryField = new ListGridField("category", "Category", 60); + ListGridField availabilityField = new ListGridField("currentAvailability", "Availability", 55); + availabilityField.setAlign(Alignment.CENTER); + + comboBox.setPickListFields(nameField, descriptionField, typeNameField, pluginNameField, categoryField, availabilityField); + + comboBox.setValueField("id"); + comboBox.setDisplayField("name"); + comboBox.setPickListWidth(800); + comboBox.setTextMatchStyle(TextMatchStyle.SUBSTRING); + comboBox.setCompleteOnTab(true); + + comboBox.addChangedHandler(new ChangedHandler() { + public void onChanged(ChangedEvent changedEvent) { + try { + Integer resourceId = (Integer) changedEvent.getValue(); + comboBox.setValue(""); + History.newItem(LinkManager.getResourceLink(resourceId)); + } catch (Exception e) { + } + } + }); + + return comboBox; + } + + + private ComboBoxItem getGroupComboBox() { + ComboBoxItem comboBox = new ComboBoxItem("query", "Query"); + comboBox.setWidth(400); + comboBox.setShowTitle(false); + + + comboBox.setOptionDataSource(new ResourceGroupsDataSource()); + ListGridField nameField = new ListGridField("name"); + ListGridField descriptionField = new ListGridField("description"); + comboBox.setPickListFields(nameField, descriptionField); + + + comboBox.setValueField("id"); + comboBox.setDisplayField("name"); + comboBox.setPickListWidth(600); + comboBox.setTextMatchStyle(TextMatchStyle.SUBSTRING); + + return comboBox; + } + }
commit 9bc700ceaba7b375b2595a204ba75d2a48814a59 Author: Greg Hinkle ghinkle@redhat.com Date: Fri May 14 15:23:46 2010 -0400
Tag view and start to combined lookup by tag
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java index 9cd7ba7..4cde3ab 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java @@ -32,6 +32,7 @@ import org.rhq.enterprise.gui.coregui.client.gwt.SubjectGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.inventory.resource.InventoryView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceView; import org.rhq.enterprise.gui.coregui.client.menu.MenuBarView; +import org.rhq.enterprise.gui.coregui.client.report.tag.TaggedView; import org.rhq.enterprise.gui.coregui.client.util.ErrorHandler; import org.rhq.enterprise.gui.coregui.client.util.message.MessageCenter; import org.rhq.enterprise.gui.coregui.client.util.preferences.UserPreferences; @@ -186,6 +187,8 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { canvas = new BundleTopView(); } else if (breadcrumbName.equals("LogOut")) { canvas = new LoginView(); + } else if (breadcrumbName.equals("Tag")) { + canvas = new TaggedView(); } else { canvas = null; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesDataSource.java index 9b70e92..7c8aa02 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesDataSource.java @@ -62,6 +62,20 @@ public class BundlesDataSource extends RPCDataSource<Bundle> { BundleCriteria criteria = new BundleCriteria(); criteria.setPageControl(getPageControl(request));
+ + if (request.getCriteria().getValues().get("tagNamespace") != null) { + criteria.addFilterTagNamespace((String) request.getCriteria().getValues().get("tagNamespace")); + } + + if (request.getCriteria().getValues().get("tagSemantic") != null) { + criteria.addFilterTagSemantic((String) request.getCriteria().getValues().get("tagSemantic")); + } + + if (request.getCriteria().getValues().get("tagName") != null) { + criteria.addFilterTagName((String) request.getCriteria().getValues().get("tagName")); + } + + bundleService.findBundlesByCriteria(criteria, new AsyncCallback<PageList<Bundle>>() { public void onFailure(Throwable caught) { CoreGUI.getErrorHandler().handleError("Failed to load bundle data", caught); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java index 4a03055..d6ebef8 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java @@ -19,6 +19,7 @@ package org.rhq.enterprise.gui.coregui.client.bundle.list;
import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.data.Criteria; import com.smartgwt.client.types.SelectionAppearance; import com.smartgwt.client.types.SelectionStyle; import com.smartgwt.client.widgets.grid.CellFormatter; @@ -44,16 +45,18 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity; */ public class BundlesListView extends VLayout {
+ private Table table; + public BundlesListView() { setWidth100(); setHeight100(); }
@Override - protected void onDraw() { - super.onDraw(); + protected void onInit() { + super.onInit();
- final Table table = new Table("Bundles"); + table = new Table("Bundles");
table.setDataSource(new BundlesWithLatestVersionDataSource());
@@ -136,4 +139,12 @@ public class BundlesListView extends VLayout { addMember(table);
} + + public void setCriteria(Criteria criteria) { + this.table.getListGrid().fetchData(criteria); + } + + public int getMatches() { + return this.table.getListGrid().getTotalRows(); + } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java index 2bec61e..02f2013 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java @@ -23,6 +23,7 @@ import java.util.ArrayList; import com.smartgwt.client.data.Criteria; import com.smartgwt.client.data.SortSpecifier; import com.smartgwt.client.types.Autofit; +import com.smartgwt.client.types.VerticalAlignment; import com.smartgwt.client.util.BooleanCallback; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Canvas; @@ -39,6 +40,7 @@ import com.smartgwt.client.widgets.grid.events.FieldStateChangedEvent; import com.smartgwt.client.widgets.grid.events.FieldStateChangedHandler; import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; import com.smartgwt.client.widgets.grid.events.SelectionEvent; +import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.LayoutSpacer; import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.toolbar.ToolStrip; @@ -54,6 +56,9 @@ public class Table extends VLayout { private static final SelectionEnablement DEFAULT_SELECTION_ENABLEMENT = SelectionEnablement.ALWAYS;
private HTMLFlow title; + + private Canvas titleComponent; + private ListGrid listGrid; private ToolStrip footer; private Label tableInfo; @@ -111,7 +116,7 @@ public class Table extends VLayout { }
public Table(String tableTitle, Criteria criteria, SortSpecifier[] sortSpecifiers, String[] excludedFieldNames, - boolean autoFetchData) { + boolean autoFetchData) { super();
setWidth100(); @@ -161,7 +166,17 @@ public class Table extends VLayout { } }
- addMember(title); + HLayout titleLayout = new HLayout(); + titleLayout.setAutoHeight(); + titleLayout.setAlign(VerticalAlignment.BOTTOM); + titleLayout.addMember(title); + + if (titleComponent != null) { + titleLayout.addMember(new LayoutSpacer()); + titleLayout.addMember(titleComponent); + } + + addMember(titleLayout); addMember(listGrid); addMember(footer);
@@ -175,7 +190,7 @@ public class Table extends VLayout { if (tableAction.confirmMessage != null) {
String message = tableAction.confirmMessage.replaceAll("\#", String.valueOf(listGrid - .getSelection().length)); + .getSelection().length));
SC.ask(message, new BooleanCallback() { public void execute(Boolean confirmed) { @@ -322,12 +337,17 @@ public class Table extends VLayout { return listGrid; }
+ + public void setTitleComponent(Canvas canvas) { + this.titleComponent = canvas; + } + public void addTableAction(String title, TableAction tableAction) { this.addTableAction(title, null, null, tableAction); }
public void addTableAction(String title, SelectionEnablement enablement, String confirmation, - TableAction tableAction) { + TableAction tableAction) { if (enablement == null) { enablement = DEFAULT_SELECTION_ENABLEMENT; } @@ -341,26 +361,25 @@ public class Table extends VLayout { }
- private void refreshTableInfo() { int count = this.listGrid.getSelection().length; for (TableActionInfo tableAction : tableActions) { boolean enabled; switch (tableAction.enablement) { - case ALWAYS: - enabled = true; - break; - case ANY: - enabled = (count >= 1); - break; - case SINGLE: - enabled = (count == 1); - break; - case MULTIPLE: - enabled = (count > 1); - break; - default: - throw new IllegalStateException("Unhandled SelectionEnablement: " + tableAction.enablement.name()); + case ALWAYS: + enabled = true; + break; + case ANY: + enabled = (count >= 1); + break; + case SINGLE: + enabled = (count == 1); + break; + case MULTIPLE: + enabled = (count > 1); + break; + default: + throw new IllegalStateException("Unhandled SelectionEnablement: " + tableAction.enablement.name()); } tableAction.actionButton.setDisabled(!enabled); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java index 1398aac..b1b1ece 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java @@ -37,6 +37,7 @@ import org.rhq.core.domain.criteria.ResourceCriteria; import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceCategory; +import org.rhq.core.domain.tagging.Tag; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; @@ -122,6 +123,23 @@ public class ResourceDatasource extends RPCDataSource<Resource> { }
+ if (request.getCriteria().getValues().get("tag") != null) { + criteria.addFilterTag((Tag) request.getCriteria().getValues().get("tag")); + } + + if (request.getCriteria().getValues().get("tagNamespace") != null) { + criteria.addFilterTagNamespace((String) request.getCriteria().getValues().get("tagNamespace")); + } + + if (request.getCriteria().getValues().get("tagSemantic") != null) { + criteria.addFilterTagSemantic((String) request.getCriteria().getValues().get("tagSemantic")); + } + + if (request.getCriteria().getValues().get("tagName") != null) { + criteria.addFilterTagName((String) request.getCriteria().getValues().get("tagName")); + } + +
resourceService.findResourcesByCriteria(criteria, new AsyncCallback<PageList<Resource>>() { public void onFailure(Throwable caught) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java index a349722..8d8f371 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java @@ -76,10 +76,10 @@ public class ResourceSearchView extends VLayout { searchPanel.setWrapItemTitles(false); searchPanel.setFields(searchBox);
- addMember(searchPanel);
final ResourceDatasource datasource = new ResourceDatasource(); table = new Table(title, criteria); + table.setTitleComponent(searchPanel); table.setDataSource(datasource);
table.getListGrid().setSelectionType(SelectionStyle.SIMPLE); @@ -134,6 +134,18 @@ public class ResourceSearchView extends VLayout { }); }
+ + + public void setCriteria(Criteria criteria) { + this.table.getListGrid().fetchData(criteria); + } + + + public int getMatches() { + return this.table.getListGrid().getTotalRows(); + } + + public void addResourceSelectedListener(ResourceSelectListener listener) { selectListeners.add(listener); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java index e342628..2f85ae3 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java @@ -19,6 +19,7 @@ package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail;
import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.data.Criteria; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.layout.HLayout;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java new file mode 100644 index 0000000..ec2c2c4 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java @@ -0,0 +1,140 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.report.tag; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.widgets.layout.SectionStack; +import com.smartgwt.client.widgets.layout.SectionStackSection; +import com.smartgwt.client.widgets.layout.VLayout; + +import org.rhq.core.domain.criteria.TagCriteria; +import org.rhq.core.domain.tagging.Tag; +import org.rhq.core.domain.tagging.compsite.TagReportComposite; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.BookmarkableView; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.ViewPath; +import org.rhq.enterprise.gui.coregui.client.bundle.list.BundlesListView; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView; + +/** + * @author Greg Hinkle + */ +public class TaggedView extends VLayout implements BookmarkableView { + + + private SectionStack sectionStack; + + private Criteria criteria; + + private SectionStackSection resourceSection; + private ResourceSearchView resourceView; + + private SectionStackSection bundleSection; + private BundlesListView bundlesView; + + public TaggedView() { + setWidth100(); + setHeight100(); + } + + @Override + protected void onInit() { + super.onInit(); + + TagCloudView tagCloudView = new TagCloudView(); + tagCloudView.setAutoHeight(); + addMember(tagCloudView); + + sectionStack = new SectionStack(); + sectionStack.setHeight("*"); + + sectionStack.addSection(getResourceStack()); + + sectionStack.addSection(getBundleStack()); + + addMember(sectionStack); + + } + + private void viewTag(String tagString) { + + + Tag tag = new Tag(tagString); + + criteria = new Criteria(); + criteria.addCriteria("tagNamespace", tag.getNamespace()); + criteria.addCriteria("tagSemantic", tag.getSemantic()); + criteria.addCriteria("tagName", tag.getName()); + + + resourceView.setCriteria(criteria); + bundlesView.setCriteria(criteria); + + + TagCriteria criteria = new TagCriteria(); + criteria.addFilterNamespace(tag.getNamespace()); + criteria.addFilterSemantic(tag.getSemantic()); + criteria.addFilterName(tag.getName()); + + GWTServiceLookup.getTagService().findTagReportCompositesByCriteria(criteria, new AsyncCallback<PageList<TagReportComposite>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load tag report",caught); + } + + public void onSuccess(PageList<TagReportComposite> result) { + TagReportComposite tagReport = result.get(0); + sectionStack.setSectionTitle(0, "Resources: " + tagReport.getResourceCount()); + sectionStack.setSectionTitle(1, "Bundles: " + tagReport.getBundleCount()); + } + }); + } + + private SectionStackSection getResourceStack() { + resourceSection = new SectionStackSection(); + resourceSection.setTitle("Resources"); + + + resourceView = new ResourceSearchView(); + resourceSection.addItem(resourceView); + return resourceSection; + } + + private SectionStackSection getBundleStack() { + bundleSection = new SectionStackSection(); + bundleSection.setTitle("Bundles"); + + bundlesView = new BundlesListView(); + bundleSection.addItem(bundlesView); + return bundleSection; + } + + public void renderView(ViewPath viewPath) { + if (!viewPath.isEnd()) { + String tagString = viewPath.getCurrent().getPath(); + viewTag(tagString); + } + } +}
commit f620405f7ce267316bc22aed0dde53fff4ffacc2 Author: Greg Hinkle ghinkle@redhat.com Date: Fri May 14 15:14:58 2010 -0400
Consistent header sizes
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css index 9c3255c..30c06fd 100644 --- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css +++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css @@ -54,7 +54,8 @@ a:hover {
.HeaderLabel { - font-size: 14pt; + height: 24px; + font-size: 11pt; font-weight: bold; color: #444444; }
commit 9573e51a09093b45ab3c1396927439dd4d6f1654 Author: Greg Hinkle ghinkle@redhat.com Date: Fri May 14 15:14:26 2010 -0400
Fix fuzzy for subselected in clause
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 ed724f2..7de5681 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 @@ -114,8 +114,8 @@ public final class CriteriaQueryGenerator { }
private String fixFilterOverride(String expression, String fieldName) { - boolean fuzzyMatch = expression.toLowerCase().contains(" like "); - boolean wantCaseInsensitiveMatch = !criteria.isCaseSensitive() && fuzzyMatch && !expression.toLowerCase().contains("select"); // Don't case change subselects + boolean fuzzyMatch = expression.toLowerCase().contains(" like ") && !expression.toLowerCase().contains("select"); // Don't fuzzy match subselects + boolean wantCaseInsensitiveMatch = !criteria.isCaseSensitive() && fuzzyMatch;
while (expression.indexOf('?') != -1) { String replacement = ":" + fieldName;
commit 5861446c45423b8d3b39c395221339383c42c242 Merge: cd7656e... 4032368... Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 20 12:31:50 2010 -0400
Merge branch 'bundle' of ssh://git.fedorahosted.org/git/rhq/rhq into bundle
commit cd7656ef360cc329b7b81d79de3c688fc75426b8 Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 20 12:30:33 2010 -0400
Fix problem in generating the deployment scheduling request
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java index d8621ad..a0ecdf9 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java @@ -841,7 +841,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot
// make sure the deployment contains the info required by the schedule service BundleDeploymentCriteria bdc = new BundleDeploymentCriteria(); - bdc.addFilterId(resourceDeployment.getId()); + bdc.addFilterId(resourceDeployment.getBundleDeployment().getId()); bdc.fetchBundleVersion(true); bdc.fetchConfiguration(true); bdc.fetchDestination(true);
commit 29edb819002efe3840645ff2badfd4aa35196459 Merge: 66f5dff... f5f1c42... Author: Heiko W. Rupp hwr@redhat.com Date: Thu May 20 18:08:42 2010 +0200
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 66f5dffe94a0124c5d0288834858a3297ffc9ff0 Author: Heiko W. Rupp hwr@redhat.com Date: Thu May 20 18:07:57 2010 +0200
BZ 594417 - catch an error in the Pluralizer if the TypeName is all in CAPS
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ListChildResourcesUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ListChildResourcesUIBean.java index ebc58b7..73d72f9 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ListChildResourcesUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ListChildResourcesUIBean.java @@ -120,7 +120,7 @@ public class ListChildResourcesUIBean extends PagedDataTableUIBean { FacesContextUtility.removeSessionScopedBean(CreateNewPackageChildResourceUIBean.class); FacesContextUtility.removeSessionScopedBean(UploadNewChildPackageUIBean.class); } catch (Throwable t) { - // if any error happens whatsoever, continue processing as if this code didn't exist + // if any error happens whatsoever, continue processing as if this code didn't exist } return null; } @@ -297,9 +297,18 @@ public class ListChildResourcesUIBean extends PagedDataTableUIBean { Pluralizer customPluralizer = new CustomEnglishPluralizer(); Set<String> dupResourceTypeNames = getDuplicateResourceTypeNames(resourceTypes); for (ResourceType resourceType : resourceTypes) { + String resourceTypeName = resourceType.getName(); + String pluralizedName = resourceTypeName; + try { + if (pluralize) + pluralizedName = customPluralizer.pluralize(resourceTypeName); + } + catch (StringIndexOutOfBoundsException oobe) { // Work around a bug in the pluralizer, BZ 594417 + // Just ignore it and take the plain resource type name + } String label = NBSP + " - " - + ((pluralize) ? customPluralizer.pluralize(resourceType.getName()) : resourceType.getName()); - if (dupResourceTypeNames.contains(resourceType.getName())) { + + ((pluralize) ? pluralizedName : resourceTypeName); + if (dupResourceTypeNames.contains(resourceTypeName)) { label += " (" + resourceType.getPlugin() + " plugin)"; } SelectItem selectItem = new SelectItem(resourceType.getId(), label); @@ -312,7 +321,7 @@ public class ListChildResourcesUIBean extends PagedDataTableUIBean { private static Set<String> getDuplicateResourceTypeNames(List<ResourceType> resourceTypes) { Set<String> resourceTypeNames = new HashSet(); Set<String> dupResourceTypeNames = new HashSet(); - for (ResourceType resourceType : resourceTypes) { + for (ResourceType resourceType : resourceTypes) { String resourceTypeName = resourceType.getName(); if (resourceTypeNames.contains(resourceTypeName)) { dupResourceTypeNames.add(resourceTypeName);
commit f5f1c423ba01093412815848b0e7f8d1b1e9f7db Author: John Sanda jsanda@redhat.com Date: Thu May 20 11:25:04 2010 -0400
Removing oracle version numbers from database type dropdown to be consistent with other dbs in list
diff --git a/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ServerProperties.java b/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ServerProperties.java index 9335814..471c1d9 100644 --- a/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ServerProperties.java +++ b/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ServerProperties.java @@ -151,7 +151,7 @@ public class ServerProperties { static { DATABASE_TYPES = new ArrayList<SelectItem>(); DATABASE_TYPES.add(new SelectItem("PostgreSQL", "PostgreSQL")); - DATABASE_TYPES.add(new SelectItem("Oracle10/11", "Oracle 10/11")); + DATABASE_TYPES.add(new SelectItem("Oracle", "Oracle")); DATABASE_TYPES.add(new SelectItem("sqlserver", "MS SQL Server")); DATABASE_TYPES.add(new SelectItem("H2", "H2 (embedded)")); //DATABASE_TYPES.add(new SelectItem("MySQL", "MySQL"));
commit c74e03dfeac5dfdb6ea6e868ac645144e6cf0b64 Author: John Sanda jsanda@redhat.com Date: Thu May 20 11:05:48 2010 -0400
[BZ 581818] Changing oracle label to 10/11 since we don't have implementation differences for the versions
diff --git a/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ServerProperties.java b/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ServerProperties.java index 564fa00..9335814 100644 --- a/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ServerProperties.java +++ b/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ServerProperties.java @@ -151,8 +151,7 @@ public class ServerProperties { static { DATABASE_TYPES = new ArrayList<SelectItem>(); DATABASE_TYPES.add(new SelectItem("PostgreSQL", "PostgreSQL")); - DATABASE_TYPES.add(new SelectItem("Oracle10g", "Oracle 10g")); - DATABASE_TYPES.add(new SelectItem("Oracle11g", "Oracle 11g")); + DATABASE_TYPES.add(new SelectItem("Oracle10/11", "Oracle 10/11")); DATABASE_TYPES.add(new SelectItem("sqlserver", "MS SQL Server")); DATABASE_TYPES.add(new SelectItem("H2", "H2 (embedded)")); //DATABASE_TYPES.add(new SelectItem("MySQL", "MySQL"));
commit 6acdd6946364329324d1e9c6468e4382455e54fb Merge: 8df8d76... 70bf45d... Author: John Sanda jsanda@redhat.com Date: Thu May 20 11:02:52 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 8df8d763d2f2a2f22a92659b75ab1d2c105eba45 Author: John Sanda jsanda@redhat.com Date: Thu May 20 11:00:22 2010 -0400
[BZ 581818] Adding option to select oracle 11g as database type
diff --git a/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ServerProperties.java b/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ServerProperties.java index dbd4940..564fa00 100644 --- a/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ServerProperties.java +++ b/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ServerProperties.java @@ -152,6 +152,7 @@ public class ServerProperties { DATABASE_TYPES = new ArrayList<SelectItem>(); DATABASE_TYPES.add(new SelectItem("PostgreSQL", "PostgreSQL")); DATABASE_TYPES.add(new SelectItem("Oracle10g", "Oracle 10g")); + DATABASE_TYPES.add(new SelectItem("Oracle11g", "Oracle 11g")); DATABASE_TYPES.add(new SelectItem("sqlserver", "MS SQL Server")); DATABASE_TYPES.add(new SelectItem("H2", "H2 (embedded)")); //DATABASE_TYPES.add(new SelectItem("MySQL", "MySQL"));
commit f74a004ddde676436bdc74e7cf39018379aa4c1b Merge: b8beeed... 9f14060... Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 20 10:47:39 2010 -0400
Merge branch 'bundle' into bundle-jay
Conflicts: etc/eclipse-tools/maven/RHQ Maven Build - Agent Only.launch modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java
diff --cc modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java index 0787438,9c7e123..d8621ad --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java @@@ -199,16 -199,7 +199,16 @@@ public class BundleManagerBean implemen return bundle; }
+ @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) - @RequiredPermission(Permission.MANAGE_INVENTORY) ++ @RequiredPermission(Permission.MANAGE_BUNDLE) + public BundleDeployment createBundleDeploymentInNewTrans(Subject subject, int bundleVersionId, + int bundleDestinationId, String name, String description, Configuration configuration) throws Exception { + + return bundleManager.createBundleDeployment(subject, bundleVersionId, bundleDestinationId, name, description, + configuration); + } + - @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public BundleDeployment createBundleDeployment(Subject subject, int bundleVersionId, int bundleDestinationId, String name, String description, Configuration configuration) throws Exception {
@@@ -668,9 -659,9 +668,9 @@@ return scheduleBundleDeploymentImpl(subject, bundleDeploymentId, isCleanDeployment, false); }
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public BundleDeployment scheduleRevertBundleDeployment(Subject subject, int bundleDestinationId, - boolean isCleanDeployment) throws Exception { + String deploymentName, String deploymentDescription, boolean isCleanDeployment) throws Exception {
BundleDeploymentCriteria c = new BundleDeploymentCriteria(); c.addFilterDestinationId(bundleDestinationId);
commit b8beeed721f7ac8618b864738a5a964f2ba59425 Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 20 10:44:17 2010 -0400
LT commit
diff --git a/etc/eclipse-tools/maven/RHQ Maven Build - Agent Only.launch b/etc/eclipse-tools/maven/RHQ Maven Build - Agent Only.launch index dfdf4e3..367a1b3 100644 --- a/etc/eclipse-tools/maven/RHQ Maven Build - Agent Only.launch +++ b/etc/eclipse-tools/maven/RHQ Maven Build - Agent Only.launch @@ -1,11 +1,11 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> -<stringAttribute key="bad_container_name" value="\rhq\etc\eclipse-tools\maven"/> -<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> -</listAttribute> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${env_var:M2_HOME}/bin/${MAVEN_EXE}"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-o -Dmaven.test.skip=true -Dagent install"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/rhq}"/> -</launchConfiguration> +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> +<stringAttribute key="bad_container_name" value="\rhq\etc\eclipse-tools\maven"/> +<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> +<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> +<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> +</listAttribute> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${env_var:M2_HOME}/bin/${MAVEN_EXE}"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-o -Dmaven.test.skip=true -Dagent install"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/rhq}"/> +</launchConfiguration>
commit 70bf45ddde4498b40e67f54ebe410c71156944b0 Author: John Mazzitelli mazz@redhat.com Date: Thu May 20 10:19:16 2010 -0400
provide the agenet with a new command line option: --purgeplugins
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 73064b1..ce49fc4 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 @@ -2014,14 +2014,31 @@ public class AgentMain { }
/** + * This will purge all plugins in the agent's plugin directory. + */ + private void cleanPluginsDirectory() { + try { + File plugins_dir = m_configuration.getPluginContainerConfiguration().getPluginDirectory(); + if (plugins_dir.exists()) { + LOG.info(AgentI18NResourceKeys.CLEANING_PLUGINS_DIRECTORY, plugins_dir.getAbsolutePath()); + cleanFile(plugins_dir); + } + } catch (Exception e) { + LOG.warn(AgentI18NResourceKeys.CLEAN_PLUGINS_FAILURE, e); + } + + return; + } + + /** * This will purge all files in the agent's data directory. */ private void cleanDataDirectory() { try { File data_dir = m_configuration.getDataDirectory(); if (data_dir.exists()) { - LOG.info(AgentI18NResourceKeys.CLEANING_DATA_DIRECTORY, data_dir); - cleanDataFile(data_dir); + LOG.info(AgentI18NResourceKeys.CLEANING_DATA_DIRECTORY, data_dir.getAbsolutePath()); + cleanFile(data_dir); }
// it is concievable the comm services data directory was configured in a different @@ -2029,8 +2046,8 @@ public class AgentMain { File comm_data_dir = m_configuration.getServiceContainerPreferences().getDataDirectory(); if (!comm_data_dir.getAbsolutePath().equals(data_dir.getAbsolutePath())) { if (comm_data_dir.exists()) { - LOG.info(AgentI18NResourceKeys.CLEANING_DATA_DIRECTORY, comm_data_dir); - cleanDataFile(comm_data_dir); + LOG.info(AgentI18NResourceKeys.CLEANING_DATA_DIRECTORY, comm_data_dir.getAbsolutePath()); + cleanFile(comm_data_dir); } } } catch (Exception e) { @@ -2046,18 +2063,18 @@ public class AgentMain { * * @param file the file/directory to delete */ - private void cleanDataFile(File file) { + private void cleanFile(File file) { boolean deleted;
File[] doomed_files = file.listFiles(); if (doomed_files != null) { for (File doomed_file : doomed_files) { - cleanDataFile(doomed_file); // call this method recursively + cleanFile(doomed_file); // call this method recursively } }
deleted = file.delete(); - LOG.debug(AgentI18NResourceKeys.CLEANING_DATA_FILE, file, deleted); + LOG.debug(AgentI18NResourceKeys.CLEANING_FILE, file, deleted);
return; } @@ -2717,11 +2734,13 @@ public class AgentMain { new LongOpt("setup", LongOpt.NO_ARGUMENT, null, 's'), new LongOpt("nostart", LongOpt.NO_ARGUMENT, null, 'n'), new LongOpt("nonative", LongOpt.NO_ARGUMENT, null, 't'), + new LongOpt("purgeplugins", LongOpt.NO_ARGUMENT, null, 'g'), new LongOpt("purgedata", LongOpt.NO_ARGUMENT, null, 'u') };
String config_file_name = null; boolean clean_config = false; boolean purge_data = false; + boolean purge_plugins = false; AgentInputReaderFactory.ConsoleType console_type = null;
Getopt getopt = new Getopt("agent", args, sopts, lopts); @@ -2784,6 +2803,11 @@ public class AgentMain { break; }
+ case 'g': { + purge_plugins = true; + break; + } + case 'a': { m_advancedSetup = true; break; @@ -2876,6 +2900,9 @@ public class AgentMain { if (purge_data) { cleanDataDirectory(); } + if (purge_plugins) { + cleanPluginsDirectory(); + }
LOG.debug(AgentI18NResourceKeys.ARGS_PROCESSED, Arrays.asList(m_commandLineArgs));
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 08d4311..364e060 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 @@ -257,12 +257,18 @@ public interface AgentI18NResourceKeys { @I18NMessage("Agent has been asked to start up clean - cleaning out the data directory: {0}") String CLEANING_DATA_DIRECTORY = "AgentMain.clean-data-dir";
- @I18NMessage("Deleting data file [{0}]. deleted successfully=[{1}]") - String CLEANING_DATA_FILE = "AgentMain.clean-data-file"; + @I18NMessage("Agent has been asked to purge all plugins - cleaning out the plugins directory: {0}") + String CLEANING_PLUGINS_DIRECTORY = "AgentMain.clean-plugins-dir"; + + @I18NMessage("Purging file [{0}]. deleted successfully=[{1}]") + String CLEANING_FILE = "AgentMain.clean-file";
@I18NMessage("A failure occurred while trying to clean the data directory. Cause: {0}") String CLEAN_DATA_DIR_FAILURE = "AgentMain.clean-data-dir-failure";
+ @I18NMessage("A failure occurred while trying to purge the plugins. Cause: {0}") + String CLEAN_PLUGINS_FAILURE = "AgentMain.clean-plugins-failure"; + @I18NMessage("Failed to delete a data file [{0}]") String CLEAN_DATA_FILE_FAILURE = "AgentMain.clean-data-file-failure";
@@ -519,13 +525,13 @@ public interface AgentI18NResourceKeys { @I18NMessage("Neither server auto-detection nor polling is enabled - the client will be allowed to start sending commands immediately, but when the server is offline, be prepared for alot of errors to be logged") String NO_AUTO_DETECT = "AgentMain.no-auto-detect";
- @I18NMessage("Native system info is enabled, but the system info API is not accessible on this platform " + - "(sigar.jar not found in classpath or SIGAR shared library not found in shared library path). " + - "Enable DEBUG logging for more details.") + @I18NMessage("Native system info is enabled, but the system info API is not accessible on this platform " + + "(sigar.jar not found in classpath or SIGAR shared library not found in shared library path). " + + "Enable DEBUG logging for more details.") String NATIVE_SYSINFO_UNAVAILABLE = "AgentMain.native-sysinfo-unavailable";
- @I18NMessage("Native system info is enabled, but the system info API is not accessible on this platform " + - "(sigar.jar not found in classpath or SIGAR shared library not found in shared library path).") + @I18NMessage("Native system info is enabled, but the system info API is not accessible on this platform " + + "(sigar.jar not found in classpath or SIGAR shared library not found in shared library path).") String NATIVE_SYSINFO_UNAVAILABLE_DEBUG = "AgentMain.native-sysinfo-unavailable-debug";
@I18NMessage("The agent encountered an error during startup and must abort") @@ -586,6 +592,7 @@ public interface AgentI18NResourceKeys { + "\ -d, --daemon Agent runs in daemon mode - will not read from stdin for commands\n\\n" + "\ -D<name>[=<value>] Overrides an agent configuration preference and sets a system property\n\\n" + "\ -e, --console=<type> Specifies the implementation to use when reading console input: jline, sigar, java\n\\n" + + "\ -g, --purgeplugins Deletes all plugins, forcing the agent to re-download all of them\n\\n" + "\ -h, --help Shows this help message (default)\n\\n" + "\ -i, --input=<filename> Specifies a script file to be used for input\n\\n" + "\ -l, --cleanconfig Clears out any existing configuration and data files so the agent starts with a totally clean slate\n\\n"
commit b4a0c26509d60caff3fbb7c10c12660cf51edf14 Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 20 10:24:24 2010 -0400
Bundle Revert Work - Added RevertWizard - Added Revert button to BundleDestinationView - Fixed up SLSB logic and remote/ws revert API - Fixed BundleDestination.toString - Fixed typo in findBundlesWithLatestVersionCompositesByCriteria method name - Some cosmetic refactoring to deploy and revert wizards
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java index aac2093..dea011e 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java @@ -223,7 +223,7 @@ public class BundleDestination implements Serializable {
@Override public String toString() { - return "BundleDeployment[id=" + id + ", bundle=" + bundle.getName() + ", group=" + group.getName() + ", name=" + return "BundleDestination[id=" + id + ", bundle=" + bundle.getName() + ", group=" + group.getName() + ", name=" + name + "]"; }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java index 24212fc..815b647 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java @@ -32,7 +32,7 @@ public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard {
// the things we build up in the wizard private Integer bundleId; - private BundleDestination bundleDestination; + private BundleDestination destination; private boolean isNewDestination = false; private BundleVersion bundleVersion; private boolean initialDeployment = false; @@ -109,12 +109,12 @@ public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard { this.initialDeployment = initialDeployment; }
- public BundleDestination getBundleDestination() { - return bundleDestination; + public BundleDestination getDestination() { + return destination; }
- public void setBundleDestination(BundleDestination bundleDestination) { - this.bundleDestination = bundleDestination; + public void setDestination(BundleDestination destination) { + this.destination = destination; }
public Boolean isDeployNow() { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java index 0f6fd21..c471ec6 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java @@ -69,7 +69,7 @@ public class BundleDeployWizard extends AbstractBundleDeployWizard {
this.setInitialDeployment(false); this.setBundleId(destination.getBundle().getId()); - this.setBundleDestination(destination); + this.setDestination(destination);
List<WizardStep> steps = init(); steps.add(new GetDeploymentInfoStep(this)); @@ -142,10 +142,10 @@ public class BundleDeployWizard extends AbstractBundleDeployWizard { }
private void deleteNewDestination() { - if (this.isNewDestination() && (null != this.getBundleDestination())) { + if (this.isNewDestination() && (null != this.getDestination())) { BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService();
- bundleServer.deleteBundleDestination(this.getBundleDestination().getId(), // + bundleServer.deleteBundleDestination(this.getDestination().getId(), // new AsyncCallback<Void>() { public void onSuccess(Void voidReturn) { } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java index aa597b2..52248ab 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java @@ -45,8 +45,8 @@ public class DeployStep implements WizardStep {
private final BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService();
- public DeployStep(BundleDeployWizard bundleCreationWizard) { - this.wizard = bundleCreationWizard; + public DeployStep(BundleDeployWizard wizard) { + this.wizard = wizard; }
public String getName() { @@ -71,7 +71,7 @@ public class DeployStep implements WizardStep { canvas.addMember(deployingImage); canvas.addMember(deployingMessage);
- bundleServer.createBundleDeployment(wizard.getBundleVersion().getId(), wizard.getBundleDestination() + bundleServer.createBundleDeployment(wizard.getBundleVersion().getId(), wizard.getDestination() .getId(), wizard.getNewDeploymentName(), wizard.getNewDeploymentDescription(), wizard .getNewDeploymentConfig(), false, -1, false, // new AsyncCallback<BundleDeployment>() { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java index bd1f394..f3c2281 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java @@ -30,8 +30,8 @@ public class GetDeploymentConfigStep implements WizardStep { private final BundleDeployWizard wizard; private ConfigurationEditor editor;
- public GetDeploymentConfigStep(BundleDeployWizard bundleCreationWizard) { - this.wizard = bundleCreationWizard; + public GetDeploymentConfigStep(BundleDeployWizard wizard) { + this.wizard = wizard; }
public String getName() { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java index f87dee6..5fbe7a1 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java @@ -37,10 +37,8 @@ public class GetDeploymentInfoStep implements WizardStep { private DynamicForm form; private final BundleDeployWizard wizard;
- // private final BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); - - public GetDeploymentInfoStep(BundleDeployWizard bundleDeployWizard) { - this.wizard = bundleDeployWizard; + public GetDeploymentInfoStep(BundleDeployWizard wizard) { + this.wizard = wizard; }
public String getName() { @@ -55,6 +53,7 @@ public class GetDeploymentInfoStep implements WizardStep { form.setColWidths("50%", "*");
final TextItem nameTextItem = new TextItem("name", "Deployment Name"); + nameTextItem.setWidth(300); nameTextItem.setRequired(true); nameTextItem.addChangedHandler(new ChangedHandler() { public void onChanged(ChangedEvent event) { @@ -68,6 +67,7 @@ public class GetDeploymentInfoStep implements WizardStep { });
final TextAreaItem descriptionTextAreaItem = new TextAreaItem("description", "Deployment Description"); + descriptionTextAreaItem.setWidth(300); descriptionTextAreaItem.addChangedHandler(new ChangedHandler() { public void onChanged(ChangedEvent event) { Object value = event.getValue(); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java index 1256135..5f1e6b9 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java @@ -37,8 +37,8 @@ public class GetDeploymentOptionsStep implements WizardStep { private DynamicForm form; private RadioGroupItem rgDeployTimeItem;
- public GetDeploymentOptionsStep(BundleDeployWizard bundleCreationWizard) { - this.wizard = bundleCreationWizard; + public GetDeploymentOptionsStep(BundleDeployWizard wizard) { + this.wizard = wizard; }
public String getName() { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java index 7d988bc..4734122 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java @@ -65,6 +65,7 @@ public class GetDestinationStep implements WizardStep { this.valForm.setColWidths("50%", "*");
final TextItem nameTextItem = new TextItem("name", "Destination Name"); + nameTextItem.setWidth(300); nameTextItem.setRequired(true); nameTextItem.addChangedHandler(new ChangedHandler() { public void onChanged(ChangedEvent event) { @@ -78,6 +79,7 @@ public class GetDestinationStep implements WizardStep { });
final TextAreaItem descriptionTextAreaItem = new TextAreaItem("description", "Destination Description"); + descriptionTextAreaItem.setWidth(300); descriptionTextAreaItem.addChangedHandler(new ChangedHandler() { public void onChanged(ChangedEvent event) { Object value = event.getValue(); @@ -90,6 +92,7 @@ public class GetDestinationStep implements WizardStep {
final TextItem deployDirTextItem = new TextItem("deployDir", "Root Deployment Directory (on destination platforms)"); + deployDirTextItem.setWidth(300); deployDirTextItem.setRequired(true); deployDirTextItem.addChangedHandler(new ChangedHandler() { public void onChanged(ChangedEvent event) { @@ -102,6 +105,7 @@ public class GetDestinationStep implements WizardStep { });
this.selector = new SinglePlatformResourceGroupSelector("group", "Resource Group"); + this.selector.setWidth(300); this.selector.setRequired(true); Validator validator = new IsIntegerValidator(); validator.setErrorMessage("You must select a valid resource group from the drop down"); @@ -131,7 +135,7 @@ public class GetDestinationStep implements WizardStep { this.dest.getDeployDir(), selectedGroup, // new AsyncCallback<BundleDestination>() { public void onSuccess(BundleDestination result) { - wizard.setBundleDestination(result); + wizard.setDestination(result); wizard.setNewDestination(true); CoreGUI.getMessageCenter().notify( new Message("Created destination [" + result.getName() + "] description [" diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java index f038e81..ee64475 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java @@ -34,8 +34,8 @@ public class SelectBundleStep implements WizardStep {
private AbstractSelector<Bundle> selector;
- public SelectBundleStep(BundleDeployWizard bundleCreationWizard) { - this.wizard = bundleCreationWizard; + public SelectBundleStep(BundleDeployWizard wizard) { + this.wizard = wizard; }
public String getName() { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java index 249085b..84bc7b4 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java @@ -56,8 +56,8 @@ public class SelectBundleVersionStep implements WizardStep { private BundleVersion latestVersion; private BundleVersion liveVersion;
- public SelectBundleVersionStep(BundleDeployWizard bundleDeployWizard) { - this.wizard = bundleDeployWizard; + public SelectBundleVersionStep(BundleDeployWizard wizard) { + this.wizard = wizard; }
public String getName() { @@ -134,7 +134,7 @@ public class SelectBundleVersionStep implements WizardStep { }
BundleDeploymentCriteria criteria = new BundleDeploymentCriteria(); - criteria.addFilterDestinationId(wizard.getBundleDestination().getId()); + criteria.addFilterDestinationId(wizard.getDestination().getId()); criteria.addFilterIsLive(true); criteria.fetchBundleVersion(true); criteria.fetchConfiguration(true); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java index abf6ac1..86eef5b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java @@ -51,6 +51,7 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewId; import org.rhq.enterprise.gui.coregui.client.ViewPath; import org.rhq.enterprise.gui.coregui.client.bundle.deploy.BundleDeployWizard; +import org.rhq.enterprise.gui.coregui.client.bundle.revert.BundleRevertWizard; import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel; import org.rhq.enterprise.gui.coregui.client.components.table.Table; import org.rhq.enterprise.gui.coregui.client.components.tagging.TagEditorView; @@ -126,7 +127,7 @@ public class BundleDestinationView extends VLayout implements BookmarkableView { deployments.setShowResizeBar(true); addMember(createDeploymentsTable());
- IButton deployButton = new IButton("Deploy..."); + IButton deployButton = new IButton("Deploy"); deployButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { new BundleDeployWizard(destination).startBundleWizard(); @@ -134,6 +135,14 @@ public class BundleDestinationView extends VLayout implements BookmarkableView { }); addMember(deployButton);
+ IButton revertButton = new IButton("Revert"); + revertButton.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + new BundleRevertWizard(destination).startBundleWizard(); + } + }); + addMember(revertButton); + detail = new Canvas(); detail.setHeight("50%"); detail.hide(); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java index 9f8b106..99261ba 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java @@ -65,7 +65,7 @@ public class BundlesWithLatestVersionDataSource extends RPCDataSource<BundleWith BundleCriteria criteria = new BundleCriteria(); criteria.setPageControl(getPageControl(request));
- bundleService.findBundlesWithLastestVersionCompositesByCriteria(criteria, + bundleService.findBundlesWithLatestVersionCompositesByCriteria(criteria, new AsyncCallback<PageList<BundleWithLatestVersionComposite>>() { public void onFailure(Throwable caught) { CoreGUI.getErrorHandler().handleError("Failed to load bundle-with-latest-version data", caught); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/AbstractBundleRevertWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/AbstractBundleRevertWizard.java new file mode 100644 index 0000000..05f8f96 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/AbstractBundleRevertWizard.java @@ -0,0 +1,95 @@ +/* + * 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.bundle.revert; + +import org.rhq.core.domain.bundle.BundleDeployment; +import org.rhq.core.domain.bundle.BundleDestination; +import org.rhq.enterprise.gui.coregui.client.bundle.AbstractBundleWizard; + +/** + * @author Jay Shaughnessy + * + */ +public abstract class AbstractBundleRevertWizard extends AbstractBundleWizard { + + // the things we build up in the wizard + private BundleDestination destination; + private String deploymentName; + private String deploymentDescription; + private BundleDeployment deployment; + private boolean isCleanDeployment = false; + private BundleDeployment liveDeployment; + private BundleDeployment previousDeployment; + + public String getDeploymentName() { + return deploymentName; + } + + public void setDeploymentName(String deploymentName) { + this.deploymentName = deploymentName; + } + + public String getDeploymentDescription() { + return deploymentDescription; + } + + public void setDeploymentDescription(String deploymentDescription) { + this.deploymentDescription = deploymentDescription; + } + + public BundleDeployment getDeployment() { + return deployment; + } + + public void setDeployment(BundleDeployment deployment) { + this.deployment = deployment; + } + + public BundleDeployment getLiveDeployment() { + return liveDeployment; + } + + public void setLiveDeployment(BundleDeployment liveDeployment) { + this.liveDeployment = liveDeployment; + } + + public BundleDeployment getPreviousDeployment() { + return previousDeployment; + } + + public void setPreviousDeployment(BundleDeployment previousDeployment) { + this.previousDeployment = previousDeployment; + } + + public BundleDestination getDestination() { + return destination; + } + + public void setDestination(BundleDestination destination) { + this.destination = destination; + } + + public boolean isCleanDeployment() { + return isCleanDeployment; + } + + public void setCleanDeployment(boolean isCleanDeployment) { + this.isCleanDeployment = isCleanDeployment; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/BundleRevertWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/BundleRevertWizard.java new file mode 100644 index 0000000..df169ba --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/BundleRevertWizard.java @@ -0,0 +1,58 @@ +/* + * 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.bundle.revert; + +import java.util.ArrayList; +import java.util.List; + +import org.rhq.core.domain.bundle.BundleDestination; +import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; + +public class BundleRevertWizard extends AbstractBundleRevertWizard { + + // Revert existing destination + public BundleRevertWizard(BundleDestination destination) { + if (null == destination) { + throw new IllegalArgumentException("destination is null"); + } + + this.setDestination(destination); + + List<WizardStep> steps = init(); + steps.add(new ConfirmationStep(this)); + steps.add(new GetRevertInfoStep(this)); + steps.add(new RevertStep(this)); + } + + private List<WizardStep> init() { + setWindowTitle("Bundle Revert Wizard"); + setTitle("Bundle Revert"); + + ArrayList<WizardStep> steps = new ArrayList<WizardStep>(); + setSteps(steps); + return steps; + } + + public void cancel() { + // nothing to do, this wizard does not create any entities prior to the scheduleRevert call. The + // BundleDeployment returned in the revert step is already in progress and must be further handled + // only by the GUI. + return; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java new file mode 100644 index 0000000..47be5ce --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java @@ -0,0 +1,170 @@ +/* + * 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.bundle.revert; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.types.Alignment; +import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.Label; +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.StaticTextItem; +import com.smartgwt.client.widgets.layout.VLayout; + +import org.rhq.core.domain.bundle.BundleDeployment; +import org.rhq.core.domain.criteria.BundleDeploymentCriteria; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; + +/** + * @author Jay Shaughnessy + * + */ +public class ConfirmationStep implements WizardStep { + + private VLayout layout; + private final BundleRevertWizard wizard; + private final BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); + + public ConfirmationStep(BundleRevertWizard wizard) { + this.wizard = wizard; + } + + public String getName() { + return "Revert Deployment Confirmation"; + } + + public Canvas getCanvas() { + if (layout == null) { + layout = new VLayout(10); + + BundleDeploymentCriteria c = new BundleDeploymentCriteria(); + c.addFilterDestinationId(this.wizard.getDestination().getId()); + c.addFilterIsLive(true); + c.fetchReplacedBundleDeployment(true); + c.fetchBundleVersion(true); + bundleServer.findBundleDeploymentsByCriteria(c, // + new AsyncCallback<PageList<BundleDeployment>>() { + public void onSuccess(PageList<BundleDeployment> liveDeployments) { + if (1 != liveDeployments.size()) { + throw new IllegalArgumentException("No live deployment found for destination [" + + wizard.getDestination() + "]"); + } + wizard.setLiveDeployment(liveDeployments.get(0)); + wizard.setPreviousDeployment(wizard.getLiveDeployment().getReplacedBundleDeployment()); + if (null == wizard.getPreviousDeployment()) { + throw new IllegalArgumentException("Live deployment [" + wizard.getLiveDeployment() + + "] can not be reverted. There is no prior deployment for the destination [" + + wizard.getDestination() + "]"); + } + + setLayout(); + } + + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError( + "Failed to find live deployment, can not revert: " + caught.getMessage(), caught); + } + }); + } + + return layout; + } + + private void setLayout() { + + BundleDeployment live = this.wizard.getLiveDeployment(); + BundleDeployment prev = this.wizard.getPreviousDeployment(); + + Label liveHeader = new Label(); + liveHeader.setContents("<b>Live Deployment:<b>"); + liveHeader.setHeight(10); + liveHeader.setWidth100(); + layout.addMember(liveHeader); + + DynamicForm liveForm = new DynamicForm(); + liveForm.setNumCols(2); + + StaticTextItem liveNameItem = new StaticTextItem("liveName", "Name"); + liveNameItem.setTitleAlign(Alignment.LEFT); + liveNameItem.setAlign(Alignment.LEFT); + liveNameItem.setWrap(false); + liveNameItem.setValue(live.getName()); + liveNameItem.setLeft(20); + + StaticTextItem liveDescItem = new StaticTextItem("liveDesc", "Description"); + liveDescItem.setTitleAlign(Alignment.LEFT); + liveDescItem.setAlign(Alignment.LEFT); + liveDescItem.setWrap(false); + liveDescItem.setValue((null != live.getName()) ? live.getName() : "none"); + + StaticTextItem liveVersionItem = new StaticTextItem("liveVersion", "Bundle Version"); + liveVersionItem.setTitleAlign(Alignment.LEFT); + liveVersionItem.setAlign(Alignment.LEFT); + liveVersionItem.setWrap(false); + liveVersionItem.setValue(live.getBundleVersion().getVersion()); + + liveForm.setItems(liveNameItem, liveDescItem, liveVersionItem); + layout.addMember(liveForm); + + Label prevHeader = new Label(); + prevHeader.setContents("<b>Previous Deployment:</b>"); + prevHeader.setHeight(20); + prevHeader.setWidth100(); + layout.addMember(prevHeader); + + DynamicForm prevForm = new DynamicForm(); + prevForm.setNumCols(2); + + StaticTextItem prevNameItem = new StaticTextItem("prevName", "Name"); + prevNameItem.setTitleAlign(Alignment.LEFT); + prevNameItem.setAlign(Alignment.LEFT); + prevNameItem.setWrap(false); + prevNameItem.setValue(prev.getName()); + + StaticTextItem prevDescItem = new StaticTextItem("prevDesc", "Description"); + prevDescItem.setTitleAlign(Alignment.LEFT); + prevDescItem.setAlign(Alignment.LEFT); + prevDescItem.setWrap(false); + prevDescItem.setValue((null != prev.getName()) ? prev.getName() : "none"); + + StaticTextItem prevVersionItem = new StaticTextItem("prevVersion", "Bundle Version"); + prevVersionItem.setTitleAlign(Alignment.LEFT); + prevVersionItem.setAlign(Alignment.LEFT); + prevVersionItem.setWrap(false); + prevVersionItem.setValue(prev.getBundleVersion().getVersion()); + + prevForm.setItems(prevNameItem, prevDescItem, prevVersionItem); + layout.addMember(prevForm); + + Label confirmation = new Label(); + confirmation + .setContents("<b>Reverting Live Deployment to Previous Deployment. Click 'Next' to continue...</b>"); + confirmation.setMargin(20); + confirmation.setWidth100(); + layout.addMember(confirmation); + + } + + public boolean nextPage() { + return true; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java new file mode 100644 index 0000000..f4ecf09 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java @@ -0,0 +1,108 @@ +/* + * 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.bundle.revert; + +import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.CheckboxItem; +import com.smartgwt.client.widgets.form.fields.TextAreaItem; +import com.smartgwt.client.widgets.form.fields.TextItem; +import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; +import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; + +import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; + +/** + * @author Jay Shaughnessy + * + */ +public class GetRevertInfoStep implements WizardStep { + + private DynamicForm form; + private final BundleRevertWizard wizard; + + public GetRevertInfoStep(BundleRevertWizard wizard) { + this.wizard = wizard; + } + + public String getName() { + return "Provide Revert Information"; + } + + public Canvas getCanvas() { + if (form == null) { + form = new DynamicForm(); + form.setWidth100(); + form.setNumCols(2); + form.setColWidths("50%", "*"); + + final TextItem nameTextItem = new TextItem("name", "Revert Deployment Name"); + nameTextItem.setRequired(true); + nameTextItem.setWidth(300); + wizard.setDeploymentName("[Reverted] " + this.wizard.getPreviousDeployment().getName()); + nameTextItem.setValue(wizard.getDeploymentName()); + nameTextItem.addChangedHandler(new ChangedHandler() { + public void onChanged(ChangedEvent event) { + Object value = event.getValue(); + if (value == null) { + value = ""; + } + wizard.setSubtitle(value.toString()); + wizard.setDeploymentName(value.toString()); + } + }); + + final TextAreaItem descriptionTextAreaItem = new TextAreaItem("description", + "revert Deployment Description"); + descriptionTextAreaItem.setWidth(300); + String liveDesc = this.wizard.getLiveDeployment().getDescription(); + liveDesc = (null == liveDesc) ? this.wizard.getLiveDeployment().getName() : liveDesc; + String prevDesc = this.wizard.getPreviousDeployment().getDescription(); + prevDesc = (null == prevDesc) ? this.wizard.getPreviousDeployment().getName() : prevDesc; + wizard.setDeploymentDescription("[Reverted From]\n" + liveDesc + "\n\n[Reverted To]\n" + prevDesc); + descriptionTextAreaItem.setValue(wizard.getDeploymentDescription()); + descriptionTextAreaItem.addChangedHandler(new ChangedHandler() { + public void onChanged(ChangedEvent event) { + Object value = event.getValue(); + if (value == null) { + value = ""; + } + wizard.setDeploymentDescription(value.toString()); + } + }); + + final CheckboxItem cleanDeploymentCBItem = new CheckboxItem("cleanDeployment", + "Clean Deployment? (wipe deploy directory prior to the revert deploy)"); + cleanDeploymentCBItem.setValue(wizard.isCleanDeployment()); + cleanDeploymentCBItem.addChangedHandler(new ChangedHandler() { + public void onChanged(ChangedEvent event) { + wizard.setCleanDeployment((Boolean) event.getValue()); + } + }); + + form.setItems(nameTextItem, descriptionTextAreaItem, cleanDeploymentCBItem); + } + + return form; + } + + public boolean nextPage() { + return form.validate(); + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/RevertStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/RevertStep.java new file mode 100644 index 0000000..6388ac8 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/RevertStep.java @@ -0,0 +1,101 @@ +/* + * 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.bundle.revert; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.HasHorizontalAlignment; +import com.google.gwt.user.client.ui.Label; +import com.smartgwt.client.types.Alignment; +import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.Img; +import com.smartgwt.client.widgets.layout.VLayout; + +import org.rhq.core.domain.bundle.BundleDeployment; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.util.message.Message; +import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity; + +/** + * @author Jay Shaughnessy + * + */ +public class RevertStep implements WizardStep { + + private VLayout canvas; + private final BundleRevertWizard wizard; + + private final BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); + + public RevertStep(BundleRevertWizard wizard) { + this.wizard = wizard; + } + + public String getName() { + return "Deploy Bundle to Destination Platforms"; + } + + public Canvas getCanvas() { + if (canvas == null) { + canvas = new VLayout(); + canvas.setWidth100(); + canvas.setHeight100(); + canvas.setAlign(Alignment.CENTER); + + final Img deployingImage = new Img("/images/status-bar.gif"); + deployingImage.setLayoutAlign(Alignment.CENTER); + deployingImage.setWidth(50); + deployingImage.setHeight(15); + + final Label deployingMessage = new Label("Reverting..."); + deployingMessage.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); + + canvas.addMember(deployingImage); + canvas.addMember(deployingMessage); + + bundleServer.scheduleRevertBundleDeployment(this.wizard.getDestination().getId(), this.wizard + .getDeploymentName(), this.wizard.getDeploymentDescription(), this.wizard.isCleanDeployment(), // + new AsyncCallback<BundleDeployment>() { + public void onSuccess(BundleDeployment result) { + deployingImage.setSrc("/images/status_complete.gif"); + deployingMessage.setText("Revert Deployment Scheduled!"); + CoreGUI.getMessageCenter().notify( + new Message("Scheduled revert bundle deployment [" + wizard.getDeploymentName() + + "] resource group [" + result.getDestination().getGroup() + "]", Severity.Info)); + wizard.setDeployment(result); + } + + public void onFailure(Throwable caught) { + deployingImage.setSrc("/images/status_error.gif"); + deployingMessage.setText("Failed to Schedule Revert Deployment!"); + CoreGUI.getErrorHandler().handleError( + "Failed to schedule revert deployment: " + caught.getMessage(), caught); + } + }); + } + + return canvas; + } + + public boolean nextPage() { + return true; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java index 8cc4ac9..11b6851 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java @@ -42,6 +42,8 @@ import org.rhq.core.domain.util.PageList;
public interface BundleGWTService extends RemoteService {
+ BundleVersion createBundleVersion(int bundleId, String name, String version, String recipe) throws Exception; + BundleVersion createBundleVersionViaURL(String url) throws Exception;
BundleVersion createBundleVersionViaRecipe(String recipe) throws Exception; @@ -53,8 +55,6 @@ public interface BundleGWTService extends RemoteService { BundleDestination createBundleDestination(int bundleId, String name, String description, String deployDir, int groupId) throws Exception;
- BundleVersion createBundleVersion(int bundleId, String name, String version, String recipe) throws Exception; - void deleteBundle(int bundleId) throws Exception;
void deleteBundleDeployment(int bundleDeploymentId) throws Exception; @@ -65,9 +65,17 @@ public interface BundleGWTService extends RemoteService {
PageList<Bundle> findBundlesByCriteria(BundleCriteria criteria) throws Exception;
+ PageList<BundleDeployment> findBundleDeploymentsByCriteria(BundleDeploymentCriteria criteria); + + PageList<BundleDestination> findBundleDestinationsByCriteria(BundleDestinationCriteria criteria); + + PageList<BundleFile> findBundleFilesByCriteria(BundleFileCriteria criteria); + + PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria(BundleResourceDeploymentCriteria criteria); + PageList<BundleVersion> findBundleVersionsByCriteria(BundleVersionCriteria criteria) throws Exception;
- PageList<BundleWithLatestVersionComposite> findBundlesWithLastestVersionCompositesByCriteria(BundleCriteria criteria) + PageList<BundleWithLatestVersionComposite> findBundlesWithLatestVersionCompositesByCriteria(BundleCriteria criteria) throws Exception;
HashMap<String, Boolean> getAllBundleVersionFilenames(int bundleVersionId) throws Exception; @@ -76,11 +84,7 @@ public interface BundleGWTService extends RemoteService {
BundleDeployment scheduleBundleDeployment(int bundleDeploymentId, boolean isCleanDeployment) throws Exception;
- PageList<BundleDeployment> findBundleDeploymentsByCriteria(BundleDeploymentCriteria criteria); + BundleDeployment scheduleRevertBundleDeployment(int bundleDestinationId, String deploymentName, + String deploymentDescription, boolean isCleanDeployment) throws Exception;
- PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria(BundleResourceDeploymentCriteria criteria); - - PageList<BundleDestination> findBundleDestinationsByCriteria(BundleDestinationCriteria criteria); - - PageList<BundleFile> findBundleFilesByCriteria(BundleFileCriteria criteria); -} +} \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java index bbf43a7..43103a5 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java @@ -155,12 +155,12 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund } }
- public PageList<BundleWithLatestVersionComposite> findBundlesWithLastestVersionCompositesByCriteria( + public PageList<BundleWithLatestVersionComposite> findBundlesWithLatestVersionCompositesByCriteria( BundleCriteria criteria) throws Exception { try { PageList<BundleWithLatestVersionComposite> results; results = bundleManager.findBundlesWithLatestVersionCompositesByCriteria(getSessionSubject(), criteria); - return SerialUtility.prepare(results, "findBundlesWithLastestVersionCompositesByCriteria"); + return SerialUtility.prepare(results, "findBundlesWithLatestVersionCompositesByCriteria"); } catch (Exception e) { throw new RuntimeException(ThrowableUtil.getAllMessages(e)); } @@ -197,6 +197,17 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund } }
+ public BundleDeployment scheduleRevertBundleDeployment(int bundleDeploymentId, String deploymentName, + String deploymentDescription, boolean isCleanDeployment) throws Exception { + try { + BundleDeployment result = bundleManager.scheduleRevertBundleDeployment(getSessionSubject(), + bundleDeploymentId, deploymentName, deploymentDescription, isCleanDeployment); + return SerialUtility.prepare(result, "scheduleBundleDeployment"); + } catch (Exception e) { + throw new RuntimeException(ThrowableUtil.getAllMessages(e)); + } + } + public PageList<BundleDeployment> findBundleDeploymentsByCriteria(BundleDeploymentCriteria criteria) { return SerialUtility.prepare(bundleManager.findBundleDeploymentsByCriteria(getSessionSubject(), criteria), "BundleService.findBundleDeploymentsByCriteria"); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java index d0569d0..0787438 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java @@ -199,6 +199,15 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot return bundle; }
+ @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) + @RequiredPermission(Permission.MANAGE_INVENTORY) + public BundleDeployment createBundleDeploymentInNewTrans(Subject subject, int bundleVersionId, + int bundleDestinationId, String name, String description, Configuration configuration) throws Exception { + + return bundleManager.createBundleDeployment(subject, bundleVersionId, bundleDestinationId, name, description, + configuration); + } + @RequiredPermission(Permission.MANAGE_INVENTORY) public BundleDeployment createBundleDeployment(Subject subject, int bundleVersionId, int bundleDestinationId, String name, String description, Configuration configuration) throws Exception { @@ -661,7 +670,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot
@RequiredPermission(Permission.MANAGE_INVENTORY) public BundleDeployment scheduleRevertBundleDeployment(Subject subject, int bundleDestinationId, - boolean isCleanDeployment) throws Exception { + String deploymentName, String deploymentDescription, boolean isCleanDeployment) throws Exception {
BundleDeploymentCriteria c = new BundleDeploymentCriteria(); c.addFilterDestinationId(bundleDestinationId); @@ -673,13 +682,34 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot + "]"); } BundleDeployment liveDeployment = liveDeployments.get(0); - if (null == liveDeployment.getReplacedBundleDeployment()) { + BundleDeployment prevDeployment = liveDeployment.getReplacedBundleDeployment(); + if (null == prevDeployment) { + throw new IllegalArgumentException( + "Live deployment [" + + liveDeployment + + "] can not be reverted. The Live deployment is either an initial deployment or a reverted deployment for destinationId [" + + bundleDestinationId + "]"); + } + prevDeployment = entityManager.find(BundleDeployment.class, prevDeployment.getId()); + if (null == prevDeployment) { throw new IllegalArgumentException("Live deployment [" + liveDeployment + "] can not be reverted. There is no prior deployment for destinationId [" + bundleDestinationId + "]"); }
- return scheduleBundleDeploymentImpl(subject, liveDeployment.getReplacedBundleDeployment().getId(), - isCleanDeployment, true); + // A revert is done by deploying a new deployment that mirrors "prevDeployment". It uses the same + // bundleVersion, destination and config as prevDeployment. It can have a new name and new desc, and + // may opt to clean the deploy dir. It must be a new deployment so that all status/auditing/history starts + // fresh and can be tracked. The key difference in the schedule request is that we set isRevert=true, + // tell the bundle handler that we are in fact reverting from the current live deployment. The + // deployment creation is done in a new transaction so it can then be scheduled. + String name = (null != deploymentName) ? deploymentName : prevDeployment.getName(); + String desc = (null != deploymentDescription) ? deploymentDescription : prevDeployment.getDescription(); + Configuration config = (null == prevDeployment.getConfiguration()) ? null : prevDeployment.getConfiguration() + .deepCopy(false); + BundleDeployment revertDeployment = bundleManager.createBundleDeploymentInNewTrans(subject, prevDeployment + .getBundleVersion().getId(), bundleDestinationId, name, desc, config); + + return scheduleBundleDeploymentImpl(subject, revertDeployment.getId(), isCleanDeployment, true); }
private BundleDeployment scheduleBundleDeploymentImpl(Subject subject, int bundleDeploymentId, @@ -717,7 +747,10 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot for (BundleDeployment d : currentDeployments) { if (d.isLive()) { d.setLive(false); - newDeployment.setReplacedBundleDeployment(d); + // you can not revert a revert, it does not logically replace anything, it is + if (!isRevert) { + newDeployment.setReplacedBundleDeployment(d); + } break; } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerLocal.java index ed4d89e..a5937b4 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerLocal.java @@ -25,11 +25,13 @@ import javax.ejb.Local; import org.rhq.core.clientapi.agent.bundle.BundleScheduleRequest; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.bundle.Bundle; +import org.rhq.core.domain.bundle.BundleDeployment; import org.rhq.core.domain.bundle.BundleDeploymentStatus; import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleResourceDeploymentHistory; import org.rhq.core.domain.bundle.BundleType; import org.rhq.core.domain.bundle.BundleVersion; +import org.rhq.core.domain.configuration.Configuration;
/** * Local interface to the manager responsible for creating and managing bundles. @@ -120,6 +122,14 @@ public interface BundleManagerLocal extends BundleManagerRemote { BundleResourceDeployment createBundleResourceDeployment(Subject subject, int bundleDeploymentId, int resourceId) throws Exception;
+ /** + * Equivalent to a all to {@link BundleManagerRemote#createBundleDeployment(Subject, int, int, String, String, Configuration)} + * with different transaction semantics. Useful when an slsb method needs to both create a deployment and schedules + * it prior to returning to an external caller. + */ + public BundleDeployment createBundleDeploymentInNewTrans(Subject subject, int bundleVersionId, + int bundleDestinationId, String name, String description, Configuration configuration) throws Exception; + // added here because the same method in @Remote was commented out to bypass a WSProvide issue HashMap<String, Boolean> getAllBundleVersionFilenames(Subject subject, int bundleVersionId) throws Exception;
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java index 7ca582f..03d6297 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java @@ -343,6 +343,10 @@ public interface BundleManagerRemote { * TODO: Add the scheduling capability, currently it's Immediate. * <br/> * @param subject user that must have proper permissions + * @param deploymentName a name for this revert deployment. If null defaults to the name of the previous + * deployment. + * @param deploymentDescription an optional longer description describing this deployment. If null defaults + * to the description of the previous deployment. * @param isCleanDeployment if true perform a wipe of the deploy directory prior to the revert deployment. Backed up * files will still be applied. If false perform as an upgrade to the existing deployment. * @return the BundleDeployment record, updated with status and (resource) deployments. @@ -351,7 +355,9 @@ public interface BundleManagerRemote { @WebMethod BundleDeployment scheduleRevertBundleDeployment( // @WebParam(name = "subject") Subject subject, // - @WebParam(name = "bundleDestinationId") int bundleDestinationId, // + @WebParam(name = "bundleDestinationId") int bundleDestinationId, // + @WebParam(name = "deploymentName") String deploymentName, // + @WebParam(name = "deploymentDescription") String deploymentDescription, // @WebParam(name = "isCleanDeployment") boolean isCleanDeployment) throws Exception;
} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java index c0ab193..d336e87 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java @@ -421,8 +421,9 @@ public class WebservicesManagerBean implements WebservicesRemote { }
public BundleDeployment scheduleRevertBundleDeployment(Subject subject, int bundleDestinationId, - boolean isCleanDeployment) throws Exception { - return bundleManager.scheduleRevertBundleDeployment(subject, bundleDestinationId, isCleanDeployment); + String deploymentName, String deploymentDescription, boolean isCleanDeployment) throws Exception { + return bundleManager.scheduleRevertBundleDeployment(subject, bundleDestinationId, deploymentName, + deploymentDescription, isCleanDeployment); }
//BUNDLEMANAGER: END ----------------------------------
commit 4032368d454183ddf7324676b9636699021d86dd Author: John Mazzitelli mazz@redhat.com Date: Thu May 20 10:19:16 2010 -0400
provide the agenet with a new command line option: --purgeplugins
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 73064b1..ce49fc4 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 @@ -2014,14 +2014,31 @@ public class AgentMain { }
/** + * This will purge all plugins in the agent's plugin directory. + */ + private void cleanPluginsDirectory() { + try { + File plugins_dir = m_configuration.getPluginContainerConfiguration().getPluginDirectory(); + if (plugins_dir.exists()) { + LOG.info(AgentI18NResourceKeys.CLEANING_PLUGINS_DIRECTORY, plugins_dir.getAbsolutePath()); + cleanFile(plugins_dir); + } + } catch (Exception e) { + LOG.warn(AgentI18NResourceKeys.CLEAN_PLUGINS_FAILURE, e); + } + + return; + } + + /** * This will purge all files in the agent's data directory. */ private void cleanDataDirectory() { try { File data_dir = m_configuration.getDataDirectory(); if (data_dir.exists()) { - LOG.info(AgentI18NResourceKeys.CLEANING_DATA_DIRECTORY, data_dir); - cleanDataFile(data_dir); + LOG.info(AgentI18NResourceKeys.CLEANING_DATA_DIRECTORY, data_dir.getAbsolutePath()); + cleanFile(data_dir); }
// it is concievable the comm services data directory was configured in a different @@ -2029,8 +2046,8 @@ public class AgentMain { File comm_data_dir = m_configuration.getServiceContainerPreferences().getDataDirectory(); if (!comm_data_dir.getAbsolutePath().equals(data_dir.getAbsolutePath())) { if (comm_data_dir.exists()) { - LOG.info(AgentI18NResourceKeys.CLEANING_DATA_DIRECTORY, comm_data_dir); - cleanDataFile(comm_data_dir); + LOG.info(AgentI18NResourceKeys.CLEANING_DATA_DIRECTORY, comm_data_dir.getAbsolutePath()); + cleanFile(comm_data_dir); } } } catch (Exception e) { @@ -2046,18 +2063,18 @@ public class AgentMain { * * @param file the file/directory to delete */ - private void cleanDataFile(File file) { + private void cleanFile(File file) { boolean deleted;
File[] doomed_files = file.listFiles(); if (doomed_files != null) { for (File doomed_file : doomed_files) { - cleanDataFile(doomed_file); // call this method recursively + cleanFile(doomed_file); // call this method recursively } }
deleted = file.delete(); - LOG.debug(AgentI18NResourceKeys.CLEANING_DATA_FILE, file, deleted); + LOG.debug(AgentI18NResourceKeys.CLEANING_FILE, file, deleted);
return; } @@ -2717,11 +2734,13 @@ public class AgentMain { new LongOpt("setup", LongOpt.NO_ARGUMENT, null, 's'), new LongOpt("nostart", LongOpt.NO_ARGUMENT, null, 'n'), new LongOpt("nonative", LongOpt.NO_ARGUMENT, null, 't'), + new LongOpt("purgeplugins", LongOpt.NO_ARGUMENT, null, 'g'), new LongOpt("purgedata", LongOpt.NO_ARGUMENT, null, 'u') };
String config_file_name = null; boolean clean_config = false; boolean purge_data = false; + boolean purge_plugins = false; AgentInputReaderFactory.ConsoleType console_type = null;
Getopt getopt = new Getopt("agent", args, sopts, lopts); @@ -2784,6 +2803,11 @@ public class AgentMain { break; }
+ case 'g': { + purge_plugins = true; + break; + } + case 'a': { m_advancedSetup = true; break; @@ -2876,6 +2900,9 @@ public class AgentMain { if (purge_data) { cleanDataDirectory(); } + if (purge_plugins) { + cleanPluginsDirectory(); + }
LOG.debug(AgentI18NResourceKeys.ARGS_PROCESSED, Arrays.asList(m_commandLineArgs));
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 08d4311..364e060 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 @@ -257,12 +257,18 @@ public interface AgentI18NResourceKeys { @I18NMessage("Agent has been asked to start up clean - cleaning out the data directory: {0}") String CLEANING_DATA_DIRECTORY = "AgentMain.clean-data-dir";
- @I18NMessage("Deleting data file [{0}]. deleted successfully=[{1}]") - String CLEANING_DATA_FILE = "AgentMain.clean-data-file"; + @I18NMessage("Agent has been asked to purge all plugins - cleaning out the plugins directory: {0}") + String CLEANING_PLUGINS_DIRECTORY = "AgentMain.clean-plugins-dir"; + + @I18NMessage("Purging file [{0}]. deleted successfully=[{1}]") + String CLEANING_FILE = "AgentMain.clean-file";
@I18NMessage("A failure occurred while trying to clean the data directory. Cause: {0}") String CLEAN_DATA_DIR_FAILURE = "AgentMain.clean-data-dir-failure";
+ @I18NMessage("A failure occurred while trying to purge the plugins. Cause: {0}") + String CLEAN_PLUGINS_FAILURE = "AgentMain.clean-plugins-failure"; + @I18NMessage("Failed to delete a data file [{0}]") String CLEAN_DATA_FILE_FAILURE = "AgentMain.clean-data-file-failure";
@@ -519,13 +525,13 @@ public interface AgentI18NResourceKeys { @I18NMessage("Neither server auto-detection nor polling is enabled - the client will be allowed to start sending commands immediately, but when the server is offline, be prepared for alot of errors to be logged") String NO_AUTO_DETECT = "AgentMain.no-auto-detect";
- @I18NMessage("Native system info is enabled, but the system info API is not accessible on this platform " + - "(sigar.jar not found in classpath or SIGAR shared library not found in shared library path). " + - "Enable DEBUG logging for more details.") + @I18NMessage("Native system info is enabled, but the system info API is not accessible on this platform " + + "(sigar.jar not found in classpath or SIGAR shared library not found in shared library path). " + + "Enable DEBUG logging for more details.") String NATIVE_SYSINFO_UNAVAILABLE = "AgentMain.native-sysinfo-unavailable";
- @I18NMessage("Native system info is enabled, but the system info API is not accessible on this platform " + - "(sigar.jar not found in classpath or SIGAR shared library not found in shared library path).") + @I18NMessage("Native system info is enabled, but the system info API is not accessible on this platform " + + "(sigar.jar not found in classpath or SIGAR shared library not found in shared library path).") String NATIVE_SYSINFO_UNAVAILABLE_DEBUG = "AgentMain.native-sysinfo-unavailable-debug";
@I18NMessage("The agent encountered an error during startup and must abort") @@ -586,6 +592,7 @@ public interface AgentI18NResourceKeys { + "\ -d, --daemon Agent runs in daemon mode - will not read from stdin for commands\n\\n" + "\ -D<name>[=<value>] Overrides an agent configuration preference and sets a system property\n\\n" + "\ -e, --console=<type> Specifies the implementation to use when reading console input: jline, sigar, java\n\\n" + + "\ -g, --purgeplugins Deletes all plugins, forcing the agent to re-download all of them\n\\n" + "\ -h, --help Shows this help message (default)\n\\n" + "\ -i, --input=<filename> Specifies a script file to be used for input\n\\n" + "\ -l, --cleanconfig Clears out any existing configuration and data files so the agent starts with a totally clean slate\n\\n"
commit 9f1406018d40b362b78b01fc0e7293c913a387fe Author: John Mazzitelli mazz@redhat.com Date: Wed May 19 16:55:40 2010 -0400
changed all MANAGE_INVENTORY required perms to MANAGE_BUNDLE - this is probalby not 100% what we want - we probably want some to use this global perm but others we might want to restrict to the resource perm CONTENT. But for now, everywhere we had MANAGE_INVENTORY is now MANAGE_BUNDLE
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java index d0569d0..9c7e123 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java @@ -143,7 +143,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot private ResourceGroupManagerLocal resourceGroupManager;
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) - @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public BundleResourceDeploymentHistory addBundleResourceDeploymentHistory(Subject subject, int bundleDeploymentId, BundleResourceDeploymentHistory history) throws Exception {
@@ -159,7 +159,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot return history; }
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public Bundle createBundle(Subject subject, String name, String description, int bundleTypeId) throws Exception { if (null == name || "".equals(name.trim())) { throw new IllegalArgumentException("Invalid bundleName: " + name); @@ -199,7 +199,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot return bundle; }
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public BundleDeployment createBundleDeployment(Subject subject, int bundleVersionId, int bundleDestinationId, String name, String description, Configuration configuration) throws Exception {
@@ -235,7 +235,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot return deployment; }
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public BundleDestination createBundleDestination(Subject subject, int bundleId, String name, String description, String deployDir, Integer groupId) throws Exception {
@@ -262,7 +262,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot return dest; }
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public BundleType createBundleType(Subject subject, String name, int resourceTypeId) throws Exception { if (null == name || "".equals(name.trim())) { throw new IllegalArgumentException("Invalid bundleTypeName: " + name); @@ -278,7 +278,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot return bundleType; }
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public BundleVersion createBundleAndBundleVersion(Subject subject, String bundleName, String bundleDescription, int bundleTypeId, String bundleVersionName, String bundleVersionDescription, String version, String recipe) throws Exception { @@ -302,7 +302,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot }
@SuppressWarnings("unchecked") - @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public BundleVersion createBundleVersion(Subject subject, int bundleId, String name, String description, String version, String recipe) throws Exception { if (null == name || "".equals(name.trim())) { @@ -371,7 +371,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot return bundleVersion; }
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public BundleVersion createBundleVersionViaRecipe(Subject subject, String recipe) throws Exception {
BundleServerPluginManager manager = BundleManagerHelper.getPluginContainer().getBundleServerPluginManager(); @@ -381,7 +381,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot return bundleVersion; }
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) @TransactionAttribute(TransactionAttributeType.NEVER) public BundleVersion createBundleVersionViaFile(Subject subject, File distributionFile) throws Exception {
@@ -392,7 +392,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot return bundleVersion; }
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) @TransactionAttribute(TransactionAttributeType.NEVER) public BundleVersion createBundleVersionViaURL(Subject subject, String distributionFileUrl) throws Exception {
@@ -554,7 +554,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot return newVersion; }
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public BundleFile addBundleFile(Subject subject, int bundleVersionId, String name, String version, Architecture architecture, InputStream fileStream) throws Exception {
@@ -609,14 +609,14 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot return bundleFile; }
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public BundleFile addBundleFileViaByteArray(Subject subject, int bundleVersionId, String name, String version, Architecture architecture, byte[] fileBytes) throws Exception {
return addBundleFile(subject, bundleVersionId, name, version, architecture, new ByteArrayInputStream(fileBytes)); }
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public BundleFile addBundleFileViaURL(Subject subject, int bundleVersionId, String name, String version, Architecture architecture, String bundleFileUrl) throws Exception {
@@ -626,7 +626,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot return addBundleFile(subject, bundleVersionId, name, version, architecture, url.openStream()); }
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public BundleFile addBundleFileViaPackageVersion(Subject subject, int bundleVersionId, String name, int packageVersionId) throws Exception {
@@ -653,13 +653,13 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot return bundleFile; }
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public BundleDeployment scheduleBundleDeployment(Subject subject, int bundleDeploymentId, boolean isCleanDeployment) throws Exception { return scheduleBundleDeploymentImpl(subject, bundleDeploymentId, isCleanDeployment, false); }
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public BundleDeployment scheduleRevertBundleDeployment(Subject subject, int bundleDestinationId, boolean isCleanDeployment) throws Exception {
@@ -789,7 +789,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot }
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) - @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public BundleScheduleRequest getScheduleRequest(Subject subject, int resourceDeploymentId, boolean isCleanDeployment, boolean isRevert) throws Exception {
@@ -853,7 +853,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot }
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) - @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public BundleResourceDeployment createBundleResourceDeployment(Subject subject, int bundleDeploymentId, int resourceId) throws Exception {
@@ -872,7 +872,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot return resourceDeployment; }
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public BundleResourceDeployment setBundleResourceDeploymentStatus(Subject subject, int resourceDeploymentId, BundleDeploymentStatus status) throws Exception {
@@ -923,7 +923,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot // return groupDeployment; //}
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public Set<String> getBundleVersionFilenames(Subject subject, int bundleVersionId, boolean withoutBundleFileOnly) throws Exception {
@@ -962,7 +962,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot
}
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public HashMap<String, Boolean> getAllBundleVersionFilenames(Subject subject, int bundleVersionId) throws Exception {
BundleVersion bundleVersion = entityManager.find(BundleVersion.class, bundleVersionId); @@ -1092,7 +1092,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot }
@SuppressWarnings("unchecked") - @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public void deleteBundle(Subject subject, int bundleId) throws Exception { Bundle bundle = this.entityManager.find(Bundle.class, bundleId); if (null == bundle) { @@ -1115,7 +1115,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot repoManager.deleteRepo(subject, bundleRepo.getId()); }
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public void deleteBundleDeployment(Subject subject, int bundleDeploymentId) throws Exception { BundleDeployment doomed = this.entityManager.find(BundleDeployment.class, bundleDeploymentId); if (null == doomed) { @@ -1128,7 +1128,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot entityManager.remove(doomed); }
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public void deleteBundleDestination(Subject subject, int bundleDestinationId) throws Exception { BundleDestination doomed = this.entityManager.find(BundleDestination.class, bundleDestinationId); if (null == doomed) { @@ -1138,7 +1138,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot entityManager.remove(doomed); }
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_BUNDLE) public void deleteBundleVersion(Subject subject, int bundleVersionId, boolean deleteBundleIfEmpty) throws Exception { BundleVersion bundleVersion = this.entityManager.find(BundleVersion.class, bundleVersionId); if (null == bundleVersion) {
commit 131673f24b6c14f72b32b2e89b1ad6d8e958739a Author: John Mazzitelli mazz@redhat.com Date: Wed May 19 16:48:52 2010 -0400
add a new MANAGE_BUNDLE global permission - confirmed the JSF and GWT role/permission editors work
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index 72b7c30..e50b2ad 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -22,7 +22,7 @@
<properties> <scm.module.path>modules/core/dbutils/</scm.module.path> - <db.schema.version>2.85</db.schema.version> + <db.schema.version>2.86</db.schema.version> </properties>
<dependencies> diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/authz-data.xml b/modules/core/dbutils/src/main/scripts/dbsetup/authz-data.xml index 88f69a6..76e0eb7 100644 --- a/modules/core/dbutils/src/main/scripts/dbsetup/authz-data.xml +++ b/modules/core/dbutils/src/main/scripts/dbsetup/authz-data.xml @@ -43,54 +43,34 @@
<table name="RHQ_PERMISSION"> <!-- give super-user-role all permissions (resource perms is mainly just to show on view-role page) --> - <data ROLE_ID="1" OPERATION="0"/> - <!-- Permission.MANAGE_SECURITY --> - <data ROLE_ID="1" OPERATION="1"/> - <!-- Permission.MANAGE_INVENTORY --> - <data ROLE_ID="1" OPERATION="2"/> - <!-- Permission.MANAGE_SETTINGS --> + <data ROLE_ID="1" OPERATION="0"/> <!-- Permission.MANAGE_SECURITY --> + <data ROLE_ID="1" OPERATION="1"/> <!-- Permission.MANAGE_INVENTORY --> + <data ROLE_ID="1" OPERATION="2"/> <!-- Permission.MANAGE_SETTINGS --> + <data ROLE_ID="1" OPERATION="12"/> <!-- Permission.MANAGE_BUNDLE --> <!-- resource permissions start here--> - <data ROLE_ID="1" OPERATION="3"/> - <!-- Permission.VIEW_RESOURCE --> - <data ROLE_ID="1" OPERATION="4"/> - <!-- Permission.MODIFY_RESOURCE --> - <data ROLE_ID="1" OPERATION="5"/> - <!-- Permission.DELETE_RESOURCE --> - <data ROLE_ID="1" OPERATION="6"/> - <!-- Permission.CREATE_CHILD_RESOURCES --> - <data ROLE_ID="1" OPERATION="7"/> - <!-- Permission.MANAGE_ALERTS --> - <data ROLE_ID="1" OPERATION="8"/> - <!-- Permission.MANAGE_MEASUREMENTS --> - <data ROLE_ID="1" OPERATION="9"/> - <!-- Permission.MANAGE_CONTENT --> - <data ROLE_ID="1" OPERATION="10"/> - <!-- Permission.CONTROL --> - <data ROLE_ID="1" OPERATION="11"/> - <!-- Permission.CONFIGURE --> + <data ROLE_ID="1" OPERATION="3"/> <!-- Permission.VIEW_RESOURCE --> + <data ROLE_ID="1" OPERATION="4"/> <!-- Permission.MODIFY_RESOURCE --> + <data ROLE_ID="1" OPERATION="5"/> <!-- Permission.DELETE_RESOURCE --> + <data ROLE_ID="1" OPERATION="6"/> <!-- Permission.CREATE_CHILD_RESOURCES --> + <data ROLE_ID="1" OPERATION="7"/> <!-- Permission.MANAGE_ALERTS --> + <data ROLE_ID="1" OPERATION="8"/> <!-- Permission.MANAGE_MEASUREMENTS --> + <data ROLE_ID="1" OPERATION="9"/> <!-- Permission.MANAGE_CONTENT --> + <data ROLE_ID="1" OPERATION="10"/> <!-- Permission.CONTROL --> + <data ROLE_ID="1" OPERATION="11"/> <!-- Permission.CONFIGURE -->
<!-- give all-resources-role all permissions (resource perms is mainly just to show on view-role page) --> - <data ROLE_ID="2" OPERATION="1"/> - <!-- Permission.MANAGE_INVENTORY --> + <data ROLE_ID="2" OPERATION="1"/> <!-- Permission.MANAGE_INVENTORY --> + <data ROLE_ID="2" OPERATION="12"/> <!-- Permission.MANAGE_BUNDLE --> <!-- resource permissions start here--> - <data ROLE_ID="2" OPERATION="3"/> - <!-- Permission.VIEW_RESOURCE --> - <data ROLE_ID="2" OPERATION="4"/> - <!-- Permission.MODIFY_RESOURCE --> - <data ROLE_ID="2" OPERATION="5"/> - <!-- Permission.DELETE_RESOURCE --> - <data ROLE_ID="2" OPERATION="6"/> - <!-- Permission.CREATE_CHILD_RESOURCES --> - <data ROLE_ID="2" OPERATION="7"/> - <!-- Permission.MANAGE_ALERTS --> - <data ROLE_ID="2" OPERATION="8"/> - <!-- Permission.MANAGE_MEASUREMENTS --> - <data ROLE_ID="2" OPERATION="9"/> - <!-- Permission.MANAGE_CONTENT --> - <data ROLE_ID="2" OPERATION="10"/> - <!-- Permission.CONTROL --> - <data ROLE_ID="2" OPERATION="11"/> - <!-- Permission.CONFIGURE --> + <data ROLE_ID="2" OPERATION="3"/> <!-- Permission.VIEW_RESOURCE --> + <data ROLE_ID="2" OPERATION="4"/> <!-- Permission.MODIFY_RESOURCE --> + <data ROLE_ID="2" OPERATION="5"/> <!-- Permission.DELETE_RESOURCE --> + <data ROLE_ID="2" OPERATION="6"/> <!-- Permission.CREATE_CHILD_RESOURCES --> + <data ROLE_ID="2" OPERATION="7"/> <!-- Permission.MANAGE_ALERTS --> + <data ROLE_ID="2" OPERATION="8"/> <!-- Permission.MANAGE_MEASUREMENTS --> + <data ROLE_ID="2" OPERATION="9"/> <!-- Permission.MANAGE_CONTENT --> + <data ROLE_ID="2" OPERATION="10"/> <!-- Permission.CONTROL --> + <data ROLE_ID="2" OPERATION="11"/> <!-- Permission.CONFIGURE --> </table>
</dbsetup> diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index 97fe5c4..2a36ec5 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -2936,8 +2936,18 @@ REFERENCES RHQ_TAGGING ( ID ) </statement> </schema-directSQL> - </schemaSpec> + </schemaSpec>
+ <schemaSpec version="2.86"> + <schema-directSQL> + <statement desc="Adding MANAGE_BUNDLE permission to overlord"> + INSERT INTO RHQ_PERMISSION VALUES(1, 12) + </statement> + <statement desc="Adding MANAGE_BUNDLE permission to superuser"> + INSERT INTO RHQ_PERMISSION VALUES(2, 12) + </statement> + </schema-directSQL> + </schemaSpec> </dbupgrade> </target> </project> diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/authz/Permission.java b/modules/core/domain/src/main/java/org/rhq/core/domain/authz/Permission.java index 518f040..f1f6cca 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/authz/Permission.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/authz/Permission.java @@ -1,25 +1,25 @@ - /* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * 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. - */ +/* + * 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, 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.domain.authz;
import java.util.EnumSet; @@ -96,7 +96,11 @@ public enum Permission { /** * can C/U/D resource config (e.g. reconfiguring JBoss to listen for jnp on port 1199) */ - CONFIGURE(Target.RESOURCE); + CONFIGURE(Target.RESOURCE), + + /* ========== New Bundle Global Permission ========== */ + + MANAGE_BUNDLE(Target.GLOBAL);
/** * The target that a permission applies to. diff --git a/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties b/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties index 15b0178..ca4439f 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties +++ b/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties @@ -305,6 +305,7 @@ admin.role.perms.perm.MANAGE_SECURITY=Manage security (users/roles) admin.role.perms.perm.MANAGE_SECURITY.warning=This permission implicitly grants (and explicitly forces selection of) all other permissions admin.role.perms.perm.MANAGE_INVENTORY=Manage inventory (resources/groups) admin.role.perms.perm.MANAGE_SETTINGS=Administer ${product.shortName} Server settings +admin.role.perms.perm.MANAGE_BUNDLE=Manage bundles admin.role.perms.perm.VIEW_RESOURCE=View admin.role.perms.perm.MODIFY_RESOURCE=Modify admin.role.perms.perm.DELETE_RESOURCE=Delete diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/role/RolePermissionsForm.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/role/RolePermissionsForm.jsp index bab5d5d..2d00e33 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/role/RolePermissionsForm.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/role/RolePermissionsForm.jsp @@ -92,6 +92,27 @@ </c:choose> </tr>
+ <!-- MANAGE_BUNDLE --> + <tr class="ListRow"> + <td class="ListCell"><b><fmt:message key="admin.role.perms.perm.MANAGE_BUNDLE"/></b></td> + + <c:choose> + <c:when test="${mode eq 'view'}"> + <c:choose> + <c:when test="${rolePermissions['MANAGE_BUNDLE']}"> + <td align="center" class="ListCell"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> + </c:when> + <c:otherwise> + <td align="center" class="ListCell"><html:img page="/images/permission_disabled.gif" width="11" height="11" border="0"/></td> + </c:otherwise> + </c:choose> + </c:when> + <c:otherwise> + <td align="center" class="ListCellCheckboxSelected"><html:multibox property="p" value="MANAGE_BUNDLE" onclick="ToggleSelection(this, 'MANAGE_BUNDLE')"/></td> + </c:otherwise> + </c:choose> + </tr> + <!-- END GLOBAL PERM ROWS -->
<!-- THE RESOURCE PERMISSIONS HEADER ROW -->
commit 7e489549b38bd71824c8a4fcf9831898ff65d884 Author: John Mazzitelli mazz@redhat.com Date: Wed May 19 11:54:51 2010 -0400
add single-threaded thread pool to bundle manager so the agent runs the deployment asynchronously from the server request.
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java index c2e4d6e..f5f3442 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java @@ -23,13 +23,14 @@ package org.rhq.core.pc.bundle;
import java.io.File; -import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.OutputStream; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -56,11 +57,13 @@ import org.rhq.core.pc.inventory.InventoryManager; import org.rhq.core.pc.inventory.ResourceContainer; import org.rhq.core.pc.util.ComponentUtil; import org.rhq.core.pc.util.FacetLockType; +import org.rhq.core.pc.util.LoggingThreadFactory; import org.rhq.core.pluginapi.bundle.BundleDeployRequest; import org.rhq.core.pluginapi.bundle.BundleDeployResult; import org.rhq.core.pluginapi.bundle.BundleFacet; import org.rhq.core.pluginapi.bundle.BundleManagerProvider; import org.rhq.core.util.MessageDigestGenerator; +import org.rhq.core.util.exception.ThrowableUtil;
/** * Manages the bundle subsystem, which allows bundles of content to be installed. @@ -79,6 +82,7 @@ public class BundleManager extends AgentService implements BundleAgentService, B private final String AUDIT_FILE_DOWNLOAD_STARTED = "File Download Started";
private PluginContainerConfiguration configuration; + private ExecutorService deployerThreadPool;
public BundleManager() { super(BundleAgentService.class); @@ -89,9 +93,25 @@ public class BundleManager extends AgentService implements BundleAgentService, B }
public void initialize() { + createDeployerThreadPool(); }
public void shutdown() { + shutdownDeployerThreadPool(); + } + + private void createDeployerThreadPool() { + shutdownDeployerThreadPool(); // paranoia - just in case somehow an old one is still around + LoggingThreadFactory threadFactory = new LoggingThreadFactory("BundleDeployment", true); + this.deployerThreadPool = Executors.newSingleThreadExecutor(threadFactory); // single-threaded so only one deployment at a time + } + + private void shutdownDeployerThreadPool() { + if (this.deployerThreadPool != null) { + this.deployerThreadPool.shutdown(); // let it finish what it was doing, so we don't abort in the middle of a deployment + this.deployerThreadPool = null; + } + return; }
public List<PackageVersion> getAllBundleVersionPackageVersions(BundleVersion bundleVersion) throws Exception { @@ -106,12 +126,12 @@ public class BundleManager extends AgentService implements BundleAgentService, B return size; }
- public BundleScheduleResponse schedule(BundleScheduleRequest request) { - BundleScheduleResponse response = new BundleScheduleResponse(); + public BundleScheduleResponse schedule(final BundleScheduleRequest request) { + final BundleScheduleResponse response = new BundleScheduleResponse();
try { - BundleResourceDeployment resourceDeployment = request.getBundleResourceDeployment(); - BundleDeployment bundleDeployment = resourceDeployment.getBundleDeployment(); + final BundleResourceDeployment resourceDeployment = request.getBundleResourceDeployment(); + final BundleDeployment bundleDeployment = resourceDeployment.getBundleDeployment();
// find the resource that will handle the bundle processing InventoryManager im = PluginContainer.getInstance().getInventoryManager(); @@ -121,46 +141,61 @@ public class BundleManager extends AgentService implements BundleAgentService, B if (resources.isEmpty()) { throw new Exception("No bundle plugin supports bundle type [" + bundleType + "]"); } - int bundleHandlerResourceId = resources.iterator().next().getId(); - - auditDeployment(resourceDeployment, AUDIT_DEPLOYMENT_SCHEDULED, bundleDeployment.getName(), - "Scheduled deployment time: " + request.getRequestedDeployTimeAsString() + " (immediate)"); - - // TODO: The logic below this point should be executed asynchronously in response to an actual - // scheduling mechanism. For now all deployments are "immediate" so just do it here. - - // pull down the bundle files that the plugin will need in order to process the bundle - ResourceContainer resourceContainer = im.getResourceContainer(bundleHandlerResourceId); + final int bundleHandlerResourceId = resources.iterator().next().getId(); + final ResourceContainer resourceContainer = im.getResourceContainer(bundleHandlerResourceId); if (null == resourceContainer.getResourceContext()) { throw new Exception("No bundle plugin resource available to handle deployment for bundle type [" - + bundleType + "]. Ensure it is imported into inventory."); + + bundleType + + "]. Ensure the bundle plugin is deployed and its resource is imported into inventory."); } - File pluginTmpDir = resourceContainer.getResourceContext().getTemporaryDirectory(); - File bundleFilesDir = new File(pluginTmpDir, "bundle-versions/" - + bundleDeployment.getBundleVersion().getId()); - Map<PackageVersion, File> downloadedFiles = downloadBundleFiles(resourceDeployment, bundleFilesDir); - - // get the bundle facet object that will process the bundle - int facetMethodTimeout = 4 * 60 * 60 * 1000; // 4 hours is given to the bundle plugin to do its thing - BundleFacet bundlePluginComponent = getBundleFacet(bundleHandlerResourceId, facetMethodTimeout); - - // deploy the bundle utilizing the bundle facet object - String deploymentMessage = "Deployment [" + bundleDeployment + "] to [" + resourceDeployment.getResource() - + "]"; - auditDeployment(resourceDeployment, AUDIT_DEPLOYMENT_STARTED, bundleDeployment.getName(), deploymentMessage); - - BundleDeployRequest deployRequest = new BundleDeployRequest(); - deployRequest.setBundleManagerProvider(this); - deployRequest.setResourceDeployment(resourceDeployment); - deployRequest.setBundleFilesLocation(bundleFilesDir); - deployRequest.setPackageVersionFiles(downloadedFiles); - deployRequest.setCleanDeployment(request.isCleanDeployment()); - deployRequest.setRevert(request.isRevert()); - BundleDeployResult result = bundlePluginComponent.deployBundle(deployRequest); - if (!result.isSuccess()) { - response.setErrorMessage(result.getErrorMessage()); - } - completeDeployment(resourceDeployment, BundleDeploymentStatus.SUCCESS, deploymentMessage); + + auditDeployment(resourceDeployment, AUDIT_DEPLOYMENT_SCHEDULED, bundleDeployment.getName(), + "Scheduled deployment time: " + request.getRequestedDeployTimeAsString()); + + Runnable deployerRunnable = new Runnable() { + public void run() { + try { + // pull down the bundle files that the plugin will need in order to process the bundle + File pluginTmpDir = resourceContainer.getResourceContext().getTemporaryDirectory(); + File bundleFilesDir = new File(pluginTmpDir, "bundle-versions/" + + bundleDeployment.getBundleVersion().getId()); + Map<PackageVersion, File> downloadedFiles = downloadBundleFiles(resourceDeployment, + bundleFilesDir); + + // deploy the bundle utilizing the bundle facet object + String deploymentMessage = "Deployment [" + bundleDeployment + "] to [" + + resourceDeployment.getResource() + "]"; + auditDeployment(resourceDeployment, AUDIT_DEPLOYMENT_STARTED, bundleDeployment.getName(), + deploymentMessage); + + BundleDeployRequest deployRequest = new BundleDeployRequest(); + deployRequest.setBundleManagerProvider(BundleManager.this); + deployRequest.setResourceDeployment(resourceDeployment); + deployRequest.setBundleFilesLocation(bundleFilesDir); + deployRequest.setPackageVersionFiles(downloadedFiles); + deployRequest.setCleanDeployment(request.isCleanDeployment()); + deployRequest.setRevert(request.isRevert()); + + // get the bundle facet object that will process the bundle and call it to start the deployment + int facetMethodTimeout = 4 * 60 * 60 * 1000; // 4 hours is given to the bundle plugin to do its thing + BundleFacet bundlePluginComponent = getBundleFacet(bundleHandlerResourceId, facetMethodTimeout); + BundleDeployResult result = bundlePluginComponent.deployBundle(deployRequest); + if (!result.isSuccess()) { + response.setErrorMessage(result.getErrorMessage()); + } + completeDeployment(resourceDeployment, BundleDeploymentStatus.SUCCESS, deploymentMessage); + } catch (InterruptedException ie) { + log.error("Failed to complete bundle deployment due to interrupt", ie); + completeDeployment(resourceDeployment, BundleDeploymentStatus.FAILURE, "Deployment interrupted"); + } catch (Throwable t) { + log.error("Failed to complete bundle deployment", t); + completeDeployment(resourceDeployment, BundleDeploymentStatus.FAILURE, "Deployment failed: " + + ThrowableUtil.getAllMessages(t)); + } + } + }; + + this.deployerThreadPool.execute(deployerRunnable); } catch (Throwable t) { log.error("Failed to schedule bundle request: " + request, t); response.setErrorMessage(t); @@ -278,24 +313,19 @@ public class BundleManager extends AgentService implements BundleAgentService, B throw new Exception("Package version [" + packageVersion + "] does not exist, cannot check hash"); }
+ String realHash; if (packageVersion.getMD5() != null) { - String realMD5 = new MessageDigestGenerator(MessageDigestGenerator.MD5).calcDigestString(packageFile); - if (!packageVersion.getMD5().equals(realMD5)) { + realHash = new MessageDigestGenerator(MessageDigestGenerator.MD5).calcDigestString(packageFile); + if (!packageVersion.getMD5().equals(realHash)) { throw new Exception("Package version [" + packageVersion + "] failed MD5 check. expected=[" - + packageVersion.getMD5() + "], actual=[" + realMD5 + "]"); + + packageVersion.getMD5() + "], actual=[" + realHash + "]"); } } else if (packageVersion.getSHA256() != null) { - FileInputStream is = new FileInputStream(packageFile); - try { - String realSHA256 = new MessageDigestGenerator(MessageDigestGenerator.SHA_256).calcDigestString(is); - if (!packageVersion.getSHA256().equals(realSHA256)) { - throw new Exception("Package version [" + packageVersion + "] failed SHA256 check. expected=[" - + packageVersion.getSHA256() + "], actual=[" + realSHA256 + "]"); - } - } finally { - is.close(); + realHash = new MessageDigestGenerator(MessageDigestGenerator.SHA_256).calcDigestString(packageFile); + if (!packageVersion.getSHA256().equals(realHash)) { + throw new Exception("Package version [" + packageVersion + "] failed SHA256 check. expected=[" + + packageVersion.getSHA256() + "], actual=[" + realHash + "]"); } - } else { log.debug("Package version [" + packageVersion + "] has no MD5/SHA256 hash - not verifying it"); }
commit 6d27b0244d246565dd71a8ce09fcee76ae39a57b Author: John Mazzitelli mazz@redhat.com Date: Wed May 19 11:53:37 2010 -0400
fix minor format problem in tostring
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeployment.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeployment.java index 67bbd74..5638dc9 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeployment.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeployment.java @@ -164,7 +164,7 @@ public class BundleResourceDeployment implements Serializable { @Override public String toString() { StringBuilder str = new StringBuilder("BundleResourceDeployment: "); - str.append(", bdd=[").append(this.bundleDeployment).append("]"); + str.append("bdd=[").append(this.bundleDeployment).append("]"); str.append(", resource=[").append(this.resource).append("]"); return str.toString(); }
commit e146f5fae5d5b3efdd8a5bc97005b159c2962dd5 Author: John Mazzitelli mazz@redhat.com Date: Wed May 19 11:53:15 2010 -0400
don't worry about doing db schema checks when just building agent from eclipse
diff --git a/etc/eclipse-tools/maven/RHQ Maven Build - Agent Only.launch b/etc/eclipse-tools/maven/RHQ Maven Build - Agent Only.launch index dfdf4e3..36b333f 100644 --- a/etc/eclipse-tools/maven/RHQ Maven Build - Agent Only.launch +++ b/etc/eclipse-tools/maven/RHQ Maven Build - Agent Only.launch @@ -1,11 +1,11 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> -<stringAttribute key="bad_container_name" value="\rhq\etc\eclipse-tools\maven"/> -<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> -</listAttribute> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${env_var:M2_HOME}/bin/${MAVEN_EXE}"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-o -Dmaven.test.skip=true -Dagent install"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/rhq}"/> -</launchConfiguration> +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> +<stringAttribute key="bad_container_name" value="\rhq\etc\eclipse-tools\maven"/> +<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> +<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> +<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> +</listAttribute> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${env_var:M2_HOME}/bin/${MAVEN_EXE}"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-o -Dmaven.test.skip=true -Ddbsetup-do-not-check-schema -Dagent install"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/rhq}"/> +</launchConfiguration>
commit 46023ae4ed50c7129ce4eb2a1eef6cebc7c6f193 Merge: 17e93cf... 4300877... Author: Ian P. Springer <ips@jetengine.(none)> Date: Wed May 19 11:23:31 2010 -0400
Merge branch 'bundle' of ssh://git.fedorahosted.org/git/rhq/rhq into bundle
commit 17e93cf08b07ce39e0d6bf625966fb3dda889a78 Author: Ian P. Springer <ips@jetengine.(none)> Date: Wed May 19 11:22:58 2010 -0400
add support for revert, clean, and dryRun flags to AntBundlePluginComponent and BundleTask
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java index 40a68cc..7d7959a 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java @@ -61,6 +61,7 @@ public class BundleAntProject extends Project { private String deploymentName; private DeploymentPhase deploymentPhase; private DeployDifferences deployDiffs = new DeployDifferences(); + private boolean dryRun;
public Set<String> getBundleFileNames() { return bundleFileNames; @@ -139,4 +140,12 @@ public class BundleAntProject extends Project { public DeployDifferences getDeployDifferences() { return deployDiffs; } + + public void setDryRun(boolean dryRun) { + this.dryRun = dryRun; + } + + public boolean isDryRun() { + return dryRun; + } } diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/DeployPropertyNames.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/DeployPropertyNames.java index 85e21fb..4e7d3bf 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/DeployPropertyNames.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/DeployPropertyNames.java @@ -16,6 +16,24 @@ public class DeployPropertyNames { /** System property that should always be available to Ant scripts - it's the bundle deployment phase being executed */ public static final String DEPLOY_PHASE = "rhq.deploy.phase";
+ /** + * Optional deploy property - if true, this is a revert of an installed bundle to its state prior to the last + * deployment; if not specified, the default is false + */ + public static final String DEPLOY_REVERT = "rhq.deploy.revert"; + + /** + * Optional deploy property - if true, this is a fresh install (that is, the deploy directory should be wiped clean + * prior to deployment of the specified version; if not specified, the default is false + */ + public static final String DEPLOY_CLEAN = "rhq.deploy.clean"; + + /** + * Optional deploy property - if true, this is a dry run or preview (that is, it should log what steps would occur + * but not actually perform any of the steps); if not specified, the default is false + */ + public static final Object DEPLOY_DRY_RUN = "rhq.deploy.dryRun"; + private DeployPropertyNames() { } } diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java index 50acca1..35d411e 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java @@ -138,12 +138,20 @@ public class BundleTask extends AbstractBundleTask { for (InputPropertyType inputProperty : this.inputProperties) { inputProperty.execute(); } + + String dryRunString = (String) projectProps.get(DeployPropertyNames.DEPLOY_DRY_RUN); + boolean dryRun = (dryRunString != null) && dryRunString.equals(Boolean.TRUE.toString()); + getProject().setDryRun(dryRun); + log("Executing '" + deploymentPhase + "' phase for deployment '" + deploymentName + "' from bundle '" + this.name + "' version " + this.version + " using config " + getProject().getConfiguration() + "..."); switch (deploymentPhase) { case INSTALL: - deployment.install(); - + String revertString = (String) projectProps.get(DeployPropertyNames.DEPLOY_REVERT); + boolean revert = (revertString != null) && revertString.equals(Boolean.TRUE.toString()); + String cleanString = (String) projectProps.get(DeployPropertyNames.DEPLOY_CLEAN); + boolean clean = (cleanString != null) && cleanString.equals(Boolean.TRUE.toString()); + deployment.install(revert, clean); break; case START: deployment.start(); diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/DeploymentType.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/DeploymentType.java index b4ea2b9..db33995 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/DeploymentType.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/DeploymentType.java @@ -52,8 +52,9 @@ public class DeploymentType extends AbstractBundleType { private Pattern replacePattern; private boolean preview; private String preinstallTarget; + private String postinstallTarget;
- public void install() throws BuildException { + public void install(boolean revert, boolean clean) throws BuildException { if (this.preinstallTarget != null) { Target target = (Target) getProject().getTargets().get(this.preinstallTarget); if (target == null) { @@ -88,6 +89,12 @@ public class DeploymentType extends AbstractBundleType { Deployer deployer = new Deployer(dd); try { DeployDifferences diffs = getProject().getDeployDifferences(); + boolean dryRun = getProject().isDryRun(); + if (revert) { + deployer.redeployAndRestoreBackupFiles(diffs, clean, dryRun); + } else { + deployer.deploy(diffs, clean, dryRun); + } deployer.deploy(diffs); getProject().log("Results:\n" + diffs + "\n"); } catch (Exception e) { @@ -99,6 +106,14 @@ public class DeploymentType extends AbstractBundleType { this.systemService.install(); }
+ if (this.postinstallTarget != null) { + Target target = (Target) getProject().getTargets().get(this.postinstallTarget); + if (target == null) { + throw new BuildException("Specified postinstall target (" + this.postinstallTarget + ") does not exist."); + } + target.performTasks(); + } + return; }
@@ -150,6 +165,14 @@ public class DeploymentType extends AbstractBundleType { this.preinstallTarget = preinstallTarget; }
+ public String getPostinstallTarget() { + return postinstallTarget; + } + + public void setPostinstallTarget(String postinstallTarget) { + this.postinstallTarget = postinstallTarget; + } + public void addConfigured(SystemServiceType systemService) { if (this.systemService != null) { throw new IllegalStateException("A deployment can only have one system-service child element."); diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/SystemServiceType.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/SystemServiceType.java index 677c117..f3ef36c 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/SystemServiceType.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/SystemServiceType.java @@ -20,9 +20,12 @@ package org.rhq.bundle.ant.type; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.taskdefs.Chmod; import org.apache.tools.ant.taskdefs.Copy; +import org.apache.tools.ant.taskdefs.Execute; import org.apache.tools.ant.taskdefs.optional.unix.Symlink;
import java.io.File; +import java.io.IOException; +import java.util.Arrays; import java.util.HashSet; import java.util.Set; import java.util.TreeSet; @@ -70,7 +73,7 @@ public class SystemServiceType extends AbstractBundleType { private Set<Character> startLevelChars; private Set<Character> stopLevelChars;
- public void install() { + public void install() throws BuildException { if (!OS_NAME.equals("Linux") || !REDHAT_RELEASE_FILE.exists() ) { throw new BuildException("The system-service element is only supported on Red Hat Linux systems."); } @@ -108,6 +111,34 @@ public class SystemServiceType extends AbstractBundleType { createScriptSymlinks(scriptDestFile, this.stopPriority, this.stopLevelChars, 'K'); }
+ public void start() throws BuildException { + File initDir = new File(this.root, INIT_DIR.getPath().substring(1)); + File scriptFile = new File(initDir, this.name); + String[] commandLine = {scriptFile.getAbsolutePath(), "start"}; + try { + executeCommand(commandLine); + } catch (IOException e) { + throw new BuildException("Failed to start " + this.name + " system service via command [" + Arrays.toString(commandLine) + + "].", e); + } + } + + public void stop() throws BuildException { + File initDir = new File(this.root, INIT_DIR.getPath().substring(1)); + File scriptFile = new File(initDir, this.name); + String[] commandLine = {scriptFile.getAbsolutePath(), "stop"}; + try { + executeCommand(commandLine); + } catch (IOException e) { + throw new BuildException("Failed to stop " + this.name + " system service via command [" + Arrays.toString(commandLine) + + "].", e); + } + } + + public void uninstall() throws BuildException { + // TODO + } + public String getName() { return name; } @@ -327,6 +358,12 @@ public class SystemServiceType extends AbstractBundleType { symlinkTask.execute(); }
+ private int executeCommand(String[] commandLine) throws IOException { + Execute executeTask = new Execute(); + executeTask.setCommandline(commandLine); + return executeTask.execute(); + } + private void setPermissions(File file, String perms) { Chmod chmodTask = new Chmod(); chmodTask.setProject(getProject()); diff --git a/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java b/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java index 3e213c9..ab444d8 100644 --- a/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java +++ b/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java @@ -106,7 +106,7 @@ public class AntBundlePluginComponent implements ResourceComponent, BundleFacet
// Get the bundle's configuration values and the global system facts and // add them as Ant properties so the Ant script can get their values. - Properties antProps = createAntProperties(bundleDeployment); + Properties antProps = createAntProperties(request); // TODO: Eventually the phase to be executed should be passed in by the PC when it calls us. antProps.setProperty(DeployPropertyNames.DEPLOY_PHASE, "INSTALL");
@@ -117,7 +117,7 @@ public class AntBundlePluginComponent implements ResourceComponent, BundleFacet .getBundleManagerProvider(), resourceDeployment); buildListeners.add(auditor);
- // Parse & execute the Ant script. + // Parse and execute the Ant script. AntLauncher antLauncher = new AntLauncher(); BundleAntProject project = antLauncher.executeBundleDeployFile(recipeFile, null, antProps, buildListeners); @@ -150,9 +150,11 @@ public class AntBundlePluginComponent implements ResourceComponent, BundleFacet return result; }
- private Properties createAntProperties(BundleDeployment bundleDeployment) { + private Properties createAntProperties(BundleDeployRequest request) { Properties antProps = new Properties();
+ BundleResourceDeployment resourceDeployment = request.getResourceDeployment(); + BundleDeployment bundleDeployment = resourceDeployment.getBundleDeployment(); String deployDir = bundleDeployment.getDestination().getDeployDir(); if (deployDir == null) { throw new IllegalStateException("Bundle deployment does not specify install dir: " + bundleDeployment); @@ -162,6 +164,8 @@ public class AntBundlePluginComponent implements ResourceComponent, BundleFacet int deploymentId = bundleDeployment.getId(); antProps.setProperty(DeployPropertyNames.DEPLOY_ID, Integer.toString(deploymentId)); antProps.setProperty(DeployPropertyNames.DEPLOY_NAME, bundleDeployment.getName()); + antProps.setProperty(DeployPropertyNames.DEPLOY_REVERT, String.valueOf(request.isRevert())); + antProps.setProperty(DeployPropertyNames.DEPLOY_CLEAN, String.valueOf(request.isCleanDeployment()));
Map<String, String> sysFacts = SystemInfoFactory.fetchTemplateEngine().getTokens(); for (Map.Entry<String, String> fact : sysFacts.entrySet()) {
commit 430087742a9da3b6c5bf569aba00ca3a8fa0efa8 Author: John Mazzitelli mazz@redhat.com Date: Wed May 19 09:08:47 2010 -0400
BZ 587026: use Iterator.remove API to avoid concurrent modification exceptions during the loop over the keyset of the cache
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerBean.java index ab94c0a..9b6b93b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerBean.java @@ -21,6 +21,7 @@ package org.rhq.enterprise.server.perspective; import java.util.ArrayList; import java.util.EnumSet; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map;
@@ -228,16 +229,18 @@ public class PerspectiveManagerBean implements PerspectiveManagerLocal, Perspect Subject subject;
synchronized (CACHE) { - for (Integer sessionId : CACHE.keySet()) { + Iterator<Integer> iterator = CACHE.keySet().iterator(); // so we can use iterator.remove and avoid concurrent-mod-exception + while (iterator.hasNext()) { + Integer sessionId = iterator.next(); try { subject = subjectManager.getSubjectBySessionId(sessionId); if (null == subject) { - log.debug("Removing perspective cache entry for session " + sessionId); - CACHE.remove(sessionId); + log.debug("Removing perspective cache entry for session. " + sessionId); + iterator.remove(); } } catch (Exception e) { - log.debug("Removing perspective cache entry for session " + sessionId); - CACHE.remove(sessionId); + log.debug("Removing perspective cache entry for session: " + sessionId); + iterator.remove(); } } }
commit 65f9c27fa690cf5ace68e3fdaff218caae8f30ab Merge: 615cdfe... 1695812... Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 18 14:47:43 2010 -0400
Merge branch 'bundle' into bundle-jay
commit 615cdfe360429c82912ad7b251af2e5614896bc1 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 18 14:44:38 2010 -0400
Bundle Deployment Work - DeployWizard --- Added Cancel Logic to Wizard to clean up anything it can clean up --- changed GetDestinationInfoStep to be after GetDestination --- Added DoubleClick assignment/removal for selectors - Some significant changes in the SLSB to better handle failure scenarios and concurrent status updates. - Added deleteBundleDestination() and deleteBundleDeployment to BundleManagerLocal - Added BundleVersionId and DestinationId filters to BundleCriteria - Added bundleTypeId filter and BundleTypeFetch to ResourceTypeCriteria
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleCriteria.java index 3120eca..e52333f 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleCriteria.java @@ -18,6 +18,9 @@ */ package org.rhq.core.domain.criteria;
+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.XmlRootElement; @@ -35,9 +38,11 @@ public class BundleCriteria extends TaggedCriteria { private static final long serialVersionUID = 1L;
private Integer filterId; + private List<Integer> filterBundleVersionIds; // needs overrides private Integer filterBundleTypeId; // needs override private String filterBundleTypeName; // needs override private String filterDescription; + private List<Integer> filterDestinationIds; // needs overrides private String filterName; private Integer filterPackageTypeId; // needs override private String filterPackageTypeName; // needs override @@ -51,11 +56,18 @@ public class BundleCriteria extends TaggedCriteria { private PageOrdering sortDescription;
public BundleCriteria() { + filterOverrides.put("bundleVersionIds", "" // + + "id IN ( SELECT bv.bundle.id " // + + " FROM BundleVersion bv " // + + " WHERE bv.id IN ( ? ) )"); filterOverrides.put("bundleTypeId", "bundleType.id = ?"); filterOverrides.put("bundleTypeName", "bundleType.name like ?"); + filterOverrides.put("destinationIds", "" // + + "id IN ( SELECT bd.bundle.id " // + + " FROM BundleDestination bd " // + + " WHERE bd.id IN ( ? ) )"); filterOverrides.put("packageTypeId", "packageType.id = ?"); filterOverrides.put("packageTypeName", "packageType.name like ?"); - }
@Override @@ -67,6 +79,17 @@ public class BundleCriteria extends TaggedCriteria { this.filterId = filterId; }
+ /** Convenience routine calls addFilterBundleVersionIds */ + public void addFilterBundleVersionId(Integer filterBundleVersionId) { + List<Integer> ids = new ArrayList<Integer>(1); + ids.add(filterBundleVersionId); + this.addFilterBundleVersionIds(ids); + } + + public void addFilterBundleVersionIds(List<Integer> filterBundleVersionIds) { + this.filterBundleVersionIds = filterBundleVersionIds; + } + public void addFilterBundleTypeId(Integer filterBundleTypeId) { this.filterBundleTypeId = filterBundleTypeId; } @@ -79,6 +102,17 @@ public class BundleCriteria extends TaggedCriteria { this.filterDescription = filterDescription; }
+ /** Convenience routine calls addFilterDestinationIds */ + public void addFilterDestinationId(Integer filterDestinationId) { + List<Integer> ids = new ArrayList<Integer>(1); + ids.add(filterDestinationId); + this.addFilterDestinationIds(ids); + } + + public void addFilterDestinationIds(List<Integer> filterDestinationIds) { + this.filterDestinationIds = filterDestinationIds; + } + public void addFilterName(String filterName) { this.filterName = filterName; } @@ -107,7 +141,6 @@ public class BundleCriteria extends TaggedCriteria { this.fetchRepo = fetchRepo; }
- public void addSortName(PageOrdering sortName) { addSortField("name"); this.sortName = sortName; diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceTypeCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceTypeCriteria.java index d8cfe89..ba5f05e 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceTypeCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceTypeCriteria.java @@ -22,6 +22,9 @@ */ package org.rhq.core.domain.criteria;
+import java.util.Arrays; +import java.util.List; + import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @@ -32,9 +35,6 @@ import org.rhq.core.domain.resource.ResourceCreationDataType; import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.domain.util.PageOrdering;
-import java.util.Arrays; -import java.util.List; - /** * @author Joseph Marques */ @@ -54,6 +54,7 @@ public class ResourceTypeCriteria extends Criteria { private CreateDeletePolicy filterCreateDeletePolicy; private Boolean filterSupportsManualAdd; private String filterPluginName; // needs overrides + private Integer filterBundleTypeId; // needs overrides
private boolean fetchSubCategory; private boolean fetchChildResourceTypes; @@ -67,6 +68,7 @@ public class ResourceTypeCriteria extends Criteria { private boolean fetchPackageTypes; private boolean fetchSubCategories; private boolean fetchProductVersions; + private boolean fetchBundleType;
private PageOrdering sortName; private PageOrdering sortCategory; @@ -75,12 +77,13 @@ public class ResourceTypeCriteria extends Criteria { public ResourceTypeCriteria() { filterOverrides.put("pluginName", "plugin like ?"); filterOverrides.put("ids", "id in ( ? )"); + filterOverrides.put("bundleTypeId", "bundleType.id = ?");
sortOverrides.put("pluginName", "plugin"); }
@Override - public Class getPersistentClass() { + public Class<?> getPersistentClass() { return ResourceType.class; }
@@ -120,6 +123,10 @@ public class ResourceTypeCriteria extends Criteria { this.filterPluginName = filterPluginName; }
+ public void addFilterBundleTypeId(Integer filterBundleTypeId) { + this.filterBundleTypeId = filterBundleTypeId; + } + public void fetchSubCategory(boolean fetchSubCategory) { this.fetchSubCategory = fetchSubCategory; } @@ -168,6 +175,10 @@ public class ResourceTypeCriteria extends Criteria { this.fetchProductVersions = fetchProductVersions; }
+ public void fetchBundleType(boolean fetchBundleType) { + this.fetchBundleType = fetchBundleType; + } + public void addSortName(PageOrdering sortName) { addSortField("name"); this.sortName = sortName; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java index 922d031..24212fc 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java @@ -33,6 +33,7 @@ public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard { // the things we build up in the wizard private Integer bundleId; private BundleDestination bundleDestination; + private boolean isNewDestination = false; private BundleVersion bundleVersion; private boolean initialDeployment = false; private Configuration newDeploymentConfig; @@ -132,4 +133,12 @@ public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard { this.isCleanDeployment = isCleanDeployment; }
+ public boolean isNewDestination() { + return isNewDestination; + } + + public void setNewDestination(boolean isNewDestination) { + this.isNewDestination = isNewDestination; + } + } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java index 01b0ae8..0f6fd21 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java @@ -21,9 +21,17 @@ package org.rhq.enterprise.gui.coregui.client.bundle.deploy; import java.util.ArrayList; import java.util.List;
+import com.google.gwt.user.client.rpc.AsyncCallback; + import org.rhq.core.domain.bundle.BundleDeployment; +import org.rhq.core.domain.bundle.BundleDeploymentStatus; import org.rhq.core.domain.bundle.BundleDestination; +import org.rhq.core.domain.criteria.BundleDeploymentCriteria; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
public class BundleDeployWizard extends AbstractBundleDeployWizard {
@@ -32,9 +40,9 @@ public class BundleDeployWizard extends AbstractBundleDeployWizard { this.setInitialDeployment(true);
List<WizardStep> steps = init(); - steps.add(new GetDeploymentInfoStep(this)); steps.add(new SelectBundleStep(this)); steps.add(new GetDestinationStep(this)); + steps.add(new GetDeploymentInfoStep(this)); steps.add(new SelectBundleVersionStep(this)); steps.add(new GetDeploymentConfigStep(this)); steps.add(new DeployStep(this)); @@ -46,8 +54,8 @@ public class BundleDeployWizard extends AbstractBundleDeployWizard { this.setBundleId(bundleId);
List<WizardStep> steps = init(); - steps.add(new GetDeploymentInfoStep(this)); steps.add(new GetDestinationStep(this)); + steps.add(new GetDeploymentInfoStep(this)); steps.add(new SelectBundleVersionStep(this)); steps.add(new GetDeploymentConfigStep(this)); steps.add(new DeployStep(this)); @@ -80,11 +88,73 @@ public class BundleDeployWizard extends AbstractBundleDeployWizard { }
public void cancel() { - BundleDeployment bd = getNewDeployment(); - if (bd != null && isInitialDeployment()) { - // the user must have created it already after verification step, delete it - // TODO + // delete a newly created deployment but only if it's status is failure and it has + // no deployments. This should be rare, or maybe impossible, but in an odd case that + // the deployment fails and they user wants to Cancel as opposed to Finish, let's + // clean up as best as possible. + if ((null != getNewDeployment()) && (0 < getNewDeployment().getId())) { + BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); + BundleDeploymentCriteria c = new BundleDeploymentCriteria(); + c.addFilterId(getNewDeployment().getId()); + c.fetchResourceDeployments(true); + bundleServer.findBundleDeploymentsByCriteria(c, // + new AsyncCallback<PageList<BundleDeployment>>() { + public void onSuccess(PageList<BundleDeployment> newDeploymentList) { + if (!newDeploymentList.isEmpty()) { + BundleDeployment newDeployment = newDeploymentList.get(0); + boolean isFailedToLaunch = BundleDeploymentStatus.FAILURE.equals(newDeployment.getStatus()) + || BundleDeploymentStatus.PENDING.equals(newDeployment.getStatus()); + boolean hasNoResourceDeployments = ((null == newDeployment.getResourceDeployments()) || newDeployment + .getResourceDeployments().isEmpty()); + + // go ahead and delete it if it hasn't really done anything but get created. + // otherwise, let folks inspect via the ui and take further action. + // if the deployment can't be deleted then don't try to delete the destination, + // it's now in use by the deployment + if (isFailedToLaunch && hasNoResourceDeployments) { + BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); + bundleServer.deleteBundleDeployment(newDeployment.getId(), // + new AsyncCallback<Void>() { + public void onSuccess(Void voidReturn) { + deleteNewDestination(); + } + + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError( + "Failed to delete new deployment on Cancel: " + caught.getMessage(), + caught); + } + }); + } + } + } + + public void onFailure(Throwable caught) { + // should not really get here + CoreGUI.getErrorHandler().handleError( + "Failed to delete new deployment on Cancel: " + caught.getMessage(), caught); + deleteNewDestination(); + } + }); + } else { + deleteNewDestination(); } }
+ private void deleteNewDestination() { + if (this.isNewDestination() && (null != this.getBundleDestination())) { + BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); + + bundleServer.deleteBundleDestination(this.getBundleDestination().getId(), // + new AsyncCallback<Void>() { + public void onSuccess(Void voidReturn) { + } + + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError( + "Failed to delete new destination on Cancel: " + caught.getMessage(), caught); + } + }); + } + } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java index 02e048e..aa597b2 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java @@ -80,7 +80,7 @@ public class DeployStep implements WizardStep { deployingMessage.setText("Created Deployment..."); CoreGUI.getMessageCenter().notify( new Message("Created deployment [" + result.getName() + "] description [" - + result.getDescription(), Severity.Info)); + + result.getDescription() + "]", Severity.Info)); wizard.setNewDeployment(result);
bundleServer.scheduleBundleDeployment(wizard.getNewDeployment().getId(), wizard diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java index a3e20b0..7d988bc 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java @@ -18,10 +18,7 @@ */ package org.rhq.enterprise.gui.coregui.client.bundle.deploy;
-import java.util.HashSet; - import com.google.gwt.user.client.rpc.AsyncCallback; -import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.CanvasItem; @@ -34,14 +31,13 @@ import com.smartgwt.client.widgets.form.validator.Validator; import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.bundle.BundleDestination; -import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.bundle.deploy.selection.PlatformResourceGroupSelector; import org.rhq.enterprise.gui.coregui.client.bundle.deploy.selection.SinglePlatformResourceGroupSelector; import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.AbstractSelector; +import org.rhq.enterprise.gui.coregui.client.util.message.Message; +import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
public class GetDestinationStep implements WizardStep {
@@ -93,7 +89,7 @@ public class GetDestinationStep implements WizardStep { });
final TextItem deployDirTextItem = new TextItem("deployDir", - "Root Deployment Directory (on destination platforms)"); + "Root Deployment Directory (on destination platforms)"); deployDirTextItem.setRequired(true); deployDirTextItem.addChangedHandler(new ChangedHandler() { public void onChanged(ChangedEvent event) { @@ -105,7 +101,6 @@ public class GetDestinationStep implements WizardStep { } });
- this.selector = new SinglePlatformResourceGroupSelector("group", "Resource Group"); this.selector.setRequired(true); Validator validator = new IsIntegerValidator(); @@ -118,7 +113,6 @@ public class GetDestinationStep implements WizardStep { ci1.setCanvas(valForm); ci1.setDisabled(true);
- this.form.addMember(this.valForm); }
@@ -134,17 +128,22 @@ public class GetDestinationStep implements WizardStep { int selectedGroup = (Integer) this.valForm.getValue("group");
bundleServer.createBundleDestination(wizard.getBundleId(), this.dest.getName(), this.dest.getDescription(), - this.dest.getDeployDir(), selectedGroup, // - new AsyncCallback<BundleDestination>() { - public void onSuccess(BundleDestination result) { - wizard.setBundleDestination(result); - } + this.dest.getDeployDir(), selectedGroup, // + new AsyncCallback<BundleDestination>() { + public void onSuccess(BundleDestination result) { + wizard.setBundleDestination(result); + wizard.setNewDestination(true); + CoreGUI.getMessageCenter().notify( + new Message("Created destination [" + result.getName() + "] description [" + + result.getDescription() + "]", Severity.Info)); + }
- public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to create destination: " + caught.getMessage(), - caught); - } - }); + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to create destination: " + caught.getMessage(), + caught); + wizard.getView().decrementStep(); + } + });
return true; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java index fc77489..8cc4ac9 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java @@ -57,6 +57,10 @@ public interface BundleGWTService extends RemoteService {
void deleteBundle(int bundleId) throws Exception;
+ void deleteBundleDeployment(int bundleDeploymentId) throws Exception; + + void deleteBundleDestination(int bundleDestinationId) throws Exception; + void deleteBundleVersion(int bundleVersionId, boolean deleteBundleIfEmpty) throws Exception;
PageList<Bundle> findBundlesByCriteria(BundleCriteria criteria) throws Exception; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java index 7a10b32..d51fe2a 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java @@ -31,6 +31,8 @@ import com.smartgwt.client.widgets.ImgProperties; import com.smartgwt.client.widgets.TransferImgButton; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; +import com.smartgwt.client.widgets.events.DoubleClickEvent; +import com.smartgwt.client.widgets.events.DoubleClickHandler; import com.smartgwt.client.widgets.events.KeyPressEvent; import com.smartgwt.client.widgets.events.KeyPressHandler; import com.smartgwt.client.widgets.form.DynamicForm; @@ -44,7 +46,6 @@ import com.smartgwt.client.widgets.grid.events.RecordDropHandler; import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; import com.smartgwt.client.widgets.grid.events.SelectionEvent; import com.smartgwt.client.widgets.layout.HLayout; -import com.smartgwt.client.widgets.layout.LayoutSpacer; import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.layout.VStack;
@@ -76,7 +77,6 @@ public abstract class AbstractSelector<T> extends VLayout { initialSelection = assignedRecords; }
- public HashSet<Integer> getSelection() { return selection; } @@ -91,16 +91,13 @@ public abstract class AbstractSelector<T> extends VLayout { protected void onDraw() { super.onDraw();
- final DynamicForm availableFilterForm = getAvailableFilterForm();
addMember(availableFilterForm);
- HLayout hlayout = new HLayout(); hlayout.setAlign(VerticalAlignment.BOTTOM);
- // LEFT SIDE availableGrid = new ListGrid(); availableGrid.setHeight(350); @@ -134,7 +131,6 @@ public abstract class AbstractSelector<T> extends VLayout { } });
- // CENTER BUTTONS VStack moveButtonStack = new VStack(6); moveButtonStack.setAlign(VerticalAlignment.CENTER); @@ -155,7 +151,6 @@ public abstract class AbstractSelector<T> extends VLayout {
hlayout.addMember(moveButtonStack);
- // RIGHT SIDE
assignedGrid = new ListGrid(); @@ -201,6 +196,22 @@ public abstract class AbstractSelector<T> extends VLayout { } });
+ availableGrid.addDoubleClickHandler(new DoubleClickHandler() { + public void onDoubleClick(DoubleClickEvent event) { + assignedGrid.transferSelectedData(availableGrid); + select(assignedGrid.getSelection()); + updateButtons(); + } + }); + + assignedGrid.addDoubleClickHandler(new DoubleClickHandler() { + public void onDoubleClick(DoubleClickEvent event) { + deselect(assignedGrid.getSelection()); + assignedGrid.removeSelectedData(); + updateButtons(); + } + }); + availableGrid.addSelectionChangedHandler(new SelectionChangedHandler() { public void onSelectionChanged(SelectionEvent selectionEvent) { updateButtons(); @@ -237,7 +248,6 @@ public abstract class AbstractSelector<T> extends VLayout {
addMember(hlayout);
- }
protected void updateButtons() { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java index fef3bdd..bbf43a7 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java @@ -113,6 +113,22 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund } }
+ public void deleteBundleDeployment(int bundleDeploymentId) throws Exception { + try { + bundleManager.deleteBundleDeployment(getSessionSubject(), bundleDeploymentId); + } catch (Exception e) { + throw new RuntimeException(ThrowableUtil.getAllMessages(e)); + } + } + + public void deleteBundleDestination(int bundleDestinationId) throws Exception { + try { + bundleManager.deleteBundleDestination(getSessionSubject(), bundleDestinationId); + } catch (Exception e) { + throw new RuntimeException(ThrowableUtil.getAllMessages(e)); + } + } + public void deleteBundleVersion(int bundleVersionId, boolean deleteBundleIfEmpty) throws Exception { try { bundleManager.deleteBundleVersion(getSessionSubject(), bundleVersionId, deleteBundleIfEmpty); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java index 2375f03..d0569d0 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java @@ -75,6 +75,7 @@ import org.rhq.core.domain.criteria.BundleFileCriteria; import org.rhq.core.domain.criteria.BundleResourceDeploymentCriteria; import org.rhq.core.domain.criteria.BundleVersionCriteria; import org.rhq.core.domain.criteria.ResourceGroupCriteria; +import org.rhq.core.domain.criteria.ResourceTypeCriteria; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.resource.ResourceType; @@ -93,6 +94,7 @@ import org.rhq.enterprise.server.content.ContentManagerLocal; import org.rhq.enterprise.server.content.RepoManagerLocal; import org.rhq.enterprise.server.core.AgentManagerLocal; import org.rhq.enterprise.server.plugin.pc.bundle.BundleServerPluginManager; +import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal; import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal; import org.rhq.enterprise.server.util.CriteriaQueryGenerator; import org.rhq.enterprise.server.util.CriteriaQueryRunner; @@ -135,6 +137,9 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot private RepoManagerLocal repoManager;
@EJB + private ResourceTypeManagerLocal resourceTypeManager; + + @EJB private ResourceGroupManagerLocal resourceGroupManager;
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) @@ -648,56 +653,6 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot return bundleFile; }
- /** TODO: Remove after we finalize the move to group only deployment in the public API - * - * - public BundleResourceDeployment scheduleBundleResourceDeployment(Subject subject, int bundleDeploymentId, - int resourceId) throws Exception { - BundleDeployment deployment = entityManager.find(BundleDeployment.class, bundleDeploymentId); - if (null == deployment) { - throw new IllegalArgumentException("Invalid bundleDeploymentId: " + bundleDeploymentId); - } - - Resource resource = (Resource) entityManager.find(Resource.class, resourceId); - if (null == resource) { - throw new IllegalArgumentException("Invalid resourceId (Resource does not exist): " + resourceId); - } - - return scheduleBundleResourceDeployment(subject, deployment, resource, null); - } - - @RequiredPermission(Permission.MANAGE_INVENTORY) - public BundleGroupDeployment scheduleBundleGroupDeployment(Subject subject, int bundleDeploymentId, - int resourceGroupId) throws Exception { - - BundleDeployment deployment = entityManager.find(BundleDeployment.class, bundleDeploymentId); - if (null == deployment) { - throw new IllegalArgumentException("Invalid bundleDeploymentId: " + bundleDeploymentId); - } - ResourceGroup resourceGroup = (ResourceGroup) entityManager.find(ResourceGroup.class, resourceGroupId); - if (null == resourceGroup) { - throw new IllegalArgumentException("Invalid resourceGroupId (ResourceGroup does not exist): " - + resourceGroupId); - } - - // - // we need to create the group deployment entity in a new transaction before the rest of the - // processing of this method; the individual deployments need to reference it. - // - BundleGroupDeployment groupDeployment = new BundleGroupDeployment(subject.getName(), deployment, resourceGroup); - groupDeployment = bundleManager.createBundleGroupDeployment(groupDeployment); - - // Create and persist updates for each of the group members. - for (Resource resource : resourceGroup.getExplicitResources()) { - BundleResourceDeployment resourceDeployment = scheduleBundleResourceDeployment(subject, deployment, - resource, groupDeployment); - groupDeployment.addResourceDeployment(resourceDeployment); - } - - return groupDeployment; - } - */ - @RequiredPermission(Permission.MANAGE_INVENTORY) public BundleDeployment scheduleBundleDeployment(Subject subject, int bundleDeploymentId, boolean isCleanDeployment) throws Exception { @@ -734,26 +689,28 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot if (null == newDeployment) { throw new IllegalArgumentException("Invalid bundleDeploymentId: " + bundleDeploymentId); } - newDeployment.setStatus(BundleDeploymentStatus.IN_PROGRESS);
BundleDestination destination = newDeployment.getDestination(); ResourceGroup group = destination.getGroup();
// Create and persist updates for each of the group members. - for (Resource resource : group.getExplicitResources()) { + Set<Resource> platforms = group.getExplicitResources(); + if (platforms.isEmpty()) { + throw new IllegalArgumentException("Destination [" + destination + + "] group has no platforms. Invalid deployment destination"); + } + + for (Resource platform : platforms) { try { - BundleResourceDeployment resourceDeployment = scheduleBundleResourceDeployment(subject, newDeployment, - resource, isCleanDeployment, isRevert); - newDeployment.addResourceDeployment(resourceDeployment); + scheduleBundleResourceDeployment(subject, newDeployment, platform, isCleanDeployment, isRevert); } catch (Throwable t) { - log.error("Failed to complete scheduling of platform deployment to [" + resource + log.error("Failed to complete scheduling of platform deployment to [" + platform + "]. Other platforms may have been scheduled. ", t); } }
- entityManager.flush(); - - // make sure the new deployment is set as the live deployment. + // make sure the new deployment is set as the live deployment and properly replaces the + // previously live deployment. destination = entityManager.find(BundleDestination.class, destination.getId()); List<BundleDeployment> currentDeployments = destination.getDeployments(); if (null != currentDeployments) { @@ -766,73 +723,64 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot } } newDeployment.setLive(true); - entityManager.merge(newDeployment);
return newDeployment; }
private BundleResourceDeployment scheduleBundleResourceDeployment(Subject subject, BundleDeployment deployment, - Resource resource, boolean isCleanDeployment, boolean isRevert) throws Exception { + Resource platform, boolean isCleanDeployment, boolean isRevert) throws Exception {
- int resourceId = resource.getId(); - AgentClient agentClient = agentManager.getAgentClient(resourceId); + int platformId = platform.getId(); + AgentClient agentClient = agentManager.getAgentClient(platformId); BundleAgentService bundleAgentService = agentClient.getBundleAgentService();
- // The BundleResourceDeployment record must exist in the db before the agent request because the agent may try to - // add History to it during immediate deployments. So, create and persist it (requires a new trans). + // The BundleResourceDeployment record must exist in the db before the agent request because the agent may try + // to add History to it during immediate deployments. So, create and persist it (requires a new trans). BundleResourceDeployment resourceDeployment = bundleManager.createBundleResourceDeployment(subject, deployment - .getId(), resourceId); - - if (ResourceCategory.PLATFORM.equals(resource.getResourceType().getCategory())) { - // make sure the deployment contains the info required by the schedule service - BundleVersion bundleVersion = entityManager - .find(BundleVersion.class, deployment.getBundleVersion().getId()); - Configuration config = entityManager.find(Configuration.class, deployment.getConfiguration().getId()); - Bundle bundle = entityManager.find(Bundle.class, bundleVersion.getBundle().getId()); - BundleType bundleType = entityManager.find(BundleType.class, bundle.getBundleType().getId()); - ResourceType resourceType = entityManager.find(ResourceType.class, bundleType.getResourceType().getId()); - bundleType.setResourceType(resourceType); - bundle.setBundleType(bundleType); - bundleVersion.setBundle(bundle); - deployment.setBundleVersion(bundleVersion); - deployment.setConfiguration(config); - resourceDeployment.setBundleDeployment(deployment); - resourceDeployment.setResource(resource); - - // now scrub the hibernate entity to make it a pojo suitable for sending to the client - HibernateDetachUtility.nullOutUninitializedFields(resourceDeployment, SerializationType.SERIALIZATION); - - BundleScheduleRequest request = new BundleScheduleRequest(resourceDeployment); - request.setCleanDeployment(isCleanDeployment); - request.setRevert(isRevert); - - // add the deployment request history (in a new trans) - BundleResourceDeploymentHistory history = new BundleResourceDeploymentHistory(subject.getName(), - AUDIT_ACTION_DEPLOYMENT_REQUESTED, deployment.getName(), null, - BundleResourceDeploymentHistory.Status.SUCCESS, "Requested deployment time: " - + request.getRequestedDeployTimeAsString(), null); - bundleManager.addBundleResourceDeploymentHistory(subject, resourceDeployment.getId(), history); + .getId(), platformId); + + if (ResourceCategory.PLATFORM.equals(platform.getResourceType().getCategory())) {
// Ask the agent to schedule the request. The agent should add history as needed. - BundleScheduleResponse response = bundleAgentService.schedule(request); + try { + BundleScheduleRequest request = bundleManager.getScheduleRequest(subject, resourceDeployment.getId(), + isCleanDeployment, isRevert); + + // add the deployment request history (in a new trans) + BundleResourceDeploymentHistory history = new BundleResourceDeploymentHistory(subject.getName(), + AUDIT_ACTION_DEPLOYMENT_REQUESTED, deployment.getName(), null, + BundleResourceDeploymentHistory.Status.SUCCESS, "Requested deployment time: " + + request.getRequestedDeployTimeAsString(), null); + bundleManager.addBundleResourceDeploymentHistory(subject, resourceDeployment.getId(), history);
- // we don't want to commit the scrubbed entities so clear the changes - this.entityManager.clear(); + BundleScheduleResponse response = bundleAgentService.schedule(request);
- // Handle Schedule Failures. This may include deployment failures for immediate deployment request - if (!response.isSuccess()) { + // Handle Schedule Failures. This may include deployment failures for immediate deployment request + if (!response.isSuccess()) { + bundleManager.setBundleResourceDeploymentStatus(subject, resourceDeployment.getId(), + BundleDeploymentStatus.FAILURE); + history = new BundleResourceDeploymentHistory(subject.getName(), AUDIT_ACTION_DEPLOYMENT, + deployment.getName(), null, BundleResourceDeploymentHistory.Status.FAILURE, response + .getErrorMessage(), null); + bundleManager.addBundleResourceDeploymentHistory(subject, resourceDeployment.getId(), history); + } + } catch (Throwable t) { + // fail the unlaunched resource deployment + BundleResourceDeploymentHistory failureHistory = new BundleResourceDeploymentHistory(subject.getName(), + this.AUDIT_ACTION_DEPLOYMENT, deployment.getName(), null, + BundleResourceDeploymentHistory.Status.FAILURE, "Failed to schedule, agent on [" + platform + + "] may be down: " + t, null); + bundleManager.addBundleResourceDeploymentHistory(subject, resourceDeployment.getId(), failureHistory); bundleManager.setBundleResourceDeploymentStatus(subject, resourceDeployment.getId(), BundleDeploymentStatus.FAILURE); - history = new BundleResourceDeploymentHistory(subject.getName(), AUDIT_ACTION_DEPLOYMENT, deployment - .getName(), null, BundleResourceDeploymentHistory.Status.FAILURE, response.getErrorMessage(), null); - bundleManager.addBundleResourceDeploymentHistory(subject, resourceDeployment.getId(), history); } + } else { bundleManager.setBundleResourceDeploymentStatus(subject, resourceDeployment.getId(), BundleDeploymentStatus.FAILURE); BundleResourceDeploymentHistory history = new BundleResourceDeploymentHistory(subject.getName(), AUDIT_ACTION_DEPLOYMENT, deployment.getName(), null, BundleResourceDeploymentHistory.Status.FAILURE, - "Target resource is not a platform [id=" + resource.getId() + "]. Fix target group for destination [" + "Target resource is not a platform [id=" + platform.getId() + "]. Fix target group for destination [" + deployment.getDestination().getName() + "]", null); bundleManager.addBundleResourceDeploymentHistory(subject, resourceDeployment.getId(), history); } @@ -840,6 +788,70 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot return resourceDeployment; }
+ @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) + @RequiredPermission(Permission.MANAGE_INVENTORY) + public BundleScheduleRequest getScheduleRequest(Subject subject, int resourceDeploymentId, + boolean isCleanDeployment, boolean isRevert) throws Exception { + + // make sure the deployment contains the info required by the schedule service + BundleResourceDeploymentCriteria brdc = new BundleResourceDeploymentCriteria(); + brdc.addFilterId(resourceDeploymentId); + brdc.fetchResource(true); + brdc.fetchBundleDeployment(true); + List<BundleResourceDeployment> resourceDeployments = bundleManager.findBundleResourceDeploymentsByCriteria( + subject, brdc); + if (null == resourceDeployments || resourceDeployments.isEmpty()) { + throw new IllegalArgumentException("Can not deploy using invalid resourceDeploymentId [" + + resourceDeploymentId + "]."); + } + BundleResourceDeployment resourceDeployment = resourceDeployments.get(0); + + // make sure the deployment contains the info required by the schedule service + BundleDeploymentCriteria bdc = new BundleDeploymentCriteria(); + bdc.addFilterId(resourceDeployment.getId()); + bdc.fetchBundleVersion(true); + bdc.fetchConfiguration(true); + bdc.fetchDestination(true); + BundleDeployment deployment = bundleManager.findBundleDeploymentsByCriteria(subject, bdc).get(0); + + BundleCriteria bc = new BundleCriteria(); + bc.addFilterDestinationId(deployment.getDestination().getId()); + Bundle bundle = bundleManager.findBundlesByCriteria(subject, bc).get(0); + + ResourceTypeCriteria rtc = new ResourceTypeCriteria(); + rtc.addFilterBundleTypeId(bundle.getBundleType().getId()); + ResourceType resourceType = resourceTypeManager.findResourceTypesByCriteria(subject, rtc).get(0); + bundle.getBundleType().setResourceType(resourceType); + + deployment.getBundleVersion().setBundle(bundle); + deployment.getDestination().setBundle(bundle); + + // BundleVersion bundleVersion = entityManager + // .find(BundleVersion.class, deployment.getBundleVersion().getId()); + // Configuration config = entityManager.find(Configuration.class, deployment.getConfiguration().getId()); + // Bundle bundle = entityManager.find(Bundle.class, bundleVersion.getBundle().getId()); + // BundleType bundleType = entityManager.find(BundleType.class, bundle.getBundleType().getId()); + // ResourceType resourceType = entityManager.find(ResourceType.class, bundleType.getResourceType().getId()); + // bundleType.setResourceType(resourceType); + // bundle.setBundleType(bundleType); + // bundleVersion.setBundle(bundle); + + //deployment.setBundleVersion(bundleVersion); + //deployment.setConfiguration(config); + resourceDeployment.setBundleDeployment(deployment); + //resourceDeployment.setResource(platform); + + // now scrub the hibernate entity to make it a pojo suitable for sending to the client + HibernateDetachUtility.nullOutUninitializedFields(resourceDeployment, SerializationType.SERIALIZATION); + + BundleScheduleRequest request = new BundleScheduleRequest(resourceDeployment); + request.setCleanDeployment(isCleanDeployment); + request.setRevert(isRevert); + + entityManager.clear(); + return request; + } + @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) @RequiredPermission(Permission.MANAGE_INVENTORY) public BundleResourceDeployment createBundleResourceDeployment(Subject subject, int bundleDeploymentId, @@ -876,6 +888,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot
// update the status on the overall deployment BundleDeployment deployment = resourceDeployment.getBundleDeployment(); + List<BundleResourceDeployment> deployments = deployment.getResourceDeployments(); boolean someInProgress = false; boolean someSuccess = false; @@ -894,7 +907,6 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot } } if (someInProgress) { - // should actually be at this status already but what the heck deployment.setStatus(BundleDeploymentStatus.IN_PROGRESS); } else if (someSuccess) { deployment.setStatus(someFailure ? BundleDeploymentStatus.MIXED : BundleDeploymentStatus.SUCCESS); @@ -1104,6 +1116,29 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot }
@RequiredPermission(Permission.MANAGE_INVENTORY) + public void deleteBundleDeployment(Subject subject, int bundleDeploymentId) throws Exception { + BundleDeployment doomed = this.entityManager.find(BundleDeployment.class, bundleDeploymentId); + if (null == doomed) { + return; + } + if (!BundleDeploymentStatus.PENDING.equals(doomed.getStatus())) { + throw new IllegalArgumentException("Can not delete deployment with status [" + doomed.getStatus() + "]"); + } + + entityManager.remove(doomed); + } + + @RequiredPermission(Permission.MANAGE_INVENTORY) + public void deleteBundleDestination(Subject subject, int bundleDestinationId) throws Exception { + BundleDestination doomed = this.entityManager.find(BundleDestination.class, bundleDestinationId); + if (null == doomed) { + return; + } + + entityManager.remove(doomed); + } + + @RequiredPermission(Permission.MANAGE_INVENTORY) public void deleteBundleVersion(Subject subject, int bundleVersionId, boolean deleteBundleIfEmpty) throws Exception { BundleVersion bundleVersion = this.entityManager.find(BundleVersion.class, bundleVersionId); if (null == bundleVersion) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerLocal.java index 7bea7c7..ed4d89e 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerLocal.java @@ -22,6 +22,7 @@ import java.util.HashMap;
import javax.ejb.Local;
+import org.rhq.core.clientapi.agent.bundle.BundleScheduleRequest; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeploymentStatus; @@ -119,14 +120,38 @@ public interface BundleManagerLocal extends BundleManagerRemote { BundleResourceDeployment createBundleResourceDeployment(Subject subject, int bundleDeploymentId, int resourceId) throws Exception;
+ // added here because the same method in @Remote was commented out to bypass a WSProvide issue + HashMap<String, Boolean> getAllBundleVersionFilenames(Subject subject, int bundleVersionId) throws Exception; + + /** + * Not for general consumption. A special case method to build the pojo that can be sent to the agent to + * schedule the deployment request. Uses NOT_SUPPORTED transaction attribute to avoid having the cleaned pojo + * affect the persistence context. + * @throws Exception + */ + public BundleScheduleRequest getScheduleRequest(Subject subject, int resourceDeploymentId, + boolean isCleanDeployment, boolean isRevert) throws Exception; + /** - * This is typically not called directly, typically scheduleBundleGroupDeployment() is called externally. - * This executes in a New Transaction and supports scheduleBundleGroupDeployment. + * This is a simple attempt at delete, typically used for removing a poorly defined deployment before it is + * actually scheduled for deployment. The status must be PENDING. It will + * fail if anything actually refers to it. + * + * @param subject + * @param bundleDeploymentId + * @throws Exception if any part of the removal fails. */ - //BundleGroupDeployment createBundleGroupDeployment(BundleGroupDeployment groupDeployment) throws Exception; + void deleteBundleDeployment(Subject subject, int bundleDeploymentId) throws Exception;
- // added here because the same method in @Remote was commented out to bypass a WSProvide issue - HashMap<String, Boolean> getAllBundleVersionFilenames(Subject subject, int bundleVersionId) throws Exception; + /** + * This is a simple attempt at delete, typically used for removing a poorly defined destination. It will + * fail if any actual deployments are referring to the destination. + * + * @param subject + * @param bundleDestinationId + * @throws Exception if any part of the removal fails. + */ + void deleteBundleDestination(Subject subject, int bundleDestinationId) throws Exception;
/** * Called internally to set deployment status. Typically to a completion status when deployment ends.
commit 16958127a00fe82573640709ed720601d22dc38c Author: John Mazzitelli mazz@redhat.com Date: Tue May 18 10:12:44 2010 -0400
BZ 587026 - fix concurrent mod exception by synchronizing access to the static cache
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerBean.java index e2ab6e4..ab94c0a 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerBean.java @@ -188,7 +188,10 @@ public class PerspectiveManagerBean implements PerspectiveManagerLocal, Perspect
private CacheEntry getCacheEntry(Subject subject) { Integer sessionId = subject.getSessionId(); - CacheEntry cacheEntry = CACHE.get(sessionId); + CacheEntry cacheEntry; + synchronized (CACHE) { + cacheEntry = CACHE.get(sessionId); + } long metadataLastModifiedTime = getPluginMetadataManager().getLastModifiedTime(); if (cacheEntry == null || cacheEntry.getMetadataLastModifiedTime() < metadataLastModifiedTime) { // Take this opportunity to clean expired sessions from the cache. @@ -207,7 +210,9 @@ public class PerspectiveManagerBean implements PerspectiveManagerLocal, Perspect List<PageLink> filteredPageLinks = applyActivatorsToPageLinks(context, scopes, basePageLinks);
cacheEntry = new CacheEntry(metadataLastModifiedTime, filteredMenu, filteredTabs, filteredPageLinks); - CACHE.put(sessionId, cacheEntry); + synchronized (CACHE) { + CACHE.put(sessionId, cacheEntry); + } } return cacheEntry; } @@ -222,16 +227,18 @@ public class PerspectiveManagerBean implements PerspectiveManagerLocal, Perspect private void cleanCache() { Subject subject;
- for (Integer sessionId : CACHE.keySet()) { - try { - subject = subjectManager.getSubjectBySessionId(sessionId); - if (null == subject) { + synchronized (CACHE) { + for (Integer sessionId : CACHE.keySet()) { + try { + subject = subjectManager.getSubjectBySessionId(sessionId); + if (null == subject) { + log.debug("Removing perspective cache entry for session " + sessionId); + CACHE.remove(sessionId); + } + } catch (Exception e) { log.debug("Removing perspective cache entry for session " + sessionId); CACHE.remove(sessionId); } - } catch (Exception e) { - log.debug("Removing perspective cache entry for session " + sessionId); - CACHE.remove(sessionId); } } }
commit c0afda9be121db9cfd95b1ca770c0f293a100d8e Merge: 56e11dc... e3b482c... Author: Ian P. Springer <ips@jetengine.(none)> Date: Mon May 17 22:54:34 2010 -0400
Merge branch 'gwt' into bundle
commit e3b482c373947b6f9cdbd3b5b0456c23b6c825bf Author: Ian P. Springer <ips@jetengine.(none)> Date: Mon May 17 22:50:50 2010 -0400
refactor Ant bundle task to support new Ant bundle recipe format
diff --git a/etc/modules/sample-bundle/src/main/rhq-bundle.xml b/etc/modules/sample-bundle/src/main/rhq-bundle.xml index c9c25ca..7ed429a 100644 --- a/etc/modules/sample-bundle/src/main/rhq-bundle.xml +++ b/etc/modules/sample-bundle/src/main/rhq-bundle.xml @@ -1,67 +1,52 @@ <?xml version="1.0"?>
-<!-- $Id$ --> - -<project name="petstore" default="deploy" +<project name="petstore" default="main" xmlns:rhq="antlib:org.rhq.bundle">
<rhq:bundle name="Java Petstore" version="2.0" - description="a sample bundle consisting of JBossAS 6.0 running the Java Petstore application"/> + description="a sample bundle consisting of JBossAS 6.0 running the Java Petstore application">
- <rhq:input-property + <rhq:input-property name="jboss.bind.address" description="the IP address the JBoss AS server should bind to" required="true"/>
- <rhq:input-property + <rhq:input-property name="http.port" description="the HTTP port the JBoss AS server should listen on" required="true" type="integer"/>
- <rhq:input-property + <rhq:input-property name="https.port" description="the HTTPS port the JBoss AS server should listen on" required="true" type="integer"/>
- <target name="deploy"> - - <echo>Deploying Java Petstore v2.0 to ${rhq.deploy.dir}...</echo> - - <rhq:install-system-service name="jbossas-petstore" scriptFile="jbossas-init-script" - configFile="jbossas-init-config" overwriteScript="true" - startLevels="3,4,5" startPriority="80" stopPriority="20"/> - - <replace file="/etc/sysconfig/jbossas-petstore" token="@@rhq.deploy.dir@@" value="${rhq.deploy.dir}"/> - <replace file="/etc/sysconfig/jbossas-petstore" token="@@jboss.bind.address@@" value="${jboss.bind.address}"/> + <rhq:deployment name="appserver" preinstallTarget="appserver-preinstall"> + <rhq:system-service name="jbossas-petstore" scriptFile="jbossas-init-script" + configFile="jbossas-init-config" overwriteScript="true" + startLevels="3,4,5" startPriority="80" stopPriority="20"/>
- <exec executable="/etc/init.d/jbossas-petstore"> - <arg value="stop"/> - </exec> + <rhq:archive name="jbossas-petstore.zip"/>
- rhq:deploy - <rhq:archive name="jbossas-petstore.zip"/> - rhq:replace - <!-- If no 'dir' attribute is specified, rhq:fileset defaults to ${rhq.deploy.dir}. --> - <rhq:fileset includes="**/*.properties"/> - </rhq:replace> + <!-- the files that should be ignored during upgrades --> + rhq:ignore + rhq:fileset + <include name="server/default/data/**"/> + <include name="server/default/logs/**"/> + <include name="server/default/tmp/**"/> + <include name="server/default/work/**"/> + </rhq:fileset> + </rhq:ignore> + </rhq:deployment>
- <!-- the files that should be ignored during upgrades --> - rhq:ignore - rhq:fileset - <include name="server/default/data/**"/> - <include name="server/default/logs/**"/> - <include name="server/default/tmp/**"/> - <include name="server/default/work/**"/> - </rhq:fileset> - </rhq:ignore> - </rhq:deploy> + </rhq:bundle>
- <exec executable="/etc/init.d/jbossas-petstore" failonerror="true"> - <arg value="start"/> - </exec> + <target name="main"/>
+ <target name="appserver-preinstall"> + <echo>Installing Java Petstore App Server to ${rhq.deploy.dir}...</echo> </target>
</project> diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java index 03daae0..7c4925b 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java @@ -25,6 +25,7 @@ package org.rhq.bundle.ant; import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -45,8 +46,7 @@ import org.apache.tools.ant.helper.AntXMLContext; import org.apache.tools.ant.helper.ProjectHelper2;
import org.rhq.bundle.ant.task.BundleTask; -import org.rhq.bundle.ant.task.DeployTask; -import org.rhq.bundle.ant.task.InputPropertyTask; +import org.rhq.bundle.ant.type.DeploymentType;
/** * This object enables you to invoke an Ant script within the running VM. You can fully run the script @@ -151,9 +151,8 @@ public class AntLauncher { project.addReference(REFID_CONTEXT, context); project.addReference(ProjectHelper2.REFID_TARGETS, context.getTargets());
- ProjectHelper2 helper = new ProjectHelper2(); try { - helper.parse(project, buildFile); + ProjectHelper.configureProject(project, buildFile); } catch (BuildException e) { throw new InvalidBuildFileException("Failed to parse bundle Ant build file.", e); } @@ -211,25 +210,11 @@ public class AntLauncher { for (Object targetObj : targets) { Target target = (Target) targetObj; Task[] tasks = target.getTasks(); - for (Task task : tasks) { - // NOTE: For rhq:inputProperty tasks, the below call will add propDefs to the project configDef. + for (Task task : tasks) { if (task.getTaskName().equals(BUNDLE_TASK_NAME)) { abortIfTaskWithinTarget(target, task); bundleTaskCount++; unconfiguredBundleTask = task; - } else if (task.getTaskName().equals(INPUT_PROPERTY_TASK_NAME)) { - abortIfTaskWithinTarget(target, task); - InputPropertyTask inputPropertyTask = (InputPropertyTask) preconfigureTask(task); - } else if (task.getTaskName().equals(DEPLOY_TASK_NAME)) { - DeployTask deployTask = (DeployTask) preconfigureTask(task); - Map<File, File> files = deployTask.getFiles(); - for (File file : files.values()) { - project.getBundleFileNames().add(file.getName()); - } - Set<File> archives = deployTask.getArchives(); - for (File archive : archives) { - project.getBundleFileNames().add(archive.getName()); - } } } } @@ -243,6 +228,19 @@ public class AntLauncher { }
BundleTask bundleTask = (BundleTask) preconfigureTask(unconfiguredBundleTask); + Collection<DeploymentType> deployments = bundleTask.getDeployments().values(); + if (deployments.isEmpty()) { + throw new InvalidBuildFileException("The bundle task must contain at least one deployment child element."); + } + DeploymentType deployment = deployments.iterator().next(); + Map<File, File> files = deployment.getFiles(); + for (File file : files.values()) { + project.getBundleFileNames().add(file.getName()); + } + Set<File> archives = deployment.getArchives(); + for (File archive : archives) { + project.getBundleFileNames().add(archive.getName()); + } }
private void abortIfTaskWithinTarget(Target target, Task task) throws InvalidBuildFileException { diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java index 8849ded..40a68cc 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java @@ -44,16 +44,22 @@ import org.rhq.core.util.updater.DeployDifferences; * are happening as the Ant script is being parsed and/or executed. * * @author John Mazzitelli + * @author Ian Springer */ public class BundleAntProject extends Project { + // Bundle-level attributes private String bundleName; private String bundleVersion; private String bundleDescription; private ConfigurationDefinition configDef; + + // Deployment-level attributes private Configuration config; private File deployDir; private final Set<String> bundleFileNames = new HashSet<String>(); private int deploymentId; + private String deploymentName; + private DeploymentPhase deploymentPhase; private DeployDifferences deployDiffs = new DeployDifferences();
public Set<String> getBundleFileNames() { @@ -114,6 +120,22 @@ public class BundleAntProject extends Project { this.deploymentId = deploymentId; }
+ public String getDeploymentName() { + return deploymentName; + } + + public void setDeploymentName(String deploymentName) { + this.deploymentName = deploymentName; + } + + public DeploymentPhase getDeploymentPhase() { + return deploymentPhase; + } + + public void setDeploymentPhase(DeploymentPhase deploymentPhase) { + this.deploymentPhase = deploymentPhase; + } + public DeployDifferences getDeployDifferences() { return deployDiffs; } diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/DeployPropertyNames.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/DeployPropertyNames.java index 822fd84..85e21fb 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/DeployPropertyNames.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/DeployPropertyNames.java @@ -4,12 +4,18 @@ package org.rhq.bundle.ant; * @author Ian Springer */ public class DeployPropertyNames { - /** System property that should always be available to ant scripts - it's the location where the deployment should be installed */ + /** System property that should always be available to Ant scripts - it's the location where the deployment should be installed */ public static final String DEPLOY_DIR = "rhq.deploy.dir";
- /** System property that should always be available to ant scripts - it's the ID of the bundle deployment */ + /** System property that should always be available to Ant scripts - it's the ID of the bundle deployment */ public static final String DEPLOY_ID = "rhq.deploy.id";
+ /** System property that should always be available to Ant scripts - it's the name of the bundle deployment */ + public static final String DEPLOY_NAME = "rhq.deploy.name"; + + /** System property that should always be available to Ant scripts - it's the bundle deployment phase being executed */ + public static final String DEPLOY_PHASE = "rhq.deploy.phase"; + private DeployPropertyNames() { } } diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/DeploymentPhase.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/DeploymentPhase.java new file mode 100644 index 0000000..4f87ab6 --- /dev/null +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/DeploymentPhase.java @@ -0,0 +1,24 @@ +package org.rhq.bundle.ant; + +/** + * A bundle deployment phase. One or more tasks are associated with each phase. The phases are executed as part of + * three user-initiated actions: + * + * Deploy: INSTALL,START + * Redeploy: STOP,UPGRADE,START + * Undeploy: STOP,UNINSTALL + * + * TODO (ips): This should probably be moved to domain or somewhere else not specific to the Ant bundle type. + */ +public enum DeploymentPhase { + INSTALL, + START, + STOP, + UPGRADE, + UNINSTALL; + + @Override + public String toString() { + return name().toLowerCase(); + } +} diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/LoggerAntBuildListener.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/LoggerAntBuildListener.java index bcdf37d..f9556ad 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/LoggerAntBuildListener.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/LoggerAntBuildListener.java @@ -85,28 +85,29 @@ public class LoggerAntBuildListener implements BuildListener { Task task = event.getTask();
if (additionalMessage != null) { - output.println(additionalMessage); + this.output.println(additionalMessage); }
if (target != null) { - output.print("[" + target.getName() + "] "); + String targetName = (target.getName() != null) ? target.getName() : ""; + this.output.print("[" + targetName + "] "); }
if (task != null) { - output.print("<" + task.getTaskName() + "> "); + this.output.print("<" + task.getTaskName() + "> "); }
if (message != null) { - output.print(message); + this.output.print(message); }
if (exception != null) { - output.println(); + this.output.println(); exception.printStackTrace(output); }
- output.println(); - output.flush(); + this.output.println(); + this.output.flush();
return; } diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java index 61d8898..50acca1 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java @@ -21,30 +21,59 @@ package org.rhq.bundle.ant.task; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.rhq.bundle.ant.DeployPropertyNames; +import org.rhq.bundle.ant.DeploymentPhase; +import org.rhq.bundle.ant.type.DeploymentType; +import org.rhq.bundle.ant.type.InputPropertyType;
import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; import java.util.Hashtable; +import java.util.List; +import java.util.Map; +import java.util.Set;
/** + * The rhq:bundle task defines the metadata needed to deploy, redeploy, or undeploy an RHQ bundle. + * * @author Ian Springer */ public class BundleTask extends AbstractBundleTask { private String name; private String version; private String description; - + private Map<String, DeploymentType> deployments = new HashMap<String, DeploymentType>(); + private Set<InputPropertyType> inputProperties = new HashSet<InputPropertyType>(); + @Override public void maybeConfigure() throws BuildException { // The below call will init the attribute fields. super.maybeConfigure();
validateAttributes(); - + //validateTypes(); + getProject().setBundleName(this.name); getProject().setBundleVersion(this.version); getProject().setBundleDescription(this.description); }
+ /** + * The RHQ Ant launcher will ensure that the following Ant project properties are defined prior to this method being + * invoked: + * + * rhq.deploy.name - the {@link org.rhq.core.domain.bundle.BundleDeployment deployment} name + * (e.g. "appserver") + * rhq.deploy.dir - the {@link org.rhq.core.domain.bundle.BundleDeployment deployment} install dir + * (e.g. "/opt/jbossas-petstore") + * rhq.deploy.phase - the {@link org.rhq.bundle.ant.DeploymentPhase deployment phase} + * + * If the bundle recipe is being executed from the command line, the user must supply these properties, along + * with any input properties required by the bundle recipe. + * + * @throws BuildException + */ @Override public void execute() throws BuildException { Hashtable projectProps = getProject().getProperties(); @@ -76,7 +105,59 @@ public class BundleTask extends AbstractBundleTask { getProject().setDeploymentId(deploymentId); log(DeployPropertyNames.DEPLOY_ID + "="" + deploymentId + """, Project.MSG_DEBUG);
- log("Executing Ant script for bundle '" + this.name + "' version " + this.version + "..."); + String deploymentName = (String) projectProps.get(DeployPropertyNames.DEPLOY_NAME); + if (deploymentName == null) { + throw new BuildException("Required property [" + DeployPropertyNames.DEPLOY_NAME + "] was not specified."); + } + getProject().setDeploymentName(deploymentName); + DeploymentType deployment = this.deployments.get(deploymentName); + if (deployment == null) { + throw new BuildException("There is no deployment element defined with name '" + deploymentName + "'."); + } + + String deploymentPhaseName = (String) projectProps.get(DeployPropertyNames.DEPLOY_PHASE); + if (deploymentPhaseName == null) { + throw new BuildException("Required property [" + DeployPropertyNames.DEPLOY_PHASE + "] was not specified."); + } + DeploymentPhase deploymentPhase; + try { + deploymentPhase = DeploymentPhase.valueOf(deploymentPhaseName.toUpperCase()); + } catch (IllegalArgumentException e) { + DeploymentPhase[] phases = DeploymentPhase.values(); + List<String> validPhaseNames = new ArrayList<String>(phases.length); + for (DeploymentPhase phase : phases) { + validPhaseNames.add(phase.name().toLowerCase()); + } + throw new BuildException("Value of property '" + DeployPropertyNames.DEPLOY_PHASE + + "' (" + deploymentPhaseName + ") is not a valid deployment phase - the valid phases are " + + validPhaseNames + "."); + } + getProject().setDeploymentPhase(deploymentPhase); + + // Initialize the deployment configuration. + for (InputPropertyType inputProperty : this.inputProperties) { + inputProperty.execute(); + } + log("Executing '" + deploymentPhase + "' phase for deployment '" + deploymentName + "' from bundle '" + + this.name + "' version " + this.version + " using config " + getProject().getConfiguration() + "..."); + switch (deploymentPhase) { + case INSTALL: + deployment.install(); + + break; + case START: + deployment.start(); + break; + case STOP: + deployment.stop(); + break; + case UPGRADE: + deployment.upgrade(); + break; + case UNINSTALL: + deployment.uninstall(); + break; + } }
public String getDescription() { @@ -103,6 +184,19 @@ public class BundleTask extends AbstractBundleTask { this.version = version; }
+ public void addConfigured(InputPropertyType inputProperty) { + this.inputProperties.add(inputProperty); + inputProperty.init(); + } + + public void addConfigured(DeploymentType deployment) { + this.deployments.put(deployment.getName(), deployment); + } + + public Map<String, DeploymentType> getDeployments() { + return deployments; + } + /** * Ensure we have a consistent and legal set of attributes, and set * any internal flags necessary based on different combinations @@ -124,4 +218,15 @@ public class BundleTask extends AbstractBundleTask { throw new BuildException("The 'version' attribute must have a non-empty value."); } } + + /** + * Ensure we have a legal set of types. + * + * @throws BuildException if an error occurs + */ + protected void validateTypes() throws BuildException { + if (this.deployments.isEmpty()) { + throw new BuildException("At least one 'deployment' child element must be specified."); + } + } } \ No newline at end of file diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/DeployTask.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/DeployTask.java deleted file mode 100644 index 1f8b5c3..0000000 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/DeployTask.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 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.bundle.ant.task; - -import java.io.File; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.regex.Pattern; - -import org.apache.tools.ant.BuildException; - -import org.apache.tools.ant.Project; -import org.rhq.bundle.ant.type.ArchiveType; -import org.rhq.bundle.ant.type.FileSet; -import org.rhq.bundle.ant.type.FileType; -import org.rhq.bundle.ant.type.IgnoreType; -import org.rhq.bundle.ant.type.ReplaceType; -import org.rhq.core.domain.configuration.Configuration; -import org.rhq.core.domain.configuration.PropertySimple; -import org.rhq.core.system.SystemInfoFactory; -import org.rhq.core.template.TemplateEngine; -import org.rhq.core.util.updater.DeployDifferences; -import org.rhq.core.util.updater.Deployer; -import org.rhq.core.util.updater.DeploymentData; -import org.rhq.core.util.updater.DeploymentProperties; - -/** - * An Ant task for deploying a bundle or previewing the deployment. - * - * @author Ian Springer - */ -public class DeployTask extends AbstractBundleTask { - private Map<File, File> files = new LinkedHashMap<File, File>(); - private Set<File> archives = new LinkedHashSet<File>(); - private Pattern ignorePattern; - private Pattern replacePattern; - private boolean preview; - - @Override - public void maybeConfigure() throws BuildException { - // The below call will init the attribute fields. - super.maybeConfigure(); - } - - @Override - public void execute() throws BuildException { - int deploymentId = getProject().getDeploymentId(); - DeploymentProperties deploymentProps = new DeploymentProperties(deploymentId, getProject().getBundleName(), - getProject().getBundleVersion(), getProject().getBundleDescription()); - File deployDir = getProject().getDeployDir(); - TemplateEngine templateEngine = createTemplateEngine(); - if (this.files.isEmpty() && this.archives.isEmpty()) { - throw new BuildException("You must specify at least one file to deploy via nested rhq:file and/or rhq:archive elements."); - } - if (!this.files.isEmpty()) { - log("Deploying files " + this.files + "...", Project.MSG_VERBOSE); - } - if (!this.archives.isEmpty()) { - log("Deploying archives " + this.archives + "...", Project.MSG_VERBOSE); - } - - // for now, apply the pattern to all files in the deployment - Map<File, Pattern> archiveReplacePatterns = new HashMap<File, Pattern>(); - for (File file : this.archives) { - archiveReplacePatterns.put(file, this.replacePattern); - } - Set<File> rawFilesToReplace = this.files.keySet(); // TODO: CHANGE ME! only replace those raw files marked as "replace=true" - DeploymentData dd = new DeploymentData(deploymentProps, this.archives, this.files, deployDir, - archiveReplacePatterns, rawFilesToReplace, templateEngine, this.ignorePattern); - Deployer deployer = new Deployer(dd); - try { - DeployDifferences diffs = getProject().getDeployDifferences(); - deployer.deploy(diffs); - getProject().log("Results:\n" + diffs + "\n"); - } catch (Exception e) { - throw new BuildException("Failed to deploy bundle '" + getProject().getBundleName() + "' version " - + getProject().getBundleVersion() + ": " + e, e); - } - - return; - } - - public Map<File, File> getFiles() { - return files; - } - - public Set<File> getArchives() { - return archives; - } - - public boolean isPreview() { - return this.preview; - } - - public void setPreview(boolean preview) { - this.preview = preview; - } - - public void addConfigured(FileType file) { - File destFile = file.getDestinationFile(); - if (destFile == null) { - File destDir = file.getDestinationDir(); - destFile = new File(destDir, file.getSource().getName()); - } - this.files.put(file.getSource(), destFile); - } - - public void addConfigured(ArchiveType archive) { - this.archives.add(archive.getSource()); - } - - public void addConfigured(IgnoreType ignore) { - List<FileSet> fileSets = ignore.getFileSets(); - this.ignorePattern = getPattern(fileSets); - } - - public void addConfigured(ReplaceType replace) { - List<FileSet> fileSets = replace.getFileSets(); - this.replacePattern = getPattern(fileSets); - } - - private TemplateEngine createTemplateEngine() { - TemplateEngine templateEngine = SystemInfoFactory.fetchTemplateEngine(); - // Add the deployment props to the template engine's tokens. - Configuration config = getProject().getConfiguration(); - for (PropertySimple prop : config.getSimpleProperties().values()) { - templateEngine.getTokens().put(prop.getName(), prop.getStringValue()); - } - return templateEngine; - } - - private static Pattern getPattern(List<FileSet> fileSets) { - boolean first = true; - StringBuilder regex = new StringBuilder(); - for (FileSet fileSet : fileSets) { - if (!first) { - regex.append("|"); - } else { - first = false; - } - regex.append("("); - File dir = fileSet.getDir(); - if (dir != null) { - regex.append(dir); - regex.append('/'); - } - if (fileSet.getIncludePatterns().length == 0) { - regex.append(".*"); - } else { - boolean firstIncludePattern = true; - for (String includePattern : fileSet.getIncludePatterns()) { - if (!firstIncludePattern) { - regex.append("|"); - } else { - firstIncludePattern = false; - } - regex.append("("); - for (int i = 0; i < includePattern.length(); i++) { - char c = includePattern.charAt(i); - if (c == '?') { - regex.append('.'); - } else if (c == '*') { - if (i + 1 < includePattern.length()) { - char c2 = includePattern.charAt(++i); - if (c2 == '*') { - regex.append(".*"); - i++; - continue; - } - } - regex.append("[^/]*"); - } else { - regex.append(c); - } - // TODO: Escape backslashes. - } - regex.append(")"); - } - } - regex.append(")"); - } - return Pattern.compile(regex.toString()); - } -} \ No newline at end of file diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/InputPropertyTask.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/InputPropertyTask.java deleted file mode 100644 index cac2dbc..0000000 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/InputPropertyTask.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 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.bundle.ant.task; - -import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.Project; -import org.rhq.core.domain.configuration.Configuration; -import org.rhq.core.domain.configuration.PropertySimple; -import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; -import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple; -import org.rhq.core.domain.configuration.definition.PropertySimpleType; - -/** - * An Ant task that defines a basic property that the user provides as input for deployment of a bundle. Typically, the - * property will be substituted into configuration files from the bundle during deployment - see ReplaceTask. - * - * If the deployment script is invoked from the GUI, the user will be prompted for values for any input properties that - * are defined via this task. If the script is invoked from the command line, the properties must be passed using the -D - * and/or -propertyfile options. - * - * @author Ian Springer - */ -public class InputPropertyTask extends AbstractBundleTask { - private String name; - private String description; - private boolean required = true; - private String defaultValue; - private String type = PropertySimpleType.STRING.xmlName(); - - @Override - public void maybeConfigure() throws BuildException { - // The below call will init the attribute fields. - super.maybeConfigure(); - - validateAttributes(); - - ConfigurationDefinition configDef = getProject().getConfigurationDefinition(); - PropertySimpleType propSimpleType = PropertySimpleType.fromXmlName(this.type); - PropertyDefinitionSimple propDef = new PropertyDefinitionSimple(this.name, this.description, this.required, - propSimpleType); - configDef.put(propDef); - } - - @Override - public void execute() throws BuildException { - String value = getProject().getProperty(this.name); - if (value == null) { - value = this.defaultValue; - } - if (value == null && this.required) { - throw new BuildException("No value was specified for required input property '" + this.name - + "', and no default is defined for the property."); - } - String valueString = (value != null) ? "'" + value + "'" : "<null>"; - log("Initializing input property '" + this.name + "' with value " + valueString + "..."); - - PropertySimple prop = new PropertySimple(this.name, value); - ConfigurationDefinition configDef = getProject().getConfigurationDefinition(); - Configuration config = getProject().getConfiguration(); - // TODO: validate the config - config.put(prop); - return; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDefaultValue() { - return defaultValue; - } - - public void setDefaultValue(String defaultValue) { - this.defaultValue = defaultValue; - } - - public Boolean getRequired() { - return required; - } - - public void setRequired(Boolean required) { - this.required = required; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - /** - * Ensure we have a consistent and legal set of attributes, and set - * any internal flags necessary based on different combinations - * of attributes. - * - * @throws org.apache.tools.ant.BuildException if an error occurs - */ - protected void validateAttributes() throws BuildException { - if (this.name == null) { - throw new BuildException("The 'name' attribute is required."); - } - if (this.name.length() == 0) { - throw new BuildException("The 'name' attribute must have a non-empty value."); - } - try { - PropertySimpleType.fromXmlName(this.type); - } catch (IllegalArgumentException e) { - throw new BuildException("Illegal value for 'type' attribute: " + this.type); - } - if (this.defaultValue == null) { - if (!this.required) { - log("No default value was specified for optional input property '" + this.name + "'.", Project.MSG_WARN); - } - } - } -} \ No newline at end of file diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/InstallSystemServiceTask.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/InstallSystemServiceTask.java deleted file mode 100644 index 828c39d..0000000 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/InstallSystemServiceTask.java +++ /dev/null @@ -1,333 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 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.bundle.ant.task; - -import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.Task; -import org.apache.tools.ant.taskdefs.Chmod; -import org.apache.tools.ant.taskdefs.Copy; -import org.apache.tools.ant.taskdefs.optional.unix.Symlink; - -import java.io.File; -import java.util.HashSet; -import java.util.Set; -import java.util.TreeSet; - -/** - * An Ant task that installs a system startup/shutdown service. Currently only Red Hat Linux versions are supported. - * - * @author Ian Springer - */ -public class InstallSystemServiceTask extends Task { - private static final String OS_NAME = System.getProperty("os.name"); - private static final File REDHAT_RELEASE_FILE = new File("/etc/redhat-release"); - private static final Set<Character> REDHAT_RUN_LEVELS = new HashSet<Character>(); - static { - for (char c = '0'; c <= '6'; c++) { - REDHAT_RUN_LEVELS.add(c); - } - // TODO: Add 's' and/or 'S' depending on the flavor of UNIX. - } - private static final File INIT_DIR = new File("/etc/init.d"); - private static final File SYSCONFIG_DIR = new File("/etc/sysconfig"); - private static final File DEFAULT_ROOT = new File("/"); - - private String name; - private File scriptFile; - private File configFile; - private boolean overwriteScript; - private boolean overwriteConfig; - private boolean overwriteLinks = true; - private File root = DEFAULT_ROOT; - private String startLevels; - - /** - * An integer from 0-99 indicating the service's start order - services with a lower priority number are started - * before services with a higher priority number. - */ - private Byte startPriority; - - /** - * An integer from 0-99 indicating the service's stop order - services with a lower priority number are stopped - * before services with a higher priority number. - */ - private Byte stopPriority; - - private Set<Character> startLevelChars; - private Set<Character> stopLevelChars; - - @Override - public void execute() throws BuildException { - if (!OS_NAME.equals("Linux") || !REDHAT_RELEASE_FILE.exists() ) { - throw new BuildException("This task can only be run on Red Hat Linux systems."); - } - validateAttributes(); - - // Install the config file if one was provided (e.g. /etc/sysconfig/named). - if (this.configFile != null) { - File sysconfigDir = new File(this.root, SYSCONFIG_DIR.getPath().substring(1)); - if (!sysconfigDir.exists()) { - sysconfigDir.mkdirs(); - } - if (!sysconfigDir.canWrite()) { - throw new BuildException(sysconfigDir + " directory is not writeable."); - } - File configDestFile = new File(sysconfigDir, this.name); - copyFile(this.configFile, configDestFile, this.overwriteConfig); - setPermissions(configDestFile, "644"); - } - - // Install the script itself (e.g. /etc/init.d/named). - File initDir = new File(this.root, INIT_DIR.getPath().substring(1)); - if (!initDir.exists()) { - initDir.mkdirs(); - } - if (!initDir.canWrite()) { - throw new BuildException(initDir + " directory is not writeable."); - } - File scriptDestFile = new File(initDir, this.name); - getProject().log("Installing service script " + scriptDestFile + "..."); - copyFile(this.scriptFile, scriptDestFile, this.overwriteScript); - setPermissions(scriptDestFile, "755"); - - // Create the symlinks in the rcX.d dirs (e.g. /etc/rc3.d/S24named -> ../init.d/named) - createScriptSymlinks(scriptDestFile, this.startPriority, this.startLevelChars, 'S'); - createScriptSymlinks(scriptDestFile, this.stopPriority, this.stopLevelChars, 'K'); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public File getScriptFile() { - return scriptFile; - } - - public void setScriptFile(File scriptFile) { - this.scriptFile = scriptFile; - } - - public File getConfigFile() { - return configFile; - } - - public void setConfigFile(File configFile) { - this.configFile = configFile; - } - - public boolean isOverwriteScript() { - return overwriteScript; - } - - public void setOverwriteScript(boolean overwriteScript) { - this.overwriteScript = overwriteScript; - } - - public boolean isOverwriteConfig() { - return overwriteConfig; - } - - public void setOverwriteConfig(boolean overwriteConfig) { - this.overwriteConfig = overwriteConfig; - } - - public boolean isOverwriteLinks() { - return overwriteLinks; - } - - public void setOverwriteLinks(boolean overwriteLinks) { - this.overwriteLinks = overwriteLinks; - } - - public String getStartLevels() { - return startLevels; - } - - public void setStartLevels(String startLevels) { - this.startLevels = startLevels; - } - - public byte getStartPriority() { - return startPriority; - } - - public void setStartPriority(byte startPriority) { - this.startPriority = startPriority; - } - - public byte getStopPriority() { - return stopPriority; - } - - public void setStopPriority(byte stopPriority) { - this.stopPriority = stopPriority; - } - - public File getRoot() { - return root; - } - - public void setRoot(File root) { - this.root = root; - } - - /** - * Ensure we have a consistent and legal set of attributes, and set - * any internal flags necessary based on different combinations - * of attributes. - * - * @throws BuildException if an error occurs - */ - protected void validateAttributes() throws BuildException { - if (this.name == null) { - throw new BuildException("The 'name' attribute is required."); - } - if (this.name.length() == 0) { - throw new BuildException("The 'name' attribute must have a non-empty value."); - } - - if (this.scriptFile == null) { - throw new BuildException("The 'scriptFile' attribute is required."); - } - if (!this.scriptFile.exists() || this.scriptFile.isDirectory()) { - throw new BuildException("The 'scriptFile' attribute must be set to the path of an existing regular file."); - } - if (!this.configFile.exists() || this.configFile.isDirectory()) { - throw new BuildException("The 'configFile' attribute must be set to the path of an existing regular file."); - } - - if (this.startLevels == null) { - throw new BuildException("The 'startLevels' attribute is required."); - } - if (this.startLevels.length() == 0) { - throw new BuildException("The 'startLevels' attribute must have a non-empty value."); - } - this.startLevelChars = parseLevels(this.startLevels); - this.stopLevelChars = new TreeSet<Character>(); - for (char level : REDHAT_RUN_LEVELS) { - if (!this.startLevelChars.contains(level)) { - this.stopLevelChars.add(level); - } - } - - if (this.startPriority == null) { - throw new BuildException("The 'startPriority' attribute is required."); - } - if (this.startPriority < 0 || this.startPriority > 99) { - throw new BuildException("The 'startPriority' attribute must be >=0 and <= 99."); - } - if (this.stopPriority == null) { - throw new BuildException("The 'stopPriority' attribute is required."); - } - if (this.stopPriority < 0 || this.stopPriority > 99) { - throw new BuildException("The 'startPriority' attribute must be >=0 and <= 99."); - } - - if (!this.root.isDirectory()) { - throw new BuildException("The 'root' attribute must be set to the path of an existing directory."); - } - if (!this.root.equals(DEFAULT_ROOT)) { - getProject().log("Using root " + this.root + "."); - } - } - - private static Set<Character> parseLevels(String levels) { - Set<Character> levelChars = new TreeSet<Character>(); - String[] tokens = levels.split("[ ]*,[ ]*"); - for (String token : tokens) { - if (!token.equals("")) { - Character level; - try { - if (token.length() != 1) { - throw new Exception(); - } - level = token.charAt(0); - if (!REDHAT_RUN_LEVELS.contains(level)) { - throw new Exception(); - } - - } catch (Exception e) { - throw new BuildException("Invalid run level: " + token - + " - the 'startLevels' attribute must be a comma-separated list of run levels - the valid levels are " - + REDHAT_RUN_LEVELS + "."); - } - if (levelChars.contains(level)) { - throw new BuildException("The 'startLevels' attribute defines run level " + level + " more than once."); - } - levelChars.add(level); - } - } - return levelChars; - } - - private void createScriptSymlinks(File scriptFile, byte priority, Set<Character> levels, char fileNamePrefix) { - String priorityString = String.format("%02d", priority); - for (char level : levels) { - File rcDir = new File(this.root, "etc/rc" + level + ".d"); - if (!rcDir.exists()) { - rcDir.mkdirs(); - } - if (!rcDir.exists()) { - throw new BuildException(rcDir + " does not exist."); - } - if (!rcDir.isDirectory()) { - throw new BuildException(rcDir + " exists but is not a directory."); - } - if (!rcDir.isDirectory()) { - throw new BuildException(rcDir + " directory is not writeable."); - } - File link = new File(rcDir, fileNamePrefix + priorityString + this.name); - getProject().log("Creating symbolic link " + link + " referencing " + scriptFile + "..."); - - createSymlink(scriptFile, link, this.overwriteLinks); - } - } - - private void copyFile(File sourceFile, File destFile, boolean overwrite) { - Copy copyTask = new Copy(); - copyTask.setProject(getProject()); - copyTask.init(); - copyTask.setFile(sourceFile); - copyTask.setTofile(destFile); - copyTask.setOverwrite(overwrite); - copyTask.execute(); - } - - private void createSymlink(File targetFile, File linkFile, boolean overwrite) { - Symlink symlinkTask = new Symlink(); - symlinkTask.setProject(getProject()); - symlinkTask.init(); - symlinkTask.setResource(targetFile.getAbsolutePath()); - symlinkTask.setLink(linkFile.getAbsolutePath()); - symlinkTask.setOverwrite(overwrite); - symlinkTask.execute(); - } - - private void setPermissions(File file, String perms) { - Chmod chmodTask = new Chmod(); - chmodTask.setProject(getProject()); - chmodTask.init(); - chmodTask.setFile(file); - chmodTask.setPerm(perms); - chmodTask.execute(); - } -} diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/AbstractBundleType.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/AbstractBundleType.java new file mode 100644 index 0000000..6874a63 --- /dev/null +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/AbstractBundleType.java @@ -0,0 +1,14 @@ +package org.rhq.bundle.ant.type; + +import org.apache.tools.ant.types.DataType; +import org.rhq.bundle.ant.BundleAntProject; + +/** + * + */ +public abstract class AbstractBundleType extends DataType { + @Override + public BundleAntProject getProject() { + return (BundleAntProject)super.getProject(); + } +} diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/AbstractFileType.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/AbstractFileType.java index 4ee7f5a..aa8572f 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/AbstractFileType.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/AbstractFileType.java @@ -32,7 +32,7 @@ import org.apache.tools.ant.types.DataType; * * @author Ian Springer */ -public abstract class AbstractFileType extends DataType { +public abstract class AbstractFileType extends AbstractBundleType { private File source;
public File getSource() { @@ -42,7 +42,7 @@ public abstract class AbstractFileType extends DataType { public void setName(String name) { File file = new File(name); if (file.isAbsolute()) { - throw new BuildException("Path specified by 'file' attribute (" + name + throw new BuildException("Path specified by 'name' attribute (" + name + ") is not relative - it must be a relative path, relative to the Ant basedir."); } this.source = getProject().resolveFile(name); diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/DeploymentType.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/DeploymentType.java new file mode 100644 index 0000000..b4ea2b9 --- /dev/null +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/DeploymentType.java @@ -0,0 +1,245 @@ +/* + * RHQ Management Platform + * Copyright (C) 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.bundle.ant.type; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Project; +import org.apache.tools.ant.Target; +import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.system.SystemInfoFactory; +import org.rhq.core.template.TemplateEngine; +import org.rhq.core.util.updater.DeployDifferences; +import org.rhq.core.util.updater.Deployer; +import org.rhq.core.util.updater.DeploymentData; +import org.rhq.core.util.updater.DeploymentProperties; + +import java.io.File; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.regex.Pattern; + +/** + * An Ant task for deploying a bundle or previewing the deployment. + * + * @author Ian Springer + */ +public class DeploymentType extends AbstractBundleType { + private String name; + private Map<File, File> files = new LinkedHashMap<File, File>(); + private Set<File> archives = new LinkedHashSet<File>(); + private SystemServiceType systemService; + private Pattern ignorePattern; + private Pattern replacePattern; + private boolean preview; + private String preinstallTarget; + + public void install() throws BuildException { + if (this.preinstallTarget != null) { + Target target = (Target) getProject().getTargets().get(this.preinstallTarget); + if (target == null) { + throw new BuildException("Specified preinstall target (" + this.preinstallTarget + ") does not exist."); + } + target.performTasks(); + } + + int deploymentId = getProject().getDeploymentId(); + DeploymentProperties deploymentProps = new DeploymentProperties(deploymentId, getProject().getBundleName(), + getProject().getBundleVersion(), getProject().getBundleDescription()); + File deployDir = getProject().getDeployDir(); + TemplateEngine templateEngine = createTemplateEngine(); + if (this.files.isEmpty() && this.archives.isEmpty()) { + throw new BuildException("You must specify at least one file to deploy via nested rhq:file and/or rhq:archive elements."); + } + if (!this.files.isEmpty()) { + log("Deploying files " + this.files + "...", Project.MSG_VERBOSE); + } + if (!this.archives.isEmpty()) { + log("Deploying archives " + this.archives + "...", Project.MSG_VERBOSE); + } + + // for now, apply the pattern to all files in the deployment + Map<File, Pattern> archiveReplacePatterns = new HashMap<File, Pattern>(); + for (File file : this.archives) { + archiveReplacePatterns.put(file, this.replacePattern); + } + Set<File> rawFilesToReplace = this.files.keySet(); // TODO: CHANGE ME! only replace those raw files marked as "replace=true" + DeploymentData dd = new DeploymentData(deploymentProps, this.archives, this.files, deployDir, + archiveReplacePatterns, rawFilesToReplace, templateEngine, this.ignorePattern); + Deployer deployer = new Deployer(dd); + try { + DeployDifferences diffs = getProject().getDeployDifferences(); + deployer.deploy(diffs); + getProject().log("Results:\n" + diffs + "\n"); + } catch (Exception e) { + throw new BuildException("Failed to deploy bundle '" + getProject().getBundleName() + "' version " + + getProject().getBundleVersion() + ": " + e, e); + } + + if (this.systemService != null) { + this.systemService.install(); + } + + return; + } + + public void start() throws BuildException { + + } + + public void stop() throws BuildException { + + } + + public void upgrade() throws BuildException { + + } + + public void uninstall() throws BuildException { + // TODO + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Map<File, File> getFiles() { + return files; + } + + public Set<File> getArchives() { + return archives; + } + + public boolean isPreview() { + return this.preview; + } + + public void setPreview(boolean preview) { + this.preview = preview; + } + + public String getPreinstallTarget() { + return preinstallTarget; + } + + public void setPreinstallTarget(String preinstallTarget) { + this.preinstallTarget = preinstallTarget; + } + + public void addConfigured(SystemServiceType systemService) { + if (this.systemService != null) { + throw new IllegalStateException("A deployment can only have one system-service child element."); + } + this.systemService = systemService; + } + + public void addConfigured(FileType file) { + File destFile = file.getDestinationFile(); + if (destFile == null) { + File destDir = file.getDestinationDir(); + destFile = new File(destDir, file.getSource().getName()); + } + this.files.put(file.getSource(), destFile); + } + + public void addConfigured(ArchiveType archive) { + this.archives.add(archive.getSource()); + } + + public void addConfigured(IgnoreType ignore) { + List<FileSet> fileSets = ignore.getFileSets(); + this.ignorePattern = getPattern(fileSets); + } + + public void addConfigured(ReplaceType replace) { + List<FileSet> fileSets = replace.getFileSets(); + this.replacePattern = getPattern(fileSets); + } + + private TemplateEngine createTemplateEngine() { + TemplateEngine templateEngine = SystemInfoFactory.fetchTemplateEngine(); + // Add the deployment props to the template engine's tokens. + Configuration config = getProject().getConfiguration(); + for (PropertySimple prop : config.getSimpleProperties().values()) { + templateEngine.getTokens().put(prop.getName(), prop.getStringValue()); + } + return templateEngine; + } + + private static Pattern getPattern(List<FileSet> fileSets) { + boolean first = true; + StringBuilder regex = new StringBuilder(); + for (FileSet fileSet : fileSets) { + if (!first) { + regex.append("|"); + } else { + first = false; + } + regex.append("("); + File dir = fileSet.getDir(); + if (dir != null) { + regex.append(dir); + regex.append('/'); + } + if (fileSet.getIncludePatterns().length == 0) { + regex.append(".*"); + } else { + boolean firstIncludePattern = true; + for (String includePattern : fileSet.getIncludePatterns()) { + if (!firstIncludePattern) { + regex.append("|"); + } else { + firstIncludePattern = false; + } + regex.append("("); + for (int i = 0; i < includePattern.length(); i++) { + char c = includePattern.charAt(i); + if (c == '?') { + regex.append('.'); + } else if (c == '*') { + if (i + 1 < includePattern.length()) { + char c2 = includePattern.charAt(++i); + if (c2 == '*') { + regex.append(".*"); + i++; + continue; + } + } + regex.append("[^/]*"); + } else { + regex.append(c); + } + // TODO: Escape backslashes. + } + regex.append(")"); + } + } + regex.append(")"); + } + return Pattern.compile(regex.toString()); + } +} \ No newline at end of file diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/FileSet.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/FileSet.java index 3f46372..bd92c50 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/FileSet.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/FileSet.java @@ -37,7 +37,7 @@ import java.util.Stack; /** * A fileset that supports includes, but not excludes or selectors. */ -public class FileSet extends DataType { +public class FileSet extends AbstractBundleType { private PatternSet defaultPatterns = new PatternSet();
private File dir; diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/IgnoreType.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/IgnoreType.java index 5a84bb8..5da4a10 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/IgnoreType.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/IgnoreType.java @@ -36,7 +36,7 @@ import java.util.List; * * @author Ian Springer */ -public class IgnoreType extends DataType { +public class IgnoreType extends AbstractBundleType { private List<FileSet> fileSets = new ArrayList<FileSet>();
public void addConfigured(FileSet fileSet) { diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/InputPropertyType.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/InputPropertyType.java new file mode 100644 index 0000000..35aca70 --- /dev/null +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/InputPropertyType.java @@ -0,0 +1,140 @@ +/* + * RHQ Management Platform + * Copyright (C) 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.bundle.ant.type; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Project; +import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; +import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple; +import org.rhq.core.domain.configuration.definition.PropertySimpleType; + +/** + * An Ant task that defines a basic property that the user provides as input for deployment of a bundle. Typically, the + * property will be substituted into configuration files from the bundle during deployment - see ReplaceTask. + * + * If the deployment script is invoked from the GUI, the user will be prompted for values for any input properties that + * are defined via this task. If the script is invoked from the command line, the properties must be passed using the -D + * and/or -propertyfile options. + * + * @author Ian Springer + */ +public class InputPropertyType extends AbstractBundleType { + private String name; + private String description; + private boolean required = true; + private String defaultValue; + private String type = PropertySimpleType.STRING.xmlName(); + + public void init() { + validateAttributes(); + + ConfigurationDefinition configDef = getProject().getConfigurationDefinition(); + PropertySimpleType propSimpleType = PropertySimpleType.fromXmlName(this.type); + PropertyDefinitionSimple propDef = new PropertyDefinitionSimple(this.name, this.description, this.required, + propSimpleType); + configDef.put(propDef); + } + + public void execute() throws BuildException { + String value = getProject().getProperty(this.name); + if (value == null) { + value = this.defaultValue; + } + if (value == null && this.required) { + throw new BuildException("No value was specified for required input property '" + this.name + + "', and no default is defined for the property."); + } + String valueString = (value != null) ? "'" + value + "'" : "<null>"; + log("Initializing input property '" + this.name + "' with value " + valueString + "..."); + + PropertySimple prop = new PropertySimple(this.name, value); + ConfigurationDefinition configDef = getProject().getConfigurationDefinition(); + Configuration config = getProject().getConfiguration(); + // TODO: validate the config + config.put(prop); + return; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDefaultValue() { + return defaultValue; + } + + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + } + + public Boolean getRequired() { + return required; + } + + public void setRequired(Boolean required) { + this.required = required; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * Ensure we have a consistent and legal set of attributes, and set + * any internal flags necessary based on different combinations + * of attributes. + * + * @throws org.apache.tools.ant.BuildException if an error occurs + */ + protected void validateAttributes() throws BuildException { + if (this.name == null) { + throw new BuildException("The 'name' attribute is required."); + } + if (this.name.length() == 0) { + throw new BuildException("The 'name' attribute must have a non-empty value."); + } + try { + PropertySimpleType.fromXmlName(this.type); + } catch (IllegalArgumentException e) { + throw new BuildException("Illegal value for 'type' attribute: " + this.type); + } + if (this.defaultValue == null) { + if (!this.required) { + log("No default value was specified for optional input property '" + this.name + "'.", Project.MSG_WARN); + } + } + } +} \ No newline at end of file diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/ReplaceType.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/ReplaceType.java index a2eb422..cdf2b6c 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/ReplaceType.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/ReplaceType.java @@ -33,7 +33,7 @@ import java.util.List; * * @author Ian Springer */ -public class ReplaceType extends DataType { +public class ReplaceType extends AbstractBundleType { private List<FileSet> fileSets = new ArrayList<FileSet>();
public void addConfigured(FileSet fileSet) { diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/SystemServiceType.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/SystemServiceType.java new file mode 100644 index 0000000..677c117 --- /dev/null +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/SystemServiceType.java @@ -0,0 +1,338 @@ +/* + * RHQ Management Platform + * Copyright (C) 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.bundle.ant.type; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.taskdefs.Chmod; +import org.apache.tools.ant.taskdefs.Copy; +import org.apache.tools.ant.taskdefs.optional.unix.Symlink; + +import java.io.File; +import java.util.HashSet; +import java.util.Set; +import java.util.TreeSet; + +/** + * An Ant task that installs a system startup/shutdown service. Currently only Red Hat Linux versions are supported. + * + * @author Ian Springer + */ +public class SystemServiceType extends AbstractBundleType { + private static final String OS_NAME = System.getProperty("os.name"); + private static final File REDHAT_RELEASE_FILE = new File("/etc/redhat-release"); + private static final Set<Character> REDHAT_RUN_LEVELS = new HashSet<Character>(); + static { + for (char c = '0'; c <= '6'; c++) { + REDHAT_RUN_LEVELS.add(c); + } + // TODO: Add 's' and/or 'S' depending on the flavor of UNIX. + } + private static final File INIT_DIR = new File("/etc/init.d"); + private static final File SYSCONFIG_DIR = new File("/etc/sysconfig"); + private static final File DEFAULT_ROOT = new File("/"); + + private String name; + private File scriptFile; + private File configFile; + private boolean overwriteScript; + private boolean overwriteConfig; + private boolean overwriteLinks = true; + private File root = DEFAULT_ROOT; + private String startLevels; + + /** + * An integer from 0-99 indicating the service's start order - services with a lower priority number are started + * before services with a higher priority number. + */ + private Byte startPriority; + + /** + * An integer from 0-99 indicating the service's stop order - services with a lower priority number are stopped + * before services with a higher priority number. + */ + private Byte stopPriority; + + private Set<Character> startLevelChars; + private Set<Character> stopLevelChars; + + public void install() { + if (!OS_NAME.equals("Linux") || !REDHAT_RELEASE_FILE.exists() ) { + throw new BuildException("The system-service element is only supported on Red Hat Linux systems."); + } + validateAttributes(); + + // Install the config file if one was provided (e.g. /etc/sysconfig/named). + if (this.configFile != null) { + File sysconfigDir = new File(this.root, SYSCONFIG_DIR.getPath().substring(1)); + if (!sysconfigDir.exists()) { + sysconfigDir.mkdirs(); + } + if (!sysconfigDir.canWrite()) { + throw new BuildException(sysconfigDir + " directory is not writeable."); + } + File configDestFile = new File(sysconfigDir, this.name); + copyFile(this.configFile, configDestFile, this.overwriteConfig); + setPermissions(configDestFile, "644"); + } + + // Install the script itself (e.g. /etc/init.d/named). + File initDir = new File(this.root, INIT_DIR.getPath().substring(1)); + if (!initDir.exists()) { + initDir.mkdirs(); + } + if (!initDir.canWrite()) { + throw new BuildException(initDir + " directory is not writeable."); + } + File scriptDestFile = new File(initDir, this.name); + getProject().log("Installing service script " + scriptDestFile + "..."); + copyFile(this.scriptFile, scriptDestFile, this.overwriteScript); + setPermissions(scriptDestFile, "755"); + + // Create the symlinks in the rcX.d dirs (e.g. /etc/rc3.d/S24named -> ../init.d/named) + createScriptSymlinks(scriptDestFile, this.startPriority, this.startLevelChars, 'S'); + createScriptSymlinks(scriptDestFile, this.stopPriority, this.stopLevelChars, 'K'); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public File getScriptFile() { + return scriptFile; + } + + public void setScriptFile(File scriptFile) { + this.scriptFile = scriptFile; + } + + public File getConfigFile() { + return configFile; + } + + public void setConfigFile(File configFile) { + this.configFile = configFile; + } + + public boolean isOverwriteScript() { + return overwriteScript; + } + + public void setOverwriteScript(boolean overwriteScript) { + this.overwriteScript = overwriteScript; + } + + public boolean isOverwriteConfig() { + return overwriteConfig; + } + + public void setOverwriteConfig(boolean overwriteConfig) { + this.overwriteConfig = overwriteConfig; + } + + public boolean isOverwriteLinks() { + return overwriteLinks; + } + + public void setOverwriteLinks(boolean overwriteLinks) { + this.overwriteLinks = overwriteLinks; + } + + public String getStartLevels() { + return startLevels; + } + + public void setStartLevels(String startLevels) { + this.startLevels = startLevels; + } + + public byte getStartPriority() { + return startPriority; + } + + public void setStartPriority(byte startPriority) { + this.startPriority = startPriority; + } + + public byte getStopPriority() { + return stopPriority; + } + + public void setStopPriority(byte stopPriority) { + this.stopPriority = stopPriority; + } + + public File getRoot() { + return root; + } + + public void setRoot(File root) { + this.root = root; + } + + /** + * Ensure we have a consistent and legal set of attributes, and set + * any internal flags necessary based on different combinations + * of attributes. + * + * @throws BuildException if an error occurs + */ + protected void validateAttributes() throws BuildException { + if (this.name == null) { + throw new BuildException("The 'name' attribute is required."); + } + if (this.name.length() == 0) { + throw new BuildException("The 'name' attribute must have a non-empty value."); + } + + if (this.scriptFile == null) { + throw new BuildException("The 'scriptFile' attribute is required."); + } + if (!this.scriptFile.exists() || this.scriptFile.isDirectory()) { + throw new BuildException("The 'scriptFile' attribute must be set to the path of an existing regular file."); + } + if (!this.configFile.exists() || this.configFile.isDirectory()) { + throw new BuildException("The 'configFile' attribute must be set to the path of an existing regular file."); + } + + if (this.startLevels == null) { + throw new BuildException("The 'startLevels' attribute is required."); + } + if (this.startLevels.length() == 0) { + throw new BuildException("The 'startLevels' attribute must have a non-empty value."); + } + this.startLevelChars = parseLevels(this.startLevels); + this.stopLevelChars = new TreeSet<Character>(); + for (char level : REDHAT_RUN_LEVELS) { + if (!this.startLevelChars.contains(level)) { + this.stopLevelChars.add(level); + } + } + + if (this.startPriority == null) { + throw new BuildException("The 'startPriority' attribute is required."); + } + if (this.startPriority < 0 || this.startPriority > 99) { + throw new BuildException("The 'startPriority' attribute must be >=0 and <= 99."); + } + if (this.stopPriority == null) { + throw new BuildException("The 'stopPriority' attribute is required."); + } + if (this.stopPriority < 0 || this.stopPriority > 99) { + throw new BuildException("The 'startPriority' attribute must be >=0 and <= 99."); + } + + if (!this.root.exists()) { + this.root.mkdirs(); + if (!this.root.exists()) { + throw new BuildException("Failed to create root directory " + this.root + + " as specified by 'root' attribute."); + } + } + if (!this.root.isDirectory()) { + throw new BuildException("The 'root' attribute must be set to the path of a directory."); + } + if (!this.root.equals(DEFAULT_ROOT)) { + getProject().log("Using root " + this.root + "."); + } + } + + private static Set<Character> parseLevels(String levels) { + Set<Character> levelChars = new TreeSet<Character>(); + String[] tokens = levels.split("[ ]*,[ ]*"); + for (String token : tokens) { + if (!token.equals("")) { + Character level; + try { + if (token.length() != 1) { + throw new Exception(); + } + level = token.charAt(0); + if (!REDHAT_RUN_LEVELS.contains(level)) { + throw new Exception(); + } + + } catch (Exception e) { + throw new BuildException("Invalid run level: " + token + + " - the 'startLevels' attribute must be a comma-separated list of run levels - the valid levels are " + + REDHAT_RUN_LEVELS + "."); + } + if (levelChars.contains(level)) { + throw new BuildException("The 'startLevels' attribute defines run level " + level + " more than once."); + } + levelChars.add(level); + } + } + return levelChars; + } + + private void createScriptSymlinks(File scriptFile, byte priority, Set<Character> levels, char fileNamePrefix) { + String priorityString = String.format("%02d", priority); + for (char level : levels) { + File rcDir = new File(this.root, "etc/rc" + level + ".d"); + if (!rcDir.exists()) { + rcDir.mkdirs(); + } + if (!rcDir.exists()) { + throw new BuildException(rcDir + " does not exist."); + } + if (!rcDir.isDirectory()) { + throw new BuildException(rcDir + " exists but is not a directory."); + } + if (!rcDir.isDirectory()) { + throw new BuildException(rcDir + " directory is not writeable."); + } + File link = new File(rcDir, fileNamePrefix + priorityString + this.name); + getProject().log("Creating symbolic link " + link + " referencing " + scriptFile + "..."); + + createSymlink(scriptFile, link, this.overwriteLinks); + } + } + + private void copyFile(File sourceFile, File destFile, boolean overwrite) { + Copy copyTask = new Copy(); + copyTask.setProject(getProject()); + copyTask.init(); + copyTask.setFile(sourceFile); + copyTask.setTofile(destFile); + copyTask.setOverwrite(overwrite); + copyTask.execute(); + } + + private void createSymlink(File targetFile, File linkFile, boolean overwrite) { + Symlink symlinkTask = new Symlink(); + symlinkTask.setProject(getProject()); + symlinkTask.init(); + symlinkTask.setResource(targetFile.getAbsolutePath()); + symlinkTask.setLink(linkFile.getAbsolutePath()); + symlinkTask.setOverwrite(overwrite); + symlinkTask.execute(); + } + + private void setPermissions(File file, String perms) { + Chmod chmodTask = new Chmod(); + chmodTask.setProject(getProject()); + chmodTask.init(); + chmodTask.setFile(file); + chmodTask.setPerm(perms); + chmodTask.execute(); + } +} diff --git a/modules/common/ant-bundle/src/main/resources/org/rhq/bundle/antlib.xml b/modules/common/ant-bundle/src/main/resources/org/rhq/bundle/antlib.xml index b522491..9f01c2b 100644 --- a/modules/common/ant-bundle/src/main/resources/org/rhq/bundle/antlib.xml +++ b/modules/common/ant-bundle/src/main/resources/org/rhq/bundle/antlib.xml @@ -6,18 +6,16 @@ <!-- bundle task --> <taskdef name="bundle" classname="org.rhq.bundle.ant.task.BundleTask"/>
- <!-- inputProperty task --> - <taskdef name="input-property" classname="org.rhq.bundle.ant.task.InputPropertyTask"/> - - <!-- deploy task and its child types --> - <taskdef name="deploy" classname="org.rhq.bundle.ant.task.DeployTask"/> + <!-- bundle task's child types --> + <typedef name="input-property" classname="org.rhq.bundle.ant.type.InputPropertyType"/> + <typedef name="deployment" classname="org.rhq.bundle.ant.type.DeploymentType"/>
+ <!-- deployment type's child types --> <typedef name="file" classname="org.rhq.bundle.ant.type.FileType"/> <typedef name="archive" classname="org.rhq.bundle.ant.type.ArchiveType"/> <typedef name="replace" classname="org.rhq.bundle.ant.type.ReplaceType"/> <typedef name="ignore" classname="org.rhq.bundle.ant.type.IgnoreType"/> <typedef name="fileset" classname="org.rhq.bundle.ant.type.FileSet"/> - - <!-- install-system-service task --> - <taskdef name="install-system-service" classname="org.rhq.bundle.ant.task.InstallSystemServiceTask"/> + <typedef name="system-service" classname="org.rhq.bundle.ant.type.SystemServiceType"/> + </antlib> diff --git a/modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java b/modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java index d5802e9..403bfa2 100644 --- a/modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java +++ b/modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java @@ -74,7 +74,7 @@ public class AntLauncherTest { Properties inputProps = createInputProperties("/test-bundle-v1-input.properties"); List<BuildListener> buildListeners = createBuildListeners();
- BundleAntProject project = ant.executeBundleDeployFile(getBuildXml("test-bundle-v1.xml"), "deploy", inputProps, + BundleAntProject project = ant.executeBundleDeployFile(getBuildXml("test-bundle-v1.xml"), null, inputProps, buildListeners); /*Map<String, String> bundleFiles = project.getBundleFiles(); assert bundleFiles != null; @@ -91,6 +91,9 @@ public class AntLauncherTest { Configuration config = project.getConfiguration(); assert config.getProperties().size() == 1 : config.getProperties(); assert "10000".equals(config.getSimpleValue("listener.port", null)) : config.getProperties(); + + String preinstallTargetExecuted = (String) project.getProperties().get("preinstallTargetExecuted"); + assert preinstallTargetExecuted.equals("true"); }
private List<BuildListener> createBuildListeners() { @@ -111,7 +114,7 @@ public class AntLauncherTest { Properties inputProps = createInputProperties("/test-bundle-v2-input.properties"); List<BuildListener> buildListeners = createBuildListeners();
- BundleAntProject project = ant.executeBundleDeployFile(getBuildXml("test-bundle-v2.xml"), "deploy", inputProps, + BundleAntProject project = ant.executeBundleDeployFile(getBuildXml("test-bundle-v2.xml"), null, inputProps, buildListeners); /*Map<String, String> bundleFiles = project.getBundleFiles(); assert bundleFiles != null; @@ -134,6 +137,8 @@ public class AntLauncherTest { Properties inputProps = new Properties(); inputProps.setProperty(DeployPropertyNames.DEPLOY_DIR, DEPLOY_DIR.getPath()); inputProps.setProperty(DeployPropertyNames.DEPLOY_ID, "100"); + inputProps.setProperty(DeployPropertyNames.DEPLOY_NAME, "appserver"); + inputProps.setProperty(DeployPropertyNames.DEPLOY_PHASE, DeploymentPhase.INSTALL.name()); InputStream inputStream = this.getClass().getResourceAsStream(resourcePath); try { inputProps.load(inputStream); diff --git a/modules/common/ant-bundle/src/test/resources/test-bundle-v1.xml b/modules/common/ant-bundle/src/test/resources/test-bundle-v1.xml index cf2c019..2e63b2c 100644 --- a/modules/common/ant-bundle/src/test/resources/test-bundle-v1.xml +++ b/modules/common/ant-bundle/src/test/resources/test-bundle-v1.xml @@ -1,34 +1,39 @@ <?xml version="1.0"?>
-<project name="test-bundle" xmlns:rhq="antlib:org.rhq.bundle"> +<project name="test-bundle" default="main" xmlns:rhq="antlib:org.rhq.bundle">
<rhq:bundle name="example.com (JBoss EAP 4.3)" version="1.0" - description="example.com corporate website hosted on JBoss EAP 4.3"/> - - <rhq:input-property - name="listener.port" - description="This is where the product will listen for incoming messages" - required="true" - defaultValue="8080" - type="integer"/> - - <target name="deploy"> - <echo>Deploying Test Bundle v1.0 to ${rhq.deploy.dir}...</echo> + description="example.com corporate website hosted on JBoss EAP 4.3"> + + <rhq:input-property + name="listener.port" + description="This is where the product will listen for incoming messages" + required="true" + defaultValue="8080" + type="integer"/>
- rhq:deploy + <rhq:deployment name="appserver" preinstallTarget="preinstall"> + <rhq:system-service name="foo" scriptFile="foo-script" + configFile="foo-config" overwriteScript="true" + startLevels="3,4,5" startPriority="80" stopPriority="20" root="root"/> <rhq:file name="test-v1.properties" destinationFile="subdir/test.properties"/> <rhq:archive name="file.zip"/> rhq:replace <rhq:fileset includes="**/*.properties"/> </rhq:replace> + <!-- the files that should be ignored during upgrades --> rhq:ignore <rhq:fileset includes="*.log"/> </rhq:ignore> - </rhq:deploy> + </rhq:deployment> + + </rhq:bundle>
- <mkdir dir="root"/> - <rhq:install-system-service name="foo" scriptFile="foo-script" configFile="foo-config" overwriteScript="true" - startLevels="3,4,5" startPriority="80" stopPriority="20" root="root"/> + <target name="main"/> + + <target name="preinstall"> + <echo>Deploying Test Bundle v1.0 to ${rhq.deploy.dir}...</echo> + <property name="preinstallTargetExecuted" value="true"/> </target>
</project> \ No newline at end of file diff --git a/modules/common/ant-bundle/src/test/resources/test-bundle-v2.xml b/modules/common/ant-bundle/src/test/resources/test-bundle-v2.xml index fd7ed44..501ba3f 100644 --- a/modules/common/ant-bundle/src/test/resources/test-bundle-v2.xml +++ b/modules/common/ant-bundle/src/test/resources/test-bundle-v2.xml @@ -1,30 +1,39 @@ <?xml version="1.0"?>
-<project name="test-bundle" xmlns:rhq="antlib:org.rhq.bundle"> - - <rhq:bundle name="example.com (JBoss EAP 4.3)" version="2.0" - description="example.com corporate website hosted on JBoss EAP 4.3"/> - - <rhq:input-property - name="listener.port" - description="This is where the product will listen for incoming messages" - required="true" - defaultValue="8080" - type="integer"/> - - <target name="deploy"> - <echo>Deploying Test Bundle v2.0 to ${rhq.deploy.dir}...</echo> - <echo file="${rhq.deploy.dir}/test.log">TEST</echo> - rhq:deploy +<project name="test-bundle" default="main" xmlns:rhq="antlib:org.rhq.bundle"> + + <rhq:bundle name="example.com (JBoss EAP 4.3)" version="1.0" + description="example.com corporate website hosted on JBoss EAP 4.3"> + + <rhq:input-property + name="listener.port" + description="This is where the product will listen for incoming messages" + required="true" + defaultValue="8080" + type="integer"/> + + <rhq:deployment name="appserver" preinstallTarget="preinstall"> + <rhq:system-service name="foo" scriptFile="foo-script" + configFile="foo-config" overwriteScript="true" + startLevels="3,4,5" startPriority="80" stopPriority="20" root="root"/> <rhq:file name="test-v2.properties" destinationFile="subdir/test.properties"/> <rhq:archive name="file.zip"/> rhq:replace <rhq:fileset includes="**/*.properties"/> </rhq:replace> + <!-- the files that should be ignored during upgrades --> rhq:ignore <rhq:fileset includes="*.log"/> </rhq:ignore> - </rhq:deploy> + </rhq:deployment> + + </rhq:bundle> + + <target name="main"/> + + <target name="preinstall"> + <echo>Deploying Test Bundle v2.0 to ${rhq.deploy.dir}...</echo> + <property name="preinstallTargetExecuted" value="true"/> </target>
</project> \ No newline at end of file diff --git a/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java b/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java index 65b151b..f3072fd 100644 --- a/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java +++ b/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java @@ -106,8 +106,10 @@ public class AntBundlePluginComponent implements ResourceComponent, BundleFacet StreamUtil.copy(in, out);
// Get the bundle's configuration values and the global system facts and - // add them as Ant properties so the ant script can get their values. + // add them as Ant properties so the Ant script can get their values. Properties antProps = createAntProperties(bundleDeployment); + // TODO: Eventually the phase to be executed should be passed in by the PC when it calls us. + antProps.setProperty(DeployPropertyNames.DEPLOY_PHASE, "INSTALL");
List<BuildListener> buildListeners = new ArrayList(); LoggerAntBuildListener logger = new LoggerAntBuildListener(null, logFileOutput, Project.MSG_DEBUG); @@ -160,6 +162,7 @@ public class AntBundlePluginComponent implements ResourceComponent, BundleFacet
int deploymentId = bundleDeployment.getId(); antProps.setProperty(DeployPropertyNames.DEPLOY_ID, Integer.toString(deploymentId)); + antProps.setProperty(DeployPropertyNames.DEPLOY_NAME, bundleDeployment.getName());
Map<String, String> sysFacts = SystemInfoFactory.fetchTemplateEngine().getTokens(); for (Map.Entry<String, String> fact : sysFacts.entrySet()) {
commit 45c791072dd09fab2405502c660c6ef105640729 Author: Ian P. Springer <ips@jetengine.(none)> Date: Mon May 17 20:09:57 2010 -0400
fix several minor typos in comments
diff --git a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/CpuComponent.java b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/CpuComponent.java index 67ee20a..d5bc264 100644 --- a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/CpuComponent.java +++ b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/CpuComponent.java @@ -41,6 +41,9 @@ import org.rhq.core.pluginapi.measurement.MeasurementFacet; import org.rhq.core.pluginapi.util.ObjectUtil; import org.rhq.core.system.CpuInformation;
+/** + * A Resource component representing a CPU core. + */ public class CpuComponent implements ResourceComponent<PlatformComponent>, MeasurementFacet { private CpuInformation cpuInformation = null; private CpuEntry startCpuEntry = null; @@ -48,7 +51,7 @@ public class CpuComponent implements ResourceComponent<PlatformComponent>, Measu /** * A Map of cpu metric names to the last (Sigar) Cpu record used in calculations for that metric in getValues. * This allows us to take proper cpu usage deltas for each metric, on different schedules. See - * RHQ-2457 for why this is necessary. + * RHQ-245 for why this is necessary. */ private Map<String, CpuEntry> cpuCache;
@@ -59,9 +62,11 @@ public class CpuComponent implements ResourceComponent<PlatformComponent>, Measu cpuCache = new HashMap<String, CpuEntry>(); startCpuEntry = new CpuEntry(cpuInformation.getCpu()); } + return; }
public void stop() { + return; }
public AvailabilityType getAvailability() { @@ -85,7 +90,7 @@ public class CpuComponent implements ResourceComponent<PlatformComponent>, Measu String property = request.getName();
if (property.startsWith("Cpu.")) { - // Grab the current cpu info from Sigar, only once for this cpu for all processed schedules + // Grab the current cpu info from SIGAR, only once for this cpu for all processed schedules if (cpu == null) { cpu = cpuInformation.getCpu(); } @@ -99,14 +104,14 @@ public class CpuComponent implements ResourceComponent<PlatformComponent>, Measu } else if (property.startsWith("CpuPerc.")) {
/* - * ! we no longer use the Sigar CpuPerc object to report cpu percentage metrics. See + * ! we no longer use the SIGAR CpuPerc object to report cpu percentage metrics. See * ! RHQ-245 for an explanation. We now calculate our own percentages using * ! the current raw cpu info from Sigar and the previous cpu numbers, cached per metric. * ! This allows us to avoid the problem in RHQ-245 while handling perCpu-perMetric schedule * ! granularity. */
- // Grab the current cpu info from Sigar, only once for this cpu for all processed schedules + // Grab the current cpu info from SIGAR, only once for this cpu for all processed schedules if (null == cpu) { cpu = cpuInformation.getCpu(); } @@ -119,20 +124,20 @@ public class CpuComponent implements ResourceComponent<PlatformComponent>, Measu CpuEntry previousCpu = cpuCache.put(property, currentCpu); previousCpu = (null == previousCpu) ? startCpuEntry : previousCpu;
- // if for some reason the delta time is excessive then toss the - // the metric, it depends on a reasonable interval between prev - // and curr. This can happen due to avail down or a newly + // if for some reason the delta time is excessive then toss + // the metric, since it depends on a reasonable interval between + // prev and curr. This can happen due to avail down or a newly // activated metric. Allow up to twice the metric interval. Number num = null; long deltaTime = currentCpu.getTimestamp() - previousCpu.getTimestamp();
if (deltaTime <= (2 * request.getInterval())) { - // Use the same calculation as Sigar uses to generate the percentages. The difference is that + // Use the same calculation that SIGAR uses to generate the percentages. The difference is that // we use a safe "previous" cpu record. num = getPercentage(previousCpu.getCpu(), cpu, property); }
- // uncomment to see details about the calculations + // Uncomment to see details about the calculations. //System.out.println("\nCPU-" + cpuInformation.getCpuIndex() + " Interval=" // + ((currentCpu.getTimestamp() - previousCpu.getTimestamp()) / 1000) + " " + property + "=" // + num + "\n Prev=" + previousCpu + "\n Curr=" + currentCpu); @@ -168,11 +173,12 @@ public class CpuComponent implements ResourceComponent<PlatformComponent>, Measu } } } + return; }
/** * Calculate the percentage of CPU taken up by the requested cpu property (metric) for the interval - * defined by the prev and curr cpu numbers. This algorithm is taken from Sigar. See + * defined by the prev and curr cpu numbers. This algorithm is taken from SIGAR. See * http://svn.hyperic.org/projects/sigar/trunk/src/sigar_format.c ( sigar_cpu_perc_calculate() ) */ private Number getPercentage(Cpu prev, Cpu curr, String property) { @@ -191,7 +197,7 @@ public class CpuComponent implements ResourceComponent<PlatformComponent>, Measu diff_soft_irq = curr.getSoftIrq() - prev.getSoftIrq(); diff_stolen = curr.getStolen() - prev.getStolen();
- // It's not exactly clear to me what Sigar is doing here. It may be to handle a rollover of + // It's not exactly clear to me what SIGAR is doing here. It may be to handle a rollover of // the cumulative cpu usage numbers. If so, this code could maybe be improved to still // determine the total usage. diff_user = diff_user < 0 ? 0 : diff_user; @@ -228,7 +234,7 @@ public class CpuComponent implements ResourceComponent<PlatformComponent>, Measu }
/** - * Just a private, immutable, utility class for associating a CPU and timestamp with teh raw Cpu object from Sigar. + * Just a private, immutable, utility class for associating a CPU and timestamp with the raw Cpu object from SIGAR. */ private class CpuEntry { private Cpu cpu;
commit 927194d360d4b47023fa9713d18365081457a1f6 Author: Ian P. Springer <ips@jetengine.(none)> Date: Mon May 17 11:21:14 2010 -0400
fix so plugin jar MD5 and plugin version are calculated by opening streams directly from the plugin jar URLs, rather than trying to convert the URLs to Files and opening the streams from the Files, which won't work when running inside the admin-console because the URLs will be jndi URLs, not file URLs (fix for https://jira.jboss.org/browse/EMBJOPR-274)
diff --git a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/descriptor/PluginTransformer.java b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/descriptor/PluginTransformer.java index 613500f..ecaa80b 100644 --- a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/descriptor/PluginTransformer.java +++ b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/descriptor/PluginTransformer.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -20,7 +20,6 @@ * if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - package org.rhq.core.clientapi.descriptor;
import org.rhq.core.domain.plugin.Plugin; @@ -30,8 +29,7 @@ import org.rhq.core.util.MessageDigestGenerator;
import java.net.URL; import java.io.IOException; -import java.io.File; -import java.util.jar.JarFile; +import java.util.jar.JarInputStream; import java.util.jar.Manifest; import java.util.jar.Attributes;
@@ -94,38 +92,33 @@ public class PluginTransformer { }
private String getMd5(URL pluginURL) throws IOException { - File jarFile = toFile(pluginURL); - return MessageDigestGenerator.getDigestString(jarFile); + return MessageDigestGenerator.getDigestString(pluginURL); }
String getVersion(PluginDescriptor pluginDescriptor, URL pluginURL) throws IOException { - if (pluginDescriptor.getVersion() != null) { - return pluginDescriptor.getVersion(); + String version = pluginDescriptor.getVersion(); + if (version == null) { + version = getVersionFromPluginJarManifest(pluginURL); } - - File pluginJarFile = toFile(pluginURL); - - String version = getVersionFromPluginJarManifest(pluginJarFile); - + if (version == null) { - throw new PluginTransformException("No version is defined for plugin jar [" + pluginJarFile - + "]. A version must be defined either via the MANIFEST.MF [" + Attributes.Name.IMPLEMENTATION_VERSION - + "] attribute or via the plugin descriptor 'version' attribute."); + throw new PluginTransformException("No version is defined for plugin jar [" + pluginURL + + "]. A version must be defined either via the MANIFEST.MF '" + Attributes.Name.IMPLEMENTATION_VERSION + + "' attribute or via the plugin descriptor 'version' attribute."); }
return version; }
- private String getVersionFromPluginJarManifest(File pluginJarFile) throws IOException { - JarFile jarFile = new JarFile(pluginJarFile); - Manifest manifest = jarFile.getManifest(); - Attributes attributes = manifest.getMainAttributes(); - - return attributes.getValue(Attributes.Name.IMPLEMENTATION_VERSION); - } - - private File toFile(URL url) { - return new File(url.getPath()); + private String getVersionFromPluginJarManifest(URL pluginJarUrl) throws IOException { + JarInputStream jarInputStream = new JarInputStream(pluginJarUrl.openStream()); + jarInputStream.close(); + Manifest manifest = jarInputStream.getManifest(); + if (manifest != null) { + Attributes attributes = manifest.getMainAttributes(); + return attributes.getValue(Attributes.Name.IMPLEMENTATION_VERSION); + } else { + return null; + } } - } diff --git a/modules/core/util/src/main/java/org/rhq/core/util/MessageDigestGenerator.java b/modules/core/util/src/main/java/org/rhq/core/util/MessageDigestGenerator.java index 9a20424..e96d86a 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/MessageDigestGenerator.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/MessageDigestGenerator.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -28,6 +28,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.net.URL; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException;
@@ -260,6 +261,18 @@ public class MessageDigestGenerator { } }
+ public byte[] calcDigest(URL url) throws IOException { + InputStream is = null; + try { + is = url.openStream(); + return calcDigest(new BufferedInputStream(is, 1024 * 32)); + } finally { + if (is != null) { + is.close(); + } + } + } + /** * Calculates the digest for a given file. The file's contents will be used as the source data for the digest calculation. * @@ -279,6 +292,24 @@ public class MessageDigestGenerator { }
/** + * Calculates the digest for a given file. The file's contents will be used as the source data for the digest calculation. + * + * @param url the URL whose contents are to be used to calculate the digest. + * + * @return the URL content's digest as a String + * + * @throws IOException if the URL could not be read or accessed + */ + public static String getDigestString(URL url) throws IOException { + MessageDigestGenerator md5 = new MessageDigestGenerator(MD5); + return md5.calcDigestString(url); + } + + public String calcDigestString(URL url) throws IOException { + return calculateDigestStringFromBytes(calcDigest(url)); + } + + /** * Given a digest byte array, this will return its String representation. * * @param bytes the digest whose String representation is to be returned
commit 56e11dc87cd349434f68ccd1bcb995ac1be6bdcd Author: John Mazzitelli mazz@redhat.com Date: Mon May 17 11:14:00 2010 -0400
pass through the clean/revert flags to the agent bundle plugins. get the file template bundle plugin to do the clean if appropriate. file template bundles don't support revert, so we fail-fast if revert is requested
diff --git a/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/bundle/BundleDeployRequest.java b/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/bundle/BundleDeployRequest.java index ce59d2a..d70716e 100644 --- a/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/bundle/BundleDeployRequest.java +++ b/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/bundle/BundleDeployRequest.java @@ -38,6 +38,8 @@ public class BundleDeployRequest implements Serializable { private BundleManagerProvider bundleManagerProvider; private File bundleFilesLocation; private Map<PackageVersion, File> packageVersionFiles; + private boolean isCleanDeployment = false; + private boolean isRevert = false;
public BundleDeployRequest() { } @@ -86,4 +88,38 @@ public class BundleDeployRequest implements Serializable { this.bundleManagerProvider = provider; }
+ /** + * @return flag to indicate if the deployment directory should have all of its files deleted + * prior to deploying the new files. All files in the deployment directory should be cleaned, + * including files/directories that are marked to be "ignored". + */ + public boolean isCleanDeployment() { + return isCleanDeployment; + } + + public void setCleanDeployment(boolean isCleanDeployment) { + this.isCleanDeployment = isCleanDeployment; + } + + /** + * @return flag to indicate if this bundle deployment request should revert a deployment back to + * a previous state. Reverting means that any files backed up from the last deployment + * are reverted to their original state. + */ + public boolean isRevert() { + return isRevert; + } + + public void setRevert(boolean isRevert) { + this.isRevert = isRevert; + } + + @Override + public String toString() { + StringBuilder str = new StringBuilder(this.getClass() + ": "); + str.append("deployment=[").append(resourceDeployment.toString()).append("], "); + str.append("clean=[").append(isCleanDeployment).append("], "); + str.append("revert=[").append(isRevert).append("]"); + return str.toString(); + } } diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java index ae584a2..c2e4d6e 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java @@ -154,6 +154,8 @@ public class BundleManager extends AgentService implements BundleAgentService, B deployRequest.setResourceDeployment(resourceDeployment); deployRequest.setBundleFilesLocation(bundleFilesDir); deployRequest.setPackageVersionFiles(downloadedFiles); + deployRequest.setCleanDeployment(request.isCleanDeployment()); + deployRequest.setRevert(request.isRevert()); BundleDeployResult result = bundlePluginComponent.deployBundle(deployRequest); if (!result.isSuccess()) { response.setErrorMessage(result.getErrorMessage()); diff --git a/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java b/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java index cc1d47d..3342ef3 100644 --- a/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java +++ b/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java @@ -18,6 +18,8 @@ */ package org.rhq.plugins.filetemplate;
+import java.io.File; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
@@ -32,6 +34,7 @@ import org.rhq.core.pluginapi.bundle.BundleFacet; import org.rhq.core.pluginapi.bundle.BundleManagerProvider; import org.rhq.core.pluginapi.inventory.ResourceComponent; import org.rhq.core.pluginapi.inventory.ResourceContext; +import org.rhq.core.pluginapi.util.FileUtils;
/** * @author John Mazzitelli @@ -62,12 +65,28 @@ public class FileTemplateBundlePluginServerComponent implements ResourceComponen
public BundleDeployResult deployBundle(BundleDeployRequest request) { BundleDeployResult result = new BundleDeployResult(); + + // the file template recipe processor does not support reverting deployments + // thus we need to fail-fast if a revert deployment is being requested + if (request.isRevert()) { + result.setErrorMessage("File template bundles cannot be reverted"); + return result; + } + try { BundleResourceDeployment resourceDeployment = request.getResourceDeployment(); BundleDeployment bundleDeployment = resourceDeployment.getBundleDeployment(); BundleVersion bundleVersion = bundleDeployment.getBundleVersion(); BundleManagerProvider bundleManagerProvider = request.getBundleManagerProvider();
+ // before processing the recipe, wipe the dest dir if we need to perform a clean deployment + if (request.isCleanDeployment()) { + File deployDir = new File(bundleDeployment.getDestination().getDeployDir()); + if (deployDir.exists()) { + FileUtils.purge(deployDir, true); + } + } + // process the recipe String recipe = bundleVersion.getRecipe(); RecipeParser parser = new RecipeParser();
commit f3a9896ba91c4049370b4ed7c9cb49662201fc8a Author: John Mazzitelli mazz@redhat.com Date: Mon May 17 09:56:03 2010 -0400
just some javadocs
diff --git a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/bundle/BundleScheduleRequest.java b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/bundle/BundleScheduleRequest.java index 207abd9..30e4f83 100644 --- a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/bundle/BundleScheduleRequest.java +++ b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/bundle/BundleScheduleRequest.java @@ -30,6 +30,8 @@ import java.util.Date; import org.rhq.core.domain.bundle.BundleResourceDeployment;
/** + * The request that the server sends down to the agent to schedule a bundle deployment. + * * @author John Mazzitelli */ public class BundleScheduleRequest implements Serializable { @@ -44,11 +46,16 @@ public class BundleScheduleRequest implements Serializable { this.resourceDeployment = resourceDeployment; }
+ /** + * @return Data describing what needs to get deployed. + */ public BundleResourceDeployment getBundleResourceDeployment() { return resourceDeployment; }
- /** In ms */ + /** + * @return the time the deployment should be scheduled to happen, in epoch millis. + */ public Long getRequestedDeployTime() { return requestedDeployTime; } @@ -57,6 +64,11 @@ public class BundleScheduleRequest implements Serializable { return DateFormat.getInstance().format(new Date(requestedDeployTime)); }
+ /** + * @return flag to indicate if the deployment directory should have all of its files deleted + * prior to deploying the new files. All files in the deployment directory will be cleaned, + * including files/directories that are marked to be "ignored". + */ public boolean isCleanDeployment() { return isCleanDeployment; } @@ -65,6 +77,11 @@ public class BundleScheduleRequest implements Serializable { this.isCleanDeployment = isCleanDeployment; }
+ /** + * @return flag to indicate if this bundle deployment request is reverting a deployment back to + * a previous state. Reverting means that any files backed up from the last deployment + * are reverted to their original state. + */ public boolean isRevert() { return isRevert; } @@ -76,7 +93,9 @@ public class BundleScheduleRequest implements Serializable { @Override public String toString() { StringBuilder str = new StringBuilder(this.getClass() + ": "); - str.append(resourceDeployment.toString()); + str.append("deployment=[").append(resourceDeployment.toString()).append("], "); + str.append("clean=[").append(isCleanDeployment).append("], "); + str.append("revert=[").append(isRevert).append("]"); return str.toString(); } }
commit 5e5bf6e98877b561413d1a361f07f76d104e3a40 Author: John Mazzitelli mazz@redhat.com Date: Fri May 14 15:31:58 2010 -0400
provide an option to clean the destination directory before laying down the new files
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/DeployDifferences.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/DeployDifferences.java index 4b26bcb..15de627 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/updater/DeployDifferences.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/DeployDifferences.java @@ -51,6 +51,7 @@ public class DeployDifferences { private final Map<String, String> restoredFiles = new HashMap<String, String>(); private final Map<String, String> realizedFiles = new HashMap<String, String>(); private final Map<String, String> errors = new HashMap<String, String>(); + private boolean cleaned = false;
public void addIgnoredFile(String path) { this.ignoredFiles.add(convertPath(path)); @@ -140,6 +141,10 @@ public class DeployDifferences { this.errors.put(convertPath(path), errorMsg); }
+ public void setCleaned(boolean cleaned) { + this.cleaned = cleaned; + } + /** * Returns the set of files that have been ignored. * @@ -227,6 +232,18 @@ public class DeployDifferences { return this.errors; }
+ /** + * Returns <code>true</code> if the delpoyment's destination directory was + * wiped of all files/directories before the new deployment files were + * copied to it. This means any ignored files or directories that were + * in the deployment's destination directory will have been deleted. + * + * @return the cleaned flag + */ + public boolean wasCleaned() { + return cleaned; + } + @Override public String toString() { StringBuilder str = new StringBuilder(); @@ -237,6 +254,7 @@ public class DeployDifferences { str.append("backed-up=").append(this.backedUpFiles).append('\n'); str.append("restored=").append(this.restoredFiles).append('\n'); str.append("realized=").append(this.realizedFiles.keySet()).append('\n'); + str.append("cleaned=[").append(this.cleaned).append(']').append('\n'); str.append("errors=").append(this.errors); return str.toString(); } diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java index e0f7322..99793e5 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java @@ -115,7 +115,7 @@ public class Deployer { * @see #deploy(DeployDifferences, boolean) */ public FileHashcodeMap deploy(DeployDifferences diff) throws Exception { - return deploy(diff, false); + return deploy(diff, false, false); }
/** @@ -123,22 +123,34 @@ public class Deployer { * @see #deploy(DeployDifferences, boolean) */ public FileHashcodeMap dryRun(DeployDifferences diff) throws Exception { - return deploy(diff, true); + return deploy(diff, false, true); }
/** * Deploys all files to their destinations. Everything this method has to do is determined * by the data passed into this object's constructor. * + * This method allows one to ask for a dry run to be performed; meaning don't actually change + * the file system, just populate the <code>diff</code> object with what would have been done. + * + * The caller can ask that an existing deployment directory be cleaned (i.e. wiped from the file system) + * before the new deployment is laid down. This is useful if there are ignored files/directories + * that would be left alone as-is, had a clean not been requested. Note that the <code>clean</code> + * parameter is ignored if a dry run is being requested. + * * @param diff this method will populate this object with information about what * changed on the file system due to this deployment + * @param clean if <code>true</code>, the caller is telling this method to first wipe clean + * any existing deployment files found in the destination directory before installing the + * new deployment. Note that this will have no effect if <code>dryRun</code> + * is <code>true</code> since a dry run by definition never affects the file system. * @param dryRun if <code>true</code>, the file system won't actually be changed; however, * the <code>diff</code> object will still be populated with information about * what would have occurred on the file system had it not been a dry run * @return file/hashcode information for all files that were deployed * @throws Exception if the deployment failed for some reason */ - public FileHashcodeMap deploy(DeployDifferences diff, boolean dryRun) throws Exception { + public FileHashcodeMap deploy(DeployDifferences diff, boolean clean, boolean dryRun) throws Exception { FileHashcodeMap map = null;
// fail-fast if we don't have enough disk space @@ -149,15 +161,15 @@ public class Deployer { map = performInitialDeployment(diff, dryRun); } else { // we have metadata in the destination directory, therefore, this deployment is updating a current one - map = performUpdateDeployment(diff, dryRun); + map = performUpdateDeployment(diff, clean, dryRun); }
return map; }
/** - * This will first perform a deploy (e.g. {@link #deploy(DeployDifferences, boolean) deploy(diff, dryRun)}) and - * then, if there are backup files from the previous deployment, those backup files will be restored to their + * This will first perform a deploy (e.g. {@link #deploy(DeployDifferences, boolean, boolean) deploy(diff, clean, dryRun)}) + * and then, if there are backup files from the previous deployment, those backup files will be restored to their * original locations. * * This is useful when you want to "undeploy" something where "undeploy" infers you want to go back to @@ -174,12 +186,14 @@ public class Deployer { * then restore the backup files - essentially overlaying the manual changes over top #1 files. This * method accomplishes that latter task. * - * @param diff see {@link #deploy(DeployDifferences, boolean)} - * @param dryRun see {@link #deploy(DeployDifferences, boolean)} - * @return see {@link #deploy(DeployDifferences, boolean)} + * @param diff see {@link #deploy(DeployDifferences, boolean, boolean)} + * @param clean see {@link #deploy(DeployDifferences, boolean, boolean)} + * @param dryRun see {@link #deploy(DeployDifferences, boolean, boolean)} + * @return see {@link #deploy(DeployDifferences, boolean, boolean)} * @throws Exception if either the deployment or backup file restoration failed */ - public FileHashcodeMap redeployAndRestoreBackupFiles(DeployDifferences diff, boolean dryRun) throws Exception { + public FileHashcodeMap redeployAndRestoreBackupFiles(DeployDifferences diff, boolean clean, boolean dryRun) + throws Exception { FileHashcodeMap map = null;
// fail-fast if we don't have enough disk space @@ -194,7 +208,7 @@ public class Deployer { // Then we update the current deployment with the new deployment (which actually should be restoring to the previous one). // Finally, we restore the backup files into the new deployment, overlaying them over top the new deployment. int id = this.deploymentsMetadata.getCurrentDeploymentProperties().getDeploymentId(); - map = performUpdateDeployment(diff, dryRun); + map = performUpdateDeployment(diff, clean, dryRun); restoreBackupFiles(id, map, diff, dryRun); if (!dryRun) { // if we restored one or more files, we need to persist the new deployment hashcode data with the restored hashcodes @@ -286,7 +300,8 @@ public class Deployer { return newFileHashcodeMap; }
- private FileHashcodeMap performUpdateDeployment(DeployDifferences diff, boolean dryRun) throws Exception { + private FileHashcodeMap performUpdateDeployment(DeployDifferences diff, boolean clean, boolean dryRun) + throws Exception { debug("Analyzing original, current and new files as part of update deployment. dryRun=", dryRun);
// NOTE: remember that data that goes in diff are only things affecting the current file set such as: @@ -442,7 +457,15 @@ public class Deployer { } }
- // 3. copy all new files except for those to be kept as-is + // 3. copy all new files except for those to be kept as-is (perform a clean first, if requested) + if (clean) { + debug("Cleaning the existing deployment's files found in the destination directory. dryRun=", dryRun); + if (!dryRun) { + purgeFileOrDirectory(this.deploymentData.getDestinationDir(), false); + } + } + diff.setCleaned(clean); + debug("Copying new files as part of update deployment. dryRun=", dryRun); FileHashcodeMap newFileHashCodeMap = extractZipAndRawFiles(currentFilesToLeaveAlone, diff, dryRun);
@@ -833,6 +856,26 @@ public class Deployer { } }
+ private void purgeFileOrDirectory(File fileOrDir, boolean deleteIt) { + // make sure we only purge deployment files, never the metadata directory or its files + if (fileOrDir != null && !fileOrDir.getName().equals(DeploymentsMetadata.METADATA_DIR)) { + if (fileOrDir.isDirectory()) { + File[] doomedFiles = fileOrDir.listFiles(); + if (doomedFiles != null) { + for (File doomedFile : doomedFiles) { + purgeFileOrDirectory(doomedFile, true); // call this method recursively + } + } + } + + if (deleteIt) { + fileOrDir.delete(); + } + } + + return; + } + private void debug(Object... objs) { if (log.isDebugEnabled()) { String bundleName = this.deploymentData.getDeploymentProps().getBundleName(); diff --git a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawFileTest.java b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawFileTest.java index bbcdd58..e1eafcb 100644 --- a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawFileTest.java +++ b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawFileTest.java @@ -228,6 +228,8 @@ public class SimpleDeployerRawFileTest { assert this.diff.getBackedUpFiles().isEmpty() : this.diff; assert this.diff.getIgnoredFiles().isEmpty() : this.diff; assert this.diff.getRealizedFiles().isEmpty() : this.diff; + assert this.diff.getRestoredFiles().isEmpty() : this.diff; + assert !this.diff.wasCleaned() : this.diff; assert this.diff.getErrors().isEmpty() : this.diff;
if (dryRun) { @@ -804,7 +806,7 @@ public class SimpleDeployerRawFileTest { deployer = new Deployer(dd); this.diff = new DeployDifferences(); FileHashcodeMap restoreFileHashcodeMap; - restoreFileHashcodeMap = deployer.redeployAndRestoreBackupFiles(this.diff, dryRun); + restoreFileHashcodeMap = deployer.redeployAndRestoreBackupFiles(this.diff, false, dryRun);
assert this.diff.getAddedFiles().isEmpty() : this.diff; assert this.diff.getDeletedFiles().isEmpty() : this.diff; diff --git a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawRelativeFileTest.java b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawRelativeFileTest.java index f72af1f..cf366cb 100644 --- a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawRelativeFileTest.java +++ b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawRelativeFileTest.java @@ -227,6 +227,8 @@ public class SimpleDeployerRawRelativeFileTest { assert this.diff.getBackedUpFiles().isEmpty() : this.diff; assert this.diff.getIgnoredFiles().isEmpty() : this.diff; assert this.diff.getRealizedFiles().isEmpty() : this.diff; + assert this.diff.getRestoredFiles().isEmpty() : this.diff; + assert !this.diff.wasCleaned() : this.diff; assert this.diff.getErrors().isEmpty() : this.diff;
if (dryRun) { @@ -802,7 +804,7 @@ public class SimpleDeployerRawRelativeFileTest { deployer = new Deployer(dd); this.diff = new DeployDifferences(); FileHashcodeMap restoreFileHashcodeMap; - restoreFileHashcodeMap = deployer.redeployAndRestoreBackupFiles(this.diff, dryRun); + restoreFileHashcodeMap = deployer.redeployAndRestoreBackupFiles(this.diff, false, dryRun);
assert this.diff.getAddedFiles().isEmpty() : this.diff; assert this.diff.getDeletedFiles().isEmpty() : this.diff; diff --git a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java index 18ded89..24884ed 100644 --- a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java +++ b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java @@ -29,6 +29,7 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.util.HashSet; import java.util.Set; +import java.util.regex.Pattern; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream;
@@ -132,6 +133,10 @@ public class SimpleDeployerTest { baseX_Y_Z_Restore(false); }
+ public void testX_Y_Z_Clean() throws Exception { + baseX_Y_Z_Clean(false); + } + public void testNoOriginalNoCurrentWithNew() throws Exception { baseNoOriginalNoCurrentWithNew(false); } @@ -176,6 +181,10 @@ public class SimpleDeployerTest { baseX_Y_Z_Restore(true); }
+ public void testX_Y_Z_Clean_DryRun() throws Exception { + baseX_Y_Z_Clean(true); + } + public void testNoOriginalNoCurrentWithNew_DryRun() throws Exception { baseNoOriginalNoCurrentWithNew(true); } @@ -220,6 +229,8 @@ public class SimpleDeployerTest { assert this.diff.getBackedUpFiles().isEmpty() : this.diff; assert this.diff.getIgnoredFiles().isEmpty() : this.diff; assert this.diff.getRealizedFiles().isEmpty() : this.diff; + assert this.diff.getRestoredFiles().isEmpty() : this.diff; + assert !this.diff.wasCleaned() : this.diff; assert this.diff.getErrors().isEmpty() : this.diff;
if (dryRun) { @@ -793,7 +804,7 @@ public class SimpleDeployerTest { deployer = new Deployer(dd); this.diff = new DeployDifferences(); FileHashcodeMap restoreFileHashcodeMap; - restoreFileHashcodeMap = deployer.redeployAndRestoreBackupFiles(this.diff, dryRun); + restoreFileHashcodeMap = deployer.redeployAndRestoreBackupFiles(this.diff, false, dryRun);
assert this.diff.getAddedFiles().isEmpty() : this.diff; assert this.diff.getDeletedFiles().isEmpty() : this.diff; @@ -820,6 +831,84 @@ public class SimpleDeployerTest { } }
+ private void baseX_Y_Z_Clean(boolean dryRun) throws Exception { + String newContentY = "testX_Y_Z_YYY"; + writeFile(newContentY, this.currentFile); + String newHashcodeY = MessageDigestGenerator.getDigestString(newContentY); + + String newContentZ = "testX_Y_Z_ZZZ"; + String newHashcodeZ = MessageDigestGenerator.getDigestString(newContentZ); + File newZipFile = createZip(newContentZ, tmpDir, "new-content.zip", originalFileName); + Set<File> newZipFiles = new HashSet<File>(1); + newZipFiles.add(newZipFile); + + File ignoredSubdir = new File(this.deployDir, "ignoreSubdir"); + File ignoredFile = new File(ignoredSubdir, "ignore-me.txt"); + ignoredSubdir.mkdirs(); + writeFile("ignored content", ignoredFile); + Pattern iRegex = Pattern.compile(".*ignoreSubdir.*"); // this matches the subdirectory name, thus everything under it is ignored + assert ignoredFile.exists() : "for some reason we couldn't create our test file; cannot know if clean worked"; + + DeploymentData dd = new DeploymentData(newDeployProps, newZipFiles, null, deployDir, null, null, null, iRegex); + Deployer deployer = new Deployer(dd); + FileHashcodeMap newFileHashcodeMap; + newFileHashcodeMap = deployer.deploy(this.diff, true, dryRun); // note: clean is true + + // The new file changed the original, and our current file has been manually updated + // but that current file's change does not match the new file. Therefore, the current file + // is out of date. The safest thing to do is backup the current and copy the new file + // to become the current file. + + assert !newFileHashcodeMap.equals(this.originalFileHashcodeMap); + assert newFileHashcodeMap.size() == 1; + assert newFileHashcodeMap.get(originalFileName).equals(newHashcodeZ); + String[] contentHash = getOriginalFilenameContentHashcode(); + if (dryRun) { + assert contentHash[0].equals(newContentY); + assert contentHash[1].equals(newHashcodeY); + } else { + assert contentHash[0].equals(newContentZ); + assert contentHash[1].equals(newHashcodeZ); + } + + assert this.diff.getAddedFiles().isEmpty() : this.diff; + assert this.diff.getDeletedFiles().isEmpty() : this.diff; + assert this.diff.getChangedFiles().size() == 1 : this.diff; + assert this.diff.getChangedFiles().contains(originalFileName) : this.diff; + assert this.diff.getBackedUpFiles().size() == 1 : this.diff; + assert this.diff.getBackedUpFiles().containsKey(originalFileName) : this.diff; + assert this.diff.getIgnoredFiles().size() == 1 : this.diff; + assert this.diff.getIgnoredFiles().contains(ignoredSubdir.getName()) : this.diff; + assert this.diff.getRealizedFiles().isEmpty() : this.diff; + assert this.diff.wasCleaned() : this.diff; + assert this.diff.getErrors().isEmpty() : this.diff; + + if (dryRun) { + assert this.metadata.getCurrentDeploymentProperties().equals(originalDeployProps); + assert this.metadata.getCurrentDeploymentFileHashcodes().equals(originalFileHashcodeMap); + } else { + assert this.metadata.getCurrentDeploymentProperties().equals(newDeployProps); + assert this.metadata.getCurrentDeploymentFileHashcodes().equals(newFileHashcodeMap); + } + + // verify the backup copy + File backupFile = new File(this.diff.getBackedUpFiles().get(originalFileName)); + if (dryRun) { + assert !backupFile.exists() : "dry run should not create backup"; + } else { + assert readFile(backupFile).equals(newContentY) : "did not backup the correct file?"; + } + + // if we cleaned, the ignored subdir and its file should no longer exist + if (dryRun) { + assert ignoredSubdir.isDirectory() : "dry run should not have really cleaned"; + assert ignoredFile.exists() : "dry run should not have really cleaned"; + } else { + assert !ignoredSubdir.exists() : "directory should have been deleted due to the clean option"; + assert !ignoredFile.exists() : "file should have been deleted due to the clean option"; + } + } + private String[] getOriginalFilenameContentHashcode() throws Exception { return getFilenameContentHashcode(this.originalFileName); }
commit dc09a262d1482f4b1a5e1310bd09ed9e105e0e0e Merge: 88bd124... 6206f2a... Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri May 14 15:05:08 2010 -0400
Merge branch 'bundle' into bundle-jay
commit 88bd12435cef0bf00458048966d29424e181e4d7 Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri May 14 15:01:01 2010 -0400
- Updated remote api to enhance scheduleBundleDeploy with "cleanDeploy" option and added ScheduleRevertBundleDeploy call. - Added BundleDeployment.replacedBundleDeployment to track sever-side which deployment the current live deployment replaced. This info is used for reverting to the previous (replaced) deployment. - added fetch of the replaced bundledeployment to the criteria - Added isCleanDeploy and isRevert flags to the schedule deploy requests - updated deploy wizard to gather isCleanDeploy setting - updated deploy wizard to gather deployment info in first step for better flow
diff --git a/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManager.js b/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManager.js index bfb807f..c3ffe08 100644 --- a/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManager.js +++ b/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManager.js @@ -81,7 +81,7 @@ function testDeployment() { var testDeployment = BundleManager.createBundleDeployment(testBundleVersion.getId(), testDest.getId(), "Deployment Test", "Deployment Test of testBundle WAR", new Configuration());
// deploy to the destination - var bd = BundleManager.scheduleBundleDeployment(testDeployment.getId()); + var bd = BundleManager.scheduleBundleDeployment(testDeployment.getId(), false); Assert.assertNotNull( bd );
// delete the test bundle if it exists (after allowing agent audit messages to complete) diff --git a/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerZip.js b/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerZip.js index cebb493..db342e4 100644 --- a/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerZip.js +++ b/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerZip.js @@ -85,7 +85,7 @@ function testDeployment() { // create a deployment using the above config var testDeployment = BundleManager.createBundleDeployment(testBundleVersion.getId(), testDest.getId(), "Deployment Zip Test", "Deployment Test of dummy ZIP", config);
- var bd = BundleManager.scheduleBundleDeployment(testDeployment.getId()); + var bd = BundleManager.scheduleBundleDeployment(testDeployment.getId(), false); Assert.assertNotNull( bd );
// Now performa redeploy, the same thing but a change to the config @@ -99,7 +99,7 @@ function testDeployment() { // create a deployment using the above config var testRedeploy = BundleManager.createBundleDeployment(testBundleVersion.getId(), testDest.getId(), "Redeployment Zip Test", "Redeploy Test of dummy ZIP", config2);
- var bd2 = BundleManager.scheduleBundleDeployment(testRedeploy.getId()); + var bd2 = BundleManager.scheduleBundleDeployment(testRedeploy.getId(), false); Assert.assertNotNull( bd2 );
// delete the test bundle if it exists (after allowing agent audit messages to complete) diff --git a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/bundle/BundleScheduleRequest.java b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/bundle/BundleScheduleRequest.java index 2b6e042..207abd9 100644 --- a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/bundle/BundleScheduleRequest.java +++ b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/bundle/BundleScheduleRequest.java @@ -37,6 +37,8 @@ public class BundleScheduleRequest implements Serializable {
private BundleResourceDeployment resourceDeployment; private long requestedDeployTime = System.currentTimeMillis(); + private boolean isCleanDeployment = false; + private boolean isRevert = false;
public BundleScheduleRequest(BundleResourceDeployment resourceDeployment) { this.resourceDeployment = resourceDeployment; @@ -55,6 +57,22 @@ public class BundleScheduleRequest implements Serializable { return DateFormat.getInstance().format(new Date(requestedDeployTime)); }
+ public boolean isCleanDeployment() { + return isCleanDeployment; + } + + public void setCleanDeployment(boolean isCleanDeployment) { + this.isCleanDeployment = isCleanDeployment; + } + + public boolean isRevert() { + return isRevert; + } + + public void setRevert(boolean isRevert) { + this.isRevert = isRevert; + } + @Override public String toString() { StringBuilder str = new StringBuilder(this.getClass() + ": "); diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml index f2aefe3..3be6291 100644 --- a/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml +++ b/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml @@ -570,6 +570,7 @@ <column name="STATUS" type="VARCHAR2" required="true" size="16"/> <column name="ERROR_MESSAGE" type="LONGVARCHAR" required="false"/> <column name="IS_LIVE" type="BOOLEAN" required="true"/> + <column name="REPLACED_BUNDLE_DEPLOYMENT_ID" type="INTEGER" required="false" references="RHQ_BUNDLE_DEPLOYMENT"/> </table>
<!-- Represents a bundle version that is deployed on a platform resource --> diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index 386723d..97fe5c4 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -2547,6 +2547,7 @@ <schema-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="SUBJECT_NAME" columnType="VARCHAR2" precision="255" /> <schema-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="IS_LIVE" columnType="BOOLEAN" /> <schema-alterColumn table="RHQ_BUNDLE_DEPLOYMENT" column="IS_LIVE" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="REPLACED_BUNDLE_DEPLOYMENT_ID" columnType="INTEGER" />
<schema-directSQL> <statement desc="Creating RHQ_BUNDLE_DEPLOYMENT foreign key relation to RHQ_BUNDLE_VERSION"> @@ -2567,6 +2568,12 @@ FOREIGN KEY (CONFIG_ID) REFERENCES RHQ_CONFIG (ID) </statement> + <statement desc="Creating RHQ_BUNDLE_DEPLOYMENT foreign key relation to RHQ_BUNDLE_DEPLOYMENT"> + ALTER TABLE RHQ_BUNDLE_DEPLOYMENT + ADD CONSTRAINT RHQ_BD_B_DEPLOYMENT_ID_FK + FOREIGN KEY (REPLACED_BUNDLE_DEPLOYMENT_ID) + REFERENCES RHQ_BUNDLE_DEPLOYMENT (ID) + </statement> </schema-directSQL>
<!-- RHQ_BUNDLE_RES_DEPLOY --> diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java index d255a57..b4b95d8 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java @@ -103,6 +103,10 @@ public class BundleDeployment implements Serializable { @Column(name = "MTIME") private Long mtime = System.currentTimeMillis();
+ @JoinColumn(name = "REPLACED_BUNDLE_DEPLOYMENT_ID", referencedColumnName = "ID", nullable = true) + @OneToOne(fetch = FetchType.LAZY, optional = true) + private BundleDeployment replacedBundleDeployment; + @JoinColumn(name = "CONFIG_ID", referencedColumnName = "ID", nullable = true) @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, optional = true) private Configuration configuration; @@ -262,6 +266,17 @@ public class BundleDeployment implements Serializable { return end - start; }
+ /** + * @return The previously "live" BundleDeployment. + */ + public BundleDeployment getReplacedBundleDeployment() { + return replacedBundleDeployment; + } + + public void setReplacedBundleDeployment(BundleDeployment replacedBundleDeployment) { + this.replacedBundleDeployment = replacedBundleDeployment; + } + public Configuration getConfiguration() { return configuration; } diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java index 5f5a672..66d85c2 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java @@ -49,6 +49,7 @@ public class BundleDeploymentCriteria extends TaggedCriteria { private boolean fetchBundleVersion; private boolean fetchConfiguration; private boolean fetchDestination; + private boolean fetchReplacedBundleDeployment; private boolean fetchResourceDeployments;
public BundleDeploymentCriteria() { @@ -115,9 +116,12 @@ public class BundleDeploymentCriteria extends TaggedCriteria { this.fetchDestination = fetchDestination; }
+ public void fetchReplacedBundleDeployment(boolean fetchReplacedBundleDeployment) { + this.fetchReplacedBundleDeployment = fetchReplacedBundleDeployment; + } + public void fetchResourceDeployments(boolean fetchResourceDeployments) { this.fetchResourceDeployments = fetchResourceDeployments; }
- } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java index 987d1ae..922d031 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java @@ -39,6 +39,7 @@ public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard { private String newDeploymentName; private String newDeploymentDescription; private BundleDeployment newDeployment; + private boolean isCleanDeployment = false; private BundleDeployment liveDeployment;
private boolean deployNow = true; @@ -122,4 +123,13 @@ public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard { public void setDeployNow(Boolean deployNow) { this.deployNow = deployNow; } + + public boolean isCleanDeployment() { + return isCleanDeployment; + } + + public void setCleanDeployment(boolean isCleanDeployment) { + this.isCleanDeployment = isCleanDeployment; + } + } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java index e52d975..01b0ae8 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java @@ -32,10 +32,10 @@ public class BundleDeployWizard extends AbstractBundleDeployWizard { this.setInitialDeployment(true);
List<WizardStep> steps = init(); + steps.add(new GetDeploymentInfoStep(this)); steps.add(new SelectBundleStep(this)); steps.add(new GetDestinationStep(this)); steps.add(new SelectBundleVersionStep(this)); - steps.add(new GetDeploymentInfoStep(this)); steps.add(new GetDeploymentConfigStep(this)); steps.add(new DeployStep(this)); } @@ -46,9 +46,9 @@ public class BundleDeployWizard extends AbstractBundleDeployWizard { this.setBundleId(bundleId);
List<WizardStep> steps = init(); + steps.add(new GetDeploymentInfoStep(this)); steps.add(new GetDestinationStep(this)); steps.add(new SelectBundleVersionStep(this)); - steps.add(new GetDeploymentInfoStep(this)); steps.add(new GetDeploymentConfigStep(this)); steps.add(new DeployStep(this)); } @@ -64,8 +64,8 @@ public class BundleDeployWizard extends AbstractBundleDeployWizard { this.setBundleDestination(destination);
List<WizardStep> steps = init(); - steps.add(new SelectBundleVersionStep(this)); steps.add(new GetDeploymentInfoStep(this)); + steps.add(new SelectBundleVersionStep(this)); steps.add(new GetDeploymentConfigStep(this)); steps.add(new DeployStep(this)); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java index bec409b..02e048e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java @@ -83,7 +83,8 @@ public class DeployStep implements WizardStep { + result.getDescription(), Severity.Info)); wizard.setNewDeployment(result);
- bundleServer.scheduleBundleDeployment(wizard.getNewDeployment().getId(), // + bundleServer.scheduleBundleDeployment(wizard.getNewDeployment().getId(), wizard + .isCleanDeployment(), // new AsyncCallback<BundleDeployment>() { public void onSuccess(BundleDeployment result) { deployingImage.setSrc("/images/status_complete.gif"); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java index c24d693..f87dee6 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java @@ -20,6 +20,7 @@ package org.rhq.enterprise.gui.coregui.client.bundle.deploy;
import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.CheckboxItem; import com.smartgwt.client.widgets.form.fields.TextAreaItem; import com.smartgwt.client.widgets.form.fields.TextItem; import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; @@ -77,7 +78,16 @@ public class GetDeploymentInfoStep implements WizardStep { } });
- form.setItems(nameTextItem, descriptionTextAreaItem); + final CheckboxItem cleanDeploymentCBItem = new CheckboxItem("cleanDeployment", + "Clean Deployment? (wipe deploy directory on destination platform)"); + cleanDeploymentCBItem.setValue(wizard.isCleanDeployment()); + cleanDeploymentCBItem.addChangedHandler(new ChangedHandler() { + public void onChanged(ChangedEvent event) { + wizard.setCleanDeployment((Boolean) event.getValue()); + } + }); + + form.setItems(nameTextItem, descriptionTextAreaItem, cleanDeploymentCBItem); }
return form; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java index e44a55a..fc77489 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java @@ -70,7 +70,7 @@ public interface BundleGWTService extends RemoteService {
ArrayList<BundleType> getAllBundleTypes() throws Exception;
- BundleDeployment scheduleBundleDeployment(int bundleDeploymentId) throws Exception; + BundleDeployment scheduleBundleDeployment(int bundleDeploymentId, boolean isCleanDeployment) throws Exception;
PageList<BundleDeployment> findBundleDeploymentsByCriteria(BundleDeploymentCriteria criteria);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java index fca82ee..fef3bdd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java @@ -69,12 +69,12 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund }
public BundleDeployment createBundleDeployment(int bundleVersionId, int bundleDestinationId, String name, - String description, Configuration configuration, boolean enforcePolicy, int enforcementInterval, - boolean pinToBundle) throws Exception { + String description, Configuration configuration, boolean enforcePolicy, int enforcementInterval, + boolean pinToBundle) throws Exception {
try { BundleDeployment result = bundleManager.createBundleDeployment(getSessionSubject(), bundleVersionId, - bundleDestinationId, name, description, configuration); + bundleDestinationId, name, description, configuration);
return SerialUtility.prepare(result, "createBundleDeployment"); } catch (Exception e) { @@ -140,7 +140,7 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund }
public PageList<BundleWithLatestVersionComposite> findBundlesWithLastestVersionCompositesByCriteria( - BundleCriteria criteria) throws Exception { + BundleCriteria criteria) throws Exception { try { PageList<BundleWithLatestVersionComposite> results; results = bundleManager.findBundlesWithLatestVersionCompositesByCriteria(getSessionSubject(), criteria); @@ -170,9 +170,11 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund return SerialUtility.prepare(results, "getAllBundleVersionFilenames"); }
- public BundleDeployment scheduleBundleDeployment(int bundleDeploymentId) throws Exception { + public BundleDeployment scheduleBundleDeployment(int bundleDeploymentId, boolean isCleanDeployment) + throws Exception { try { - BundleDeployment result = bundleManager.scheduleBundleDeployment(getSessionSubject(), bundleDeploymentId); + BundleDeployment result = bundleManager.scheduleBundleDeployment(getSessionSubject(), bundleDeploymentId, + isCleanDeployment); return SerialUtility.prepare(result, "scheduleBundleDeployment"); } catch (Exception e) { throw new RuntimeException(ThrowableUtil.getAllMessages(e)); @@ -181,25 +183,25 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund
public PageList<BundleDeployment> findBundleDeploymentsByCriteria(BundleDeploymentCriteria criteria) { return SerialUtility.prepare(bundleManager.findBundleDeploymentsByCriteria(getSessionSubject(), criteria), - "BundleService.findBundleDeploymentsByCriteria"); + "BundleService.findBundleDeploymentsByCriteria"); }
public PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria( - BundleResourceDeploymentCriteria criteria) { + BundleResourceDeploymentCriteria criteria) { return SerialUtility.prepare(bundleManager.findBundleResourceDeploymentsByCriteria(getSessionSubject(), - criteria), "BundleService.findBundleResourceDeploymentsByCriteria"); + criteria), "BundleService.findBundleResourceDeploymentsByCriteria");
}
public PageList<BundleDestination> findBundleDestinationsByCriteria(BundleDestinationCriteria criteria) { - return SerialUtility.prepare(bundleManager.findBundleDestinationsByCriteria(getSessionSubject(), - criteria), "BundleService.findBundleDestinationsByCriteria"); + return SerialUtility.prepare(bundleManager.findBundleDestinationsByCriteria(getSessionSubject(), criteria), + "BundleService.findBundleDestinationsByCriteria");
}
public PageList<BundleFile> findBundleFilesByCriteria(BundleFileCriteria criteria) { - return SerialUtility.prepare(bundleManager.findBundleFilesByCriteria(getSessionSubject(), - criteria), "BundleService.findBundleFilesByCriteria"); + return SerialUtility.prepare(bundleManager.findBundleFilesByCriteria(getSessionSubject(), criteria), + "BundleService.findBundleFilesByCriteria"); }
} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java index 011ae75..2375f03 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java @@ -699,7 +699,36 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot */
@RequiredPermission(Permission.MANAGE_INVENTORY) - public BundleDeployment scheduleBundleDeployment(Subject subject, int bundleDeploymentId) throws Exception { + public BundleDeployment scheduleBundleDeployment(Subject subject, int bundleDeploymentId, boolean isCleanDeployment) + throws Exception { + return scheduleBundleDeploymentImpl(subject, bundleDeploymentId, isCleanDeployment, false); + } + + @RequiredPermission(Permission.MANAGE_INVENTORY) + public BundleDeployment scheduleRevertBundleDeployment(Subject subject, int bundleDestinationId, + boolean isCleanDeployment) throws Exception { + + BundleDeploymentCriteria c = new BundleDeploymentCriteria(); + c.addFilterDestinationId(bundleDestinationId); + c.addFilterIsLive(true); + c.fetchReplacedBundleDeployment(true); + List<BundleDeployment> liveDeployments = bundleManager.findBundleDeploymentsByCriteria(subject, c); + if (1 != liveDeployments.size()) { + throw new IllegalArgumentException("No live deployment found for destinationId [" + bundleDestinationId + + "]"); + } + BundleDeployment liveDeployment = liveDeployments.get(0); + if (null == liveDeployment.getReplacedBundleDeployment()) { + throw new IllegalArgumentException("Live deployment [" + liveDeployment + + "] can not be reverted. There is no prior deployment for destinationId [" + bundleDestinationId + "]"); + } + + return scheduleBundleDeploymentImpl(subject, liveDeployment.getReplacedBundleDeployment().getId(), + isCleanDeployment, true); + } + + private BundleDeployment scheduleBundleDeploymentImpl(Subject subject, int bundleDeploymentId, + boolean isCleanDeployment, boolean isRevert) throws Exception {
BundleDeployment newDeployment = entityManager.find(BundleDeployment.class, bundleDeploymentId); if (null == newDeployment) { @@ -714,7 +743,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot for (Resource resource : group.getExplicitResources()) { try { BundleResourceDeployment resourceDeployment = scheduleBundleResourceDeployment(subject, newDeployment, - resource); + resource, isCleanDeployment, isRevert); newDeployment.addResourceDeployment(resourceDeployment); } catch (Throwable t) { log.error("Failed to complete scheduling of platform deployment to [" + resource @@ -731,6 +760,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot for (BundleDeployment d : currentDeployments) { if (d.isLive()) { d.setLive(false); + newDeployment.setReplacedBundleDeployment(d); break; } } @@ -742,7 +772,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot }
private BundleResourceDeployment scheduleBundleResourceDeployment(Subject subject, BundleDeployment deployment, - Resource resource) throws Exception { + Resource resource, boolean isCleanDeployment, boolean isRevert) throws Exception {
int resourceId = resource.getId(); AgentClient agentClient = agentManager.getAgentClient(resourceId); @@ -773,6 +803,8 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot HibernateDetachUtility.nullOutUninitializedFields(resourceDeployment, SerializationType.SERIALIZATION);
BundleScheduleRequest request = new BundleScheduleRequest(resourceDeployment); + request.setCleanDeployment(isCleanDeployment); + request.setRevert(isRevert);
// add the deployment request history (in a new trans) BundleResourceDeploymentHistory history = new BundleResourceDeploymentHistory(subject.getName(), @@ -976,8 +1008,8 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot return queryRunner.execute(); }
- - public PageList<BundleDestination> findBundleDestinationsByCriteria(Subject subject, BundleDestinationCriteria criteria) { + public PageList<BundleDestination> findBundleDestinationsByCriteria(Subject subject, + BundleDestinationCriteria criteria) { CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
CriteriaQueryRunner<BundleDestination> queryRunner = new CriteriaQueryRunner<BundleDestination>(criteria, diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java index 89fa3c4..7ca582f 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java @@ -249,11 +249,9 @@ public interface BundleManagerRemote { @WebParam(name = "criteria") BundleDeploymentCriteria criteria);
@WebMethod - PageList<BundleDestination> findBundleDestinationsByCriteria( - @WebParam(name = "subject") Subject subject, + PageList<BundleDestination> findBundleDestinationsByCriteria(@WebParam(name = "subject") Subject subject, @WebParam(name = "criteria") BundleDestinationCriteria criteria);
- @WebMethod PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria( // @WebParam(name = "subject") Subject subject, // @@ -319,16 +317,41 @@ public interface BundleManagerRemote { * Deploy the bundle to the destination, as described in the provided deployment. * Deployment is asynchronous so return of this method does not indicate individual resource deployments are * complete. The returned BundleDeployment can be used to track the history of the individual deployments. - * - * TODO: Add the scheduling capability, currently it's Immediate. - * + * <br/><br/> + * TODO: Add the scheduling capability, currently it's Immediate. + * <br/> * @param subject user that must have proper permissions * @param bundleDeploymentId the BundleDeployment being used to guide the deployments + * @param isCleanDeployment if true perform a wipe of the deploy directory prior to the deployment. If false + * perform as an upgrade to the existing deployment, if any. * @return the BundleDeployment record, updated with status and (resource) deployments. * @throws Exception */ @WebMethod - BundleDeployment scheduleBundleDeployment( // + BundleDeployment scheduleBundleDeployment( @WebParam(name = "subject") Subject subject, // - @WebParam(name = "bundleDeploymentId") int bundleDeploymentId) throws Exception; + @WebParam(name = "bundleDeploymentId") int bundleDeploymentId, + @WebParam(name = "isCleanDeployment") boolean isCleanDeployment) throws Exception; + + /** + * For the specified destination, revert from the current live deployment to the deployment it had replaced. + * A revert first rolls back to the previous deployment (bundle version and configuration) and then rolls forward + * by replacing changed files that had been backed up during the most recent (live) deployment. + * The returned BundleDeployment represents the new live deployment and can be used to track the history of the + * individual revert deployments. + * <br/><br/> + * TODO: Add the scheduling capability, currently it's Immediate. + * <br/> + * @param subject user that must have proper permissions + * @param isCleanDeployment if true perform a wipe of the deploy directory prior to the revert deployment. Backed up + * files will still be applied. If false perform as an upgrade to the existing deployment. + * @return the BundleDeployment record, updated with status and (resource) deployments. + * @throws Exception + */ + @WebMethod + BundleDeployment scheduleRevertBundleDeployment( // + @WebParam(name = "subject") Subject subject, // + @WebParam(name = "bundleDestinationId") int bundleDestinationId, // + @WebParam(name = "isCleanDeployment") boolean isCleanDeployment) throws Exception; + } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java index 12c2370..c0ab193 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java @@ -415,8 +415,14 @@ public class WebservicesManagerBean implements WebservicesRemote { return bundleManager.getBundleVersionFilenames(subject, bundleVersionId, withoutBundleFileOnly); }
- public BundleDeployment scheduleBundleDeployment(Subject subject, int bundleDeploymentId) throws Exception { - return bundleManager.scheduleBundleDeployment(subject, bundleDeploymentId); + public BundleDeployment scheduleBundleDeployment(Subject subject, int bundleDeploymentId, boolean isCleanDeployment) + throws Exception { + return bundleManager.scheduleBundleDeployment(subject, bundleDeploymentId, isCleanDeployment); + } + + public BundleDeployment scheduleRevertBundleDeployment(Subject subject, int bundleDestinationId, + boolean isCleanDeployment) throws Exception { + return bundleManager.scheduleRevertBundleDeployment(subject, bundleDestinationId, isCleanDeployment); }
//BUNDLEMANAGER: END ---------------------------------- diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java index 36473c9..f668692 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java @@ -728,7 +728,7 @@ public class BundleManagerBeanTest extends UpdateSubsytemTestBase { assertNotNull(bd1); assertEquals(BundleDeploymentStatus.PENDING, bd1.getStatus());
- BundleDeployment bd1d = bundleManager.scheduleBundleDeployment(overlord, bd1.getId()); + BundleDeployment bd1d = bundleManager.scheduleBundleDeployment(overlord, bd1.getId(), false); assertNotNull(bd1d); assertEquals(bd1.getId(), bd1d.getId());
commit 6206f2af8b0b7555f0b84bd97166f3a146fa2ef5 Author: John Mazzitelli mazz@redhat.com Date: Fri May 14 11:40:08 2010 -0400
fail fast if there is not enough disk space
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java index 4160c5e..e0f7322 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java @@ -141,6 +141,9 @@ public class Deployer { public FileHashcodeMap deploy(DeployDifferences diff, boolean dryRun) throws Exception { FileHashcodeMap map = null;
+ // fail-fast if we don't have enough disk space + checkDiskUsage(); + if (!this.deploymentsMetadata.isManaged()) { // the destination dir has not been used to deploy a bundle yet, therefore, this is the first deployment map = performInitialDeployment(diff, dryRun); @@ -179,6 +182,9 @@ public class Deployer { public FileHashcodeMap redeployAndRestoreBackupFiles(DeployDifferences diff, boolean dryRun) throws Exception { FileHashcodeMap map = null;
+ // fail-fast if we don't have enough disk space + checkDiskUsage(); + if (!this.deploymentsMetadata.isManaged()) { // the destination dir has not been used to deploy a bundle yet, therefore, this is the first deployment map = performInitialDeployment(diff, dryRun); @@ -233,6 +239,41 @@ public class Deployer { return diskUsage; }
+ /** + * This will get an {@link #estimateDiskUsage() estimate} of how much disk space the deployment will need + * and compare it to the amount of estimated disk space is currently usable. If there does not appear to be + * enough usable disk space to fit the deployment, this method will thrown an exception. Otherwise, this + * method will simply return normally. + * + * This can be used to fail-fast a deployment - there is no need to process the deployment if there is not + * enough disk space to start with. + * + * @throws Exception if there does not appear to be enough disk space to store the deployment content + */ + public void checkDiskUsage() throws Exception { + DeploymentDiskUsage usage; + + try { + usage = estimateDiskUsage(); + } catch (Exception e) { + debug("Cannot estimate disk usage - will assume there is enough space and will continue. Cause: ", e); + return; + } + + debug("Estimated disk usage for this deployment is [", usage.getDiskUsage(), "] bytes (file count=[", usage + .getFileCount(), "]). The maximum disk space currently usable is estimated to be [", usage + .getMaxDiskUsable(), "] bytes."); + + if (usage.getDiskUsage() > usage.getMaxDiskUsable()) { + throw new Exception( + "There does not appear to be enough disk space for this deployment. Its estimated disk usage [" + + usage.getDiskUsage() + "] is larger than the estimated amount of usable disk space [" + + usage.getMaxDiskUsable() + "]."); + } + + return; + } + private FileHashcodeMap performInitialDeployment(DeployDifferences diff, boolean dryRun) throws Exception { FileHashcodeMap newFileHashcodeMap = extractZipAndRawFiles(new HashMap<String, String>(0), diff, dryRun);
commit 2636933489ee9cd2643bb1926e997af0d816ad01 Author: John Mazzitelli mazz@redhat.com Date: Fri May 14 11:21:08 2010 -0400
correct the javadoc
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java index ee60caf..4160c5e 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java @@ -81,11 +81,11 @@ import org.rhq.core.util.stream.StreamUtil; * from the original; the second is when there was no original file, but there is now a current * file on disk and a new file to be installed. In either case, the current file is backed up * before the new file is copied over top the current file. Files that need to be - * backed up that are located under the destination directory will have its backup copied - * to its original deployment's backup metadata directory. If a file that needs to be backed up - * is referred to via an absolute path (that is, outside the destination directory), it - * will be copied with the {@link #BACKUP_EXTENSION} extension added to the end - * of the backup file's filename but in the same directory as its original. + * backed up will have its backup copied to new deployment's metadata directory, under + * the backup subdirectory called {@link DeploymentsMetadata#BACKUP_DIR}. If a file + * that needs to be backed up is referred to via an absolute path (that is, outside the destination + * directory), it will be copied to the {@link DeploymentsMetadata#EXT_BACKUP_DIR} directory found + * in the metadata directory. * * @author John Mazzitelli */
commit 308954493d40be8eba9efc7308456fd980ee5917 Merge: b8cf83c... b94a92b... Author: John Mazzitelli mazz@redhat.com Date: Fri May 14 10:05:22 2010 -0400
Merge branch 'bundle' of ssh://git.fedorahosted.org/git/rhq/rhq into bundle
commit b8cf83cc1b7038f68309f6529f9c423922a625de Author: John Mazzitelli mazz@redhat.com Date: Fri May 14 10:05:08 2010 -0400
remove override annotation so it builds on jdk5
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/ExtractorZipFileVisitor.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/ExtractorZipFileVisitor.java index 4a03049..2aae1aa 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/updater/ExtractorZipFileVisitor.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/ExtractorZipFileVisitor.java @@ -98,7 +98,6 @@ public class ExtractorZipFileVisitor implements ZipUtil.ZipEntryVisitor { return fileHashcodeMap; }
- @Override public boolean visit(ZipEntry entry, ZipInputStream stream) throws Exception {
String pathname = entry.getName(); diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/InMemoryZipFileVisitor.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/InMemoryZipFileVisitor.java index 9e85f18..43a6c8d 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/updater/InMemoryZipFileVisitor.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/InMemoryZipFileVisitor.java @@ -75,7 +75,6 @@ public class InMemoryZipFileVisitor implements ZipUtil.ZipEntryVisitor { return fileHashcodeMap; }
- @Override public boolean visit(ZipEntry entry, ZipInputStream stream) throws Exception {
if (entry.isDirectory()) {
commit b94a92bfa231e7eda88fd13d3277ec12db0bf37d Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri May 14 10:01:16 2010 -0400
Fixing merge problem where we ended up with two decls of findDestinationsByCriteria()
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java index 703654a..12c2370 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java @@ -389,11 +389,6 @@ public class WebservicesManagerBean implements WebservicesRemote { return bundleManager.findBundlesByCriteria(subject, criteria); }
- public PageList<BundleDestination> findBundleDestinationsByCriteria(Subject subject, - BundleDestinationCriteria criteria) { - return bundleManager.findBundleDestinationsByCriteria(subject, criteria); - } - public PageList<BundleFile> findBundleFilesByCriteria(Subject subject, BundleFileCriteria criteria) { return bundleManager.findBundleFilesByCriteria(subject, criteria); }
commit b166e8e7345de3e27fee289b0fb426ac76d4c404 Author: John Mazzitelli mazz@redhat.com Date: Thu May 13 18:21:52 2010 -0400
add the "estimateDiskUsage" method so before you deploy, you can examine if the disk has enought space. this is only an estimate and doesn't take into account copying external files to a different partition or disk than that of the destination directory. this assumes all content is being stored on the partition where the destination dir is
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java index 5adc3e1..ee60caf 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java @@ -33,12 +33,15 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.regex.Pattern; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
import org.rhq.core.util.MessageDigestGenerator; import org.rhq.core.util.ZipUtil; +import org.rhq.core.util.ZipUtil.ZipEntryVisitor; import org.rhq.core.util.file.FileUtil; import org.rhq.core.util.stream.StreamCopyDigest; import org.rhq.core.util.stream.StreamUtil; @@ -198,6 +201,38 @@ public class Deployer { return map; }
+ /** + * Returns an estimated amount of disk space the deployment will need if it gets installed. + * @return information on the estimated disk usage + * @throws Exception if cannot determine the estimated disk usage + */ + public DeploymentDiskUsage estimateDiskUsage() throws Exception { + final DeploymentDiskUsage diskUsage = new DeploymentDiskUsage(); + + diskUsage.setMaxDiskUsable(this.deploymentData.getDestinationDir().getUsableSpace()); + + Set<File> zipFiles = this.deploymentData.getZipFiles(); + for (File zipFile : zipFiles) { + ZipUtil.walkZipFile(zipFile, new ZipEntryVisitor() { + public boolean visit(ZipEntry entry, ZipInputStream stream) throws Exception { + if (!entry.isDirectory()) { + diskUsage.increaseDiskUsage(entry.getSize()); + diskUsage.incrementFileCount(); + } + return true; + } + }); + } + + Map<File, File> rawFiles = this.deploymentData.getRawFiles(); + for (File rawFile : rawFiles.keySet()) { + diskUsage.increaseDiskUsage(rawFile.length()); + diskUsage.incrementFileCount(); + } + + return diskUsage; + } + private FileHashcodeMap performInitialDeployment(DeployDifferences diff, boolean dryRun) throws Exception { FileHashcodeMap newFileHashcodeMap = extractZipAndRawFiles(new HashMap<String, String>(0), diff, dryRun);
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentDiskUsage.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentDiskUsage.java new file mode 100644 index 0000000..6f29d4c --- /dev/null +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentDiskUsage.java @@ -0,0 +1,83 @@ +/* + * 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, 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; + +/** + * Provides information about the estimated disk usage needed for a deployment. + * + * @author John Mazzitelli + */ +public class DeploymentDiskUsage { + private long maxDiskUsable = 0L; + private long diskUsage = 0L; + private int fileCount = 0; + + /** + * Returns the amount of bytes that are estimated to be usable on disk. + * In other words, consider this the maximum amount of space available. + * If you compare this with the {@link #getDiskUsage() deployment disk usage} + * you can esimtate if the disk can fit the deployment content. + * + * @return maximum amount of disk that is estimated to be available + */ + public long getMaxDiskUsable() { + return maxDiskUsable; + } + + public void setMaxDiskUsable(long maxDiskUsable) { + this.maxDiskUsable = maxDiskUsable; + } + + public long getDiskUsage() { + return diskUsage; + } + + public void setDiskUsage(long diskUsage) { + this.diskUsage = diskUsage; + } + + public void increaseDiskUsage(long additionalDiskUsage) { + if (additionalDiskUsage > 0) { + this.diskUsage += additionalDiskUsage; + } + } + + public int getFileCount() { + return fileCount; + } + + public void setFileCount(int fileCount) { + this.fileCount = fileCount; + } + + public void incrementFileCount() { + this.fileCount++; + } + + @Override + public String toString() { + return "Disk Usage: max-avail=[" + this.maxDiskUsable + "], usage=[" + this.diskUsage + "], file-count=[" + + this.fileCount + "])"; + } +} diff --git a/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java b/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java index a12a8e1..50709cc 100644 --- a/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java +++ b/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java @@ -259,6 +259,12 @@ public class DeployerTest { null, templateEngine, ignoreRegex); Deployer deployer = new Deployer(dd); diff = new DeployDifferences(); + + DeploymentDiskUsage diskUsage = deployer.estimateDiskUsage(); + assert diskUsage.getMaxDiskUsable() > 0L; + assert diskUsage.getDiskUsage() > 0L; + assert diskUsage.getFileCount() == 6 : "should have been 5 files in zip and 1 raw file"; + deployer.deploy(diff);
if (ignore) {
commit cb501ae8104f3cf5d32e3b48e704529e9be464cc Merge: c4c09c4... b9ba2de... Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 13 17:50:57 2010 -0400
Merge branch 'bundle' into bundle-jay
Conflicts: modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java
diff --cc modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java index 0d36b76,305c300..abf6ac1 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java @@@ -75,8 -78,8 +75,8 @@@ public class BundleDestinationView exte this.destination = bundleDestination; this.bundle = bundleDestination.getBundle();
- addMember(new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/BundleDeployment_24.png") + addMember(new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/BundleDestination_24.png") - + ""/> " + destination.getName())); + + ""/> " + destination.getName()));
DynamicForm form = new DynamicForm(); form.setNumCols(4);
commit c4c09c482e97a78d6a0193a7d75e4582872620a6 Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 13 17:47:55 2010 -0400
Bundle Deploy Wizard Work - added a Deploy button to Destination view - deploy wizard better supports redeploy to a seeded destination
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java index 61f4b88..987d1ae 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java @@ -22,7 +22,6 @@ import org.rhq.core.domain.bundle.BundleDeployment; import org.rhq.core.domain.bundle.BundleDestination; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.configuration.Configuration; -import org.rhq.core.domain.configuration.definition.ConfigurationTemplate; import org.rhq.enterprise.gui.coregui.client.bundle.AbstractBundleWizard;
/** @@ -33,15 +32,15 @@ public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard {
// the things we build up in the wizard private Integer bundleId; - private Integer destinationId; private BundleDestination bundleDestination; private BundleVersion bundleVersion; - private boolean newDestination = false; - private String deploymentName; - private String deploymentDescription; - private BundleDeployment bundleDeployment; - private ConfigurationTemplate template; - private Configuration config; + private boolean initialDeployment = false; + private Configuration newDeploymentConfig; + private String newDeploymentName; + private String newDeploymentDescription; + private BundleDeployment newDeployment; + private BundleDeployment liveDeployment; + private boolean deployNow = true;
public Integer getBundleId() { @@ -60,52 +59,52 @@ public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard { this.bundleVersion = bundleVersion; }
- public Integer getDestinationId() { - return destinationId; + public String getNewDeploymentName() { + return newDeploymentName; }
- public void setDestinationId(Integer destinationId) { - this.destinationId = destinationId; + public void setNewDeploymentName(String newDeploymentName) { + this.newDeploymentName = newDeploymentName; }
- public String getName() { - return deploymentName; + public String getNewDeploymentDescription() { + return newDeploymentDescription; }
- public void setName(String name) { - this.deploymentName = name; + public void setNewDeploymentDescription(String newDeploymentDescription) { + this.newDeploymentDescription = newDeploymentDescription; }
- public String getDescription() { - return deploymentDescription; + public Configuration getNewDeploymentConfig() { + return newDeploymentConfig; }
- public void setDescription(String description) { - this.deploymentDescription = description; + public void setNewDeploymentConfig(Configuration newDeploymentConfig) { + this.newDeploymentConfig = newDeploymentConfig; }
- public Configuration getConfig() { - return config; + public BundleDeployment getNewDeployment() { + return newDeployment; }
- public ConfigurationTemplate getTemplate() { - return template; + public void setNewDeployment(BundleDeployment newDeployment) { + this.newDeployment = newDeployment; }
- public void setTemplate(ConfigurationTemplate template) { - this.template = template; + public BundleDeployment getLiveDeployment() { + return liveDeployment; }
- public void setConfig(Configuration config) { - this.config = config; + public void setLiveDeployment(BundleDeployment liveDeployment) { + this.liveDeployment = liveDeployment; }
- public BundleDeployment getBundleDeployment() { - return bundleDeployment; + public boolean isInitialDeployment() { + return initialDeployment; }
- public void setBundleDeployment(BundleDeployment bundleDeployment) { - this.bundleDeployment = bundleDeployment; + public void setInitialDeployment(boolean initialDeployment) { + this.initialDeployment = initialDeployment; }
public BundleDestination getBundleDestination() { @@ -116,14 +115,6 @@ public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard { this.bundleDestination = bundleDestination; }
- public boolean isNewDestination() { - return newDestination; - } - - public void setNewDestination(boolean newDestination) { - this.newDestination = newDestination; - } - public Boolean isDeployNow() { return deployNow; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java index 9f7a6b8..e52d975 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java @@ -22,13 +22,14 @@ import java.util.ArrayList; import java.util.List;
import org.rhq.core.domain.bundle.BundleDeployment; +import org.rhq.core.domain.bundle.BundleDestination; import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
public class BundleDeployWizard extends AbstractBundleDeployWizard {
- // New Deployment, No Bundle Selected + // Initial Deployment, No Bundle Selected public BundleDeployWizard() { - this.setNewDestination(true); + this.setInitialDeployment(true);
List<WizardStep> steps = init(); steps.add(new SelectBundleStep(this)); @@ -39,13 +40,9 @@ public class BundleDeployWizard extends AbstractBundleDeployWizard { steps.add(new DeployStep(this)); }
- // New Deployment, Seeded with Bundle - public BundleDeployWizard(Integer bundleId) { - if (null == bundleId) { - throw new IllegalArgumentException("bundleId is null"); - } - - this.setNewDestination(true); + // Initial Deployment, Seeded with Bundle + public BundleDeployWizard(int bundleId) { + this.setInitialDeployment(true); this.setBundleId(bundleId);
List<WizardStep> steps = init(); @@ -56,14 +53,15 @@ public class BundleDeployWizard extends AbstractBundleDeployWizard { steps.add(new DeployStep(this)); }
- // Redeploy - public BundleDeployWizard(Integer bundleId, Integer destinationId) { - if (null == destinationId) { - throw new IllegalArgumentException("destinationId is null"); + // Redeploy to existing destination + public BundleDeployWizard(BundleDestination destination) { + if (null == destination) { + throw new IllegalArgumentException("destination is null"); }
- this.setBundleId(bundleId); - this.setDestinationId(destinationId); + this.setInitialDeployment(false); + this.setBundleId(destination.getBundle().getId()); + this.setBundleDestination(destination);
List<WizardStep> steps = init(); steps.add(new SelectBundleVersionStep(this)); @@ -82,8 +80,8 @@ public class BundleDeployWizard extends AbstractBundleDeployWizard { }
public void cancel() { - BundleDeployment bd = getBundleDeployment(); - if (bd != null && isNewDestination()) { + BundleDeployment bd = getNewDeployment(); + if (bd != null && isInitialDeployment()) { // the user must have created it already after verification step, delete it // TODO } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java index dc6f02d..bec409b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java @@ -72,7 +72,8 @@ public class DeployStep implements WizardStep { canvas.addMember(deployingMessage);
bundleServer.createBundleDeployment(wizard.getBundleVersion().getId(), wizard.getBundleDestination() - .getId(), wizard.getName(), wizard.getDescription(), wizard.getConfig(), false, -1, false, // + .getId(), wizard.getNewDeploymentName(), wizard.getNewDeploymentDescription(), wizard + .getNewDeploymentConfig(), false, -1, false, // new AsyncCallback<BundleDeployment>() { public void onSuccess(BundleDeployment result) { deployingImage.setSrc("/images/status_complete.gif"); @@ -80,26 +81,25 @@ public class DeployStep implements WizardStep { CoreGUI.getMessageCenter().notify( new Message("Created deployment [" + result.getName() + "] description [" + result.getDescription(), Severity.Info)); - wizard.setBundleDeployment(result); + wizard.setNewDeployment(result);
- bundleServer.scheduleBundleDeployment(wizard.getBundleDeployment().getId(), // + bundleServer.scheduleBundleDeployment(wizard.getNewDeployment().getId(), // new AsyncCallback<BundleDeployment>() { public void onSuccess(BundleDeployment result) { deployingImage.setSrc("/images/status_complete.gif"); - deployingMessage.setText("Bundle Group Deployment Scheduled!"); + deployingMessage.setText("Bundle Deployment Scheduled!"); CoreGUI.getMessageCenter().notify( - new Message("Schedule bundle group deployment [" - + wizard.getBundleDeployment().getName() + "] resource group [" - + result.getDestination().getGroup() + "]", Severity.Info)); - wizard.setBundleDeployment(result); + new Message("Scheduled bundle deployment [" + wizard.getNewDeploymentName() + + "] resource group [" + result.getDestination().getGroup() + "]", + Severity.Info)); + wizard.setNewDeployment(result); }
public void onFailure(Throwable caught) { deployingImage.setSrc("/images/status_error.gif"); - deployingMessage.setText("Failed to Schedule Group Deployment!"); + deployingMessage.setText("Failed to Schedule Deployment!"); CoreGUI.getErrorHandler().handleError( - "Failed to schedule group deployment: " + caught.getMessage(), caught); - wizard.setBundleDeployment(null); + "Failed to schedule deployment: " + caught.getMessage(), caught); } }); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java index 26db38a..bd1f394 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java @@ -40,26 +40,40 @@ public class GetDeploymentConfigStep implements WizardStep {
public Canvas getCanvas() { if (null == editor) { - ConfigurationDefinition configDef = wizard.getBundleVersion().getConfigurationDefinition(); - Configuration startingConfig = (null != this.wizard.getTemplate()) ? this.wizard.getTemplate() - .getConfiguration() : new Configuration(); + ConfigurationDefinition configDef = this.wizard.getBundleVersion().getConfigurationDefinition();
// if there are no prop defs for this config def then we can skip this step entirely. just // set an empty config. if (configDef.getPropertyDefinitions().isEmpty()) { - this.wizard.setConfig(startingConfig); + this.wizard.setNewDeploymentConfig(new Configuration()); this.wizard.getView().incrementStep(); + } else { + // otherwise, pop up the config editor to get the needed config + Configuration startingConfig = (null == this.wizard.getLiveDeployment()) ? new Configuration() + : getNormalizedLiveConfig(configDef); + editor = new ConfigurationEditor(configDef, startingConfig); } - - // otherwise, pop up the config editor to get the needed config - editor = new ConfigurationEditor(configDef, startingConfig); }
return editor; }
+ private Configuration getNormalizedLiveConfig(ConfigurationDefinition configDef) { + Configuration config = this.wizard.getLiveDeployment().getConfiguration(); + if (null == config) { + config = new Configuration(); + } else { + config = config.deepCopy(false); + //TODO: get access to this method, may need to add slsb call + // also, may need to enhance this drop unnecessary config (maybe it can just stay around) + //ConfigurationUtility.normalizeConfiguration(config, configDef); + } + + return config; + } + public boolean nextPage() { - wizard.setConfig(editor.getConfiguration()); + wizard.setNewDeploymentConfig(editor.getConfiguration()); return true; } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java index e834afd..c24d693 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java @@ -62,7 +62,7 @@ public class GetDeploymentInfoStep implements WizardStep { value = ""; } wizard.setSubtitle(value.toString()); - wizard.setName(value.toString()); + wizard.setNewDeploymentName(value.toString()); } });
@@ -73,7 +73,7 @@ public class GetDeploymentInfoStep implements WizardStep { if (value == null) { value = ""; } - wizard.setDescription(value.toString()); + wizard.setNewDeploymentDescription(value.toString()); } });
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java index 141f99d..249085b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java @@ -133,40 +133,47 @@ public class SelectBundleVersionStep implements WizardStep { selectVersionValues.put(bundleVersion.getVersion(), bundleVersion.getVersion()); }
- radioGroupValues.put(LATEST_VERSION, "Latest Version [ " + latestVersion.getVersion() + " ]"); - radioGroupValues.put(SELECT_VERSION, "Select Version"); - BundleDeploymentCriteria criteria = new BundleDeploymentCriteria(); - criteria.addFilterBundleId(wizard.getBundleId()); + criteria.addFilterDestinationId(wizard.getBundleDestination().getId()); criteria.addFilterIsLive(true); criteria.fetchBundleVersion(true); + criteria.fetchConfiguration(true); bundleServer.findBundleDeploymentsByCriteria(criteria, // new AsyncCallback<PageList<BundleDeployment>>() {
public void onSuccess(PageList<BundleDeployment> result) { + radioGroupValues.put(LATEST_VERSION, "Latest Version [ " + latestVersion.getVersion() + + " ]"); + if (!result.isEmpty()) { - liveVersion = result.get(0).getBundleVersion(); + BundleDeployment liveDeployment = result.get(0); + // make sure the liveDeployment record has a bundleversion with configdef loaded + BundleVersion liveBundleVersion = liveDeployment.getBundleVersion(); + int i = bundleVersions.indexOf(liveBundleVersion); + liveDeployment.setBundleVersion(bundleVersions.get(i)); + wizard.setLiveDeployment(liveDeployment); + liveVersion = liveDeployment.getBundleVersion(); radioGroupValues.put(LIVE_VERSION, "Live Version [ " + liveVersion.getVersion() + " ]"); } + + radioGroupValues.put(SELECT_VERSION, "Select Version from List:"); + selectVersionItem.setValueMap(selectVersionValues); + selectVersionItem.setValue(latestVersion.getVersion()); + selectVersionItem.redraw(); + + radioGroupItem.setValueMap(radioGroupValues); + radioGroupItem.setValue(LATEST_VERSION); + wizard.setBundleVersion(latestVersion); + radioGroupItem.setDisabled(false); + radioGroupItem.redraw(); + form.markForRedraw(); }
public void onFailure(Throwable caught) { CoreGUI.getErrorHandler().handleError("Failed to find defined deployments.", caught); } }); - - radioGroupItem.setValueMap(radioGroupValues); - radioGroupItem.setValue(LATEST_VERSION); - wizard.setBundleVersion(latestVersion); - radioGroupItem.setDisabled(false); - radioGroupItem.redraw(); - - selectVersionItem.setValueMap(selectVersionValues); - selectVersionItem.setValue(latestVersion.getVersion()); - selectVersionItem.redraw(); - - form.markForRedraw(); }
public void onFailure(Throwable caught) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectTemplateStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectTemplateStep.java deleted file mode 100644 index 64efeaa..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectTemplateStep.java +++ /dev/null @@ -1,89 +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.bundle.deploy; - -import java.util.LinkedHashMap; -import java.util.Map; - -import com.smartgwt.client.widgets.Canvas; -import com.smartgwt.client.widgets.form.DynamicForm; -import com.smartgwt.client.widgets.form.fields.SelectItem; -import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; -import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; - -import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; -import org.rhq.core.domain.configuration.definition.ConfigurationTemplate; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; - -public class SelectTemplateStep implements WizardStep { - - private final BundleDeployWizard wizard; - private DynamicForm form; - - private SelectItem selectTemplateItem = null; - private LinkedHashMap<String, String> selectTemplateValues = new LinkedHashMap<String, String>(); - private ConfigurationDefinition definition = null; - private Map<String, ConfigurationTemplate> templates = null; - - public SelectTemplateStep(BundleDeployWizard bundleDeployWizard) { - this.wizard = bundleDeployWizard; - } - - public String getName() { - return "Select Configuration Template"; - } - - public Canvas getCanvas() { - if (form == null) { - form = new DynamicForm(); - form.setWidth100(); - form.setNumCols(2); - form.setColWidths("50%", "*"); - - definition = wizard.getBundleVersion().getConfigurationDefinition(); - templates = definition.getTemplates(); - - if (templates != null && !templates.isEmpty()) { - for (String templateName : templates.keySet()) { - selectTemplateValues.put(templateName, templateName); - } - - selectTemplateItem = new SelectItem("selectTemplate", "Configuration Template"); - selectTemplateItem.setValueMap(selectTemplateValues); - selectTemplateItem.addChangedHandler(new ChangedHandler() { - public void onChanged(ChangedEvent event) { - wizard.setTemplate((ConfigurationTemplate) templates.get(event.getValue())); - } - }); - } else { - selectTemplateItem = new SelectItem("selectTemplate", "No Configuration Templates Defined"); - selectTemplateItem.setDisabled(true); - } - - form.setItems(selectTemplateItem); - } - - this.wizard.getView().getNextButton().setDisabled(false); - return form; - } - - public boolean nextPage() { - return form.validate(); - } -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java index cd77145..0d36b76 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java @@ -27,8 +27,10 @@ import java.util.Date; import java.util.HashSet;
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.IButton; +import com.smartgwt.client.widgets.events.ClickEvent; +import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.CanvasItem; import com.smartgwt.client.widgets.form.fields.LinkItem; @@ -36,15 +38,11 @@ import com.smartgwt.client.widgets.form.fields.StaticTextItem; import com.smartgwt.client.widgets.grid.CellFormatter; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; -import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; -import com.smartgwt.client.widgets.grid.events.SelectionEvent; import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; import org.rhq.core.domain.bundle.BundleDestination; -import org.rhq.core.domain.bundle.BundleResourceDeployment; -import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.criteria.BundleDestinationCriteria; import org.rhq.core.domain.tagging.Tag; import org.rhq.core.domain.util.PageList; @@ -52,7 +50,7 @@ import org.rhq.enterprise.gui.coregui.client.BookmarkableView; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewId; import org.rhq.enterprise.gui.coregui.client.ViewPath; -import org.rhq.enterprise.gui.coregui.client.bundle.deployment.BundleResourceDeploymentHistoryListView; +import org.rhq.enterprise.gui.coregui.client.bundle.deploy.BundleDeployWizard; import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel; import org.rhq.enterprise.gui.coregui.client.components.table.Table; import org.rhq.enterprise.gui.coregui.client.components.tagging.TagEditorView; @@ -68,7 +66,6 @@ public class BundleDestinationView extends VLayout implements BookmarkableView { private BundleGWTServiceAsync bundleService;
private BundleDestination destination; - private BundleVersion version; private Bundle bundle;
private Canvas detail; @@ -79,7 +76,7 @@ public class BundleDestinationView extends VLayout implements BookmarkableView { this.bundle = bundleDestination.getBundle();
addMember(new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/BundleDeployment_24.png") - + ""/> " + destination.getName())); + + ""/> " + destination.getName()));
DynamicForm form = new DynamicForm(); form.setNumCols(4); @@ -94,16 +91,16 @@ public class BundleDestinationView extends VLayout implements BookmarkableView { TagEditorView tagEditor = new TagEditorView(destination.getTags(), false, new TagsChangedCallback() { public void tagsChanged(HashSet<Tag> tags) { GWTServiceLookup.getTagService().updateBundleDestinationTags(destination.getId(), tags, - new AsyncCallback<Void>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to update bundle destination's tags", caught); - } - - public void onSuccess(Void result) { - CoreGUI.getMessageCenter().notify( - new Message("Bundle Destination Tags updated", Message.Severity.Info)); - } - }); + new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to update bundle destination's tags", caught); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify( + new Message("Bundle Destination Tags updated", Message.Severity.Info)); + } + }); } }); tagItem.setCanvas(tagEditor); @@ -129,11 +126,18 @@ public class BundleDestinationView extends VLayout implements BookmarkableView { deployments.setShowResizeBar(true); addMember(createDeploymentsTable());
+ IButton deployButton = new IButton("Deploy..."); + deployButton.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + new BundleDeployWizard(destination).startBundleWizard(); + } + }); + addMember(deployButton); + detail = new Canvas(); detail.setHeight("50%"); detail.hide(); addMember(detail); - }
private Table createDeploymentsTable() { @@ -142,7 +146,8 @@ public class BundleDestinationView extends VLayout implements BookmarkableView { ListGridField name = new ListGridField("name", "Name"); name.setCellFormatter(new CellFormatter() { public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { - return "<a href="#Bundles/Bundle/" + bundle.getId() + "/deployments/" + listGridRecord.getAttribute("id") + "">" + o + "</a>"; + return "<a href="#Bundles/Bundle/" + bundle.getId() + "/deployments/" + + listGridRecord.getAttribute("id") + "">" + o + "</a>"; } });
@@ -169,7 +174,6 @@ public class BundleDestinationView extends VLayout implements BookmarkableView {
table.getListGrid().setData(records.toArray(new ListGridRecord[records.size()]));
- return table; }
@@ -192,7 +196,6 @@ public class BundleDestinationView extends VLayout implements BookmarkableView {
final BundleDestination destination = result.get(0);
- viewBundleDestination(destination, viewPath.getCurrent());
} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java index 6b98f4d..7d2b2ff 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java @@ -77,6 +77,7 @@ import org.rhq.core.domain.criteria.AlertCriteria; import org.rhq.core.domain.criteria.AlertDefinitionCriteria; import org.rhq.core.domain.criteria.BundleCriteria; import org.rhq.core.domain.criteria.BundleDeploymentCriteria; +import org.rhq.core.domain.criteria.BundleDestinationCriteria; import org.rhq.core.domain.criteria.BundleFileCriteria; import org.rhq.core.domain.criteria.BundleResourceDeploymentCriteria; import org.rhq.core.domain.criteria.BundleVersionCriteria; @@ -383,6 +384,11 @@ public class WebservicesManagerBean implements WebservicesRemote { return bundleManager.findBundlesByCriteria(subject, criteria); }
+ public PageList<BundleDestination> findBundleDestinationsByCriteria(Subject subject, + BundleDestinationCriteria criteria) { + return bundleManager.findBundleDestinationsByCriteria(subject, criteria); + } + public PageList<BundleFile> findBundleFilesByCriteria(Subject subject, BundleFileCriteria criteria) { return bundleManager.findBundleFilesByCriteria(subject, criteria); }
commit b9ba2debfeaf073b8d55d108436a700c7a631223 Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 13 16:13:00 2010 -0400
single group selector for deployment wizard
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java index 0fde744..a3e20b0 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java @@ -29,12 +29,15 @@ import com.smartgwt.client.widgets.form.fields.TextAreaItem; import com.smartgwt.client.widgets.form.fields.TextItem; 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.IsIntegerValidator; +import com.smartgwt.client.widgets.form.validator.Validator; import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.bundle.BundleDestination; import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.bundle.deploy.selection.PlatformResourceGroupSelector; +import org.rhq.enterprise.gui.coregui.client.bundle.deploy.selection.SinglePlatformResourceGroupSelector; import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; @@ -46,7 +49,7 @@ public class GetDestinationStep implements WizardStep { private final BundleDeployWizard wizard; private VLayout form; DynamicForm valForm = new DynamicForm(); - private AbstractSelector<ResourceGroup> selector; + private SinglePlatformResourceGroupSelector selector; private BundleDestination dest = new BundleDestination();
public GetDestinationStep(BundleDeployWizard wizard) { @@ -90,7 +93,7 @@ public class GetDestinationStep implements WizardStep { });
final TextItem deployDirTextItem = new TextItem("deployDir", - "Root Deployment Directory (on destination platforms)"); + "Root Deployment Directory (on destination platforms)"); deployDirTextItem.setRequired(true); deployDirTextItem.addChangedHandler(new ChangedHandler() { public void onChanged(ChangedEvent event) { @@ -102,44 +105,46 @@ public class GetDestinationStep implements WizardStep { } });
- this.valForm.setItems(nameTextItem, descriptionTextAreaItem, deployDirTextItem); + + this.selector = new SinglePlatformResourceGroupSelector("group", "Resource Group"); + this.selector.setRequired(true); + Validator validator = new IsIntegerValidator(); + validator.setErrorMessage("You must select a valid resource group from the drop down"); + this.selector.setValidators(validator); + + this.valForm.setItems(nameTextItem, descriptionTextAreaItem, deployDirTextItem, selector); CanvasItem ci1 = new CanvasItem(); ci1.setShowTitle(false); ci1.setCanvas(valForm); ci1.setDisabled(true);
- this.selector = new PlatformResourceGroupSelector(); - CanvasItem ci2 = new CanvasItem(); - ci2.setShowTitle(false); - ci2.setCanvas(this.selector); - ci2.setDisabled(true);
this.form.addMember(this.valForm); - this.form.addMember(this.selector); }
return this.form; }
public boolean nextPage() { - HashSet<Integer> selection = this.selector.getSelection(); - if (selection.size() != 1) { - SC.warn("Select only a single destination group for deployment."); + + if (!valForm.validate()) { return false; }
+ int selectedGroup = (Integer) this.valForm.getValue("group"); + bundleServer.createBundleDestination(wizard.getBundleId(), this.dest.getName(), this.dest.getDescription(), - this.dest.getDeployDir(), selection.iterator().next(), // - new AsyncCallback<BundleDestination>() { - public void onSuccess(BundleDestination result) { - wizard.setBundleDestination(result); - } + this.dest.getDeployDir(), selectedGroup, // + new AsyncCallback<BundleDestination>() { + public void onSuccess(BundleDestination result) { + wizard.setBundleDestination(result); + }
- public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to create destination: " + caught.getMessage(), - caught); - } - }); + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to create destination: " + caught.getMessage(), + caught); + } + });
return true; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/selection/SinglePlatformResourceGroupSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/selection/SinglePlatformResourceGroupSelector.java new file mode 100644 index 0000000..cbb5c7a --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/selection/SinglePlatformResourceGroupSelector.java @@ -0,0 +1,70 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.bundle.deploy.selection; + +import com.smartgwt.client.data.DSRequest; +import com.smartgwt.client.types.TextMatchStyle; +import com.smartgwt.client.widgets.form.fields.ComboBoxItem; +import com.smartgwt.client.widgets.grid.ListGridField; + +import org.rhq.core.domain.criteria.ResourceGroupCriteria; +import org.rhq.core.domain.resource.ResourceCategory; +import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupsDataSource; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceGroupSelector; + +/** + * @author Greg Hinkle + */ +public class SinglePlatformResourceGroupSelector extends ComboBoxItem { + + public SinglePlatformResourceGroupSelector(String name, String title) { + super(name, title); + + ListGridField nameField = new ListGridField("name"); + ListGridField descriptionField = new ListGridField("description"); + + setOptionDataSource(new PlatformResourceGroupsDataSource()); + + setWidth(240); + setTitle("Group"); + + + setValueField("id"); + setDisplayField("name"); + setPickListWidth(450); + setPickListFields(nameField, descriptionField); + setTextMatchStyle(TextMatchStyle.SUBSTRING); + } + + + protected class PlatformResourceGroupsDataSource extends ResourceGroupsDataSource { + + @Override + protected ResourceGroupCriteria getFetchCriteria(final DSRequest request) { + ResourceGroupCriteria result = super.getFetchCriteria(request); + result.addFilterExplicitResourceCategory(ResourceCategory.PLATFORM); + return result; + } + } + +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java index 5351937..305c300 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java @@ -86,7 +86,7 @@ public class BundleDestinationView extends VLayout implements BookmarkableView {
LinkItem bundleName = new LinkItem("bundle"); bundleName.setTitle("Bundle"); - bundleName.setTarget("#Bundles/Bundle/" + bundle.getId()); + bundleName.setValue("#Bundles/Bundle/" + bundle.getId()); bundleName.setLinkTitle(bundle.getName());
CanvasItem tagItem = new CanvasItem("tag"); @@ -114,7 +114,7 @@ public class BundleDestinationView extends VLayout implements BookmarkableView {
LinkItem destinationGroup = new LinkItem("group"); destinationGroup.setTitle("Group"); - destinationGroup.setTarget("#ResourceGroup/" + destination.getGroup().getId()); + destinationGroup.setValue("#ResourceGroup/" + destination.getGroup().getId()); destinationGroup.setLinkTitle(destination.getGroup().getName());
StaticTextItem path = new StaticTextItem("path", "Path");
commit e0ddca852fcc3f6a96077aa85c60154abbc89790 Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 13 15:29:19 2010 -0400
Add destinations to tag report
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java b/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java index 37aabb1..28207c4 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java @@ -56,9 +56,9 @@ import org.rhq.core.domain.resource.group.ResourceGroup; @NamedQuery(name = Tag.QUERY_TAG_COMPOSITE_REPORT, query = "SELECT new org.rhq.core.domain.tagging.compsite.TagReportComposite( \n" + " t.id, t.namespace, t.semantic, t.name,\n" + - " (count(r) + count(g) + count(b) + count(bv) + count(bd)) AS Total,\n" + - " count(r) AS Resources, count(g) AS ResourceGroups, count(b) AS Bundles, count(bv) AS BundleVersions, count(bd) AS BundleDeployments )\n" + - "FROM Tag t LEFT JOIN t.resources r LEFT JOIN t.resourceGroups g LEFT JOIN t.bundles b LEFT JOIN t.bundleVersions bv LEFT JOIN t.bundleDeployments bd\n" + + " (count(r) + count(g) + count(b) + count(bv) + count(bd) + count(bds)) AS Total,\n" + + " count(r) AS Resources, count(g) AS ResourceGroups, count(b) AS Bundles, count(bv) AS BundleVersions, count(bd) AS BundleDeployments, count(bds) AS BundleDestinations )\n" + + "FROM Tag t LEFT JOIN t.resources r LEFT JOIN t.resourceGroups g LEFT JOIN t.bundles b LEFT JOIN t.bundleVersions bv LEFT JOIN t.bundleDeployments bd LEFT JOIN t.bundleDestinations bds \n" + "GROUP BY t.id, t.namespace, t.semantic, t.name\n" + "ORDER BY (count(r) + count(g) + count(b) + count(bv) + count(bd)) desc") }) diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/compsite/TagReportComposite.java b/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/compsite/TagReportComposite.java index 1d54955..1804daa 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/compsite/TagReportComposite.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/compsite/TagReportComposite.java @@ -30,14 +30,14 @@ import org.rhq.core.domain.tagging.Tag; public class TagReportComposite extends Tag {
private Tag tag; - private long total, resourceCount, resourceGroupCount, bundleCount, bundleVersionCount, bundleDeploymentCount; + private long total, resourceCount, resourceGroupCount, bundleCount, bundleVersionCount, bundleDeploymentCount, bundleDestinationCount;
public TagReportComposite() { }
public TagReportComposite(int id, String namespace, String semantic, String name, long total, - long resourceCount, long resourceGroupCount, long bundleCount, long bundleVersionCount, long bundleDeploymentCount) { + long resourceCount, long resourceGroupCount, long bundleCount, long bundleVersionCount, long bundleDeploymentCount, long bundleDestinationCount) { tag = new Tag(namespace, semantic, name); tag.setId(id); this.total = total; @@ -46,6 +46,7 @@ public class TagReportComposite extends Tag { this.bundleCount = bundleCount; this.bundleVersionCount = bundleVersionCount; this.bundleDeploymentCount = bundleDeploymentCount; + this.bundleDestinationCount = bundleDestinationCount; }
public Tag getTag() { @@ -75,4 +76,8 @@ public class TagReportComposite extends Tag { public long getBundleDeploymentCount() { return bundleDeploymentCount; } + + public long getBundleDestinationCount() { + return bundleDestinationCount; + } }
commit 12e33230a90acbe26876bdf6176318e36241a34b Author: John Mazzitelli mazz@redhat.com Date: Thu May 13 15:31:07 2010 -0400
missing this from the web services remote API
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java index 6b98f4d..12c2370 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java @@ -77,6 +77,7 @@ import org.rhq.core.domain.criteria.AlertCriteria; import org.rhq.core.domain.criteria.AlertDefinitionCriteria; import org.rhq.core.domain.criteria.BundleCriteria; import org.rhq.core.domain.criteria.BundleDeploymentCriteria; +import org.rhq.core.domain.criteria.BundleDestinationCriteria; import org.rhq.core.domain.criteria.BundleFileCriteria; import org.rhq.core.domain.criteria.BundleResourceDeploymentCriteria; import org.rhq.core.domain.criteria.BundleVersionCriteria; @@ -374,6 +375,11 @@ public class WebservicesManagerBean implements WebservicesRemote { return bundleManager.findBundleDeploymentsByCriteria(subject, criteria); }
+ public PageList<BundleDestination> findBundleDestinationsByCriteria(Subject subject, + BundleDestinationCriteria criteria) { + return bundleManager.findBundleDestinationsByCriteria(subject, criteria); + } + public PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria(Subject subject, BundleResourceDeploymentCriteria criteria) { return bundleManager.findBundleResourceDeploymentsByCriteria(subject, criteria);
commit 78b25b976589cd1889480f057d4dc2f1be445ca0 Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 13 14:45:08 2010 -0400
destination terminology correction
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java index 38e9c41..e579cbd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java @@ -92,7 +92,7 @@ public class BundleView extends VLayout implements BookmarkableView { Tab versionsTab = createVersionsTab(); tabs.addTab(versionsTab);
- Tab deploymentsTab = createDeploymentsTab(); + Tab deploymentsTab = createDestinationsTab(); tabs.addTab(deploymentsTab);
addMember(headerLabel); @@ -101,7 +101,7 @@ public class BundleView extends VLayout implements BookmarkableView { if (nextViewId != null) { if (nextViewId.getPath().equals("versions")) { tabs.selectTab(versionsTab); - } else if (nextViewId.getPath().equals("deployments")) { + } else if (nextViewId.getPath().equals("desinations")) { tabs.selectTab(deploymentsTab); } } @@ -109,13 +109,13 @@ public class BundleView extends VLayout implements BookmarkableView { markForRedraw(); }
- private Tab createDeploymentsTab() { - Tab deploymentsTab = new Tab("Deployments"); + private Tab createDestinationsTab() { + Tab destinationsTab = new Tab("Destinations");
- deploymentsTab.setPane(new BundleDestinationListView(bundle.getId())); + destinationsTab.setPane(new BundleDestinationListView(bundle.getId()));
- return deploymentsTab; + return destinationsTab; }
private Tab createVersionsTab() {
commit c89ec1036faea31b1b713b18dc4c0825b4c3e253 Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 13 14:43:55 2010 -0400
New destination lists view more backbuttons
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java index 4ca494b..f93f66a 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java @@ -55,6 +55,7 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewId; import org.rhq.enterprise.gui.coregui.client.ViewPath; import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel; +import org.rhq.enterprise.gui.coregui.client.components.buttons.BackButton; import org.rhq.enterprise.gui.coregui.client.components.table.Table; import org.rhq.enterprise.gui.coregui.client.components.tagging.TagEditorView; import org.rhq.enterprise.gui.coregui.client.components.tagging.TagsChangedCallback; @@ -72,7 +73,7 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { private BundleVersion version; private Bundle bundle;
- private Canvas detail; + private VLayout detail;
private void viewBundleDeployment(BundleDeployment bundleDeployment, ViewId current) {
@@ -80,6 +81,10 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { this.version = bundleDeployment.getBundleVersion(); this.bundle = bundleDeployment.getBundleVersion().getBundle();
+ addMember(new BackButton("Back to Destination: " + deployment.getDestination().getName(),"Bundles/" + version.getBundle().getId() + "/destinations/" + deployment.getDestination().getId())); + + + addMember(new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/BundleDeployment_24.png") + ""/> " + deployment.getName()));
@@ -89,7 +94,7 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { LinkItem bundleName = new LinkItem("bundle"); bundleName.setTitle("Bundle"); bundleName.setTarget("#Bundles/Bundle/" + bundle.getId()); - bundleName.setValue(bundle.getName()); + bundleName.setLinkTitle(bundle.getName());
CanvasItem tagItem = new CanvasItem("tag"); tagItem.setShowTitle(false); @@ -116,7 +121,7 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView {
LinkItem destinationGroup = new LinkItem("group"); destinationGroup.setTarget("#ResourceGroup/" + deployment.getDestination().getGroup().getId()); - destinationGroup.setValue("Group"); + destinationGroup.setLinkTitle(deployment.getDestination().getGroup().getName());
StaticTextItem path = new StaticTextItem("path", "Path"); path.setValue(deployment.getDestination().getDeployDir()); @@ -126,13 +131,13 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { addMember(form);
Table deployments = createDeploymentsTable(); - deployments.setHeight("50%"); + deployments.setHeight("*"); deployments.setShowResizeBar(true); deployments.setResizeBarTarget("next"); addMember(createDeploymentsTable());
- detail = new Canvas(); - detail.setHeight("50%"); + detail = new VLayout(); + detail.setAutoHeight(); detail.hide(); addMember(detail);
@@ -193,7 +198,9 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { BundleResourceDeploymentHistoryListView detailView = new BundleResourceDeploymentHistoryListView( bundleResourceDeployment);
- detail.addChild(detailView); + detail.removeMembers(detail.getMembers()); + detail.addMember(detailView); + detail.setHeight("50%"); detail.animateShow(AnimationEffect.SLIDE);
/* diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationDataSource.java new file mode 100644 index 0000000..234d242 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationDataSource.java @@ -0,0 +1,119 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.bundle.destination; + +import java.util.Date; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.data.DSRequest; +import com.smartgwt.client.data.DSResponse; +import com.smartgwt.client.data.fields.DataSourceIntegerField; +import com.smartgwt.client.data.fields.DataSourceTextField; +import com.smartgwt.client.widgets.grid.ListGridRecord; + +import org.rhq.core.domain.bundle.BundleDestination; +import org.rhq.core.domain.criteria.BundleDestinationCriteria; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; + +/** + * @author Greg Hinkle + */ +public class BundleDestinationDataSource extends RPCDataSource<BundleDestination> { + + public BundleDestinationDataSource() { + + DataSourceIntegerField idField = new DataSourceIntegerField("id", "Id"); + idField.setPrimaryKey(true); + addField(idField); + + DataSourceTextField name = new DataSourceTextField("name", "Name"); + addField(name); + + DataSourceTextField description = new DataSourceTextField("description", "Description"); + addField(description); + + DataSourceTextField bundle = new DataSourceTextField("bundleName", "Bundle"); + addField(bundle); + + DataSourceTextField group = new DataSourceTextField("groupName", "Group"); + addField(group); + + DataSourceTextField deployDir = new DataSourceTextField("deployDir", "Deploy Directory"); + addField(deployDir); + + } + + @Override + protected void executeFetch(final DSRequest request, final DSResponse response) { + BundleDestinationCriteria criteria = new BundleDestinationCriteria(); + + if (request.getCriteria().getValues().containsKey("bundleId")) { + criteria.addFilterBundleId(Integer.parseInt(request.getCriteria().getAttributeAsString("bundleId"))); + } + + criteria.fetchBundle(true); + criteria.fetchDeployments(true); + criteria.fetchGroup(true); + criteria.fetchTags(true); + + GWTServiceLookup.getBundleService().findBundleDestinationsByCriteria(criteria, + new AsyncCallback<PageList<BundleDestination>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load bundle destinations",caught); + } + + public void onSuccess(PageList<BundleDestination> result) { + response.setData(buildRecords(result)); + processResponse(request.getRequestId(), response); + } + }); + } + + @Override + public BundleDestination copyValues(ListGridRecord from) { + return null; // TODO: Implement this method. + } + + @Override + public ListGridRecord copyValues(BundleDestination from) { + ListGridRecord record = new ListGridRecord(); + + record.setAttribute("id", from.getId()); + record.setAttribute("name", from.getName()); + record.setAttribute("description", from.getDescription()); + record.setAttribute("bundleId", from.getBundle().getId()); + record.setAttribute("bundleName", from.getBundle().getName()); + + record.setAttribute("groupId", from.getGroup().getId()); + record.setAttribute("groupName", from.getGroup().getName()); + + record.setAttribute("deployDir", from.getDeployDir()); + record.setAttribute("entity", from); + + + return record; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationListView.java new file mode 100644 index 0000000..f850938 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationListView.java @@ -0,0 +1,82 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.bundle.destination; + +import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.widgets.grid.CellFormatter; +import com.smartgwt.client.widgets.grid.ListGridRecord; +import com.smartgwt.client.widgets.layout.VLayout; + +import org.rhq.enterprise.gui.coregui.client.components.table.Table; + +/** + * @author Greg Hinkle + */ +public class BundleDestinationListView extends VLayout { + + + private Integer bundleId; + + public BundleDestinationListView() { + setWidth100(); + setHeight100(); + } + + public BundleDestinationListView(Integer bundleId) { + this(); + this.bundleId = bundleId; + } + + @Override + protected void onDraw() { + super.onDraw(); + + + Criteria criteria = new Criteria(); + if (bundleId != null) { + criteria.setAttribute("bundleId",bundleId.intValue()); + } + + Table table = new Table("Bundle Destinations", criteria); + + table.setDataSource(new BundleDestinationDataSource()); + + table.getListGrid().getField("id").setWidth(25); + table.getListGrid().getField("name").setWidth("20%"); + table.getListGrid().getField("name").setCellFormatter(new CellFormatter() { + public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { + return "<a href="#Bundles/Bundles/" + listGridRecord.getAttribute("bundleId") + "/destinations/" + listGridRecord.getAttribute("id") + "">" + o + "</a>"; + } + }); + + + table.getListGrid().getField("description").setWidth("25%"); + //table.getListGrid().getField("bundleName").setWidth("20%"); + table.getListGrid().hideField("bundleName"); + table.getListGrid().getField("groupName").setWidth("20%"); + table.getListGrid().getField("deployDir").setWidth("20%"); + + + addMember(table); + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java index 072f127..38e9c41 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java @@ -44,6 +44,7 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewId; import org.rhq.enterprise.gui.coregui.client.ViewPath; import org.rhq.enterprise.gui.coregui.client.bundle.deployment.BundleDeploymentView; +import org.rhq.enterprise.gui.coregui.client.bundle.destination.BundleDestinationListView; import org.rhq.enterprise.gui.coregui.client.bundle.destination.BundleDestinationView; import org.rhq.enterprise.gui.coregui.client.bundle.version.BundleVersionView; import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel; @@ -77,6 +78,8 @@ public class BundleView extends VLayout implements BookmarkableView { }
public void viewBundle(Bundle bundle, ViewId nextViewId) { + removeMembers(getMembers()); + this.bundle = bundle;
headerLabel = new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/Bundle_24.png") + ""/> " + bundle.getName()); @@ -108,6 +111,10 @@ public class BundleView extends VLayout implements BookmarkableView {
private Tab createDeploymentsTab() { Tab deploymentsTab = new Tab("Deployments"); + + + deploymentsTab.setPane(new BundleDestinationListView(bundle.getId())); + return deploymentsTab; }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java index 131a2be..0ce4c53 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java @@ -80,7 +80,7 @@ public class BundleVersionView extends VLayout implements BookmarkableView { tabs.addTab(createUpdateHistoryTab());
- addMember(new BackButton("Back to Bundle: " + version.getBundle().getName(),"Bundles/" + version.getBundle().getId())); + addMember(new BackButton("Back to Bundle: " + version.getBundle().getName(),"Bundles/Bundle/" + version.getBundle().getId()));
addMember(new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/BundleVersion_24.png") + ""/> " + version.getName() + ": " + version.getVersion())); addMember(tabs);
commit f0e732088797604e2b5a3b60d15e463ed84da100 Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 13 14:43:31 2010 -0400
Step details are expandable
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java index a1b7423..c5e7952 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java @@ -24,6 +24,7 @@ package org.rhq.enterprise.gui.coregui.client.bundle.deployment;
import java.util.ArrayList;
+import com.smartgwt.client.types.ExpansionMode; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; @@ -55,9 +56,14 @@ public class BundleResourceDeploymentHistoryListView extends VLayout { grid.setHeight100();
ListGridField action = new ListGridField("action", "Action"); - ListGridField message = new ListGridField("message", "Message"); + ListGridField message = new ListGridField("info", "Info"); ListGridField status = new ListGridField("status", "status");
+ grid.setCanExpandRecords(true); + grid.setExpansionMode(ExpansionMode.DETAIL_FIELD); + grid.setDetailField("message"); + + grid.setFields(action, message, status);
grid.setData(buildRecords());
commit 3b9d3cb02e6a86287450c81548effa87ccdd864d Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 13 14:42:43 2010 -0400
New separate icon for destinations
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java index cd77145..5351937 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java @@ -78,7 +78,7 @@ public class BundleDestinationView extends VLayout implements BookmarkableView { this.destination = bundleDestination; this.bundle = bundleDestination.getBundle();
- addMember(new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/BundleDeployment_24.png") + addMember(new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/BundleDestination_24.png") + ""/> " + destination.getName()));
DynamicForm form = new DynamicForm(); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeDataSource.java index 19d96cf..9e7ddb4 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeDataSource.java @@ -220,7 +220,7 @@ public class BundleTreeDataSource extends RPCDataSource { node.setID(destination.getBundle().getId() + ":destinations:" +destination.getId()); node.setParentID(destination.getBundle().getId() + ":destinations"); node.setIsFolder(false); - node.setIcon("subsystems/bundle/BundleDeployment_16.png"); + node.setIcon("subsystems/bundle/BundleDestination_16.png"); } return node; } diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/BundleDeployment_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/BundleDeployment_16.png index 78a92d9..4f37c3a 100644 Binary files a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/BundleDeployment_16.png and b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/BundleDeployment_16.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/BundleDeployment_24.png b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/BundleDeployment_24.png index b2ef100..1d4d547 100644 Binary files a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/BundleDeployment_24.png and b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/BundleDeployment_24.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/BundleDestination_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/BundleDestination_16.png new file mode 100644 index 0000000..78a92d9 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/BundleDestination_16.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/BundleDestination_24.png b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/BundleDestination_24.png new file mode 100644 index 0000000..b2ef100 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/bundle/BundleDestination_24.png differ
commit b216ce74bcf1c97cdb6443be281b219eabbfcf6b Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 13 13:35:05 2010 -0400
improve bundle resource deployment list
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java index 0724c46..4ca494b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java @@ -24,6 +24,7 @@ package org.rhq.enterprise.gui.coregui.client.bundle.deployment;
import java.util.ArrayList; import java.util.Date; +import java.util.HashMap; import java.util.HashSet;
import com.google.gwt.user.client.rpc.AsyncCallback; @@ -33,6 +34,7 @@ import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.CanvasItem; import com.smartgwt.client.widgets.form.fields.LinkItem; import com.smartgwt.client.widgets.form.fields.StaticTextItem; +import com.smartgwt.client.widgets.grid.CellFormatter; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; @@ -124,8 +126,9 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { addMember(form);
Table deployments = createDeploymentsTable(); - deployments.setHeight100(); + deployments.setHeight("50%"); deployments.setShowResizeBar(true); + deployments.setResizeBarTarget("next"); addMember(createDeploymentsTable());
detail = new Canvas(); @@ -138,15 +141,41 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { private Table createDeploymentsTable() { Table table = new Table("Deployment Machines");
- ListGridField resource = new ListGridField("resource", "Resource"); + + ListGridField resourceIcon = new ListGridField("resourceAvailabity"); + HashMap<String,String> icons = new HashMap<String, String>(); + icons.put("UP","types/Platform_up_16.png"); + icons.put("DOWN","types/Platform_down_16.png"); + resourceIcon.setValueIcons(icons); + resourceIcon.setValueIconSize(16); + resourceIcon.setCellFormatter(new CellFormatter() { + public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { + return ""; + } + }); + resourceIcon.setWidth(30); + + + ListGridField resource = new ListGridField("resource", "Platform"); + resource.setCellFormatter(new CellFormatter() { + public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { + return "<a href="#Resource/" + listGridRecord.getAttribute("resourceId") + "">" + o + "</a>"; + } + }); + ListGridField resourceVersion = new ListGridField("resourceVersion", "Operating System"); ListGridField status = new ListGridField("status", "Status");
- table.getListGrid().setFields(resource, status); + table.getListGrid().setFields(resourceIcon, resource, resourceVersion, status);
ArrayList<ListGridRecord> records = new ArrayList<ListGridRecord>(); for (BundleResourceDeployment rd : deployment.getResourceDeployments()) { ListGridRecord record = new ListGridRecord(); record.setAttribute("resource", rd.getResource().getName()); + + + record.setAttribute("resourceAvailabity", rd.getResource().getCurrentAvailability().getAvailabilityType().name()); + record.setAttribute("resourceId", rd.getResource().getId()); + record.setAttribute("resourceVersion", rd.getResource().getVersion()); record.setAttribute("status", rd.getStatus().name()); record.setAttribute("id", rd.getId()); record.setAttribute("entity", rd);
commit 6195455d4098d3094ffc1f19ddc242d2bfedfb7b Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 13 13:34:41 2010 -0400
fix deployment lookup
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java index 585b963..31c506f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java @@ -76,7 +76,7 @@ public class BundleDeploymentDataSource extends RPCDataSource<BundleDeployment> }
if (request.getCriteria().getValues().containsKey("bundleVersionId")) { - criteria.addFilterBundleId(Integer.parseInt(request.getCriteria().getAttribute("bundleVersionId"))); + criteria.addFilterBundleVersionId(Integer.parseInt(request.getCriteria().getAttribute("bundleVersionId"))); }
bundleService.findBundleDeploymentsByCriteria(criteria, new AsyncCallback<PageList<BundleDeployment>>() {
commit 8db824c75754eb139f7d9f0ab2c268077186c4ff Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 13 13:34:24 2010 -0400
Avoid NPE
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java index c8679e4..a1b7423 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java @@ -78,7 +78,9 @@ public class BundleResourceDeploymentHistoryListView extends VLayout {
record.setAttribute("info", step.getInfo());
- record.setAttribute("category", step.getCategory().toString()); + if (step.getCategory() != null) { + record.setAttribute("category", step.getCategory().toString()); + }
record.setAttribute("message", step.getMessage());
commit da7f91922882929bcf880f65fe2869864f43ef8d Merge: 21a583a... fa38f9f... Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 13 14:29:49 2010 -0400
Merge branch 'bundle' into bundle-jay
commit 21a583a62c23d17b13cfaeb782e7c4f625f2715d Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 13 14:26:49 2010 -0400
BundleManagerBean work - fix issue with status update - add logic for 'is_live' deployment handling
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java index 0a066d1..37f278c 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java @@ -700,22 +700,44 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot @RequiredPermission(Permission.MANAGE_INVENTORY) public BundleDeployment scheduleBundleDeployment(Subject subject, int bundleDeploymentId) throws Exception {
- BundleDeployment deployment = entityManager.find(BundleDeployment.class, bundleDeploymentId); - if (null == deployment) { + BundleDeployment newDeployment = entityManager.find(BundleDeployment.class, bundleDeploymentId); + if (null == newDeployment) { throw new IllegalArgumentException("Invalid bundleDeploymentId: " + bundleDeploymentId); } + newDeployment.setStatus(BundleDeploymentStatus.IN_PROGRESS);
- BundleDestination destination = deployment.getDestination(); + BundleDestination destination = newDeployment.getDestination(); ResourceGroup group = destination.getGroup();
// Create and persist updates for each of the group members. for (Resource resource : group.getExplicitResources()) { - BundleResourceDeployment resourceDeployment = scheduleBundleResourceDeployment(subject, deployment, - resource); - deployment.addResourceDeployment(resourceDeployment); + try { + BundleResourceDeployment resourceDeployment = scheduleBundleResourceDeployment(subject, newDeployment, + resource); + newDeployment.addResourceDeployment(resourceDeployment); + } catch (Throwable t) { + log.error("Failed to complete scheduling of platform deployment to [" + resource + + "]. Other platforms may have been scheduled. ", t); + } }
- return deployment; + entityManager.flush(); + + // make sure the new deployment is set as the live deployment. + destination = entityManager.find(BundleDestination.class, destination.getId()); + List<BundleDeployment> currentDeployments = destination.getDeployments(); + if (null != currentDeployments) { + for (BundleDeployment d : currentDeployments) { + if (d.isLive()) { + d.setLive(false); + break; + } + } + } + newDeployment.setLive(true); + entityManager.merge(newDeployment); + + return newDeployment; }
private BundleResourceDeployment scheduleBundleResourceDeployment(Subject subject, BundleDeployment deployment, @@ -816,7 +838,10 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot throw new IllegalArgumentException("Invalid bundleDeploymentId: " + resourceDeploymentId); }
- // set the status on the overall deployment + // update the status + resourceDeployment.setStatus(status); + + // update the status on the overall deployment BundleDeployment deployment = resourceDeployment.getBundleDeployment(); List<BundleResourceDeployment> deployments = deployment.getResourceDeployments(); boolean someInProgress = false; @@ -836,7 +861,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot } } if (someInProgress) { - // should actually be at this status already by what the heck + // should actually be at this status already but what the heck deployment.setStatus(BundleDeploymentStatus.IN_PROGRESS); } else if (someSuccess) { deployment.setStatus(someFailure ? BundleDeploymentStatus.MIXED : BundleDeploymentStatus.SUCCESS);
commit 97e38866a85084925f37117382402dfa391b05dd Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 13 14:25:41 2010 -0400
Updated test scripts to - create 'platforms' group automatically assuming platforms exist in inventory - better distinguish entities in the two tests - perform a redeploy (in test_bundleManagerZip.js)
diff --git a/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManager.js b/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManager.js index 9496ebb..bfb807f 100644 --- a/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManager.js +++ b/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManager.js @@ -56,8 +56,23 @@ function testDeployment() { var rgc = new ResourceGroupCriteria(); rgc.addFilterName("platforms"); // wINdows, lINux var groups = ResourceGroupManager.findResourceGroupsByCriteria(rgc); - Assert.assertTrue( groups.size() > 0 ); - var groupId = groups.get(0).getId(); + var groupId; + // create if needed (and possible) + if ( groups.isEmpty() ) { + var c = new ResourceCriteria(); + c.addFilterResourceCategory(ResourceCategory.PLATFORM); + var platforms = ResourceManager.findResourcesByCriteria(c); + Assert.assertTrue( platforms.size() > 0 ); + + var rg = new ResourceGroup("platforms"); + var platformSet = new java.util.HashSet(); + platformSet.addAll( platforms ); + rg.setExplicitResources(platformSet); + rg = ResourceGroupManager.createResourceGroup(rg); + groupId = rg.getId(); + } else { + groupId = groups.get(0).getId(); + }
// create a destination to deploy to var testDest = BundleManager.createBundleDestination( testBundleVersion.getBundle().getId(), "Deployment Test Dest", "test Dest", "/tmp/bundle-test", groupId); @@ -89,6 +104,7 @@ function getBundleType() { function cleanupTestBundle() { // delete the test bundle if it exists var bc = new BundleCriteria(); + bc.setStrict( true ); bc.addFilterName( bundleName ); var bundles = BundleManager.findBundlesByCriteria( bc ); if ( null != bundles && bundles.size() > 0 ) { diff --git a/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerZip.js b/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerZip.js index 138e4cd..cebb493 100644 --- a/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerZip.js +++ b/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerZip.js @@ -43,19 +43,38 @@ function testDeployment() { }
// delete the test bundle if it exists - var bc = new BundleCriteria(); - bc.addFilterName( bundleName ); - var bundles = BundleManager.findBundlesByCriteria( bc ); - if ( null != bundles && bundles.size() > 0 ) { - print( "\n Deleting existing testScriptBundle in order to test a fresh deploy...") - BundleManager.deleteBundle( bundles.get(0).getId() ); - } - + cleanupTestBundle(); + // create bundleVersion 1.0 var distributionFile = new java.io.File("./src/test/resources/cli-test-bundle-zip.zip"); distributionFile = new java.io.File(distributionFile.getAbsolutePath()); var testBundleVersion = BundleManager.createBundleVersionViaFile( distributionFile );
+ // Find a target platform group + var rgc = new ResourceGroupCriteria(); + rgc.addFilterName("platforms"); // wINdows, lINux + var groups = ResourceGroupManager.findResourceGroupsByCriteria(rgc); + var groupId; + // create if needed (and possible) + if ( groups.isEmpty() ) { + var c = new ResourceCriteria(); + c.addFilterResourceCategory(ResourceCategory.PLATFORM); + var platforms = ResourceManager.findResourcesByCriteria(c); + Assert.assertTrue( platforms.size() > 0 ); + + var rg = new ResourceGroup("platforms"); + var platformSet = new java.util.HashSet(); + platformSet.addAll( platforms ); + rg.setExplicitResources(platformSet); + rg = ResourceGroupManager.createResourceGroup(rg); + groupId = rg.getId(); + } else { + groupId = groups.get(0).getId(); + } + + // create a destination to deploy to + var testDest = BundleManager.createBundleDestination( testBundleVersion.getBundle().getId(), "test-cli-bundle-zip destination", "test-cli-bundle-zip destination", "/tmp/bundle-zip-test", groupId); + // create the config, setting the required properties from the recipe var config = new Configuration(); var property = new PropertySimple("dummy.name", "NAME REPLACED HERE!!!"); @@ -63,21 +82,29 @@ function testDeployment() { var property = new PropertySimple("dummy.description", "FLOPPY!!!"); config.put( property );
- // Find a target platform group - var rgc = new ResourceGroupCriteria(); - rgc.addFilterName("platforms"); - var groups = ResourceGroupManager.findResourceGroupsByCriteria(rgc); - Assert.assertTrue( groups.size() > 0 ); - var groupId = groups.get(0).getId(); - - // create a destination to deploy to - var testDest = BundleManager.createBundleDestination( testBundleVersion.getBundle().getId(), "Deployment Test Dest", "test Dest", "/tmp/bundle-test", groupId); - // create a deployment using the above config - var testDeployment = BundleManager.createBundleDeployment(testBundleVersion.getId(), testDest.getId(), "Deployment Test", "Deployment Test of dummy ZIP", config); + var testDeployment = BundleManager.createBundleDeployment(testBundleVersion.getId(), testDest.getId(), "Deployment Zip Test", "Deployment Test of dummy ZIP", config);
var bd = BundleManager.scheduleBundleDeployment(testDeployment.getId()); Assert.assertNotNull( bd ); + + // Now performa redeploy, the same thing but a change to the config + // create the config, setting the required properties from the recipe + var config2 = new Configuration(); + var property = new PropertySimple("dummy.name", "NAME REPLACED HERE!!!"); + config2.put( property ); + var property = new PropertySimple("dummy.description", "FLOPPY V2.0 !!!"); + config2.put( property ); + + // create a deployment using the above config + var testRedeploy = BundleManager.createBundleDeployment(testBundleVersion.getId(), testDest.getId(), "Redeployment Zip Test", "Redeploy Test of dummy ZIP", config2); + + var bd2 = BundleManager.scheduleBundleDeployment(testRedeploy.getId()); + Assert.assertNotNull( bd2 ); + + // delete the test bundle if it exists (after allowing agent audit messages to complete) + //sleep( 5000 ); + //cleanupTestBundle(); }
function getBundleType() { @@ -91,3 +118,16 @@ function getBundleType() {
print( "\n Could not find template bundle type, is the plugin loaded?"); } + +function cleanupTestBundle() { + // delete the test bundle if it exists + var bc = new BundleCriteria(); + bc.setStrict( true ); + bc.addFilterName( bundleName ); + var bundles = BundleManager.findBundlesByCriteria( bc ); + if ( null != bundles && bundles.size() > 0 ) { + print( "\n Deleting existing testScriptBundle in order to test a fresh deploy...") + BundleManager.deleteBundle( bundles.get(0).getId() ); + } +} +
commit fa38f9f79bdd071669c11540558c4ea0902fe198 Author: John Mazzitelli mazz@redhat.com Date: Thu May 13 14:09:32 2010 -0400
provide api to support the restoration of backup files
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/stream/StreamCopyDigest.java b/modules/core/util/src/main/java/org/rhq/core/util/stream/StreamCopyDigest.java new file mode 100644 index 0000000..8f22225 --- /dev/null +++ b/modules/core/util/src/main/java/org/rhq/core/util/stream/StreamCopyDigest.java @@ -0,0 +1,82 @@ +/* + * 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, 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.stream; + +import java.io.BufferedInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +import org.rhq.core.util.MessageDigestGenerator; + +/** + * This copies stream data to another stream, while calculating the stream's message + * digest on the fly as the copy is performed. + * + * @author John Mazzitelli + */ +public class StreamCopyDigest { + private final MessageDigestGenerator generator; + + public StreamCopyDigest() { + this.generator = new MessageDigestGenerator(); + } + + public StreamCopyDigest(MessageDigestGenerator generator) { + this.generator = generator; + } + + /** + * @return the generator used to calculate digests/hashcodes + */ + public MessageDigestGenerator getMessageDigestGenerator() { + return generator; + } + + /** + * Copies the input stream data to the output stream and returns the + * copied data's digest string. + * + * Note: the streams are never closed - the caller is responsible for that. + * + * @param in input content + * @param out where to write the input content + * @return the copied content's digest string (aka hashcode) + */ + public String copyAndCalculateHashcode(InputStream in, OutputStream out) { + try { + byte[] buffer = new byte[32768]; + BufferedInputStream bufferedStream = new BufferedInputStream(in, buffer.length); + for (int bytesRead = bufferedStream.read(buffer); bytesRead != -1; bytesRead = bufferedStream.read(buffer)) { + out.write(buffer, 0, bytesRead); + this.generator.add(buffer, 0, bytesRead); + } + out.flush(); + } catch (IOException ioe) { + throw new RuntimeException("Stream data cannot be copied", ioe); + } + + return this.generator.getDigestString(); + } +} diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/DeployDifferences.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/DeployDifferences.java index a93d96a..4b26bcb 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/updater/DeployDifferences.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/DeployDifferences.java @@ -48,6 +48,7 @@ public class DeployDifferences { private final Set<String> addedFiles = new HashSet<String>(); private final Set<String> changedFiles = new HashSet<String>(); private final Map<String, String> backedUpFiles = new HashMap<String, String>(); + private final Map<String, String> restoredFiles = new HashMap<String, String>(); private final Map<String, String> realizedFiles = new HashMap<String, String>(); private final Map<String, String> errors = new HashMap<String, String>();
@@ -127,6 +128,10 @@ public class DeployDifferences { this.backedUpFiles.put(convertPath(originalPath), convertPath(backupPath)); }
+ public void addRestoredFile(String restoredPath, String backupPath) { + this.restoredFiles.put(convertPath(restoredPath), convertPath(backupPath)); + } + public void addRealizedFile(String path, String content) { this.realizedFiles.put(convertPath(path), content); } @@ -183,6 +188,18 @@ public class DeployDifferences { }
/** + * Returns the set of files that have been restored from a backup copy. + * The key is the restored path of the file (i.e. the location where the + * file now resides after being restored); the value is the path where + * the backup copy of the file is. + * + * @return the information on files that were restored + */ + public Map<String, String> getRestoredFiles() { + return this.restoredFiles; + } + + /** * Returns the set of files that have been realized. * When a file is said to be "realized", it means the file was original * a template with replacement tokens but those replacement tokens have @@ -218,6 +235,7 @@ public class DeployDifferences { str.append("changed=").append(this.changedFiles).append('\n'); str.append("ignored=").append(this.ignoredFiles).append('\n'); str.append("backed-up=").append(this.backedUpFiles).append('\n'); + str.append("restored=").append(this.restoredFiles).append('\n'); str.append("realized=").append(this.realizedFiles.keySet()).append('\n'); str.append("errors=").append(this.errors); return str.toString(); diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java index 13b67a0..5adc3e1 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java @@ -40,6 +40,7 @@ import org.apache.commons.logging.LogFactory; import org.rhq.core.util.MessageDigestGenerator; import org.rhq.core.util.ZipUtil; import org.rhq.core.util.file.FileUtil; +import org.rhq.core.util.stream.StreamCopyDigest; import org.rhq.core.util.stream.StreamUtil;
/** @@ -106,29 +107,92 @@ public class Deployer { return; }
+ /** + * Convienence method that is equivalent to {@link #deploy(DeployDifferences, boolean) deploy(diff, false)}. + * @see #deploy(DeployDifferences, boolean) + */ public FileHashcodeMap deploy(DeployDifferences diff) throws Exception { + return deploy(diff, false); + } + + /** + * Convienence method that is equivalent to {@link #deploy(DeployDifferences, boolean) deploy(diff, true)}. + * @see #deploy(DeployDifferences, boolean) + */ + public FileHashcodeMap dryRun(DeployDifferences diff) throws Exception { + return deploy(diff, true); + } + + /** + * Deploys all files to their destinations. Everything this method has to do is determined + * by the data passed into this object's constructor. + * + * @param diff this method will populate this object with information about what + * changed on the file system due to this deployment + * @param dryRun if <code>true</code>, the file system won't actually be changed; however, + * the <code>diff</code> object will still be populated with information about + * what would have occurred on the file system had it not been a dry run + * @return file/hashcode information for all files that were deployed + * @throws Exception if the deployment failed for some reason + */ + public FileHashcodeMap deploy(DeployDifferences diff, boolean dryRun) throws Exception { FileHashcodeMap map = null;
if (!this.deploymentsMetadata.isManaged()) { // the destination dir has not been used to deploy a bundle yet, therefore, this is the first deployment - map = performInitialDeployment(diff, false); + map = performInitialDeployment(diff, dryRun); } else { // we have metadata in the destination directory, therefore, this deployment is updating a current one - map = performUpdateDeployment(diff, false); + map = performUpdateDeployment(diff, dryRun); }
return map; }
- public FileHashcodeMap dryRun(DeployDifferences diff) throws Exception { + /** + * This will first perform a deploy (e.g. {@link #deploy(DeployDifferences, boolean) deploy(diff, dryRun)}) and + * then, if there are backup files from the previous deployment, those backup files will be restored to their + * original locations. + * + * This is useful when you want to "undeploy" something where "undeploy" infers you want to go back to + * how the file system looked previously to a subsequent deployment (the one this method is being told + * to "redeploy"), including manual changes that were made over top the previous deployment. + * + * For example, suppose you deployed deployment ID #1 and then the user manually changed some files + * within that #1 deployment. Later on, you deploy deployment ID #2 (which will not only deploy + * #2's files but will also backup the files that were manually changed within deployment #1). + * You find that deployment #2 is bad and you want to revert back to how the file system looked + * previously. You could opt to rollback to deployment ID #1 minus those manual changes - to do + * this you simply {@link #deploy(DeployDifferences) deploy} #1 again. However, if you want to + * go back to the previous content including those manual changes, you first deploy #1 and + * then restore the backup files - essentially overlaying the manual changes over top #1 files. This + * method accomplishes that latter task. + * + * @param diff see {@link #deploy(DeployDifferences, boolean)} + * @param dryRun see {@link #deploy(DeployDifferences, boolean)} + * @return see {@link #deploy(DeployDifferences, boolean)} + * @throws Exception if either the deployment or backup file restoration failed + */ + public FileHashcodeMap redeployAndRestoreBackupFiles(DeployDifferences diff, boolean dryRun) throws Exception { FileHashcodeMap map = null;
if (!this.deploymentsMetadata.isManaged()) { // the destination dir has not been used to deploy a bundle yet, therefore, this is the first deployment - map = performInitialDeployment(diff, true); + map = performInitialDeployment(diff, dryRun); } else { - // we have metadata in the destination directory, therefore, this deployment is updating a current one - map = performUpdateDeployment(diff, true); + // we have metadata in the destination directory, therefore, this deployment is updating a current one. + // First get the ID of the currently existing deployment - this is where our backup files exist. + // Then we update the current deployment with the new deployment (which actually should be restoring to the previous one). + // Finally, we restore the backup files into the new deployment, overlaying them over top the new deployment. + int id = this.deploymentsMetadata.getCurrentDeploymentProperties().getDeploymentId(); + map = performUpdateDeployment(diff, dryRun); + restoreBackupFiles(id, map, diff, dryRun); + if (!dryRun) { + // if we restored one or more files, we need to persist the new deployment hashcode data with the restored hashcodes + if (!diff.getRestoredFiles().isEmpty()) { + this.deploymentsMetadata.setCurrentDeployment(this.deploymentData.getDeploymentProps(), map, false); + } + } }
return map; @@ -329,7 +393,8 @@ public class Deployer { if (fileToBackup.isAbsolute()) { File backupDir = this.deploymentsMetadata.getDeploymentExternalBackupDirectory(deploymentId); if (isWindows && driveLetter != null) { - backupDir = new File(backupDir, "_" + driveLetter.toUpperCase()); + String dirName = this.deploymentsMetadata.getExternalBackupDirectoryNameForWindows(driveLetter); + backupDir = new File(backupDir, dirName); bakFile = new File(backupDir, fileToBackupPathNoDriveLetter.toString()); } else { bakFile = new File(backupDir, fileToBackupPath); @@ -480,7 +545,8 @@ public class Deployer { newFileHashCodeMap.putAll(currentFilesToLeaveAlone); // remember that these are still there
if (!dryRun) { - this.deploymentsMetadata.setCurrentDeployment(this.deploymentData.getDeploymentProps(), newFileHashCodeMap); + this.deploymentsMetadata.setCurrentDeployment(this.deploymentData.getDeploymentProps(), newFileHashCodeMap, + true); }
return newFileHashCodeMap; @@ -562,12 +628,141 @@ public class Deployer { return fileHashcodeMap; }
+ /** + * Takes all backup files found in a previous deployment and restores those files to their + * original locations. + * + * This method is usually called after a {@link #deploy(DeployDifferences, boolean)} has been completed + * because it would be at that time when the previous deployment's information has been persisted + * and is available. Rarely will you ever want to restore backup files without first deploying + * content. + * + * @param prevDeploymentId the previous deployment ID which contains the backup files + * @param map the map containing filenames/hashcodes that will be adjusted to reflect the restored file hashcodes + * @param diff used to store information about the restored files + * @param dryRun if <code>true</code>, don't really restore the files, but log the files that would + * have been restored; <code>false</code> means you really want to restore the files + * @throws Exception + */ + private void restoreBackupFiles(int prevDeploymentId, FileHashcodeMap map, DeployDifferences diff, boolean dryRun) + throws Exception { + + // do the relative backup files first - these go into the destination directory + File backupDir = this.deploymentsMetadata.getDeploymentBackupDirectory(prevDeploymentId); + String backupDirBase = backupDir.getAbsolutePath(); + if (!backupDirBase.endsWith(File.separator)) { + backupDirBase += File.separator; // make sure it ends with a file separator so our string manipulation works + } + File destDir = this.deploymentData.getDestinationDir(); + restoreBackupFilesRecursive(backupDir, backupDirBase, destDir, map, diff, dryRun); + + // now do the external backup files - these go into directories external to the destination directory + // note that if we are on windows, we have to do special things due to the existence of multiple root + // directories (i.e. drive letters). + Map<String, File> extBackupDirs; + extBackupDirs = this.deploymentsMetadata.getDeploymentExternalBackupDirectoriesForWindows(prevDeploymentId); + if (extBackupDirs == null) { + // we are on a non-windows platform; there is only one main root directory - "/" + File extBackupDir = this.deploymentsMetadata.getDeploymentExternalBackupDirectory(prevDeploymentId); + extBackupDirs = new HashMap<String, File>(1); + extBackupDirs.put("/", extBackupDir); + } + + for (Map.Entry<String, File> entry : extBackupDirs.entrySet()) { + String rootDir = entry.getKey(); + File extBackupDir = entry.getValue(); + String extBackupDirBase = extBackupDir.getAbsolutePath(); + if (!extBackupDirBase.endsWith(File.separator)) { + extBackupDirBase += File.separator; + } + restoreExternalBackupFilesRecursive(rootDir, extBackupDir, extBackupDirBase, map, diff, dryRun); + } + + return; + } + + private void restoreBackupFilesRecursive(File file, String base, File destDir, FileHashcodeMap map, + DeployDifferences diff, boolean dryRun) throws Exception { + + File[] children = file.listFiles(); + if (children != null) { + for (File child : children) { + if (child.isDirectory()) { + restoreBackupFilesRecursive(child, base, destDir, map, diff, dryRun); + } else { + String childRelativePath = child.getAbsolutePath().substring(base.length()); + File restoredFile = new File(destDir, childRelativePath); + debug("Restoring backup file [" + child + "] to [" + restoredFile + "]. dryRun=" + dryRun); + if (!dryRun) { + restoredFile.getParentFile().mkdirs(); + String hashcode = copyFileAndCalcHashcode(child, restoredFile); + map.put(childRelativePath, hashcode); + } else { + map.put(childRelativePath, MessageDigestGenerator.getDigestString(child)); + } + diff.addRestoredFile(childRelativePath, child.getAbsolutePath()); + } + } + } + return; + } + + private void restoreExternalBackupFilesRecursive(String rootDir, File backupDir, String base, FileHashcodeMap map, + DeployDifferences diff, boolean dryRun) throws Exception { + + File[] children = backupDir.listFiles(); + if (children != null) { + for (File child : children) { + if (child.isDirectory()) { + restoreExternalBackupFilesRecursive(rootDir, child, base, map, diff, dryRun); + } else { + String childRelativePath = child.getAbsolutePath().substring(base.length()); + File restoredFile = new File(rootDir, childRelativePath); + debug("Restoring backup file [" + child + "] to external location [" + restoredFile + "]. dryRun=" + + dryRun); + if (!dryRun) { + restoredFile.getParentFile().mkdirs(); + String hashcode = copyFileAndCalcHashcode(child, restoredFile); + map.put(restoredFile.getAbsolutePath(), hashcode); + } else { + map.put(restoredFile.getAbsolutePath(), MessageDigestGenerator.getDigestString(child)); + } + diff.addRestoredFile(restoredFile.getAbsolutePath(), child.getAbsolutePath()); + } + } + } + return; + } + + private String copyFileAndCalcHashcode(File src, File dest) throws Exception { + BufferedInputStream is = null; + BufferedOutputStream os = null; + try { + is = new BufferedInputStream(new FileInputStream(src)); + os = new BufferedOutputStream(new FileOutputStream(dest)); + StreamCopyDigest copier = new StreamCopyDigest(); + return copier.copyAndCalculateHashcode(is, os); + } finally { + try { + if (is != null) + is.close(); + } catch (Exception ignore) { + } + + try { + if (os != null) + os.close(); + } catch (Exception ignore) { + } + } + } + private void debug(Object... objs) { if (log.isDebugEnabled()) { - StringBuilder str = new StringBuilder(); String bundleName = this.deploymentData.getDeploymentProps().getBundleName(); String bundleVersion = this.deploymentData.getDeploymentProps().getBundleVersion(); int deploymentId = this.deploymentData.getDeploymentProps().getDeploymentId(); + StringBuilder str = new StringBuilder(); str.append("Bundle [").append(bundleName).append(" v").append(bundleVersion).append(']'); str.append("; Deployment [").append(deploymentId).append("]: "); for (Object o : objs) { diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentsMetadata.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentsMetadata.java index dec7dfa..3f456b8 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentsMetadata.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentsMetadata.java @@ -24,7 +24,10 @@ package org.rhq.core.util.updater;
import java.io.File; +import java.util.HashMap; +import java.util.Map; import java.util.Set; +import java.util.regex.Matcher; import java.util.regex.Pattern;
import org.rhq.core.util.file.FileUtil; @@ -54,16 +57,17 @@ public class DeploymentsMetadata { if (rootDirectory == null) { throw new NullPointerException("rootDirectory == null"); } - this.rootDirectory = rootDirectory; + this.rootDirectory = rootDirectory.getAbsoluteFile(); // ensure it has an absolute path }
@Override public String toString() { - return "DeploymentMetadata [" + getRootDirectory().getAbsolutePath() + "]"; + return "DeploymentMetadata [" + getRootDirectory() + "]"; }
/** * @return the root directory where the bundle deployments are and where the metadata directory is located. + * The returned File will have an absolute path. */ public File getRootDirectory() { return rootDirectory; @@ -108,8 +112,7 @@ public class DeploymentsMetadata { public File getMetadataDirectoryOnlyIfExists() throws Exception { File metaDir = getMetadataDirectory(); if (!metaDir.isDirectory()) { - throw new IllegalStateException("Not a managed deployment location: " - + getRootDirectory().getAbsolutePath()); + throw new IllegalStateException("Not a managed deployment location: " + getRootDirectory()); } return metaDir; } @@ -150,6 +153,27 @@ public class DeploymentsMetadata { }
/** + * Returns information about the previous deployment given a specific deployment ID. + * + * @param id identifies which deployment whose previous deployment props are to be returned + * @return props with previous deployment information, or <code>null</code> if there was no previous deployment + * @throws Exception if could not load the previous deployment information or the given deployment ID is invalid + */ + public DeploymentProperties getPreviousDeploymentProperties(int deploymentId) throws Exception { + try { + File deploymentSubdir = getDeploymentMetadataDirectory(deploymentId); + File propertiesFile = new File(deploymentSubdir, PREVIOUS_DEPLOYMENT_FILE); + DeploymentProperties props = null; + if (propertiesFile.exists()) { + props = DeploymentProperties.loadFromFile(propertiesFile); + } + return props; + } catch (Exception e) { + throw new IllegalStateException("Cannot get deployment info", e); + } + } + + /** * Returns the files and their hashcodes for the current deployment. This does not * perform live computations of the file hashcodes, instead it reads the data out of * the metadata file from a previous computation when the files were initially @@ -248,15 +272,80 @@ public class DeploymentsMetadata { }
/** + * Returns all the metadata directories that contain backup files for external directories + * (i.e. outside the deployment directory). The returned map has driver letter root directories + * as their keys (e.g. "C:"); the values are the backup directories that contain files that were stored on their + * associated drive. + * + * Obviously, this method is only appropriate to be called on Windows platforms. If this method is + * called while the Java VM is running in a non-Windows environment, <code>null</code> is returned. + * + * @param deploymentId the ID of the deployment whose backup directories are to be returned + * @return backup directories for the deployment's external files, keyed on the drive letter root directory + */ + public Map<String, File> getDeploymentExternalBackupDirectoriesForWindows(int deploymentId) throws Exception { + + boolean isWindows = (File.separatorChar == '\'); + if (!isWindows) { + return null; + } + + try { + // find all the direct children directories of the main external backup directory; if any of them + // have the name "_X" where "X" is a letter from A to Z, that denotes a drive letter and + // that directory contains all the backup files for that drive. + Map<String, File> backupDirs = new HashMap<String, File>(); + Pattern driveLetterPattern = Pattern.compile("_([a-zA-Z])"); + File dir = getDeploymentExternalBackupDirectory(deploymentId); + File[] children = dir.listFiles(); + if (children != null) { + for (File child : children) { + if (child.isDirectory()) { + String dirName = child.getName(); + Matcher m = driveLetterPattern.matcher(dirName); + if (m.matches()) { + String driveLetter = m.group(1).toUpperCase(); + backupDirs.put(driveLetter + ":\", child); + } + } + } + } + return backupDirs; + } catch (Exception e) { + throw new IllegalStateException("Cannot determine deployment external backup dir for [" + deploymentId + + "]", e); + } + } + + /** + * Given a Windows drive letter, this will return the name of the external backup directory + * where all backups for external files should be copied to. This method involves no relative or + * absolute paths, this only returns the short name of the directory. The returned name should + * be appended to the end of a {@link #getDeploymentExternalBackupDirectory(int) external backup directory} + * to obtain the full path. + * + * @param driveLetter + * @return the name of the directory that should be used when storing external files for backup. + */ + public String getExternalBackupDirectoryNameForWindows(String driveLetter) { + return "_" + driveLetter.toUpperCase(); + } + + /** * Call this when you already know the properties, and files/hashcodes for the current live deployment. * This method will also mark this initialized, live deployment as the "current" deployment. - * + * In addition, if <code>rememberPrevious</code> is <code>true</code>, this will take the previous + * deployment information and backup that data - pass <code>false</code> if you merely want to update + * the current deployment properties without affecting anything else, specifically the backed up + * previous deployment data. + * * @param deploymentProps identifies the deployment information for the live deployment * @param fileHashcodeMap the files and their hashcodes of the current live deployment + * @param rememberPrevious if <code>true</code>, this will create a backup of the previous deployment data * @throws Exception if failed to write out the necessary metadata about the given live data information */ - public void setCurrentDeployment(DeploymentProperties deploymentProps, FileHashcodeMap fileHashcodeMap) - throws Exception { + public void setCurrentDeployment(DeploymentProperties deploymentProps, FileHashcodeMap fileHashcodeMap, + boolean rememberPrevious) throws Exception {
// determine where we need to put the metadata and create its empty directory // Don't worry if the directory already exists, we probably backed up files there ahead of time. @@ -275,10 +364,14 @@ public class DeploymentsMetadata {
// since we are being told this is the live deployment, this deployment should be considered the current one File currentDeploymentPropertiesFile = new File(getMetadataDirectory(), CURRENT_DEPLOYMENT_FILE); - File previousDeploymentPropertiesFile = new File(deploymentMetadataDir, PREVIOUS_DEPLOYMENT_FILE); - if (currentDeploymentPropertiesFile.exists()) { - FileUtil.copyFile(currentDeploymentPropertiesFile, previousDeploymentPropertiesFile); + + if (rememberPrevious) { + File previousDeploymentPropertiesFile = new File(deploymentMetadataDir, PREVIOUS_DEPLOYMENT_FILE); + if (currentDeploymentPropertiesFile.exists()) { + FileUtil.copyFile(currentDeploymentPropertiesFile, previousDeploymentPropertiesFile); + } } + deploymentProps.saveToFile(currentDeploymentPropertiesFile);
return; @@ -300,7 +393,7 @@ public class DeploymentsMetadata {
// calculate the hashcodes from the live files and write the data to the proper file FileHashcodeMap map = FileHashcodeMap.generateFileHashcodeMap(getRootDirectory(), ignoreRegex, ignored); - setCurrentDeployment(deploymentProps, map); + setCurrentDeployment(deploymentProps, map, true); return map; }
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/ExtractorZipFileVisitor.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/ExtractorZipFileVisitor.java index 93230ec..4a03049 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/updater/ExtractorZipFileVisitor.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/ExtractorZipFileVisitor.java @@ -34,6 +34,7 @@ import java.util.zip.ZipInputStream; import org.rhq.core.template.TemplateEngine; import org.rhq.core.util.MessageDigestGenerator; import org.rhq.core.util.ZipUtil; +import org.rhq.core.util.stream.StreamCopyDigest; import org.rhq.core.util.stream.StreamUtil;
/** diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/StreamCopyDigest.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/StreamCopyDigest.java deleted file mode 100644 index fd71770..0000000 --- a/modules/core/util/src/main/java/org/rhq/core/util/updater/StreamCopyDigest.java +++ /dev/null @@ -1,82 +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, 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.BufferedInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -import org.rhq.core.util.MessageDigestGenerator; - -/** - * This copies stream data to another stream, while calculating the stream's message - * digest on the fly as the copy is performed. - * - * @author John Mazzitelli - */ -public class StreamCopyDigest { - private final MessageDigestGenerator generator; - - public StreamCopyDigest() { - this.generator = new MessageDigestGenerator(); - } - - public StreamCopyDigest(MessageDigestGenerator generator) { - this.generator = generator; - } - - /** - * @return the generator used to calculate digests/hashcodes - */ - public MessageDigestGenerator getMessageDigestGenerator() { - return generator; - } - - /** - * Copies the input stream data to the output stream and returns the - * copied data's digest string. - * - * Note: the streams are never closed - the caller is responsible for that. - * - * @param in input content - * @param out where to write the input content - * @return the copied content's digest string (aka hashcode) - */ - public String copyAndCalculateHashcode(InputStream in, OutputStream out) { - try { - byte[] buffer = new byte[32768]; - BufferedInputStream bufferedStream = new BufferedInputStream(in, buffer.length); - for (int bytesRead = bufferedStream.read(buffer); bytesRead != -1; bytesRead = bufferedStream.read(buffer)) { - out.write(buffer, 0, bytesRead); - this.generator.add(buffer, 0, bytesRead); - } - out.flush(); - } catch (IOException ioe) { - throw new RuntimeException("Stream data cannot be copied", ioe); - } - - return this.generator.getDigestString(); - } -} diff --git a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawFileTest.java b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawFileTest.java index 40e9c70..bbcdd58 100644 --- a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawFileTest.java +++ b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawFileTest.java @@ -137,6 +137,10 @@ public class SimpleDeployerRawFileTest { baseX_Y_Z(false); }
+ public void testX_Y_Z_Restore() throws Exception { + baseX_Y_Z_Restore(false); + } + public void testNoOriginalNoCurrentWithNew() throws Exception { baseNoOriginalNoCurrentWithNew(false); } @@ -177,6 +181,10 @@ public class SimpleDeployerRawFileTest { baseX_Y_Z(true); }
+ public void testX_Y_Z_Restore_DryRun() throws Exception { + baseX_Y_Z_Restore(true); + } + public void testNoOriginalNoCurrentWithNew_DryRun() throws Exception { baseNoOriginalNoCurrentWithNew(true); } @@ -390,8 +398,8 @@ public class SimpleDeployerRawFileTest { }
// The new file changed the original, and our current file has been manually updated - // but that current file's change does not match to new file. Therefore, the current file - // it out of date. The safest thing to do is backup the current and copy the new file + // but that current file's change does not match the new file. Therefore, the current file + // is out of date. The safest thing to do is backup the current and copy the new file // to become the current file.
assert !newFileHashcodeMap.equals(this.originalFileHashcodeMap); @@ -742,6 +750,87 @@ public class SimpleDeployerRawFileTest { } }
+ private void baseX_Y_Z_Restore(boolean dryRun) throws Exception { + String newContentY = "testX_Y_Z_YYY"; + writeFile(newContentY, this.currentFile); + String newHashcodeY = MessageDigestGenerator.getDigestString(newContentY); + + String newContentZ = "testX_Y_Z_ZZZ"; + String newHashcodeZ = MessageDigestGenerator.getDigestString(newContentZ); + File newRawFile = writeFile(newContentZ, tmpDir, "new-content.txt"); + Map<File, File> newRawFiles = new HashMap<File, File>(1); + newRawFiles.put(newRawFile, this.currentFile); + + DeploymentData dd = new DeploymentData(newDeployProps, null, newRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); + FileHashcodeMap newFileHashcodeMap; + newFileHashcodeMap = deployer.deploy(this.diff); // no dry run - we need to do this to force backup file creation + + // The new file changed the original, and our current file has been manually updated + // but that current file's change does not match the new file. Therefore, the current file + // is out of date. The safest thing to do is backup the current and copy the new file + // to become the current file. + + assert !newFileHashcodeMap.equals(this.originalFileHashcodeMap); + assert newFileHashcodeMap.size() == 1; + assert newFileHashcodeMap.get(currentAbsPath).equals(newHashcodeZ); + String[] contentHash = getOriginalFilenameContentHashcode(); + assert contentHash[0].equals(newContentZ); + assert contentHash[1].equals(newHashcodeZ); + + assert this.diff.getAddedFiles().isEmpty() : this.diff; + assert this.diff.getDeletedFiles().isEmpty() : this.diff; + assert this.diff.getChangedFiles().size() == 1 : this.diff; + assert this.diff.getChangedFiles().contains(this.diff.convertPath(currentAbsPath)) : this.diff; + assert this.diff.getBackedUpFiles().size() == 1 : this.diff; + assert this.diff.getBackedUpFiles().containsKey(this.diff.convertPath(currentAbsPath)) : this.diff; + assert this.diff.getRestoredFiles().isEmpty() : this.diff; + assert this.diff.getIgnoredFiles().isEmpty() : this.diff; + assert this.diff.getRealizedFiles().isEmpty() : this.diff; + assert this.diff.getErrors().isEmpty() : this.diff; + + assert this.metadata.getCurrentDeploymentProperties().equals(newDeployProps); + assert this.metadata.getCurrentDeploymentFileHashcodes().equals(newFileHashcodeMap); + + // verify the backup copy + File backupFile = new File(this.diff.getBackedUpFiles().get(this.diff.convertPath(currentAbsPath))); + assert readFile(backupFile).equals(newContentY) : "did not backup the correct file?"; + + // all we did so far was upgrade to v2 and created a backup file, now we need to redeploy v1 and see the backup restored + DeploymentProperties v1Duplicate = new DeploymentProperties(); + v1Duplicate.putAll(this.originalDeployProps); + v1Duplicate.setDeploymentId(3); // this is the same as v1, but it needs a unique deployment ID + dd = new DeploymentData(v1Duplicate, null, sourceRawFiles, deployDir, null, null, null, null); + deployer = new Deployer(dd); + this.diff = new DeployDifferences(); + FileHashcodeMap restoreFileHashcodeMap; + restoreFileHashcodeMap = deployer.redeployAndRestoreBackupFiles(this.diff, dryRun); + + assert this.diff.getAddedFiles().isEmpty() : this.diff; + assert this.diff.getDeletedFiles().isEmpty() : this.diff; + assert this.diff.getChangedFiles().size() == 1 : this.diff; + assert this.diff.getChangedFiles().contains(this.diff.convertPath(currentAbsPath)) : this.diff; + assert this.diff.getBackedUpFiles().isEmpty() : this.diff; + assert this.diff.getRestoredFiles().size() == 1 : this.diff; + assert this.diff.getRestoredFiles().containsKey(this.diff.convertPath(currentAbsPath)) : this.diff; + assert this.diff.getIgnoredFiles().isEmpty() : this.diff; + assert this.diff.getRealizedFiles().isEmpty() : this.diff; + assert this.diff.getErrors().isEmpty() : this.diff; + + assert restoreFileHashcodeMap.get(this.diff.convertPath(currentAbsPath)).equals(newHashcodeY) : "hashcode doesn't reflect restored backup"; + + if (dryRun) { + // still our v2 + assert this.metadata.getCurrentDeploymentProperties().equals(newDeployProps); + assert this.metadata.getCurrentDeploymentFileHashcodes().equals(newFileHashcodeMap); + } else { + // we reverted back to v1 with the manual changes + assert this.metadata.getCurrentDeploymentProperties().equals(v1Duplicate); + assert this.metadata.getCurrentDeploymentFileHashcodes().equals(restoreFileHashcodeMap); + assert MessageDigestGenerator.getDigestString(this.currentFile).equals(newHashcodeY) : "file wasn't restored"; + } + } + private String[] getOriginalFilenameContentHashcode() throws Exception { return getFilenameContentHashcode(this.currentAbsPath); } diff --git a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawRelativeFileTest.java b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawRelativeFileTest.java index 3dc27e3..f72af1f 100644 --- a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawRelativeFileTest.java +++ b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawRelativeFileTest.java @@ -136,6 +136,10 @@ public class SimpleDeployerRawRelativeFileTest { baseX_Y_Z(false); }
+ public void testX_Y_Z_Restore() throws Exception { + baseX_Y_Z_Restore(false); + } + public void testNoOriginalNoCurrentWithNew() throws Exception { baseNoOriginalNoCurrentWithNew(false); } @@ -176,6 +180,10 @@ public class SimpleDeployerRawRelativeFileTest { baseX_Y_Z(true); }
+ public void testX_Y_Z_Restore_DryRun() throws Exception { + baseX_Y_Z_Restore(true); + } + public void testNoOriginalNoCurrentWithNew_DryRun() throws Exception { baseNoOriginalNoCurrentWithNew(true); } @@ -389,8 +397,8 @@ public class SimpleDeployerRawRelativeFileTest { }
// The new file changed the original, and our current file has been manually updated - // but that current file's change does not match to new file. Therefore, the current file - // it out of date. The safest thing to do is backup the current and copy the new file + // but that current file's change does not match the new file. Therefore, the current file + // is out of date. The safest thing to do is backup the current and copy the new file // to become the current file.
assert !newFileHashcodeMap.equals(this.originalFileHashcodeMap); @@ -740,6 +748,88 @@ public class SimpleDeployerRawRelativeFileTest { } }
+ private void baseX_Y_Z_Restore(boolean dryRun) throws Exception { + String newContentY = "testX_Y_Z_YYY"; + writeFile(newContentY, this.currentFile); + String newHashcodeY = MessageDigestGenerator.getDigestString(newContentY); + + String newContentZ = "testX_Y_Z_ZZZ"; + String newHashcodeZ = MessageDigestGenerator.getDigestString(newContentZ); + File newRawFile = writeFile(newContentZ, tmpDir, "new-content.txt"); + Map<File, File> newRawFiles = new HashMap<File, File>(1); + newRawFiles.put(newRawFile, this.currentFile); + + DeploymentData dd = new DeploymentData(newDeployProps, null, newRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); + FileHashcodeMap newFileHashcodeMap; + newFileHashcodeMap = deployer.deploy(this.diff); // no dry run - we need to do this to force backup file creation + + // The new file changed the original, and our current file has been manually updated + // but that current file's change does not match the new file. Therefore, the current file + // is out of date. The safest thing to do is backup the current and copy the new file + // to become the current file. + + assert !newFileHashcodeMap.equals(this.originalFileHashcodeMap); + assert newFileHashcodeMap.size() == 1; + assert newFileHashcodeMap.get(currentRelativePath).equals(newHashcodeZ); + String[] contentHash = getOriginalFilenameContentHashcode(); + assert contentHash[0].equals(newContentZ); + assert contentHash[1].equals(newHashcodeZ); + + assert this.diff.getAddedFiles().isEmpty() : this.diff; + assert this.diff.getDeletedFiles().isEmpty() : this.diff; + assert this.diff.getChangedFiles().size() == 1 : this.diff; + assert this.diff.getChangedFiles().contains(currentRelativePath) : this.diff; + assert this.diff.getBackedUpFiles().size() == 1 : this.diff; + assert this.diff.getBackedUpFiles().containsKey(currentRelativePath) : this.diff; + assert this.diff.getRestoredFiles().isEmpty() : this.diff; + assert this.diff.getIgnoredFiles().isEmpty() : this.diff; + assert this.diff.getRealizedFiles().isEmpty() : this.diff; + assert this.diff.getErrors().isEmpty() : this.diff; + + assert this.metadata.getCurrentDeploymentProperties().equals(newDeployProps); + assert this.metadata.getCurrentDeploymentFileHashcodes().equals(newFileHashcodeMap); + + // verify the backup copy + File backupFile = new File(this.diff.getBackedUpFiles().get(currentRelativePath)); + assert readFile(backupFile).equals(newContentY) : "did not backup the correct file?"; + + // all we did so far was upgrade to v2 and created a backup file, now we need to redeploy v1 and see the backup restored + DeploymentProperties v1Duplicate = new DeploymentProperties(); + v1Duplicate.putAll(this.originalDeployProps); + v1Duplicate.setDeploymentId(3); // this is the same as v1, but it needs a unique deployment ID + dd = new DeploymentData(v1Duplicate, null, sourceRawFiles, deployDir, null, null, null, null); + deployer = new Deployer(dd); + this.diff = new DeployDifferences(); + FileHashcodeMap restoreFileHashcodeMap; + restoreFileHashcodeMap = deployer.redeployAndRestoreBackupFiles(this.diff, dryRun); + + assert this.diff.getAddedFiles().isEmpty() : this.diff; + assert this.diff.getDeletedFiles().isEmpty() : this.diff; + assert this.diff.getChangedFiles().size() == 1 : this.diff; + assert this.diff.getChangedFiles().contains(currentRelativePath) : this.diff; + assert this.diff.getBackedUpFiles().isEmpty() : this.diff; + assert this.diff.getRestoredFiles().size() == 1 : this.diff; + assert this.diff.getRestoredFiles().containsKey(currentRelativePath) : this.diff; + assert this.diff.getIgnoredFiles().isEmpty() : this.diff; + assert this.diff.getRealizedFiles().isEmpty() : this.diff; + assert this.diff.getErrors().isEmpty() : this.diff; + + assert restoreFileHashcodeMap.get(currentRelativePath).equals(newHashcodeY) : "hashcode doesn't reflect restored backup"; + + if (dryRun) { + // still our v2 + assert this.metadata.getCurrentDeploymentProperties().equals(newDeployProps); + assert this.metadata.getCurrentDeploymentFileHashcodes().equals(newFileHashcodeMap); + } else { + // we reverted back to v1 with the manual changes + assert this.metadata.getCurrentDeploymentProperties().equals(v1Duplicate); + assert this.metadata.getCurrentDeploymentFileHashcodes().equals(restoreFileHashcodeMap); + assert MessageDigestGenerator.getDigestString(new File(deployDir, currentRelativePath)) + .equals(newHashcodeY) : "file wasn't restored"; + } + } + private String[] getOriginalFilenameContentHashcode() throws Exception { return getFilenameContentHashcode(new File(deployDir, currentRelativePath).getAbsolutePath()); } diff --git a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java index 3b2d670..18ded89 100644 --- a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java +++ b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java @@ -128,6 +128,10 @@ public class SimpleDeployerTest { baseX_Y_Z(false); }
+ public void testX_Y_Z_Restore() throws Exception { + baseX_Y_Z_Restore(false); + } + public void testNoOriginalNoCurrentWithNew() throws Exception { baseNoOriginalNoCurrentWithNew(false); } @@ -168,6 +172,10 @@ public class SimpleDeployerTest { baseX_Y_Z(true); }
+ public void testX_Y_Z_Restore_DryRun() throws Exception { + baseX_Y_Z_Restore(true); + } + public void testNoOriginalNoCurrentWithNew_DryRun() throws Exception { baseNoOriginalNoCurrentWithNew(true); } @@ -383,8 +391,8 @@ public class SimpleDeployerTest { }
// The new file changed the original, and our current file has been manually updated - // but that current file's change does not match to new file. Therefore, the current file - // it out of date. The safest thing to do is backup the current and copy the new file + // but that current file's change does not match the new file. Therefore, the current file + // is out of date. The safest thing to do is backup the current and copy the new file // to become the current file.
assert !newFileHashcodeMap.equals(this.originalFileHashcodeMap); @@ -731,6 +739,87 @@ public class SimpleDeployerTest { } }
+ private void baseX_Y_Z_Restore(boolean dryRun) throws Exception { + String newContentY = "testX_Y_Z_YYY"; + writeFile(newContentY, this.currentFile); + String newHashcodeY = MessageDigestGenerator.getDigestString(newContentY); + + String newContentZ = "testX_Y_Z_ZZZ"; + String newHashcodeZ = MessageDigestGenerator.getDigestString(newContentZ); + File newZipFile = createZip(newContentZ, tmpDir, "new-content.zip", originalFileName); + Set<File> newZipFiles = new HashSet<File>(1); + newZipFiles.add(newZipFile); + + DeploymentData dd = new DeploymentData(newDeployProps, newZipFiles, null, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); + FileHashcodeMap newFileHashcodeMap; + newFileHashcodeMap = deployer.deploy(this.diff); // no dry run - we need to do this to force backup file creation + + // The new file changed the original, and our current file has been manually updated + // but that current file's change does not match the new file. Therefore, the current file + // is out of date. The safest thing to do is backup the current and copy the new file + // to become the current file. + + assert !newFileHashcodeMap.equals(this.originalFileHashcodeMap); + assert newFileHashcodeMap.size() == 1; + assert newFileHashcodeMap.get(originalFileName).equals(newHashcodeZ); + String[] contentHash = getOriginalFilenameContentHashcode(); + assert contentHash[0].equals(newContentZ); + assert contentHash[1].equals(newHashcodeZ); + + assert this.diff.getAddedFiles().isEmpty() : this.diff; + assert this.diff.getDeletedFiles().isEmpty() : this.diff; + assert this.diff.getChangedFiles().size() == 1 : this.diff; + assert this.diff.getChangedFiles().contains(originalFileName) : this.diff; + assert this.diff.getBackedUpFiles().size() == 1 : this.diff; + assert this.diff.getBackedUpFiles().containsKey(originalFileName) : this.diff; + assert this.diff.getRestoredFiles().isEmpty() : this.diff; + assert this.diff.getIgnoredFiles().isEmpty() : this.diff; + assert this.diff.getRealizedFiles().isEmpty() : this.diff; + assert this.diff.getErrors().isEmpty() : this.diff; + + assert this.metadata.getCurrentDeploymentProperties().equals(newDeployProps); + assert this.metadata.getCurrentDeploymentFileHashcodes().equals(newFileHashcodeMap); + + // verify the backup copy + File backupFile = new File(this.diff.getBackedUpFiles().get(originalFileName)); + assert readFile(backupFile).equals(newContentY) : "did not backup the correct file?"; + + // all we did so far was upgrade to v2 and created a backup file, now we need to redeploy v1 and see the backup restored + DeploymentProperties v1Duplicate = new DeploymentProperties(); + v1Duplicate.putAll(this.originalDeployProps); + v1Duplicate.setDeploymentId(3); // this is the same as v1, but it needs a unique deployment ID + dd = new DeploymentData(v1Duplicate, originalZipFiles, null, deployDir, null, null, null, null); + deployer = new Deployer(dd); + this.diff = new DeployDifferences(); + FileHashcodeMap restoreFileHashcodeMap; + restoreFileHashcodeMap = deployer.redeployAndRestoreBackupFiles(this.diff, dryRun); + + assert this.diff.getAddedFiles().isEmpty() : this.diff; + assert this.diff.getDeletedFiles().isEmpty() : this.diff; + assert this.diff.getChangedFiles().size() == 1 : this.diff; + assert this.diff.getChangedFiles().contains(originalFileName) : this.diff; + assert this.diff.getBackedUpFiles().isEmpty() : this.diff; + assert this.diff.getRestoredFiles().size() == 1 : this.diff; + assert this.diff.getRestoredFiles().containsKey(originalFileName) : this.diff; + assert this.diff.getIgnoredFiles().isEmpty() : this.diff; + assert this.diff.getRealizedFiles().isEmpty() : this.diff; + assert this.diff.getErrors().isEmpty() : this.diff; + + assert restoreFileHashcodeMap.get(originalFileName).equals(newHashcodeY) : "hashcode doesn't reflect restored backup"; + + if (dryRun) { + // still our v2 + assert this.metadata.getCurrentDeploymentProperties().equals(newDeployProps); + assert this.metadata.getCurrentDeploymentFileHashcodes().equals(newFileHashcodeMap); + } else { + // we reverted back to v1 with the manual changes + assert this.metadata.getCurrentDeploymentProperties().equals(v1Duplicate); + assert this.metadata.getCurrentDeploymentFileHashcodes().equals(restoreFileHashcodeMap); + assert MessageDigestGenerator.getDigestString(this.currentFile).equals(newHashcodeY) : "file wasn't restored"; + } + } + private String[] getOriginalFilenameContentHashcode() throws Exception { return getFilenameContentHashcode(this.originalFileName); }
commit 860f549ad6b9f13498e8f059acfad1538ec95733 Author: Ian P. Springer <ips@jetengine.(none)> Date: Thu May 13 13:04:20 2010 -0400
improve default Resource descriptions for JBoss AS Server Resources (fixes https://jira.jboss.org/jira/browse/EMBJOPR-292)
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/InProcessJBossASDiscovery.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/InProcessJBossASDiscovery.java index a1f6b26..486f519 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/InProcessJBossASDiscovery.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/InProcessJBossASDiscovery.java @@ -1,6 +1,6 @@ /* * Jopr Management Platform - * Copyright (C) 2005-2009 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -38,6 +38,7 @@ import org.rhq.plugins.jbossas5.connection.LocalProfileServiceConnectionProvider import org.rhq.plugins.jbossas5.connection.ProfileServiceConnection; import org.rhq.plugins.jbossas5.connection.ProfileServiceConnectionProvider; import org.rhq.plugins.jbossas5.helper.JBossInstallationInfo; +import org.rhq.plugins.jbossas5.helper.JBossProductType; import org.rhq.plugins.jbossas5.util.ManagedComponentUtils;
import org.jboss.deployers.spi.management.ManagementView; @@ -45,14 +46,11 @@ import org.jboss.managed.api.ComponentType; import org.jboss.managed.api.ManagedComponent;
/** - * A helper class for discovering an in-process JBossAS server. + * A helper class for discovering an in-process JBoss app server. */ public class InProcessJBossASDiscovery { private final Log log = LogFactory.getLog(this.getClass());
- private static final String DEFAULT_RESOURCE_DESCRIPTION_AS = "JBoss Application Server (AS)"; - private static final String DEFAULT_RESOURCE_DESCRIPTION_EAP = "JBoss Enterprise Application Platform (EAP)"; - private static final String JAVA_HOME_ENV_VAR = "JAVA_HOME";
/** @@ -70,7 +68,7 @@ public class InProcessJBossASDiscovery { try { connection = connectionProvider.connect(); } catch (Exception e) { - // This most likely just means we're not embedded inside a JBoss AS 5.x instance. + // This most likely just means we're not embedded inside a JBoss 5.x or 6.x app server instance. log.debug("Unable to connect to in-process ProfileService.", e); return null; } @@ -95,12 +93,13 @@ public class InProcessJBossASDiscovery { } catch (IOException e) { throw new InvalidPluginConfigurationException(e); } - String resourceName = "JBoss "; - resourceName += installInfo.isEap() ? "EAP " : "AS "; - resourceName += installInfo.getMajorVersion(); + + JBossProductType productType = installInfo.getProductType(); + String resourceName = productType.NAME; + resourceName += " " + installInfo.getMajorVersion(); resourceName += " (" + serverName + ")";
- String description = installInfo.isEap() ? DEFAULT_RESOURCE_DESCRIPTION_EAP : DEFAULT_RESOURCE_DESCRIPTION_AS; + String description = productType.DESCRIPTION;
String version = (String) ManagedComponentUtils.getSimplePropertyValue(serverConfigComponent, "specificationVersion"); diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JBossProductType.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JBossProductType.java index 024bc41..3428f4a 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JBossProductType.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JBossProductType.java @@ -25,16 +25,16 @@ package org.rhq.plugins.jbossas5.helper; import java.util.jar.Attributes;
/** - * The product type of a JBoss 5.x/6.x application server installation - AS, EAP, EWP, or SOA. + * The product type of a JBoss 5.x/6.x application server installation - AS, EAP, EWP, or SOA-P. * * @author Jessica Sant * @author Ian Springer */ public enum JBossProductType { - AS("JBoss AS", "JBoss Application Server", "default"), // the public offering - EAP("JBoss EAP", "JBoss Enterprise Application Platform", "default"), // the customer offering - EWP("JBoss EWP", "JBoss Enterprise Web Platform", "default"), // the customer offering - SOA("JBoss SOA-P", "JBoss Enterprise SOA Platform", "production"); // the customer SOA platform + AS("JBoss AS", "JBoss Application Server (AS)", "default"), // community + EAP("JBoss EAP", "JBoss Enterprise Application Platform (EAP)", "default"), // enterprise + EWP("JBoss EWP", "JBoss Enterprise Web Platform (EWP)", "default"), // enterprise + SOA("JBoss SOA-P", "JBoss Enterprise SOA Platform (SOA-P)", "production"); // enterprise
public final String NAME; public final String DESCRIPTION; diff --git a/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml index 546a418..3c547fb 100644 --- a/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml @@ -940,7 +940,7 @@ classLoader="instance" class="ApplicationServerComponent" discovery="ApplicationServerDiscoveryComponent" - description="JBoss Application Server (AS) or Enterprise Application Platform (EAP) 5.x" + description="JBoss Application Server (AS), Enterprise Application Platform (EAP), Enterprise SOA Platform (SOA-P), or Enterprise Web Platform (EWP) 5.x or 6.x instance" supportsManualAdd="true">
<subcategories>
commit c3b1f00f7d2d0c3bf370ade3e5c041f851b4d369 Merge: 749d915... 9f5fb1a... Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 13 11:29:17 2010 -0400
Merging in some additional tag features
Merge branch 'gwt' into localbundle
Conflicts: modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TagGWTService.java modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TagGWTServiceImpl.java modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerRemote.java
diff --cc modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TagGWTService.java index c9d5a75,8c7dc24..849fbc6 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TagGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TagGWTService.java @@@ -53,7 -54,5 +54,7 @@@ public interface TagGWTService extends
void updateBundleDeploymentTags(int bundleDeploymentId, Set<Tag> tags);
+ void updateBundleDestinationTags(int bundleDestinationId, Set<Tag> tags); + - + PageList<TagReportComposite> findTagReportCompositesByCriteria(TagCriteria tagCriteria); } diff --cc modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TagGWTServiceImpl.java index 9f3906f,4a05658..20add85 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TagGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TagGWTServiceImpl.java @@@ -74,8 -75,8 +75,12 @@@ public class TagGWTServiceImpl extends tagManager.updateBundleDeploymentTags(getSessionSubject(), bundleDeploymentId, tags); }
+ public void updateBundleDestinationTags(int bundleDestinationId, Set<Tag> tags) { + tagManager.updateBundleDestinationTags(getSessionSubject(), bundleDestinationId, tags); + } + + public PageList<TagReportComposite> findTagReportCompositesByCriteria(TagCriteria tagCriteria) { + return SerialUtility.prepare(tagManager.findTagReportCompositesByCriteria(getSessionSubject(), tagCriteria), + "TagService.findTagReportCompositesByCriteria"); + } } diff --cc modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java index f1bd668,cd608fe..c432e2e --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java @@@ -204,27 -205,15 +206,37 @@@ public class TagManagerBean implements } }
+ + + @RequiredPermission(Permission.MANAGE_INVENTORY) + // todo verify + public void updateBundleDestinationTags(Subject subject, int bundleDestinationId, Set<Tag> tags) { + + Set<Tag> definedTags = addTags(subject, tags); + BundleDestination bundleDestination = entityManager.find(BundleDestination.class, bundleDestinationId); + + Set<Tag> previousTags = new HashSet<Tag>(bundleDestination.getTags()); + previousTags.removeAll(definedTags); + for (Tag tag : previousTags) { + tag.removeBundleDestination(bundleDestination); + } + + for (Tag tag : definedTags) { + tag.addBundleDestination(bundleDestination); + } + } + + + public PageList<TagReportComposite> findTagReportCompositesByCriteria(Subject subject, TagCriteria tagCriteria) { + // TODO criteria stuff
+ Query query = entityManager.createNamedQuery(Tag.QUERY_TAG_COMPOSITE_REPORT); + + PageList<TagReportComposite> result = new PageList<TagReportComposite>(); + + result.addAll(query.getResultList()); + + return result; + } + } diff --cc modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerRemote.java index 1e7ba0e,98bcc63..50ecf5f --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerRemote.java @@@ -56,8 -57,6 +57,8 @@@ public interface TagManagerRemote
void updateBundleDeploymentTags(Subject subject, int bundleDeploymentId, Set<Tag> tags);
+ void updateBundleDestinationTags(Subject subject, int bundleDestinationId, Set<Tag> tags); + - + PageList<TagReportComposite> findTagReportCompositesByCriteria(Subject subject, TagCriteria tagCriteria);
}
commit 749d9156d921cf9f622506cfbe6b0c9c48d1c5bf Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 13 11:13:13 2010 -0400
Expose destinations into bundle tree instead of deployments Add Detination centric view Fix bundle file list
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java index aa3392b..0724c46 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java @@ -201,6 +201,7 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { criteria.fetchBundleVersion(true); criteria.fetchConfiguration(true); criteria.fetchResourceDeployments(true); + criteria.fetchDestination(true); criteria.fetchTags(true);
bundleService = GWTServiceLookup.getBundleService(); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java new file mode 100644 index 0000000..cd77145 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java @@ -0,0 +1,203 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.bundle.destination; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashSet; + +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.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.CanvasItem; +import com.smartgwt.client.widgets.form.fields.LinkItem; +import com.smartgwt.client.widgets.form.fields.StaticTextItem; +import com.smartgwt.client.widgets.grid.CellFormatter; +import com.smartgwt.client.widgets.grid.ListGridField; +import com.smartgwt.client.widgets.grid.ListGridRecord; +import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; +import com.smartgwt.client.widgets.grid.events.SelectionEvent; +import com.smartgwt.client.widgets.layout.VLayout; + +import org.rhq.core.domain.bundle.Bundle; +import org.rhq.core.domain.bundle.BundleDeployment; +import org.rhq.core.domain.bundle.BundleDestination; +import org.rhq.core.domain.bundle.BundleResourceDeployment; +import org.rhq.core.domain.bundle.BundleVersion; +import org.rhq.core.domain.criteria.BundleDestinationCriteria; +import org.rhq.core.domain.tagging.Tag; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.BookmarkableView; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.ViewId; +import org.rhq.enterprise.gui.coregui.client.ViewPath; +import org.rhq.enterprise.gui.coregui.client.bundle.deployment.BundleResourceDeploymentHistoryListView; +import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel; +import org.rhq.enterprise.gui.coregui.client.components.table.Table; +import org.rhq.enterprise.gui.coregui.client.components.tagging.TagEditorView; +import org.rhq.enterprise.gui.coregui.client.components.tagging.TagsChangedCallback; +import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.util.message.Message; + +/** + * @author Greg Hinkle + */ +public class BundleDestinationView extends VLayout implements BookmarkableView { + private BundleGWTServiceAsync bundleService; + + private BundleDestination destination; + private BundleVersion version; + private Bundle bundle; + + private Canvas detail; + + private void viewBundleDestination(BundleDestination bundleDestination, ViewId current) { + + this.destination = bundleDestination; + this.bundle = bundleDestination.getBundle(); + + addMember(new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/BundleDeployment_24.png") + + ""/> " + destination.getName())); + + DynamicForm form = new DynamicForm(); + form.setNumCols(4); + + LinkItem bundleName = new LinkItem("bundle"); + bundleName.setTitle("Bundle"); + bundleName.setTarget("#Bundles/Bundle/" + bundle.getId()); + bundleName.setLinkTitle(bundle.getName()); + + CanvasItem tagItem = new CanvasItem("tag"); + tagItem.setShowTitle(false); + TagEditorView tagEditor = new TagEditorView(destination.getTags(), false, new TagsChangedCallback() { + public void tagsChanged(HashSet<Tag> tags) { + GWTServiceLookup.getTagService().updateBundleDestinationTags(destination.getId(), tags, + new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to update bundle destination's tags", caught); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify( + new Message("Bundle Destination Tags updated", Message.Severity.Info)); + } + }); + } + }); + tagItem.setCanvas(tagEditor); + tagItem.setRowSpan(4); + + StaticTextItem created = new StaticTextItem("created", "Created"); + created.setValue(new Date(destination.getCtime())); + + LinkItem destinationGroup = new LinkItem("group"); + destinationGroup.setTitle("Group"); + destinationGroup.setTarget("#ResourceGroup/" + destination.getGroup().getId()); + destinationGroup.setLinkTitle(destination.getGroup().getName()); + + StaticTextItem path = new StaticTextItem("path", "Path"); + path.setValue(destination.getDeployDir()); + + form.setFields(bundleName, tagItem, created, destinationGroup, path); + + addMember(form); + + Table deployments = createDeploymentsTable(); + deployments.setHeight100(); + deployments.setShowResizeBar(true); + addMember(createDeploymentsTable()); + + detail = new Canvas(); + detail.setHeight("50%"); + detail.hide(); + addMember(detail); + + } + + private Table createDeploymentsTable() { + Table table = new Table("Deployment History"); + + ListGridField name = new ListGridField("name", "Name"); + name.setCellFormatter(new CellFormatter() { + public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { + return "<a href="#Bundles/Bundle/" + bundle.getId() + "/deployments/" + listGridRecord.getAttribute("id") + "">" + o + "</a>"; + } + }); + + ListGridField description = new ListGridField("description", "Description"); + ListGridField installDate = new ListGridField("installDate", "Install Date"); + ListGridField status = new ListGridField("status", "Status"); + + table.getListGrid().setFields(name, description, installDate, status); + + ArrayList<ListGridRecord> records = new ArrayList<ListGridRecord>(); + for (BundleDeployment rd : destination.getDeployments()) { + ListGridRecord record = new ListGridRecord(); + + record.setAttribute("name", rd.getName()); + record.setAttribute("description", rd.getDescription()); + record.setAttribute("bundleId", bundle.getId()); + record.setAttribute("version", rd.getBundleVersion().getName()); + record.setAttribute("status", rd.getStatus().name()); + record.setAttribute("id", rd.getId()); + record.setAttribute("entity", rd); + record.setAttribute("installDate", new Date(rd.getCtime())); + records.add(record); + } + + table.getListGrid().setData(records.toArray(new ListGridRecord[records.size()])); + + + return table; + } + + public void renderView(final ViewPath viewPath) { + int bundleDestinationId = Integer.parseInt(viewPath.getCurrent().getPath()); + + BundleDestinationCriteria criteria = new BundleDestinationCriteria(); + criteria.addFilterId(bundleDestinationId); + criteria.fetchBundle(true); + criteria.fetchDeployments(true); + criteria.fetchTags(true); + + bundleService = GWTServiceLookup.getBundleService(); + bundleService.findBundleDestinationsByCriteria(criteria, new AsyncCallback<PageList<BundleDestination>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load bundle destiation", caught); + } + + public void onSuccess(PageList<BundleDestination> result) { + + final BundleDestination destination = result.get(0); + + + viewBundleDestination(destination, viewPath.getCurrent()); + + } + }); + + } + +} \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java index bc7e2d7..072f127 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java @@ -43,6 +43,8 @@ import org.rhq.enterprise.gui.coregui.client.Breadcrumb; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewId; import org.rhq.enterprise.gui.coregui.client.ViewPath; +import org.rhq.enterprise.gui.coregui.client.bundle.deployment.BundleDeploymentView; +import org.rhq.enterprise.gui.coregui.client.bundle.destination.BundleDestinationView; import org.rhq.enterprise.gui.coregui.client.bundle.version.BundleVersionView; import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel; import org.rhq.enterprise.gui.coregui.client.components.table.Table; @@ -254,7 +256,18 @@ public class BundleView extends VLayout implements BookmarkableView { } else { // one version removeMembers(getMembers()); - BundleVersionView view = new BundleVersionView(); + BundleDeploymentView view = new BundleDeploymentView(); + addMember(view); + view.renderView(viewPath.next()); + } + } else if (viewPath.getCurrent().getPath().equals("destinations")) { + if (viewPath.isEnd()) { + + // versions list screen + } else { + // one version + removeMembers(getMembers()); + BundleDestinationView view = new BundleDestinationView(); addMember(view); view.renderView(viewPath.next()); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeDataSource.java index efc969b..19d96cf 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeDataSource.java @@ -36,9 +36,11 @@ import com.smartgwt.client.widgets.tree.TreeNode;
import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; +import org.rhq.core.domain.bundle.BundleDestination; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.criteria.BundleCriteria; import org.rhq.core.domain.criteria.BundleDeploymentCriteria; +import org.rhq.core.domain.criteria.BundleDestinationCriteria; import org.rhq.core.domain.criteria.BundleVersionCriteria; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.CoreGUI; @@ -54,7 +56,6 @@ public class BundleTreeDataSource extends RPCDataSource { private BundleGWTServiceAsync bundleService = GWTServiceLookup.getBundleService();
- public BundleTreeDataSource() { DataSourceField idDataField = new DataSourceTextField("id", "ID"); idDataField.setPrimaryKey(true); @@ -81,6 +82,7 @@ public class BundleTreeDataSource extends RPCDataSource { if (p == null) {
BundleCriteria criteria = new BundleCriteria(); + criteria.fetchDestinations(true); criteria.setPageControl(getPageControl(request));
bundleService.findBundlesByCriteria(criteria, new AsyncCallback<PageList<Bundle>>() { @@ -121,7 +123,7 @@ public class BundleTreeDataSource extends RPCDataSource { criteria.addFilterBundleId(bundleId); bundleService.findBundleDeploymentsByCriteria(criteria, new AsyncCallback<PageList<BundleDeployment>>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed ot load bundle",caught); + CoreGUI.getErrorHandler().handleError("Failed to load bundle", caught); }
public void onSuccess(PageList<BundleDeployment> result) { @@ -129,7 +131,20 @@ public class BundleTreeDataSource extends RPCDataSource { processResponse(request.getRequestId(), response); } }); + } else if (p.endsWith(":destinations")) { + int bundleId = Integer.parseInt(p.substring(0, p.indexOf(":"))); + BundleDestinationCriteria criteria = new BundleDestinationCriteria(); + criteria.addFilterBundleId(bundleId); + bundleService.findBundleDestinationsByCriteria(criteria, new AsyncCallback<PageList<BundleDestination>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load bundle destinations", caught); + }
+ public void onSuccess(PageList<BundleDestination> result) { + response.setData(buildRecords(result)); + processResponse(request.getRequestId(), response); + } + });
}
@@ -164,14 +179,12 @@ public class BundleTreeDataSource extends RPCDataSource { versionNode.setAttribute("name", "Versions"); records.add(versionNode);
- TreeNode deploymentsNode = new TreeNode("Deployments"); - deploymentsNode.setID(bundle.getId() + ":deployments"); + TreeNode deploymentsNode = new TreeNode("Destinations"); + deploymentsNode.setID(bundle.getId() + ":destinations"); deploymentsNode.setParentID(String.valueOf(bundle.getId())); - deploymentsNode.setName("Deployments"); + deploymentsNode.setName("Destinations"); records.add(deploymentsNode); - } - } return records.toArray(new ListGridRecord[records.size()]); } @@ -201,6 +214,13 @@ public class BundleTreeDataSource extends RPCDataSource { node.setParentID(deployment.getBundleVersion().getBundle().getId() + ":deployments"); node.setIsFolder(false); node.setIcon("subsystems/bundle/BundleDeployment_16.png"); + } else if (from instanceof BundleDestination) { + BundleDestination destination = (BundleDestination) from; + node.setName(destination.getName()); + node.setID(destination.getBundle().getId() + ":destinations:" +destination.getId()); + node.setParentID(destination.getBundle().getId() + ":destinations"); + node.setIsFolder(false); + node.setIcon("subsystems/bundle/BundleDeployment_16.png"); } return node; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java index 2212ee1..131a2be 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java @@ -80,9 +80,9 @@ public class BundleVersionView extends VLayout implements BookmarkableView { tabs.addTab(createUpdateHistoryTab());
- addMember(new BackButton("Back to Bundle","#Bundles/mybundle")); + addMember(new BackButton("Back to Bundle: " + version.getBundle().getName(),"Bundles/" + version.getBundle().getId()));
- addMember(new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/BundleVersion_24.png") + ""/> " + version.getName())); + addMember(new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/BundleVersion_24.png") + ""/> " + version.getName() + ": " + version.getVersion())); addMember(tabs);
if (nextViewId != null) { @@ -169,7 +169,7 @@ public class BundleVersionView extends VLayout implements BookmarkableView { private Tab createFilesTab() { Tab tab = new Tab("Files");
- FileListView filesView = new FileListView(version.getBundleFiles()); + FileListView filesView = new FileListView(version.getId());
tab.setPane(filesView);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/file/FileListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/file/FileListView.java index 0d5f02e..cf27a27 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/file/FileListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/file/FileListView.java @@ -24,6 +24,7 @@ package org.rhq.enterprise.gui.coregui.client.bundle.version.file;
import java.util.List;
+import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; @@ -31,22 +32,28 @@ import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.bundle.BundleFile; import org.rhq.core.domain.bundle.BundleVersion; +import org.rhq.core.domain.criteria.BundleFileCriteria; +import org.rhq.core.domain.measurement.MeasurementConverterClient; +import org.rhq.core.domain.measurement.MeasurementUnits; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.components.table.Table; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
/** * @author Greg Hinkle */ public class FileListView extends VLayout {
- private List<BundleFile> files; + private int bundleVersionId;
- public FileListView(List<BundleFile> files) { - this.files = files; + + public FileListView(int bundleVersionId) { + this.bundleVersionId = bundleVersionId; }
- @Override - protected void onDraw() { - super.onDraw(); + + private void viewFiles(PageList<BundleFile> files) {
Table table = new Table("Bundle Files");
@@ -56,9 +63,13 @@ public class FileListView extends VLayout { id.setWidth("20%");
ListGridField name = new ListGridField("name", "Name"); - name.setWidth("80%"); + name.setWidth("60%");
- listGrid.setFields(id,name); + ListGridField size = new ListGridField("size", "File Size"); + name.setWidth("20%"); + + + listGrid.setFields(id, name, size);
listGrid.setData(buildRecords(files));
@@ -67,6 +78,27 @@ public class FileListView extends VLayout { }
+ @Override + protected void onDraw() { + super.onDraw(); + + + BundleFileCriteria criteria = new BundleFileCriteria(); + criteria.addFilterBundleVersionId(bundleVersionId); + criteria.fetchPackageVersion(true); + + GWTServiceLookup.getBundleService().findBundleFilesByCriteria(criteria, + new AsyncCallback<PageList<BundleFile>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load bundle file data", caught); + } + + public void onSuccess(PageList<BundleFile> result) { + viewFiles(result); + } + }); + } +
private ListGridRecord[] buildRecords(List<BundleFile> files) { ListGridRecord[] records = new ListGridRecord[files.size()]; @@ -74,11 +106,18 @@ public class FileListView extends VLayout { int i = 0; for (BundleFile file : files) { ListGridRecord record = new ListGridRecord(); - record.setAttribute("id",file.getId()); + record.setAttribute("id", file.getId()); record.setAttribute("name", file.getPackageVersion().getFileName()); + + Long size = file.getPackageVersion().getFileSize(); + if (size != null) { + record.setAttribute("size", + MeasurementConverterClient.format(size.doubleValue(), MeasurementUnits.BYTES, true)); + } records[i++] = record; } return records; }
+ }
commit 7595b85f570d4b2f48ac251b42041b46ea81f87a Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 13 11:12:09 2010 -0400
File and destination exposure to gwt
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java index 2d3c2c0..e44a55a 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java @@ -26,6 +26,7 @@ import com.google.gwt.user.client.rpc.RemoteService; import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; import org.rhq.core.domain.bundle.BundleDestination; +import org.rhq.core.domain.bundle.BundleFile; import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleType; import org.rhq.core.domain.bundle.BundleVersion; @@ -33,6 +34,8 @@ import org.rhq.core.domain.bundle.composite.BundleWithLatestVersionComposite; import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.criteria.BundleCriteria; import org.rhq.core.domain.criteria.BundleDeploymentCriteria; +import org.rhq.core.domain.criteria.BundleDestinationCriteria; +import org.rhq.core.domain.criteria.BundleFileCriteria; import org.rhq.core.domain.criteria.BundleResourceDeploymentCriteria; import org.rhq.core.domain.criteria.BundleVersionCriteria; import org.rhq.core.domain.util.PageList; @@ -72,4 +75,8 @@ public interface BundleGWTService extends RemoteService { PageList<BundleDeployment> findBundleDeploymentsByCriteria(BundleDeploymentCriteria criteria);
PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria(BundleResourceDeploymentCriteria criteria); + + PageList<BundleDestination> findBundleDestinationsByCriteria(BundleDestinationCriteria criteria); + + PageList<BundleFile> findBundleFilesByCriteria(BundleFileCriteria criteria); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java index 67678fa..fca82ee 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java @@ -24,6 +24,7 @@ import java.util.HashMap; import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; import org.rhq.core.domain.bundle.BundleDestination; +import org.rhq.core.domain.bundle.BundleFile; import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleType; import org.rhq.core.domain.bundle.BundleVersion; @@ -31,6 +32,8 @@ import org.rhq.core.domain.bundle.composite.BundleWithLatestVersionComposite; import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.criteria.BundleCriteria; import org.rhq.core.domain.criteria.BundleDeploymentCriteria; +import org.rhq.core.domain.criteria.BundleDestinationCriteria; +import org.rhq.core.domain.criteria.BundleFileCriteria; import org.rhq.core.domain.criteria.BundleResourceDeploymentCriteria; import org.rhq.core.domain.criteria.BundleVersionCriteria; import org.rhq.core.domain.util.PageList; @@ -66,12 +69,12 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund }
public BundleDeployment createBundleDeployment(int bundleVersionId, int bundleDestinationId, String name, - String description, Configuration configuration, boolean enforcePolicy, int enforcementInterval, - boolean pinToBundle) throws Exception { + String description, Configuration configuration, boolean enforcePolicy, int enforcementInterval, + boolean pinToBundle) throws Exception {
try { BundleDeployment result = bundleManager.createBundleDeployment(getSessionSubject(), bundleVersionId, - bundleDestinationId, name, description, configuration); + bundleDestinationId, name, description, configuration);
return SerialUtility.prepare(result, "createBundleDeployment"); } catch (Exception e) { @@ -137,7 +140,7 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund }
public PageList<BundleWithLatestVersionComposite> findBundlesWithLastestVersionCompositesByCriteria( - BundleCriteria criteria) throws Exception { + BundleCriteria criteria) throws Exception { try { PageList<BundleWithLatestVersionComposite> results; results = bundleManager.findBundlesWithLatestVersionCompositesByCriteria(getSessionSubject(), criteria); @@ -178,13 +181,25 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund
public PageList<BundleDeployment> findBundleDeploymentsByCriteria(BundleDeploymentCriteria criteria) { return SerialUtility.prepare(bundleManager.findBundleDeploymentsByCriteria(getSessionSubject(), criteria), - "BundleService.findBundleDeploymentsByCriteria"); + "BundleService.findBundleDeploymentsByCriteria"); }
public PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria( - BundleResourceDeploymentCriteria criteria) { + BundleResourceDeploymentCriteria criteria) { return SerialUtility.prepare(bundleManager.findBundleResourceDeploymentsByCriteria(getSessionSubject(), - criteria), "BundleService.findBundleResourceDeploymentsByCriteria"); + criteria), "BundleService.findBundleResourceDeploymentsByCriteria");
} + + public PageList<BundleDestination> findBundleDestinationsByCriteria(BundleDestinationCriteria criteria) { + return SerialUtility.prepare(bundleManager.findBundleDestinationsByCriteria(getSessionSubject(), + criteria), "BundleService.findBundleDestinationsByCriteria"); + + } + + public PageList<BundleFile> findBundleFilesByCriteria(BundleFileCriteria criteria) { + return SerialUtility.prepare(bundleManager.findBundleFilesByCriteria(getSessionSubject(), + criteria), "BundleService.findBundleFilesByCriteria"); + } + } \ No newline at end of file
commit 57668caf5f6f6d3a376632c992d354e7b538f6ca Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 13 11:11:40 2010 -0400
Expose destination tag updating
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TagGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TagGWTService.java index 9ab2919..c9d5a75 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TagGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TagGWTService.java @@ -53,5 +53,7 @@ public interface TagGWTService extends RemoteService {
void updateBundleDeploymentTags(int bundleDeploymentId, Set<Tag> tags);
+ void updateBundleDestinationTags(int bundleDestinationId, Set<Tag> tags); +
} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TagGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TagGWTServiceImpl.java index fb27c52..9f3906f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TagGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TagGWTServiceImpl.java @@ -73,4 +73,9 @@ public class TagGWTServiceImpl extends AbstractGWTServiceImpl implements TagGWTS public void updateBundleDeploymentTags(int bundleDeploymentId, Set<Tag> tags) { tagManager.updateBundleDeploymentTags(getSessionSubject(), bundleDeploymentId, tags); } + + public void updateBundleDestinationTags(int bundleDestinationId, Set<Tag> tags) { + tagManager.updateBundleDestinationTags(getSessionSubject(), bundleDestinationId, tags); + } + }
commit cc25efa9287c5659cab5e790bb344570cb8bb22a Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 13 11:10:56 2010 -0400
Fix casesensitive setting for overrides with subselects
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 31c947a..ed724f2 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 @@ -114,8 +114,8 @@ public final class CriteriaQueryGenerator { }
private String fixFilterOverride(String expression, String fieldName) { - boolean fuzzyMatch = expression.toLowerCase().contains(" like ") && !expression.toLowerCase().contains("select"); // Don't fuzzy match subselects - boolean wantCaseInsensitiveMatch = !criteria.isCaseSensitive() && fuzzyMatch; + boolean fuzzyMatch = expression.toLowerCase().contains(" like "); + boolean wantCaseInsensitiveMatch = !criteria.isCaseSensitive() && fuzzyMatch && !expression.toLowerCase().contains("select"); // Don't case change subselects
while (expression.indexOf('?') != -1) { String replacement = ":" + fieldName;
commit 54ce46f7b1eb91e9744d6f574d90b6113a798b53 Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 13 11:10:28 2010 -0400
new bundle destination criteria
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDestinationCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDestinationCriteria.java new file mode 100644 index 0000000..62a42f8 --- /dev/null +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDestinationCriteria.java @@ -0,0 +1,108 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2009 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +package org.rhq.core.domain.criteria; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; + +import org.rhq.core.domain.bundle.BundleDeployment; +import org.rhq.core.domain.bundle.BundleDeploymentStatus; +import org.rhq.core.domain.bundle.BundleDestination; + +/** + * @author Jay Shaughnessy + */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.FIELD) +@SuppressWarnings("unused") +public class BundleDestinationCriteria extends TaggedCriteria { + private static final long serialVersionUID = 1L; + + private Integer filterId; + private String filterName; + private String filterDescription; + private Integer filterBundleId; // needs override + private Integer filterBundleVersionId; // needs override + private BundleDeploymentStatus filterStatus; // needs override + private String filterDeployDir; + private Integer filterGroupId; // needs override + + + private boolean fetchBundle; + private boolean fetchDeployments; + private boolean fetchGroup; + + public BundleDestinationCriteria() { + + filterOverrides.put("bundleId", "bundle.id = ?"); + filterOverrides.put("bundleVersionId", "deployments.bundleVersion.id = ?"); + filterOverrides.put("status", "deployment.status like ?"); + filterOverrides.put("groupId", "group.id = ?"); + + } + + @Override + public Class<?> getPersistentClass() { + return BundleDestination.class; + } + + public void addFilterId(Integer filterId) { + this.filterId = filterId; + } + + public void addFilterName(String filterName) { + this.filterName = filterName; + } + + public void addFilterBundleId(Integer filterBundleId) { + this.filterBundleId = filterBundleId; + } + + public void addFilterStatus(BundleDeploymentStatus filterStatus) { + this.filterStatus = filterStatus; + } + + public void addFilterDescription(String filterDescription) { + this.filterDescription = filterDescription; + } + + + public void addFilterBundleVersionId(Integer filterBundleVersionId) { + this.filterBundleVersionId = filterBundleVersionId; + } + + + public void addFilterGroupId(Integer filterGroupId) { + this.filterGroupId = filterGroupId; + } + + public void fetchBundle(boolean fetchBundle) { + this.fetchBundle = fetchBundle; + } + + public void fetchDeployments(boolean fetchDeployments) { + this.fetchDeployments = fetchDeployments; + } + + public void fetchGroup(boolean fetchGroup) { + this.fetchGroup = fetchGroup; + } +} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java index 0a066d1..45b2d00 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java @@ -70,6 +70,7 @@ import org.rhq.core.domain.content.PackageVersion; import org.rhq.core.domain.content.Repo; import org.rhq.core.domain.criteria.BundleCriteria; import org.rhq.core.domain.criteria.BundleDeploymentCriteria; +import org.rhq.core.domain.criteria.BundleDestinationCriteria; import org.rhq.core.domain.criteria.BundleFileCriteria; import org.rhq.core.domain.criteria.BundleResourceDeploymentCriteria; import org.rhq.core.domain.criteria.BundleVersionCriteria; @@ -950,6 +951,15 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot return queryRunner.execute(); }
+ + public PageList<BundleDestination> findBundleDestinationsByCriteria(Subject subject, BundleDestinationCriteria criteria) { + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + + CriteriaQueryRunner<BundleDestination> queryRunner = new CriteriaQueryRunner<BundleDestination>(criteria, + generator, entityManager); + return queryRunner.execute(); + } + public PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria(Subject subject, BundleResourceDeploymentCriteria criteria) {
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java index 15af280..89fa3c4 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java @@ -42,6 +42,7 @@ import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.content.Architecture; import org.rhq.core.domain.criteria.BundleCriteria; import org.rhq.core.domain.criteria.BundleDeploymentCriteria; +import org.rhq.core.domain.criteria.BundleDestinationCriteria; import org.rhq.core.domain.criteria.BundleFileCriteria; import org.rhq.core.domain.criteria.BundleResourceDeploymentCriteria; import org.rhq.core.domain.criteria.BundleVersionCriteria; @@ -248,6 +249,12 @@ public interface BundleManagerRemote { @WebParam(name = "criteria") BundleDeploymentCriteria criteria);
@WebMethod + PageList<BundleDestination> findBundleDestinationsByCriteria( + @WebParam(name = "subject") Subject subject, + @WebParam(name = "criteria") BundleDestinationCriteria criteria); + + + @WebMethod PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria( // @WebParam(name = "subject") Subject subject, // @WebParam(name = "BundleResourceDeploymentCriteria") BundleResourceDeploymentCriteria criteria); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java index e3082dd..f1bd668 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java @@ -38,6 +38,7 @@ import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.authz.Permission; import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; +import org.rhq.core.domain.bundle.BundleDestination; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.criteria.TagCriteria; import org.rhq.core.domain.resource.Resource; @@ -202,4 +203,28 @@ public class TagManagerBean implements TagManagerLocal { tag.addBundleDeployment(bundleDeployment); } } + + + + @RequiredPermission(Permission.MANAGE_INVENTORY) + // todo verify + public void updateBundleDestinationTags(Subject subject, int bundleDestinationId, Set<Tag> tags) { + + Set<Tag> definedTags = addTags(subject, tags); + BundleDestination bundleDestination = entityManager.find(BundleDestination.class, bundleDestinationId); + + Set<Tag> previousTags = new HashSet<Tag>(bundleDestination.getTags()); + previousTags.removeAll(definedTags); + for (Tag tag : previousTags) { + tag.removeBundleDestination(bundleDestination); + } + + for (Tag tag : definedTags) { + tag.addBundleDestination(bundleDestination); + } + } + + + + } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerRemote.java index 9dcbd74..1e7ba0e 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerRemote.java @@ -56,6 +56,8 @@ public interface TagManagerRemote {
void updateBundleDeploymentTags(Subject subject, int bundleDeploymentId, Set<Tag> tags);
+ void updateBundleDestinationTags(Subject subject, int bundleDestinationId, Set<Tag> tags); +
}
commit 805a1eb6be5241efa6c754acb9a0d71a7ecc6e35 Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 13 11:09:33 2010 -0400
Put tag fetching into abstract tag criteria
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleCriteria.java index ab37573..3120eca 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleCriteria.java @@ -46,7 +46,6 @@ public class BundleCriteria extends TaggedCriteria { private boolean fetchDestinations; private boolean fetchPackageType; private boolean fetchRepo; - private boolean fetchTags;
private PageOrdering sortName; private PageOrdering sortDescription; @@ -108,9 +107,6 @@ public class BundleCriteria extends TaggedCriteria { this.fetchRepo = fetchRepo; }
- public void fetchTags(boolean fetchTags) { - this.fetchTags = fetchTags; - }
public void addSortName(PageOrdering sortName) { addSortField("name"); diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java index 6a0011e..5f5a672 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java @@ -50,7 +50,6 @@ public class BundleDeploymentCriteria extends TaggedCriteria { private boolean fetchConfiguration; private boolean fetchDestination; private boolean fetchResourceDeployments; - private boolean fetchTags;
public BundleDeploymentCriteria() { filterOverrides.put("bundleId", "bundleVersion.bundle.id = ?"); @@ -120,8 +119,5 @@ public class BundleDeploymentCriteria extends TaggedCriteria { this.fetchResourceDeployments = fetchResourceDeployments; }
- public void fetchTags(boolean fetchTags) { - this.fetchTags = fetchTags; - }
} diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleVersionCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleVersionCriteria.java index ce073a1..c4240b4 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleVersionCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleVersionCriteria.java @@ -45,7 +45,6 @@ public class BundleVersionCriteria extends TaggedCriteria { private boolean fetchBundleDeployments; private boolean fetchBundleFiles; private boolean fetchConfigurationDefinition; - private boolean fetchTags;
public BundleVersionCriteria() { filterOverrides.put("bundleId", "bundle.id = ?"); @@ -97,9 +96,4 @@ public class BundleVersionCriteria extends TaggedCriteria { this.fetchConfigurationDefinition = fetchConfigurationDefinition; }
- public void fetchTags(boolean fetchTags) { - this.fetchTags = fetchTags; - } - - } diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java index 8f65e55..bacef93 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java @@ -85,7 +85,6 @@ public class ResourceCriteria extends TaggedCriteria { private boolean fetchResourceErrors; private boolean fetchEventSources; private boolean fetchProductVersion; - private boolean fetchTags;
private PageOrdering sortName; private PageOrdering sortInventoryStatus; @@ -292,10 +291,6 @@ public class ResourceCriteria extends TaggedCriteria { this.fetchProductVersion = fetchProductVersion; }
- public void fetchTags(boolean fetchTags) { - this.fetchTags = fetchTags; - } - public void addSortName(PageOrdering sortName) { addSortField("name"); this.sortName = sortName; diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java index c7047b2..bbefbb3 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java @@ -62,7 +62,6 @@ public class ResourceGroupCriteria extends TaggedCriteria { private boolean fetchGroupDefinition; private boolean fetchResourceType; private boolean fetchRoles; - private boolean fetchTags;
private PageOrdering sortName; private PageOrdering sortResourceTypeName; // requires overrides @@ -209,10 +208,6 @@ public class ResourceGroupCriteria extends TaggedCriteria { this.fetchResourceType = fetchResourceType; }
- public void fetchTags(boolean fetchTags) { - this.fetchTags = fetchTags; - } - /** * Requires MANAGE_SECURITY * @param fetchRoles diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/TaggedCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/TaggedCriteria.java index cc3c3fa..0ff464a 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/TaggedCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/TaggedCriteria.java @@ -31,6 +31,9 @@ public abstract class TaggedCriteria extends Criteria {
private Tag filterTag;
+ private boolean fetchTags; + + protected TaggedCriteria() {
String entityName = getPersistentClass().getName(); @@ -73,4 +76,9 @@ public abstract class TaggedCriteria extends Criteria { return this.filterTag != null; }
+ + public void fetchTags(boolean fetchTags) { + this.fetchTags = fetchTags; + } + }
commit 9a160c2c5bfbf9bb579f476eae324618f93d1f18 Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 13 11:07:49 2010 -0400
Set file size of uploaded packages
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java index 4e2ce11..02a5d54 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java @@ -1233,7 +1233,7 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe log.error("Error savinf the package.", e); } newPackageVersion.setPackageBits(bits); - + newPackageVersion.setFileSize((long) bits.getBits().length); newPackageVersion = persistOrMergePackageVersionSafely(newPackageVersion);
existingPackage.addVersion(newPackageVersion);
commit 8316654b013d7f5963e6710f00217f0d7460a2f1 Merge: c36b43b... 2a4435a... Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 12 17:45:51 2010 -0400
Merge branch 'bundle-jay' into bundle
commit 2a4435a6b979c126c021f0e1b06f187f44e58da2 Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 12 17:45:01 2010 -0400
Bundle Deploy Wizard - 1st pass at integrating destination workflow - needs work
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java index e7611f5..61f4b88 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java @@ -33,17 +33,15 @@ public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard {
// the things we build up in the wizard private Integer bundleId; - private BundleVersion bundleVersion; + private Integer destinationId; private BundleDestination bundleDestination; - private Integer platformGroupId; + private BundleVersion bundleVersion; + private boolean newDestination = false; + private String deploymentName; + private String deploymentDescription; private BundleDeployment bundleDeployment; - private String name; - private String description; - private String deployDir; private ConfigurationTemplate template; private Configuration config; - - private Boolean newDefinition = Boolean.TRUE; private boolean deployNow = true;
public Integer getBundleId() { @@ -62,28 +60,28 @@ public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard { this.bundleVersion = bundleVersion; }
- public BundleDestination getBundleDestination() { - return bundleDestination; + public Integer getDestinationId() { + return destinationId; }
- public void setBundleDestination(BundleDestination bundleDestination) { - this.bundleDestination = bundleDestination; + public void setDestinationId(Integer destinationId) { + this.destinationId = destinationId; }
public String getName() { - return name; + return deploymentName; }
public void setName(String name) { - this.name = name; + this.deploymentName = name; }
public String getDescription() { - return description; + return deploymentDescription; }
public void setDescription(String description) { - this.description = description; + this.deploymentDescription = description; }
public Configuration getConfig() { @@ -110,24 +108,20 @@ public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard { this.bundleDeployment = bundleDeployment; }
- public boolean isNewDefinition() { - return Boolean.TRUE.equals(newDefinition); - } - - public Boolean getNewDefinition() { - return newDefinition; + public BundleDestination getBundleDestination() { + return bundleDestination; }
- public void setNewDefinition(Boolean newDefinition) { - this.newDefinition = newDefinition; + public void setBundleDestination(BundleDestination bundleDestination) { + this.bundleDestination = bundleDestination; }
- public Integer getPlatformGroupId() { - return platformGroupId; + public boolean isNewDestination() { + return newDestination; }
- public void setPlatformGroupId(Integer platformGroupId) { - this.platformGroupId = platformGroupId; + public void setNewDestination(boolean newDestination) { + this.newDestination = newDestination; }
public Boolean isDeployNow() { @@ -137,13 +131,4 @@ public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard { public void setDeployNow(Boolean deployNow) { this.deployNow = deployNow; } - - public String getDeployDir() { - return deployDir; - } - - public void setDeployDir(String installDir) { - this.deployDir = installDir; - } - } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java index b84602a..9f7a6b8 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java @@ -22,94 +22,52 @@ import java.util.ArrayList; import java.util.List;
import org.rhq.core.domain.bundle.BundleDeployment; -import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
public class BundleDeployWizard extends AbstractBundleDeployWizard {
+ // New Deployment, No Bundle Selected public BundleDeployWizard() { + this.setNewDestination(true); + List<WizardStep> steps = init(); - steps.add(new SelectDestinationStep(this)); steps.add(new SelectBundleStep(this)); + steps.add(new GetDestinationStep(this)); steps.add(new SelectBundleVersionStep(this)); steps.add(new GetDeploymentInfoStep(this)); steps.add(new GetDeploymentConfigStep(this)); steps.add(new DeployStep(this)); }
- public BundleDeployWizard(Integer platformGroupId) { - this.setPlatformGroupId(platformGroupId); - - List<WizardStep> steps = init(); - if (null == this.getPlatformGroupId()) { - steps.add(new SelectDestinationStep(this)); + // New Deployment, Seeded with Bundle + public BundleDeployWizard(Integer bundleId) { + if (null == bundleId) { + throw new IllegalArgumentException("bundleId is null"); } - steps.add(new SelectBundleStep(this)); - steps.add(new SelectBundleVersionStep(this)); - steps.add(new GetDeploymentInfoStep(this)); - steps.add(new GetDeploymentConfigStep(this)); - steps.add(new DeployStep(this)); - }
- public BundleDeployWizard(Integer platformGroupId, Integer bundleId) { - this.setPlatformGroupId(platformGroupId); + this.setNewDestination(true); this.setBundleId(bundleId);
List<WizardStep> steps = init(); - if (null == this.getPlatformGroupId()) { - steps.add(new SelectDestinationStep(this)); - } - if (null == this.getBundleId()) { - steps.add(new SelectBundleStep(this)); - } + steps.add(new GetDestinationStep(this)); steps.add(new SelectBundleVersionStep(this)); steps.add(new GetDeploymentInfoStep(this)); steps.add(new GetDeploymentConfigStep(this)); steps.add(new DeployStep(this)); }
- public BundleDeployWizard(Integer platformGroupId, Integer bundleId, BundleVersion bundleVersion) { - this.setPlatformGroupId(platformGroupId); - this.setBundleId(bundleId); - this.setBundleVersion(bundleVersion); - - List<WizardStep> steps = init(); - if (null == this.getPlatformGroupId()) { - steps.add(new SelectDestinationStep(this)); - } - if (null == this.getBundleId()) { - steps.add(new SelectBundleStep(this)); + // Redeploy + public BundleDeployWizard(Integer bundleId, Integer destinationId) { + if (null == destinationId) { + throw new IllegalArgumentException("destinationId is null"); } - if (null == this.getBundleVersion()) { - steps.add(new SelectBundleVersionStep(this)); - } - steps.add(new GetDeploymentInfoStep(this)); - steps.add(new GetDeploymentConfigStep(this)); - steps.add(new DeployStep(this)); - } - - public BundleDeployWizard(BundleDeployment bundleDeployment) { - List<WizardStep> steps = init(); - this.setBundleId(bundleDeployment.getBundleVersion().getBundle().getId()); - this.setBundleVersion(bundleDeployment.getBundleVersion()); - this.setBundleDeployment(bundleDeployment); - setNewDefinition(Boolean.FALSE);
- steps.add(new SelectDestinationStep(this)); - steps.add(new GetDeploymentConfigStep(this)); - steps.add(new DeployStep(this)); - } + this.setBundleId(bundleId); + this.setDestinationId(destinationId);
- public BundleDeployWizard(Integer platformGroupId, BundleDeployment bundleDeployment) { List<WizardStep> steps = init(); - this.setBundleId(bundleDeployment.getBundleVersion().getBundle().getId()); - this.setBundleVersion(bundleDeployment.getBundleVersion()); - this.setBundleDeployment(bundleDeployment); - setNewDefinition(Boolean.FALSE); - - if (null == this.getPlatformGroupId()) { - steps.add(new SelectDestinationStep(this)); - } + steps.add(new SelectBundleVersionStep(this)); + steps.add(new GetDeploymentInfoStep(this)); steps.add(new GetDeploymentConfigStep(this)); steps.add(new DeployStep(this)); } @@ -125,7 +83,7 @@ public class BundleDeployWizard extends AbstractBundleDeployWizard {
public void cancel() { BundleDeployment bd = getBundleDeployment(); - if (bd != null && isNewDefinition()) { + if (bd != null && isNewDestination()) { // the user must have created it already after verification step, delete it // TODO } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java index d13b045..dc6f02d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java @@ -71,48 +71,46 @@ public class DeployStep implements WizardStep { canvas.addMember(deployingImage); canvas.addMember(deployingMessage);
- if (wizard.isNewDefinition()) { - bundleServer.createBundleDeployment(wizard.getBundleVersion().getId(), wizard.getBundleDestination() - .getId(), wizard.getName(), wizard.getDescription(), wizard.getConfig(), false, -1, false, // - new AsyncCallback<BundleDeployment>() { - public void onSuccess(BundleDeployment result) { - deployingImage.setSrc("/images/status_complete.gif"); - deployingMessage.setText("Created Deployment..."); - CoreGUI.getMessageCenter().notify( - new Message("Created deployment [" + result.getName() + "] description [" - + result.getDescription(), Severity.Info)); - wizard.setBundleDeployment(result); - - bundleServer.scheduleBundleDeployment(wizard.getBundleDeployment().getId(), // - new AsyncCallback<BundleDeployment>() { - public void onSuccess(BundleDeployment result) { - deployingImage.setSrc("/images/status_complete.gif"); - deployingMessage.setText("Bundle Group Deployment Scheduled!"); - CoreGUI.getMessageCenter().notify( - new Message("Schedule bundle group deployment [" - + wizard.getBundleDeployment().getName() + "] resource group [" - + result.getDestination().getGroup() + "]", Severity.Info)); - wizard.setBundleDeployment(result); - } - - public void onFailure(Throwable caught) { - deployingImage.setSrc("/images/status_error.gif"); - deployingMessage.setText("Failed to Schedule Group Deployment!"); - CoreGUI.getErrorHandler().handleError( - "Failed to schedule group deployment: " + caught.getMessage(), caught); - wizard.setBundleDeployment(null); - } - }); - } - - public void onFailure(Throwable caught) { - deployingImage.setSrc("/images/status_error.gif"); - deployingMessage.setText("Failed to create deployment!"); - CoreGUI.getErrorHandler().handleError( - "Failed to create deployment: " + caught.getMessage(), caught); - } - }); - } + bundleServer.createBundleDeployment(wizard.getBundleVersion().getId(), wizard.getBundleDestination() + .getId(), wizard.getName(), wizard.getDescription(), wizard.getConfig(), false, -1, false, // + new AsyncCallback<BundleDeployment>() { + public void onSuccess(BundleDeployment result) { + deployingImage.setSrc("/images/status_complete.gif"); + deployingMessage.setText("Created Deployment..."); + CoreGUI.getMessageCenter().notify( + new Message("Created deployment [" + result.getName() + "] description [" + + result.getDescription(), Severity.Info)); + wizard.setBundleDeployment(result); + + bundleServer.scheduleBundleDeployment(wizard.getBundleDeployment().getId(), // + new AsyncCallback<BundleDeployment>() { + public void onSuccess(BundleDeployment result) { + deployingImage.setSrc("/images/status_complete.gif"); + deployingMessage.setText("Bundle Group Deployment Scheduled!"); + CoreGUI.getMessageCenter().notify( + new Message("Schedule bundle group deployment [" + + wizard.getBundleDeployment().getName() + "] resource group [" + + result.getDestination().getGroup() + "]", Severity.Info)); + wizard.setBundleDeployment(result); + } + + public void onFailure(Throwable caught) { + deployingImage.setSrc("/images/status_error.gif"); + deployingMessage.setText("Failed to Schedule Group Deployment!"); + CoreGUI.getErrorHandler().handleError( + "Failed to schedule group deployment: " + caught.getMessage(), caught); + wizard.setBundleDeployment(null); + } + }); + } + + public void onFailure(Throwable caught) { + deployingImage.setSrc("/images/status_error.gif"); + deployingMessage.setText("Failed to create deployment!"); + CoreGUI.getErrorHandler().handleError("Failed to create deployment: " + caught.getMessage(), + caught); + } + }); }
return canvas; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java index a9fbb2e..e834afd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java @@ -77,20 +77,7 @@ public class GetDeploymentInfoStep implements WizardStep { } });
- final TextItem installDirTextItem = new TextItem("installDir", - "Root Installation Directory (on destination platform)"); - installDirTextItem.setRequired(true); - installDirTextItem.addChangedHandler(new ChangedHandler() { - public void onChanged(ChangedEvent event) { - Object value = event.getValue(); - if (value == null) { - value = ""; - } - wizard.setDeployDir(value.toString()); - } - }); - - form.setItems(nameTextItem, descriptionTextAreaItem, installDirTextItem); + form.setItems(nameTextItem, descriptionTextAreaItem); }
return form; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java new file mode 100644 index 0000000..0fde744 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java @@ -0,0 +1,146 @@ +/* + * 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.bundle.deploy; + +import java.util.HashSet; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.util.SC; +import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.CanvasItem; +import com.smartgwt.client.widgets.form.fields.TextAreaItem; +import com.smartgwt.client.widgets.form.fields.TextItem; +import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; +import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; +import com.smartgwt.client.widgets.layout.VLayout; + +import org.rhq.core.domain.bundle.BundleDestination; +import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.bundle.deploy.selection.PlatformResourceGroupSelector; +import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.AbstractSelector; + +public class GetDestinationStep implements WizardStep { + + private final BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); + private final BundleDeployWizard wizard; + private VLayout form; + DynamicForm valForm = new DynamicForm(); + private AbstractSelector<ResourceGroup> selector; + private BundleDestination dest = new BundleDestination(); + + public GetDestinationStep(BundleDeployWizard wizard) { + this.wizard = wizard; + } + + public String getName() { + return "New Destination"; + } + + public Canvas getCanvas() { + if (this.form == null) { + this.form = new VLayout(); + + this.valForm.setWidth100(); + this.valForm.setNumCols(2); + this.valForm.setColWidths("50%", "*"); + + final TextItem nameTextItem = new TextItem("name", "Destination Name"); + nameTextItem.setRequired(true); + nameTextItem.addChangedHandler(new ChangedHandler() { + public void onChanged(ChangedEvent event) { + Object value = event.getValue(); + if (value == null) { + value = ""; + } + wizard.setSubtitle(value.toString()); + dest.setName(value.toString()); + } + }); + + final TextAreaItem descriptionTextAreaItem = new TextAreaItem("description", "Destination Description"); + descriptionTextAreaItem.addChangedHandler(new ChangedHandler() { + public void onChanged(ChangedEvent event) { + Object value = event.getValue(); + if (value == null) { + value = ""; + } + dest.setDescription(value.toString()); + } + }); + + final TextItem deployDirTextItem = new TextItem("deployDir", + "Root Deployment Directory (on destination platforms)"); + deployDirTextItem.setRequired(true); + deployDirTextItem.addChangedHandler(new ChangedHandler() { + public void onChanged(ChangedEvent event) { + Object value = event.getValue(); + if (value == null) { + value = ""; + } + dest.setDeployDir(value.toString()); + } + }); + + this.valForm.setItems(nameTextItem, descriptionTextAreaItem, deployDirTextItem); + CanvasItem ci1 = new CanvasItem(); + ci1.setShowTitle(false); + ci1.setCanvas(valForm); + ci1.setDisabled(true); + + this.selector = new PlatformResourceGroupSelector(); + CanvasItem ci2 = new CanvasItem(); + ci2.setShowTitle(false); + ci2.setCanvas(this.selector); + ci2.setDisabled(true); + + this.form.addMember(this.valForm); + this.form.addMember(this.selector); + } + + return this.form; + } + + public boolean nextPage() { + HashSet<Integer> selection = this.selector.getSelection(); + if (selection.size() != 1) { + SC.warn("Select only a single destination group for deployment."); + return false; + } + + bundleServer.createBundleDestination(wizard.getBundleId(), this.dest.getName(), this.dest.getDescription(), + this.dest.getDeployDir(), selection.iterator().next(), // + new AsyncCallback<BundleDestination>() { + public void onSuccess(BundleDestination result) { + wizard.setBundleDestination(result); + } + + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to create destination: " + caught.getMessage(), + caught); + } + }); + + return true; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java index 6519937..141f99d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java @@ -28,7 +28,9 @@ import com.smartgwt.client.widgets.form.fields.SelectItem; import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
+import org.rhq.core.domain.bundle.BundleDeployment; import org.rhq.core.domain.bundle.BundleVersion; +import org.rhq.core.domain.criteria.BundleDeploymentCriteria; import org.rhq.core.domain.criteria.BundleVersionCriteria; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.CoreGUI; @@ -39,6 +41,7 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; public class SelectBundleVersionStep implements WizardStep {
static private final String LATEST_VERSION = "latest"; + static private final String LIVE_VERSION = "live"; static private final String SELECT_VERSION = "select";
private final BundleDeployWizard wizard; @@ -51,6 +54,7 @@ public class SelectBundleVersionStep implements WizardStep { private LinkedHashMap<String, String> selectVersionValues = new LinkedHashMap<String, String>(); private PageList<BundleVersion> bundleVersions = null; private BundleVersion latestVersion; + private BundleVersion liveVersion;
public SelectBundleVersionStep(BundleDeployWizard bundleDeployWizard) { this.wizard = bundleDeployWizard; @@ -77,8 +81,12 @@ public class SelectBundleVersionStep implements WizardStep { if (isLatestVersion) { wizard.setBundleVersion(latestVersion); } - selectVersionItem.setDisabled(isLatestVersion); - selectVersionItem.setRequired(!isLatestVersion); + boolean isLiveVersion = LIVE_VERSION.equals(event.getValue()); + if (isLiveVersion) { + wizard.setBundleVersion(liveVersion); + } + selectVersionItem.setDisabled(isLatestVersion || isLiveVersion); + selectVersionItem.setRequired(!(isLatestVersion || isLiveVersion)); selectVersionItem.redraw(); form.markForRedraw(); } @@ -127,6 +135,27 @@ public class SelectBundleVersionStep implements WizardStep {
radioGroupValues.put(LATEST_VERSION, "Latest Version [ " + latestVersion.getVersion() + " ]"); radioGroupValues.put(SELECT_VERSION, "Select Version"); + + BundleDeploymentCriteria criteria = new BundleDeploymentCriteria(); + criteria.addFilterBundleId(wizard.getBundleId()); + criteria.addFilterIsLive(true); + criteria.fetchBundleVersion(true); + bundleServer.findBundleDeploymentsByCriteria(criteria, // + new AsyncCallback<PageList<BundleDeployment>>() { + + public void onSuccess(PageList<BundleDeployment> result) { + if (!result.isEmpty()) { + liveVersion = result.get(0).getBundleVersion(); + radioGroupValues.put(LIVE_VERSION, "Live Version [ " + liveVersion.getVersion() + + " ]"); + } + } + + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to find defined deployments.", caught); + } + }); + radioGroupItem.setValueMap(radioGroupValues); radioGroupItem.setValue(LATEST_VERSION); wizard.setBundleVersion(latestVersion); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectDestinationStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectDestinationStep.java deleted file mode 100644 index 2954884..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectDestinationStep.java +++ /dev/null @@ -1,60 +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.bundle.deploy; - -import java.util.HashSet; - -import com.smartgwt.client.util.SC; -import com.smartgwt.client.widgets.Canvas; - -import org.rhq.core.domain.resource.group.ResourceGroup; -import org.rhq.enterprise.gui.coregui.client.bundle.deploy.selection.PlatformResourceGroupSelector; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.AbstractSelector; - -public class SelectDestinationStep implements WizardStep { - - private final BundleDeployWizard wizard; - - private AbstractSelector<ResourceGroup> selector; - - public SelectDestinationStep(BundleDeployWizard bundleCreationWizard) { - this.wizard = bundleCreationWizard; - } - - public String getName() { - return "Select Destination Platform Group"; - } - - public Canvas getCanvas() { - this.selector = new PlatformResourceGroupSelector(); - return this.selector; - } - - public boolean nextPage() { - HashSet<Integer> selection = this.selector.getSelection(); - if (selection.size() != 1) { - SC.warn("Select only a single destination group for deployment."); - return false; - } - - this.wizard.setPlatformGroupId(selection.iterator().next()); - return true; - } -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java index 92707b2..4a03055 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java @@ -127,7 +127,7 @@ public class BundlesListView extends VLayout { Severity.Error)); return; } - new BundleDeployWizard(null, result.get(0).getId()).startBundleWizard(); + new BundleDeployWizard(result.get(0).getId()).startBundleWizard(); } }); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java index 2cbd570..2d3c2c0 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java @@ -25,6 +25,7 @@ import com.google.gwt.user.client.rpc.RemoteService;
import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; +import org.rhq.core.domain.bundle.BundleDestination; import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleType; import org.rhq.core.domain.bundle.BundleVersion; @@ -46,6 +47,9 @@ public interface BundleGWTService extends RemoteService { String description, Configuration configuration, boolean enforcePolicy, int enforcementInterval, boolean pinToBundle) throws Exception;
+ BundleDestination createBundleDestination(int bundleId, String name, String description, String deployDir, + int groupId) throws Exception; + BundleVersion createBundleVersion(int bundleId, String name, String version, String recipe) throws Exception;
void deleteBundle(int bundleId) throws Exception; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java index fc870ba..67678fa 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java @@ -23,6 +23,7 @@ import java.util.HashMap;
import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; +import org.rhq.core.domain.bundle.BundleDestination; import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleType; import org.rhq.core.domain.bundle.BundleVersion; @@ -78,6 +79,19 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund } }
+ public BundleDestination createBundleDestination(int bundleId, String name, String description, String deployDir, + int groupId) throws Exception { + + try { + BundleDestination result = bundleManager.createBundleDestination(getSessionSubject(), bundleId, name, + description, deployDir, groupId); + + return SerialUtility.prepare(result, "createBundleDestination"); + } catch (Exception e) { + throw new Exception(ThrowableUtil.getAllMessages(e)); + } + } + public BundleVersion createBundleVersion(int bundleId, String name, String version, String recipe) throws Exception { BundleVersion results; try {
commit 9e530d7439a216769cfbcf7977996faa7d0ee899 Merge: 4864545... 9f5fb1a... Author: Ian P. Springer <ips@jetengine.(none)> Date: Wed May 12 16:22:50 2010 -0400
Merge branch 'gwt' of ssh://git.fedorahosted.org/git/rhq/rhq into gwt
commit 9f5fb1af91d75030c04daef6b30d9510fa8ca484 Author: Greg Hinkle ghinkle@redhat.com Date: Wed May 12 15:44:26 2010 -0400
Tag info exposure Tag cloud view
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java b/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java index cced341..f814647 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java @@ -53,9 +53,10 @@ import org.rhq.core.domain.resource.group.ResourceGroup; @Entity @NamedQueries( { @NamedQuery(name = Tag.QUERY_TAG_COMPOSITE_REPORT, - query = "SELECT t.id, t.namespace, t.semantic, t.name,\n" + + query = "SELECT new org.rhq.core.domain.tagging.compsite.TagReportComposite( \n" + + " t.id, t.namespace, t.semantic, t.name,\n" + " (count(r) + count(g) + count(b) + count(bv) + count(bd)) AS Total,\n" + - " count(r) AS Resources, count(g) AS ResourceGroups, count(b) AS Bundles, count(bv) AS BundleVersions, count(bd) AS BundleDeployments\n" + + " count(r) AS Resources, count(g) AS ResourceGroups, count(b) AS Bundles, count(bv) AS BundleVersions, count(bd) AS BundleDeployments )\n" + "FROM Tag t LEFT JOIN t.resources r LEFT JOIN t.resourceGroups g LEFT JOIN t.bundles b LEFT JOIN t.bundleVersions bv LEFT JOIN t.bundleDeployments bd\n" + "GROUP BY t.id, t.namespace, t.semantic, t.name\n" + "ORDER BY (count(r) + count(g) + count(b) + count(bv) + count(bd)) desc") @@ -129,6 +130,10 @@ public class Tag implements Serializable { return id; }
+ public void setId(int id) { + this.id = id; + } + public String getNamespace() { return namespace; } @@ -309,4 +314,6 @@ public class Tag implements Serializable { result = 31 * result + name.hashCode(); return result; } + + } diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/compsite/TagReportComposite.java b/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/compsite/TagReportComposite.java new file mode 100644 index 0000000..1d54955 --- /dev/null +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/compsite/TagReportComposite.java @@ -0,0 +1,78 @@ +/* + * 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, 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.domain.tagging.compsite; + +import org.rhq.core.domain.tagging.Tag; + +/** + * @author Greg Hinkle + */ +public class TagReportComposite extends Tag { + + private Tag tag; + private long total, resourceCount, resourceGroupCount, bundleCount, bundleVersionCount, bundleDeploymentCount; + + public TagReportComposite() { + } + + public TagReportComposite(int id, String namespace, String semantic, String name, + long total, + long resourceCount, long resourceGroupCount, long bundleCount, long bundleVersionCount, long bundleDeploymentCount) { + tag = new Tag(namespace, semantic, name); + tag.setId(id); + this.total = total; + this.resourceCount = resourceCount; + this.resourceGroupCount = resourceGroupCount; + this.bundleCount = bundleCount; + this.bundleVersionCount = bundleVersionCount; + this.bundleDeploymentCount = bundleDeploymentCount; + } + + public Tag getTag() { + return tag; + } + + public long getTotal() { + return total; + } + + public long getResourceCount() { + return resourceCount; + } + + public long getResourceGroupCount() { + return resourceGroupCount; + } + + public long getBundleCount() { + return bundleCount; + } + + public long getBundleVersionCount() { + return bundleVersionCount; + } + + public long getBundleDeploymentCount() { + return bundleDeploymentCount; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/DemoCanvas.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/DemoCanvas.java index f192c58..bf912cd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/DemoCanvas.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/DemoCanvas.java @@ -22,6 +22,7 @@ import org.rhq.enterprise.gui.coregui.client.components.configuration.Configurat import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceSelector; import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeTreeView; +import org.rhq.enterprise.gui.coregui.client.report.tag.TagCloudView;
import com.smartgwt.client.types.Side; import com.smartgwt.client.types.TabBarControls; @@ -52,6 +53,7 @@ public class DemoCanvas extends Canvas {
// topTabSet.setTop(50);
+ Tab tagTab = new Tab("Tag Cloud"); Tab selectorTab = new Tab("Selector"); Tab typeTree = new Tab("Type Tree"); Tab treeTab = new Tab("Resource Tree"); @@ -59,6 +61,8 @@ public class DemoCanvas extends Canvas { //Tab alertHistoryTab = new Tab("Alert History");
+ tagTab.setPane(new TagCloudView()); + selectorTab.setPane(new ResourceSelector());
// Agent: resource (10005) type (10060) @@ -70,6 +74,7 @@ public class DemoCanvas extends Canvas { typeTree.setPane(new ResourceTypeTreeView()); //alertHistoryTab.setPane(new AbstractAlertsView());
+ topTabSet.addTab(tagTab); topTabSet.addTab(selectorTab); topTabSet.addTab(typeTree); topTabSet.addTab(configTab); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java index ac4e968..3ad9e83 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java @@ -32,6 +32,7 @@ import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.platform.Platfor import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.alerts.RecentAlertsPortlet; import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.imported.RecentlyAddedView; import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.summary.InventorySummaryView; +import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.summary.TagCloudPortlet; import org.rhq.enterprise.gui.coregui.client.dashboard.store.DashboardStore; import org.rhq.enterprise.gui.coregui.client.dashboard.store.StoredDashboard; import org.rhq.enterprise.gui.coregui.client.dashboard.store.StoredPortlet; @@ -94,9 +95,12 @@ public class DashboardsView extends VLayout {
- StoredPortlet summary = new StoredPortlet("Inventory Summary", InventorySummaryView.KEY, 300); + StoredPortlet summary = new StoredPortlet("Inventory Summary", InventorySummaryView.KEY, 250); col1.add(summary);
+ StoredPortlet tagCloud = new StoredPortlet("Tag Cloud", TagCloudPortlet.KEY, 250); + col1.add(tagCloud); + StoredPortlet graph = new StoredPortlet("ghinkle (MAC OS X) CPU", GraphPortlet.KEY, 250); graph.setProperty("resourceId","10001"); graph.setProperty("definitionId","10139"); 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 df9037f..2e5dcd5 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 @@ -33,6 +33,7 @@ import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.alerts.Re import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.imported.RecentlyAddedView; import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.platform.PlatformPortletView; import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.summary.InventorySummaryView; +import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.summary.TagCloudPortlet; import org.rhq.enterprise.gui.coregui.client.dashboard.store.StoredPortlet;
/** @@ -57,6 +58,7 @@ public class PortletFactory {
registeredPortlets.put(GraphPortlet.KEY, GraphPortlet.Factory.INSTANCE);
+ registeredPortlets.put(TagCloudPortlet.KEY, TagCloudPortlet.Factory.INSTANCE); }
public static Canvas buildPortlet(StoredPortlet storedPortlet) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/TagCloudPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/TagCloudPortlet.java new file mode 100644 index 0000000..7f21a81 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/TagCloudPortlet.java @@ -0,0 +1,68 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.dashboard.portlets.summary; + +import com.google.gwt.core.client.GWT; +import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.layout.VLayout; + +import org.rhq.enterprise.gui.coregui.client.dashboard.PortletView; +import org.rhq.enterprise.gui.coregui.client.dashboard.PortletViewFactory; +import org.rhq.enterprise.gui.coregui.client.dashboard.store.StoredPortlet; +import org.rhq.enterprise.gui.coregui.client.report.tag.TagCloudView; + +/** + * @author Greg Hinkle + */ +public class TagCloudPortlet extends VLayout implements PortletView { + + public static final String KEY = "TagCloud"; + + @Override + protected void onInit() { + super.onInit(); + addMember(new TagCloudView()); + } + + public void configure(StoredPortlet storedPortlet) { + // TODO: Implement this method. + } + + public Canvas getHelpCanvas() { + return null; // TODO: Implement this method. + } + + public Canvas getSettingsCanvas() { + return null; // TODO: Implement this method. + } + + public static final class Factory implements PortletViewFactory { + public static PortletViewFactory INSTANCE = new Factory(); + + public final PortletView getInstance() { + return GWT.create(TagCloudPortlet.class); + } + } + +} + diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TagGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TagGWTService.java index 9ab2919..8c7dc24 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TagGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TagGWTService.java @@ -29,6 +29,7 @@ import com.google.gwt.user.client.rpc.RemoteService; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.criteria.TagCriteria; import org.rhq.core.domain.tagging.Tag; +import org.rhq.core.domain.tagging.compsite.TagReportComposite; import org.rhq.core.domain.util.PageList;
/** @@ -53,5 +54,5 @@ public interface TagGWTService extends RemoteService {
void updateBundleDeploymentTags(int bundleDeploymentId, Set<Tag> tags);
- + PageList<TagReportComposite> findTagReportCompositesByCriteria(TagCriteria tagCriteria); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java new file mode 100644 index 0000000..3d5eedc --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java @@ -0,0 +1,103 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.report.tag; + +import java.util.Collections; +import java.util.Comparator; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.widgets.HTMLFlow; +import com.smartgwt.client.widgets.layout.VLayout; + +import org.rhq.core.domain.criteria.TagCriteria; +import org.rhq.core.domain.tagging.compsite.TagReportComposite; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; + +/** + * @author Greg Hinkle + */ +public class TagCloudView extends VLayout { + + + @Override + protected void onDraw() { + super.onDraw(); + + + GWTServiceLookup.getTagService().findTagReportCompositesByCriteria(new TagCriteria(), + new AsyncCallback<PageList<TagReportComposite>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load tags", caught); + } + + public void onSuccess(PageList<TagReportComposite> result) { + drawTags(result); + } + }); + + + } + + + private void drawTags(PageList<TagReportComposite> tags) { + + long max = 0; + long total = 0; + for (TagReportComposite tag : tags) { + if (tag.getTotal() > max) { + max = tag.getTotal(); + } + total += tag.getTotal(); + } + + Collections.sort(tags, new Comparator<TagReportComposite>() { + public int compare(TagReportComposite o1, TagReportComposite o2) { + return o1.getTag().toString().compareTo(o2.getTag().toString()); + } + }); + + + StringBuilder buf = new StringBuilder(); + + int minFont = 8; + int maxFont = 22; + + for (TagReportComposite tag : tags) { + + int font = (int) ((((double) tag.getTotal()) / (double) max) * (maxFont - minFont)) + minFont; + + + buf.append("<a href="#Tag/" + tag.getTag().toString() + "" style="font-size: " + font + "pt; margin: 8px;">" + tag.getTag().toString() + "</a> "); + + + } + + HTMLFlow flow = new HTMLFlow(buf.toString()); + + addMember(flow); + + } + +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TagGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TagGWTServiceImpl.java index fb27c52..4a05658 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TagGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TagGWTServiceImpl.java @@ -26,6 +26,7 @@ import java.util.Set;
import org.rhq.core.domain.criteria.TagCriteria; import org.rhq.core.domain.tagging.Tag; +import org.rhq.core.domain.tagging.compsite.TagReportComposite; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.gwt.TagGWTService; import org.rhq.enterprise.gui.coregui.server.util.SerialUtility; @@ -73,4 +74,9 @@ public class TagGWTServiceImpl extends AbstractGWTServiceImpl implements TagGWTS public void updateBundleDeploymentTags(int bundleDeploymentId, Set<Tag> tags) { tagManager.updateBundleDeploymentTags(getSessionSubject(), bundleDeploymentId, tags); } + + public PageList<TagReportComposite> findTagReportCompositesByCriteria(TagCriteria tagCriteria) { + return SerialUtility.prepare(tagManager.findTagReportCompositesByCriteria(getSessionSubject(), tagCriteria), + "TagService.findTagReportCompositesByCriteria"); + } } diff --git a/modules/enterprise/remoting/client-api/src/main/java/org/rhq/enterprise/client/RemoteClient.java b/modules/enterprise/remoting/client-api/src/main/java/org/rhq/enterprise/client/RemoteClient.java index ed4fd00..7e04253 100644 --- a/modules/enterprise/remoting/client-api/src/main/java/org/rhq/enterprise/client/RemoteClient.java +++ b/modules/enterprise/remoting/client-api/src/main/java/org/rhq/enterprise/client/RemoteClient.java @@ -41,6 +41,7 @@ import org.rhq.enterprise.server.content.DistributionManagerRemote; import org.rhq.enterprise.server.content.RepoManagerRemote; import org.rhq.enterprise.server.discovery.DiscoveryBossRemote; import org.rhq.enterprise.server.event.EventManagerRemote; +import org.rhq.enterprise.server.install.remote.RemoteInstallManagerRemote; import org.rhq.enterprise.server.measurement.AvailabilityManagerRemote; import org.rhq.enterprise.server.measurement.CallTimeDataManagerRemote; import org.rhq.enterprise.server.measurement.MeasurementBaselineManagerRemote; @@ -58,6 +59,7 @@ import org.rhq.enterprise.server.search.SavedSearchManagerRemote; import org.rhq.enterprise.server.support.SupportManagerRemote; import org.rhq.enterprise.server.system.ServerVersion; import org.rhq.enterprise.server.system.SystemManagerRemote; +import org.rhq.enterprise.server.tagging.TagManagerRemote;
/** * A remote access client that provides transparent servlet-based proxies to an RHQ Server. @@ -98,8 +100,9 @@ public class RemoteClient { SavedSearchManager(SavedSearchManagerRemote.class), // SubjectManager(SubjectManagerRemote.class), // SupportManager(SupportManagerRemote.class), // - SystemManager(SystemManagerRemote.class) // - // RemoteInstallManager(RemoteInstallManagerRemote.class), + SystemManager(SystemManagerRemote.class), // + RemoteInstallManager(RemoteInstallManagerRemote.class), // + TagManager(TagManagerRemote.class) ;
private Class<?> remote; @@ -421,9 +424,13 @@ public class RemoteClient { return RemoteClientProxy.getProcessor(this, Manager.SystemManager); }
- // public RemoteInstallManagerRemote getRemoteInstallManagerRemote() { - // return RemoteClientProxy.getProcessor(this, Manager.RemoteInstallManager); - // } + public RemoteInstallManagerRemote getRemoteInstallManagerRemote() { + return RemoteClientProxy.getProcessor(this, Manager.RemoteInstallManager); + } + + public TagManagerRemote getTagManagerRemote() { + return RemoteClientProxy.getProcessor(this, Manager.TagManager); + }
/** * Returns the map of all remote managers running in the server that this diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java index e3082dd..cd608fe 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java @@ -30,6 +30,7 @@ import javax.ejb.EJB; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; +import javax.persistence.Query;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -43,6 +44,7 @@ import org.rhq.core.domain.criteria.TagCriteria; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.domain.tagging.Tag; +import org.rhq.core.domain.tagging.compsite.TagReportComposite; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.server.RHQConstants; import org.rhq.enterprise.server.authz.AuthorizationManagerLocal; @@ -55,7 +57,7 @@ import org.rhq.enterprise.server.util.CriteriaQueryRunner; * @author Greg Hinkle */ @Stateless -public class TagManagerBean implements TagManagerLocal { +public class TagManagerBean implements TagManagerLocal, TagManagerRemote {
private final Log log = LogFactory.getLog(TagManagerBean.class);
@@ -202,4 +204,16 @@ public class TagManagerBean implements TagManagerLocal { tag.addBundleDeployment(bundleDeployment); } } + + public PageList<TagReportComposite> findTagReportCompositesByCriteria(Subject subject, TagCriteria tagCriteria) { + // TODO criteria stuff + + Query query = entityManager.createNamedQuery(Tag.QUERY_TAG_COMPOSITE_REPORT); + + PageList<TagReportComposite> result = new PageList<TagReportComposite>(); + + result.addAll(query.getResultList()); + + return result; + } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerRemote.java index 9dcbd74..98bcc63 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerRemote.java @@ -30,6 +30,7 @@ import javax.ejb.Remote; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.criteria.TagCriteria; import org.rhq.core.domain.tagging.Tag; +import org.rhq.core.domain.tagging.compsite.TagReportComposite; import org.rhq.core.domain.util.PageList;
/** @@ -56,6 +57,6 @@ public interface TagManagerRemote {
void updateBundleDeploymentTags(Subject subject, int bundleDeploymentId, Set<Tag> tags);
- + PageList<TagReportComposite> findTagReportCompositesByCriteria(Subject subject, TagCriteria tagCriteria);
}
commit c36b43bf479f0473851a025e84a0d2980dc10d41 Merge: 24240f0... 7d51784... Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 12 14:48:39 2010 -0400
Merge branch 'bundle-jay' into bundle
commit 24240f0d292222ee9ef64bdaf5a0ae81c9617c75 Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 12 14:48:32 2010 -0400
LT commit
diff --git a/modules/core/util/src/test/resources/ini-editor-test.ini b/modules/core/util/src/test/resources/ini-editor-test.ini index c5eeef2..7a6d5f0 100644 --- a/modules/core/util/src/test/resources/ini-editor-test.ini +++ b/modules/core/util/src/test/resources/ini-editor-test.ini @@ -1,36 +1,36 @@ -[main] - # Where Puppet stores dynamic and growing data. - # The default value is '/var/puppet'. - vardir = /var/lib/puppet - - # The Puppet log directory. - # The default value is '$vardir/log'. - logdir = /var/log/puppet - - # Where Puppet PID files are kept. - # The default value is '$vardir/run'. - rundir = /var/run/puppet - - # Where SSL certificates are kept. - # The default value is '$confdir/ssl'. - ssldir = $vardir/ssl - -[puppetd] - # The file in which puppetd stores a list of the classes - # associated with the retrieved configuratiion. Can be loaded in - # the separate ``puppet`` executable using the ``--loadclasses`` - # option. - # The default value is '$confdir/classes.txt'. - classfile = $vardir/classes.txt - - # Where puppetd caches the local configuration. An - # extension indicating the cache format is added automatically. - # The default value is '$confdir/localconfig'. - localconfig = $vardir/localconfig - -[puppetca] -autosign = false - -[puppetmasterd] -ca = true -certname = mycertname +[main] + # Where Puppet stores dynamic and growing data. + # The default value is '/var/puppet'. + vardir = /var/lib/puppet + + # The Puppet log directory. + # The default value is '$vardir/log'. + logdir = /var/log/puppet + + # Where Puppet PID files are kept. + # The default value is '$vardir/run'. + rundir = /var/run/puppet + + # Where SSL certificates are kept. + # The default value is '$confdir/ssl'. + ssldir = $vardir/ssl + +[puppetd] + # The file in which puppetd stores a list of the classes + # associated with the retrieved configuratiion. Can be loaded in + # the separate ``puppet`` executable using the ``--loadclasses`` + # option. + # The default value is '$confdir/classes.txt'. + classfile = $vardir/classes.txt + + # Where puppetd caches the local configuration. An + # extension indicating the cache format is added automatically. + # The default value is '$confdir/localconfig'. + localconfig = $vardir/localconfig + +[puppetca] +autosign = false + +[puppetmasterd] +ca = true +certname = mycertname
commit 7d517848b2461174ac0298af3a30d8f17b9114b0 Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 12 14:47:45 2010 -0400
Changes to resolve incompatibilities - !! JUST TO GET SUCCESSFUL COMPILE !! -
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java index e09cc25..585b963 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java @@ -49,7 +49,7 @@ public class BundleDeploymentDataSource extends RPCDataSource<BundleDeployment>
public BundleDeploymentDataSource() {
- DataSourceIntegerField id = new DataSourceIntegerField("id","ID"); + DataSourceIntegerField id = new DataSourceIntegerField("id", "ID"); id.setPrimaryKey(true); addField(id);
@@ -65,14 +65,12 @@ public class BundleDeploymentDataSource extends RPCDataSource<BundleDeployment> DataSourceTextField bundleVersion = new DataSourceTextField("bundleVersion", "Bundle Version"); addField(bundleVersion);
- }
@Override protected void executeFetch(final DSRequest request, final DSResponse response) { BundleDeploymentCriteria criteria = new BundleDeploymentCriteria();
- if (request.getCriteria().getValues().containsKey("bundleId")) { criteria.addFilterBundleId(Integer.parseInt(request.getCriteria().getAttribute("bundleId"))); } @@ -83,7 +81,7 @@ public class BundleDeploymentDataSource extends RPCDataSource<BundleDeployment>
bundleService.findBundleDeploymentsByCriteria(criteria, new AsyncCallback<PageList<BundleDeployment>>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load bundle deployments",caught); + CoreGUI.getErrorHandler().handleError("Failed to load bundle deployments", caught); }
public void onSuccess(PageList<BundleDeployment> result) { @@ -92,12 +90,11 @@ public class BundleDeploymentDataSource extends RPCDataSource<BundleDeployment> } });
- }
@Override public BundleDeployment copyValues(ListGridRecord from) { - return null; // TODO: Implement this method. + return null; // TODO: Implement this method. }
@Override @@ -107,18 +104,16 @@ public class BundleDeploymentDataSource extends RPCDataSource<BundleDeployment>
record.setAttribute("id", from.getId()); record.setAttribute("name", from.getName()); - record.setAttribute("installDir", from.getInstallDir()); + record.setAttribute("deployDir", from.getDestination().getDeployDir()); record.setAttribute("description", from.getDescription()); record.setAttribute("createdTime", new Date(from.getCtime())); record.setAttribute("configuration", from.getConfiguration());
- if (from.getBundleVersion() != null) { record.setAttribute("bundleVersionVersion", from.getBundleVersion().getVersion()); record.setAttribute("bundleVersionId", from.getBundleVersion().getId()); }
- return record; } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java index 5ad6359..aa3392b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java @@ -78,11 +78,8 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { this.version = bundleDeployment.getBundleVersion(); this.bundle = bundleDeployment.getBundleVersion().getBundle();
- - - addMember(new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/BundleDeployment_24.png") + ""/> " + deployment.getName())); - - + addMember(new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/BundleDeployment_24.png") + + ""/> " + deployment.getName()));
DynamicForm form = new DynamicForm(); form.setNumCols(4); @@ -92,45 +89,40 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { bundleName.setTarget("#Bundles/Bundle/" + bundle.getId()); bundleName.setValue(bundle.getName());
- - CanvasItem tagItem = new CanvasItem("tag"); tagItem.setShowTitle(false); TagEditorView tagEditor = new TagEditorView(version.getTags(), false, new TagsChangedCallback() { public void tagsChanged(HashSet<Tag> tags) { - GWTServiceLookup.getTagService().updateBundleDeploymentTags(deployment.getId(), tags, new AsyncCallback<Void>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to update bundle deployment's tags", caught); - } + GWTServiceLookup.getTagService().updateBundleDeploymentTags(deployment.getId(), tags, + new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to update bundle deployment's tags", caught); + }
- public void onSuccess(Void result) { - CoreGUI.getMessageCenter().notify(new Message("Bundle Deployment Tags updated", Message.Severity.Info)); - } - }); + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify( + new Message("Bundle Deployment Tags updated", Message.Severity.Info)); + } + }); } }); tagItem.setCanvas(tagEditor); tagItem.setRowSpan(4);
- - StaticTextItem deployed = new StaticTextItem("deployed","Deployed"); + StaticTextItem deployed = new StaticTextItem("deployed", "Deployed"); deployed.setValue(new Date(deployment.getCtime()));
- LinkItem destinationGroup = new LinkItem("group"); - destinationGroup.setTarget("#ResourceGroup/" + deployment.getGroupDeployments().get(0).getGroup().getId()); + destinationGroup.setTarget("#ResourceGroup/" + deployment.getDestination().getGroup().getId()); destinationGroup.setValue("Group");
- - StaticTextItem path = new StaticTextItem("path","Path"); - path.setValue(deployment.getInstallDir()); - + StaticTextItem path = new StaticTextItem("path", "Path"); + path.setValue(deployment.getDestination().getDeployDir());
form.setFields(bundleName, tagItem, deployed, destinationGroup, path);
addMember(form);
- Table deployments = createDeploymentsTable(); deployments.setHeight100(); deployments.setShowResizeBar(true); @@ -155,46 +147,42 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { for (BundleResourceDeployment rd : deployment.getResourceDeployments()) { ListGridRecord record = new ListGridRecord(); record.setAttribute("resource", rd.getResource().getName()); - record.setAttribute("status",rd.getStatus().name()); - record.setAttribute("id",rd.getId()); - record.setAttribute("entity",rd); + record.setAttribute("status", rd.getStatus().name()); + record.setAttribute("id", rd.getId()); + record.setAttribute("entity", rd); records.add(record); }
table.getListGrid().setData(records.toArray(new ListGridRecord[records.size()]));
- table.getListGrid().addSelectionChangedHandler(new SelectionChangedHandler() { public void onSelectionChanged(SelectionEvent selectionEvent) { if (selectionEvent.getState()) {
- - BundleResourceDeployment bundleResourceDeployment = - (BundleResourceDeployment) selectionEvent.getRecord().getAttributeAsObject("entity"); - BundleResourceDeploymentHistoryListView detailView = - new BundleResourceDeploymentHistoryListView(bundleResourceDeployment); + BundleResourceDeployment bundleResourceDeployment = (BundleResourceDeployment) selectionEvent + .getRecord().getAttributeAsObject("entity"); + BundleResourceDeploymentHistoryListView detailView = new BundleResourceDeploymentHistoryListView( + bundleResourceDeployment);
detail.addChild(detailView); detail.animateShow(AnimationEffect.SLIDE);
+ /* + BundleResourceDeploymentCriteria criteria = new BundleResourceDeploymentCriteria(); + criteria.addFilterId(selectionEvent.getRecord().getAttributeAsInt("id")); + criteria.fetchHistories(true); + criteria.fetchResource(true); + criteria.fetchBundleDeployment(true); + bundleService.findBundleResourceDeploymentsByCriteria(criteria, new AsyncCallback<PageList<BundleResourceDeployment>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load resource deployment history details",caught); + }
-/* - BundleResourceDeploymentCriteria criteria = new BundleResourceDeploymentCriteria(); - criteria.addFilterId(selectionEvent.getRecord().getAttributeAsInt("id")); - criteria.fetchHistories(true); - criteria.fetchResource(true); - criteria.fetchBundleDeployment(true); - bundleService.findBundleResourceDeploymentsByCriteria(criteria, new AsyncCallback<PageList<BundleResourceDeployment>>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load resource deployment history details",caught); - } - - public void onSuccess(PageList<BundleResourceDeployment> result) { - - } - }); -*/ + public void onSuccess(PageList<BundleResourceDeployment> result) {
+ } + }); + */
} else { detail.animateHide(AnimationEffect.SLIDE); @@ -205,71 +193,64 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { return table; }
- - public void renderView(final ViewPath viewPath) { int bundleDeploymentId = Integer.parseInt(viewPath.getCurrent().getPath());
- BundleDeploymentCriteria criteria = new BundleDeploymentCriteria(); criteria.addFilterId(bundleDeploymentId); criteria.fetchBundleVersion(true); criteria.fetchConfiguration(true); criteria.fetchResourceDeployments(true); - criteria.fetchGroupDeployments(true); criteria.fetchTags(true);
bundleService = GWTServiceLookup.getBundleService(); - bundleService.findBundleDeploymentsByCriteria(criteria, - new AsyncCallback<PageList<BundleDeployment>>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load budle version", caught); - } - - public void onSuccess(PageList<BundleDeployment> result) { - - final BundleDeployment deployment = result.get(0); + bundleService.findBundleDeploymentsByCriteria(criteria, new AsyncCallback<PageList<BundleDeployment>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load budle version", caught); + }
- BundleCriteria bundleCriteria = new BundleCriteria(); - bundleCriteria.addFilterId(deployment.getBundleVersion().getBundle().getId()); - bundleService.findBundlesByCriteria(bundleCriteria, new AsyncCallback<PageList<Bundle>>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to find bundle",caught); - } + public void onSuccess(PageList<BundleDeployment> result) {
- public void onSuccess(PageList<Bundle> result) { + final BundleDeployment deployment = result.get(0);
- deployment.getBundleVersion().setBundle(result.get(0)); + BundleCriteria bundleCriteria = new BundleCriteria(); + bundleCriteria.addFilterId(deployment.getBundleVersion().getBundle().getId()); + bundleService.findBundlesByCriteria(bundleCriteria, new AsyncCallback<PageList<Bundle>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to find bundle", caught); + }
+ public void onSuccess(PageList<Bundle> result) {
- BundleResourceDeploymentCriteria criteria = new BundleResourceDeploymentCriteria(); - criteria.addFilterBundleDeploymentId(deployment.getId()); - criteria.fetchHistories(true); - criteria.fetchResource(true); - criteria.fetchBundleDeployment(true); - bundleService.findBundleResourceDeploymentsByCriteria(criteria, new AsyncCallback<PageList<BundleResourceDeployment>>() { + deployment.getBundleVersion().setBundle(result.get(0));
- public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load deployment detail",caught); - } + BundleResourceDeploymentCriteria criteria = new BundleResourceDeploymentCriteria(); + criteria.addFilterBundleDeploymentId(deployment.getId()); + criteria.fetchHistories(true); + criteria.fetchResource(true); + criteria.fetchBundleDeployment(true); + bundleService.findBundleResourceDeploymentsByCriteria(criteria, + new AsyncCallback<PageList<BundleResourceDeployment>>() {
- public void onSuccess(PageList<BundleResourceDeployment> result) { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load deployment detail", caught); + }
- deployment.setResourceDeployments(result); + public void onSuccess(PageList<BundleResourceDeployment> result) {
- viewBundleDeployment(deployment, viewPath.getCurrent()); + deployment.setResourceDeployments(result);
- } - }); + viewBundleDeployment(deployment, viewPath.getCurrent());
- } - }); + } + });
} });
+ } + });
}
- } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java index 1bc11ea..c8679e4 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java @@ -37,7 +37,6 @@ import org.rhq.core.domain.bundle.BundleResourceDeploymentHistory; */ public class BundleResourceDeploymentHistoryListView extends VLayout {
- private BundleResourceDeployment resourceDeployment;
public BundleResourceDeploymentHistoryListView(BundleResourceDeployment resourceDeployment) { @@ -51,7 +50,6 @@ public class BundleResourceDeploymentHistoryListView extends VLayout { protected void onInit() { super.onInit();
- ListGrid grid = new ListGrid(); grid.setWidth100(); grid.setHeight100(); @@ -60,18 +58,14 @@ public class BundleResourceDeploymentHistoryListView extends VLayout { ListGridField message = new ListGridField("message", "Message"); ListGridField status = new ListGridField("status", "status");
- grid.setFields(action, message, status);
grid.setData(buildRecords());
addMember(grid);
- }
- - public ListGridRecord[] buildRecords() { ArrayList<ListGridRecord> records = new ArrayList<ListGridRecord>();
@@ -80,11 +74,17 @@ public class BundleResourceDeploymentHistoryListView extends VLayout { ListGridRecord record = new ListGridRecord(); record.setAttribute("id", step.getId());
- record.setAttribute("action", step.getAuditAction()); + record.setAttribute("action", step.getAction()); + + record.setAttribute("info", step.getInfo()); + + record.setAttribute("category", step.getCategory().toString()); + + record.setAttribute("message", step.getMessage());
- record.setAttribute("message",step.getAuditMessage()); + record.setAttribute("attachment", step.getAttachment());
- record.setAttribute("status", step.getAuditStatus().name()); + record.setAttribute("status", step.getStatus().name());
records.add(record); }
commit 721b4963d25f6bd83f56f71d4a985121ce333c6c Merge: 66ff32b... 28c15b1... Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 12 14:39:14 2010 -0400
Merge branch 'gwt' into bundle-jay
Conflicts: modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java
diff --cc modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java index 510eca2,759ea64..6a0011e --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java @@@ -36,13 -35,11 +36,15 @@@ public class BundleDeploymentCriteria e private static final long serialVersionUID = 1L;
private Integer filterId; + private Boolean filterIsLive; private String filterName; private String filterDescription; + private Integer filterBundleId; // needs override - private Integer filterBundleVersionId; // needs override - ++ private Integer filterBundleVersionId; // needs override + private Integer filterDestinationId; // needs override + private String filterDestinationName; // needs override + private BundleDeploymentStatus filterStatus; + private String filterSubjectName;
private boolean fetchBundleVersion; private boolean fetchConfiguration; @@@ -51,8 -47,11 +53,10 @@@ - private boolean fetchGroupDeployments; private boolean fetchTags;
public BundleDeploymentCriteria() { - + filterOverrides.put("bundleId", "bundleVersion.bundle.id = ?"); + filterOverrides.put("bundleVersionId", "bundleVersion.id = ?"); - + filterOverrides.put("destinationId", "destination.id = ?"); + filterOverrides.put("destinationName", "destination.name like ?"); }
@Override @@@ -92,6 -71,16 +96,14 @@@ this.filterDescription = filterDescription; }
- + public void addFilterBundleId(Integer filterBundleId) { + this.filterBundleId = filterBundleId; + } + + public void addFilterBundleVersionId(Integer filterBundleVersionId) { + this.filterBundleVersionId = filterBundleVersionId; + } + - public void fetchBundleVersion(boolean fetchBundleVersion) { this.fetchBundleVersion = fetchBundleVersion; } diff --cc modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java index ee579ed,cced341..612e631 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java @@@ -50,6 -51,15 +52,12 @@@ import org.rhq.core.domain.resource.gro * @author Greg Hinkle */ @Entity -@NamedQueries( { - @NamedQuery(name = Tag.QUERY_TAG_COMPOSITE_REPORT, - query = "SELECT t.id, t.namespace, t.semantic, t.name,\n" + - " (count(r) + count(g) + count(b) + count(bv) + count(bd)) AS Total,\n" + - " count(r) AS Resources, count(g) AS ResourceGroups, count(b) AS Bundles, count(bv) AS BundleVersions, count(bd) AS BundleDeployments\n" + - "FROM Tag t LEFT JOIN t.resources r LEFT JOIN t.resourceGroups g LEFT JOIN t.bundles b LEFT JOIN t.bundleVersions bv LEFT JOIN t.bundleDeployments bd\n" + - "GROUP BY t.id, t.namespace, t.semantic, t.name\n" + - "ORDER BY (count(r) + count(g) + count(b) + count(bv) + count(bd)) desc") -}) ++@NamedQueries( { @NamedQuery(name = Tag.QUERY_TAG_COMPOSITE_REPORT, query = "SELECT t.id, t.namespace, t.semantic, t.name,\n" ++ + " (count(r) + count(g) + count(b) + count(bv) + count(bd)) AS Total,\n" ++ + " count(r) AS Resources, count(g) AS ResourceGroups, count(b) AS Bundles, count(bv) AS BundleVersions, count(bd) AS BundleDeployments\n" ++ + "FROM Tag t LEFT JOIN t.resources r LEFT JOIN t.resourceGroups g LEFT JOIN t.bundles b LEFT JOIN t.bundleVersions bv LEFT JOIN t.bundleDeployments bd\n" ++ + "GROUP BY t.id, t.namespace, t.semantic, t.name\n" ++ + "ORDER BY (count(r) + count(g) + count(b) + count(bv) + count(bd)) desc") }) @SequenceGenerator(name = "RHQ_TAGGING_SEQ", sequenceName = "RHQ_TAGGING_ID_SEQ", allocationSize = 10) @Table(name = "RHQ_TAGGING") @XmlAccessorType(XmlAccessType.FIELD) @@@ -91,11 -103,7 +101,11 @@@ public class Tag implements Serializabl @ManyToMany private Set<BundleDeployment> bundleDeployments;
+ @JoinTable(name = "RHQ_TAGGING_BUNDLE_DEST_MAP", joinColumns = { @JoinColumn(name = "TAG_ID") }, inverseJoinColumns = { @JoinColumn(name = "BUNDLE_DESTINATION_ID") }) + @ManyToMany + private Set<BundleDestination> bundleDestinations; + - protected Tag() { + public Tag() { }
public Tag(String namespace, String semantic, String name) { diff --cc modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java index acf8058,dcfa08b..2cbd570 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java @@@ -23,8 -23,11 +23,9 @@@ import java.util.HashMap
import com.google.gwt.user.client.rpc.RemoteService;
-import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; -import org.rhq.core.domain.bundle.BundleGroupDeployment; + import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleType; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.bundle.composite.BundleWithLatestVersionComposite; @@@ -60,5 -65,15 +63,9 @@@ public interface BundleGWTService exten
ArrayList<BundleType> getAllBundleTypes() throws Exception;
- /* - BundleResourceDeployment scheduleBundleResourceDeployment(int bundleDeploymentId, int resourceId) - throws Exception; - */ - - BundleGroupDeployment scheduleBundleGroupDeployment(int bundleDeploymentId, int resourceGroupId) throws Exception; + BundleDeployment scheduleBundleDeployment(int bundleDeploymentId) throws Exception; + + PageList<BundleDeployment> findBundleDeploymentsByCriteria(BundleDeploymentCriteria criteria); + + PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria(BundleResourceDeploymentCriteria criteria); - } diff --cc modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java index 2c14167,2072a56..fc870ba --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java @@@ -23,6 -23,8 +23,7 @@@ import java.util.HashMap
import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; -import org.rhq.core.domain.bundle.BundleGroupDeployment; + import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleType; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.bundle.composite.BundleWithLatestVersionComposite; @@@ -158,4 -177,15 +161,16 @@@ public class BundleGWTServiceImpl exten throw new RuntimeException(ThrowableUtil.getAllMessages(e)); } } + + public PageList<BundleDeployment> findBundleDeploymentsByCriteria(BundleDeploymentCriteria criteria) { + return SerialUtility.prepare(bundleManager.findBundleDeploymentsByCriteria(getSessionSubject(), criteria), - "BundleService.findBundleDeploymentsByCriteria"); ++ "BundleService.findBundleDeploymentsByCriteria"); + } + - public PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria(BundleResourceDeploymentCriteria criteria) { - return SerialUtility.prepare(bundleManager.findBundleResourceDeploymentsByCriteria(getSessionSubject(), criteria), - "BundleService.findBundleResourceDeploymentsByCriteria"); ++ public PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria( ++ BundleResourceDeploymentCriteria criteria) { ++ return SerialUtility.prepare(bundleManager.findBundleResourceDeploymentsByCriteria(getSessionSubject(), ++ criteria), "BundleService.findBundleResourceDeploymentsByCriteria"); + + } }
commit 66ff32b494f04498094fea3aa813febdd8d36db7 Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 12 14:18:39 2010 -0400
LT commit
diff --git a/modules/core/util/src/test/resources/ini-editor-test.ini b/modules/core/util/src/test/resources/ini-editor-test.ini index c5eeef2..7a6d5f0 100644 --- a/modules/core/util/src/test/resources/ini-editor-test.ini +++ b/modules/core/util/src/test/resources/ini-editor-test.ini @@ -1,36 +1,36 @@ -[main] - # Where Puppet stores dynamic and growing data. - # The default value is '/var/puppet'. - vardir = /var/lib/puppet - - # The Puppet log directory. - # The default value is '$vardir/log'. - logdir = /var/log/puppet - - # Where Puppet PID files are kept. - # The default value is '$vardir/run'. - rundir = /var/run/puppet - - # Where SSL certificates are kept. - # The default value is '$confdir/ssl'. - ssldir = $vardir/ssl - -[puppetd] - # The file in which puppetd stores a list of the classes - # associated with the retrieved configuratiion. Can be loaded in - # the separate ``puppet`` executable using the ``--loadclasses`` - # option. - # The default value is '$confdir/classes.txt'. - classfile = $vardir/classes.txt - - # Where puppetd caches the local configuration. An - # extension indicating the cache format is added automatically. - # The default value is '$confdir/localconfig'. - localconfig = $vardir/localconfig - -[puppetca] -autosign = false - -[puppetmasterd] -ca = true -certname = mycertname +[main] + # Where Puppet stores dynamic and growing data. + # The default value is '/var/puppet'. + vardir = /var/lib/puppet + + # The Puppet log directory. + # The default value is '$vardir/log'. + logdir = /var/log/puppet + + # Where Puppet PID files are kept. + # The default value is '$vardir/run'. + rundir = /var/run/puppet + + # Where SSL certificates are kept. + # The default value is '$confdir/ssl'. + ssldir = $vardir/ssl + +[puppetd] + # The file in which puppetd stores a list of the classes + # associated with the retrieved configuratiion. Can be loaded in + # the separate ``puppet`` executable using the ``--loadclasses`` + # option. + # The default value is '$confdir/classes.txt'. + classfile = $vardir/classes.txt + + # Where puppetd caches the local configuration. An + # extension indicating the cache format is added automatically. + # The default value is '$confdir/localconfig'. + localconfig = $vardir/localconfig + +[puppetca] +autosign = false + +[puppetmasterd] +ca = true +certname = mycertname
commit 9f97694b7079b77e3db520529328237704f70a3c Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 12 14:14:18 2010 -0400
DB Upgrade Work -- integrate latest provisiong data model changes
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml index 8e4e4a0..f2aefe3 100644 --- a/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml +++ b/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml @@ -549,8 +549,9 @@
<!-- This index is for constraint, not performance --> <index name="RHQ_BUNDLE_DESTINATION_UNIQUE" unique="true"> - <field ref="BUNDLE_ID"/> - <field ref="NAME"/> + <field ref="BUNDLE_ID"/> + <field ref="GROUP_ID"/> + <field ref="DEPLOY_DIR"/> </index> </table>
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index ff5ae35..386723d 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -2487,20 +2487,20 @@ CREATE TABLE RHQ_BUNDLE_DESTINATION ( ID INTEGER PRIMARY KEY ) </statement> </schema-directSQL> - <schema-alterColumn table="RHQ_BUNDLE_DEPLOY" column="ID" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_DEPLOY" column="NAME" columnType="VARCHAR2" precision="200" /> - <schema-alterColumn table="RHQ_BUNDLE_DEPLOY" column="NAME" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_DEPLOY" column="DESCRIPTION" columnType="VARCHAR2" precision="500" /> - <schema-addColumn table="RHQ_BUNDLE_DEPLOY" column="CTIME" columnType="LONG" /> - <schema-alterColumn table="RHQ_BUNDLE_DEPLOY" column="CTIME" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_DEPLOY" column="MTIME" columnType="LONG" /> - <schema-alterColumn table="RHQ_BUNDLE_DEPLOY" column="MTIME" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_DEPLOY" column="BUNDLE_ID" columnType="INTEGER" /> - <schema-alterColumn table="RHQ_BUNDLE_DEPLOY" column="BUNDLE_ID" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_DEPLOY" column="GROUP_ID" columnType="INTEGER" /> - <schema-alterColumn table="RHQ_BUNDLE_DEPLOY" column="GROUP_ID" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_DEPLOY" column="DEPLOY_DIR" columnType="VARCHAR2" precision="256" /> - <schema-alterColumn table="RHQ_BUNDLE_DEPLOY" column="DEPLOY_DIR" nullable="FALSE" /> + <schema-alterColumn table="RHQ_BUNDLE_DESTINATION" column="ID" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_DESTINATION" column="NAME" columnType="VARCHAR2" precision="200" /> + <schema-alterColumn table="RHQ_BUNDLE_DESTINATION" column="NAME" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_DESTINATION" column="DESCRIPTION" columnType="VARCHAR2" precision="500" /> + <schema-addColumn table="RHQ_BUNDLE_DESTINATION" column="CTIME" columnType="LONG" /> + <schema-alterColumn table="RHQ_BUNDLE_DESTINATION" column="CTIME" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_DESTINATION" column="MTIME" columnType="LONG" /> + <schema-alterColumn table="RHQ_BUNDLE_DESTINATION" column="MTIME" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_DESTINATION" column="BUNDLE_ID" columnType="INTEGER" /> + <schema-alterColumn table="RHQ_BUNDLE_DESTINATION" column="BUNDLE_ID" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_DESTINATION" column="GROUP_ID" columnType="INTEGER" /> + <schema-alterColumn table="RHQ_BUNDLE_DESTINATION" column="GROUP_ID" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_DESTINATION" column="DEPLOY_DIR" columnType="VARCHAR2" precision="256" /> + <schema-alterColumn table="RHQ_BUNDLE_DESTINATION" column="DEPLOY_DIR" nullable="FALSE" />
<schema-directSQL> <statement desc="Creating RHQ_BUNDLE_DESTINATION foreign key relation to RHQ_BUNDLE"> @@ -2515,9 +2515,9 @@ FOREIGN KEY (GROUP_ID) REFERENCES RHQ_RESOURCE_GROUP (ID) </statement> - <statement desc="Creating RHQ_BUNDLE_DEPLOY unique constraint"> + <statement desc="Creating RHQ_BUNDLE_DESTINATION unique constraint"> CREATE UNIQUE INDEX RHQ_BUNDLE_DESTINATION_UNIQUE - ON RHQ_BUNDLE_DEPLOY (bundle_id, name) + ON RHQ_BUNDLE_DESTINATION (bundle_id, group_id, deploy_dir) </statement> </schema-directSQL>
@@ -2876,7 +2876,7 @@
<schema-directSQL> <statement> - CREATE TABLE RHQ_TAGGING_BUNDLE_DEPLOY_MAP ( BUNDLE_DEPLOY_ID INTEGER ) + CREATE TABLE RHQ_TAGGING_BUNDLE_DEPLOY_MAP ( BUNDLE_DEPLOYMENT_ID INTEGER ) </statement> </schema-directSQL> <schema-alterColumn table="RHQ_TAGGING_BUNDLE_DEPLOY_MAP" column="BUNDLE_DEPLOYMENT_ID" nullable="false" /> @@ -2924,7 +2924,7 @@ </statement> <statement> ALTER TABLE RHQ_TAGGING_BUNDLE_DEST_MAP - ADD CONSTRAINT RHQ_TBDM_TAG_ID_FK + ADD CONSTRAINT RHQ_TBDESTM_TAG_ID_FK FOREIGN KEY ( TAG_ID ) REFERENCES RHQ_TAGGING ( ID ) </statement> diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java index fb217a6..aac2093 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java @@ -223,7 +223,8 @@ public class BundleDestination implements Serializable {
@Override public String toString() { - return "BundleDeployment[id=" + id + ", bundle=" + bundle.getName() + ", name=" + name + "]"; + return "BundleDeployment[id=" + id + ", bundle=" + bundle.getName() + ", group=" + group.getName() + ", name=" + + name + "]"; }
@Override @@ -231,7 +232,8 @@ public class BundleDestination implements Serializable { final int prime = 31; int result = 1; result = prime * result + ((bundle == null) ? 0 : bundle.hashCode()); - result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + ((group == null) ? 0 : group.hashCode()); + result = prime * result + ((deployDir == null) ? 0 : deployDir.hashCode()); return result; }
@@ -254,11 +256,19 @@ public class BundleDestination implements Serializable { return false; }
- if (this.name == null) { - if (other.name != null) { + if (this.group == null) { + if (other.group != null) { return false; } - } else if (!this.name.equals(other.name)) { + } else if (!this.group.equals(other.group)) { + return false; + } + + if (this.deployDir == null) { + if (other.deployDir != null) { + return false; + } + } else if (!this.deployDir.equalsIgnoreCase(other.deployDir)) { return false; }
commit 28c15b148402271dd7ff7cd001c8138fda899d21 Author: Greg Hinkle ghinkle@redhat.com Date: Wed May 12 13:43:11 2010 -0400
A new back button for in view pane navigation
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 new file mode 100644 index 0000000..a53e8e0 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/buttons/BackButton.java @@ -0,0 +1,57 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.components.buttons; + +import com.google.gwt.user.client.History; +import com.smartgwt.client.widgets.IButton; +import com.smartgwt.client.widgets.StretchImgButton; +import com.smartgwt.client.widgets.events.ClickEvent; +import com.smartgwt.client.widgets.events.ClickHandler; + +/** + * @author Greg Hinkle + */ +public class BackButton extends StretchImgButton { + + + public BackButton() { + setSrc("buttons/back/back.png"); + } + + public BackButton(String title, final String anchor) { + this(); + setTitle("<b>" + title + "</b>"); + addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + History.newItem(anchor); + } + }); + setAutoFit(true); + setHeight(22); + setWrap(false); + setShowDown(false); + + setCapSize(20); + setStyleName("backLink"); + } +} diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Over_end.png b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Over_end.png new file mode 100644 index 0000000..1c0074a Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Over_end.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Over_start.png b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Over_start.png new file mode 100644 index 0000000..ac1c6f0 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Over_start.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Over_stretch.png b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Over_stretch.png new file mode 100644 index 0000000..7f96ab4 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_Over_stretch.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_end.png b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_end.png new file mode 100644 index 0000000..9fc5d42 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_end.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_start.png b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_start.png new file mode 100644 index 0000000..fb883ee Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_start.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_stretch.png b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_stretch.png new file mode 100644 index 0000000..b9a0672 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/back/back_stretch.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_Over_end.png b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_Over_end.png new file mode 100644 index 0000000..ca2d063 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_Over_end.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_Over_start.png b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_Over_start.png new file mode 100644 index 0000000..0e63bdb Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_Over_start.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_Over_stretch.png b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_Over_stretch.png new file mode 100644 index 0000000..1014225 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_Over_stretch.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_end.png b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_end.png new file mode 100644 index 0000000..414a717 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_end.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_start.png b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_start.png new file mode 100644 index 0000000..ffac9c9 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_start.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_stretch.png b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_stretch.png new file mode 100644 index 0000000..3039034 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/buttons/backTwo/back_stretch.png differ
commit c4be6984e52ebccdd686734832c1feaef21c93e5 Author: Greg Hinkle ghinkle@redhat.com Date: Wed May 12 13:42:23 2010 -0400
Added lookup by tag for tagged entities breadcrumb and bundle version view tweaks
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleCriteria.java index d6fd9a7..48fdf02 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleCriteria.java @@ -31,7 +31,7 @@ import org.rhq.core.domain.util.PageOrdering; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) @SuppressWarnings("unused") -public class BundleCriteria extends Criteria { +public class BundleCriteria extends TaggedCriteria { private static final long serialVersionUID = 1L;
private Integer filterId; diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java index 912eab7..759ea64 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java @@ -31,7 +31,7 @@ import org.rhq.core.domain.bundle.BundleDeployment; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) @SuppressWarnings("unused") -public class BundleDeploymentCriteria extends Criteria { +public class BundleDeploymentCriteria extends TaggedCriteria { private static final long serialVersionUID = 1L;
private Integer filterId; diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleVersionCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleVersionCriteria.java index d9ccb8e..ce073a1 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleVersionCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleVersionCriteria.java @@ -31,7 +31,7 @@ import org.rhq.core.domain.bundle.BundleVersion; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) @SuppressWarnings("unused") -public class BundleVersionCriteria extends Criteria { +public class BundleVersionCriteria extends TaggedCriteria { private static final long serialVersionUID = 1L;
private Integer filterId; diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java index d27a7e5..8f65e55 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java @@ -41,7 +41,7 @@ import java.util.List; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) @SuppressWarnings("unused") -public class ResourceCriteria extends Criteria { +public class ResourceCriteria extends TaggedCriteria { private static final long serialVersionUID = 1L;
private Integer filterId; diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java index 62a56bf..c7047b2 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java @@ -38,7 +38,7 @@ import org.rhq.core.domain.util.PageOrdering; */ @XmlAccessorType(XmlAccessType.FIELD) @SuppressWarnings("unused") -public class ResourceGroupCriteria extends Criteria { +public class ResourceGroupCriteria extends TaggedCriteria { private static final long serialVersionUID = 1L;
private Integer filterId; diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/TaggedCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/TaggedCriteria.java new file mode 100644 index 0000000..cc3c3fa --- /dev/null +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/TaggedCriteria.java @@ -0,0 +1,76 @@ +/* + * 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, 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.domain.criteria; + +import org.rhq.core.domain.tagging.Tag; + +/** + * @author Greg Hinkle + */ +public abstract class TaggedCriteria extends Criteria { + + private Tag filterTag; + + protected TaggedCriteria() { + + String entityName = getPersistentClass().getName(); + entityName = entityName.substring(entityName.lastIndexOf(".")+1); + + filterOverrides.put("tag", "id IN (SELECT taggedEntity.id FROM " + entityName + " taggedEntity JOIN taggedEntity.tags tag \n " + + " WHERE \n" + + " (tag.namespace LIKE :tagNamespace OR :tagNamespace IS NULL ) AND \n" + // first '?' will get ordinal 1 + " (tag.semantic LIKE :tagSemantic OR :tagSemantic IS NULL ) AND \n" + // second '?' will get ordinal 2 + " (tag.name LIKE :tagName OR :tagName IS NULL ) )"); // third '?' will get ordinal 3 + } + + public void addFilterTagNamespace(String filterTagNamespace) { + if (this.filterTag == null) { + this.filterTag = new Tag(); + } + this.filterTag.setNamespace(filterTagNamespace); + } + + public void addFilterTagSemantic(String filterTagSemantic) { + if (this.filterTag == null) { + this.filterTag = new Tag(); + } + this.filterTag.setSemantic(filterTagSemantic); + } + + public void addFilterTagName(String filterTagName) { + if (this.filterTag == null) { + this.filterTag = new Tag(); + } + this.filterTag.setName(filterTagName); + } + + public void addFilterTag(Tag tag) { + this.filterTag = tag; + } + + + public boolean isTagFiltered() { + return this.filterTag != null; + } + +} diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java b/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java index f30ab82..cced341 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java @@ -34,6 +34,8 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToMany; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.xml.bind.annotation.XmlAccessType; @@ -49,6 +51,15 @@ import org.rhq.core.domain.resource.group.ResourceGroup; * @author Greg Hinkle */ @Entity +@NamedQueries( { + @NamedQuery(name = Tag.QUERY_TAG_COMPOSITE_REPORT, + query = "SELECT t.id, t.namespace, t.semantic, t.name,\n" + + " (count(r) + count(g) + count(b) + count(bv) + count(bd)) AS Total,\n" + + " count(r) AS Resources, count(g) AS ResourceGroups, count(b) AS Bundles, count(bv) AS BundleVersions, count(bd) AS BundleDeployments\n" + + "FROM Tag t LEFT JOIN t.resources r LEFT JOIN t.resourceGroups g LEFT JOIN t.bundles b LEFT JOIN t.bundleVersions bv LEFT JOIN t.bundleDeployments bd\n" + + "GROUP BY t.id, t.namespace, t.semantic, t.name\n" + + "ORDER BY (count(r) + count(g) + count(b) + count(bv) + count(bd)) desc") +}) @SequenceGenerator(name = "RHQ_TAGGING_SEQ", sequenceName = "RHQ_TAGGING_ID_SEQ", allocationSize = 10) @Table(name = "RHQ_TAGGING") @XmlAccessorType(XmlAccessType.FIELD) @@ -56,6 +67,8 @@ public class Tag implements Serializable {
private static final long serialVersionUID = 1L;
+ public static final String QUERY_TAG_COMPOSITE_REPORT = "Tag.compositeReport"; + @Column(name = "ID", nullable = false) @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_TAGGING_SEQ") @Id @@ -90,7 +103,7 @@ public class Tag implements Serializable { @ManyToMany private Set<BundleDeployment> bundleDeployments;
- protected Tag() { + public Tag() { }
public Tag(String namespace, String semantic, String name) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java index e2907b5..77b1701 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java @@ -96,6 +96,7 @@ public class BundleTopView extends HLayout implements BookmarkableView { currentNextPath = null; setContent(new BundlesListView()); } else if (viewPath.getCurrent().getPath().equals("Bundle")) { + viewPath.getCurrent().getBreadcrumbs().clear(); if (!viewPath.getNext().equals(currentNextPath)) { currentNextPath = viewPath.getNext(); bundleView = new BundleView(); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java index d046b9d..5ad6359 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java @@ -88,6 +88,7 @@ public class BundleDeploymentView extends VLayout implements BookmarkableView { form.setNumCols(4);
LinkItem bundleName = new LinkItem("bundle"); + bundleName.setTitle("Bundle"); bundleName.setTarget("#Bundles/Bundle/" + bundle.getId()); bundleName.setValue(bundle.getName());
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java index 8925eca..bc7e2d7 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java @@ -43,7 +43,6 @@ import org.rhq.enterprise.gui.coregui.client.Breadcrumb; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewId; import org.rhq.enterprise.gui.coregui.client.ViewPath; -import org.rhq.enterprise.gui.coregui.client.bundle.deployment.BundleDeploymentView; import org.rhq.enterprise.gui.coregui.client.bundle.version.BundleVersionView; import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel; import org.rhq.enterprise.gui.coregui.client.components.table.Table; @@ -229,6 +228,7 @@ public class BundleView extends VLayout implements BookmarkableView {
public void onSuccess(PageList<Bundle> result) { Bundle bundle = result.get(0); + viewId.getBreadcrumbs().set(0,new Breadcrumb(String.valueOf(bundle.getId()), bundle.getName())); viewBundle(bundle, viewPath.getCurrent()); viewId.getBreadcrumbs().add(new Breadcrumb(String.valueOf(bundle.getId()), bundle.getName())); CoreGUI.refreshBreadCrumbTrail(); @@ -254,7 +254,7 @@ public class BundleView extends VLayout implements BookmarkableView { } else { // one version removeMembers(getMembers()); - BundleDeploymentView view = new BundleDeploymentView(); + BundleVersionView view = new BundleVersionView(); addMember(view); view.renderView(viewPath.next()); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java index ddc43c3..2212ee1 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java @@ -48,6 +48,7 @@ import org.rhq.enterprise.gui.coregui.client.ViewPath; import org.rhq.enterprise.gui.coregui.client.bundle.deployment.BundleDeploymentListView; import org.rhq.enterprise.gui.coregui.client.bundle.version.file.FileListView; import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel; +import org.rhq.enterprise.gui.coregui.client.components.buttons.BackButton; import org.rhq.enterprise.gui.coregui.client.components.tagging.TagEditorView; import org.rhq.enterprise.gui.coregui.client.components.tagging.TagsChangedCallback; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; @@ -79,6 +80,8 @@ public class BundleVersionView extends VLayout implements BookmarkableView { tabs.addTab(createUpdateHistoryTab());
+ addMember(new BackButton("Back to Bundle","#Bundles/mybundle")); + addMember(new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/BundleVersion_24.png") + ""/> " + version.getName())); addMember(tabs);
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css index 0efdaea..9c3255c 100644 --- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css +++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css @@ -45,6 +45,14 @@ a:hover { text-decoration: underline; }
+ +.backLink { + color: #4A5D75; + font-weight: bold; + text-decoration: none; +} + + .HeaderLabel { font-size: 14pt; font-weight: bold; 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 1a774b4..31c947a 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 @@ -41,9 +41,11 @@ import org.rhq.core.domain.criteria.Criteria; import org.rhq.core.domain.criteria.ResourceCriteria; import org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria; import org.rhq.core.domain.criteria.SubjectCriteria; +import org.rhq.core.domain.criteria.TaggedCriteria; import org.rhq.core.domain.operation.OperationRequestStatus; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.search.SearchSubsystem; +import org.rhq.core.domain.tagging.Tag; import org.rhq.core.domain.util.OrderingField; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageOrdering; @@ -53,7 +55,7 @@ import org.rhq.enterprise.server.search.execution.SearchTranslationManager;
/** * A query generator used to generate queries with specific filtering, prefetching, or sorting requirements. - * + * * @author Joseph Marques */ public final class CriteriaQueryGenerator { @@ -68,6 +70,7 @@ public final class CriteriaQueryGenerator { private Criteria criteria; private String searchExpressionWhereClause;
+ private String authorizationJoinFragment; private String authorizationPermsFragment; private String authorizationCustomConditionFragment; @@ -111,7 +114,7 @@ public final class CriteriaQueryGenerator { }
private String fixFilterOverride(String expression, String fieldName) { - boolean fuzzyMatch = expression.toLowerCase().indexOf(" like ") != -1; + boolean fuzzyMatch = expression.toLowerCase().contains(" like ") && !expression.toLowerCase().contains("select"); // Don't fuzzy match subselects boolean wantCaseInsensitiveMatch = !criteria.isCaseSensitive() && fuzzyMatch;
while (expression.indexOf('?') != -1) { @@ -150,31 +153,31 @@ public final class CriteriaQueryGenerator { this.authorizationSubjectId = subjectId; if (type == AuthorizationTokenType.RESOURCE) { if (fragment == null) { - this.authorizationJoinFragment = "" // - + "JOIN " + alias + ".implicitGroups authGroup " + NL // - + "JOIN authGroup.roles authRole " + NL // - + "JOIN authRole.subjects authSubject " + NL; + this.authorizationJoinFragment = "" // + + "JOIN " + alias + ".implicitGroups authGroup " + NL // + + "JOIN authGroup.roles authRole " + NL // + + "JOIN authRole.subjects authSubject " + NL; } else { this.authorizationJoinFragment = "" // - + "JOIN " + alias + "." + fragment + " authRes " + NL // - + "JOIN authRes.implicitGroups authGroup " + NL // - + "JOIN authGroup.roles authRole " + NL // - + "JOIN authRole.subjects authSubject " + NL; + + "JOIN " + alias + "." + fragment + " authRes " + NL // + + "JOIN authRes.implicitGroups authGroup " + NL // + + "JOIN authGroup.roles authRole " + NL // + + "JOIN authRole.subjects authSubject " + NL; } } else if (type == AuthorizationTokenType.GROUP) { if (fragment == null) { this.authorizationJoinFragment = "" // - + "JOIN " + alias + ".roles authRole " + NL // - + "JOIN authRole.subjects authSubject " + NL; + + "JOIN " + alias + ".roles authRole " + NL // + + "JOIN authRole.subjects authSubject " + NL; } else { this.authorizationJoinFragment = "" // - + "JOIN " + alias + "." + fragment + " authGroup " + NL // - + "JOIN authGroup.roles authRole " + NL // - + "JOIN authRole.subjects authSubject " + NL; + + "JOIN " + alias + "." + fragment + " authGroup " + NL // + + "JOIN authGroup.roles authRole " + NL // + + "JOIN authRole.subjects authSubject " + NL; } } else { throw new IllegalArgumentException(this.getClass().getSimpleName() - + " does not yet support generating queries for '" + type + "' token types"); + + " does not yet support generating queries for '" + type + "' token types"); }
// If the query results are narrowed by requiredParams generate the fragment now. It's done @@ -185,16 +188,17 @@ public final class CriteriaQueryGenerator { List<Permission> requiredPerms = this.criteria.getRequiredPermissions(); if (!(null == requiredPerms || requiredPerms.isEmpty())) { this.authorizationPermsFragment = "" // - + "AND ( SELECT COUNT(DISTINCT p)" + NL // - + " FROM Subject innerSubject" + NL // - + " JOIN innerSubject.roles r" + NL // - + " JOIN r.permissions p" + NL // - + " WHERE innerSubject.id = " + this.authorizationSubjectId + NL // - + " AND p IN ( :requiredPerms ) ) = :requiredPermsSize" + NL; + + "AND ( SELECT COUNT(DISTINCT p)" + NL // + + " FROM Subject innerSubject" + NL // + + " JOIN innerSubject.roles r" + NL // + + " JOIN r.permissions p" + NL // + + " WHERE innerSubject.id = " + this.authorizationSubjectId + NL // + + " AND p IN ( :requiredPerms ) ) = :requiredPermsSize" + NL; } }
// for testing purposes only, should use getQuery(EntityManager) or getCountQuery(EntityManager) instead + public String getQueryString(boolean countQuery) { StringBuilder results = new StringBuilder(); results.append("SELECT "); @@ -436,7 +440,7 @@ public final class CriteriaQueryGenerator { } } catch (Exception e) { LOG.error("Could not get JPQL translation for '" + searchExpression + "': " - + ThrowableUtil.getAllMessages(e, true)); + + ThrowableUtil.getAllMessages(e, true)); } }
@@ -480,7 +484,7 @@ public final class CriteriaQueryGenerator { * that method where the persistentBagFields property is initialized. * * @return Returns a list of fields from the persistent class to which the criteria class corresponds. The fields in - * the list are themselves instances of List and have "bag" semantics. + * the list are themselves instances of List and have "bag" semantics. */ public List<Field> getPersistentBagFields() { return persistentBagFields; @@ -490,10 +494,10 @@ public final class CriteriaQueryGenerator { * If you want to return something other than the list of entities represented by the passed Criteria object, * you can alter the projection here to return a customized subset or superset of data. The projection will * only affect the ResultSet for the data query, not the count query. - * - * If you are projecting a composite object that does not directly extend the entity your Criteria object + * <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} + * {@link CriteriaQueryRunner} */ public void alterProjection(String projection) { this.projection = projection; @@ -515,28 +519,25 @@ public final class CriteriaQueryGenerator { }
private void setBindValues(Query query, boolean countQuery) { - boolean wantCaseInsensitiveMatch = !criteria.isCaseSensitive(); - boolean wantsFuzzyMatching = !criteria.isStrict();
for (Map.Entry<String, Object> critField : getFilterFields(criteria).entrySet()) { Object value = critField.getValue(); - if (value instanceof String) { - String formattedValue = (String) value;
- if (wantsFuzzyMatching) { - formattedValue = "%" + QueryUtility.escapeSearchParameter(formattedValue) + "%"; - } + if (value instanceof Tag) { + Tag tag = (Tag) value; + query.setParameter("tagNamespace", tag.getNamespace()); + query.setParameter("tagSemantic", tag.getSemantic()); + query.setParameter("tagName", tag.getName());
- if (wantCaseInsensitiveMatch) { - formattedValue = formattedValue.toLowerCase(); + } else { + if (value instanceof String) { + value = prepareStringBindValue((String) value); } - - value = formattedValue; - } - if (LOG.isDebugEnabled()) { - LOG.debug("Bind: (" + critField.getKey() + ", " + value + ")"); + if (LOG.isDebugEnabled()) { + LOG.debug("Bind: (" + critField.getKey() + ", " + value + ")"); + } + query.setParameter(critField.getKey(), value); } - query.setParameter(critField.getKey(), value); } if (null != this.authorizationPermsFragment) { List<Permission> requiredPerms = this.criteria.getRequiredPermissions(); @@ -545,6 +546,18 @@ public final class CriteriaQueryGenerator { } }
+ private String prepareStringBindValue(String value) { + if (!criteria.isStrict()) { + value = "%" + QueryUtility.escapeSearchParameter(value) + "%"; + } + + if (!criteria.isCaseSensitive()) { + value = value.toLowerCase(); + } + + return value; + } + public static void main(String[] args) { //testSubjectCriteria(); //testAlertCriteria();
commit bbe2c73195c69fbe543d0afcb561276a8f2ef7cd Author: Greg Hinkle ghinkle@redhat.com Date: Wed May 12 13:41:09 2010 -0400
Fix selector inital selection display
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java index 2f2bed2..7a10b32 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java @@ -230,7 +230,9 @@ public abstract class AbstractSelector<T> extends VLayout {
if (initialSelection != null) { assignedGrid.setData(initialSelection); - select(initialSelection); + for (ListGridRecord record : initialSelection) { + selection.add(record.getAttributeAsInt("id")); + } }
addMember(hlayout); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java index f14514f..d373ac6 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java @@ -23,6 +23,7 @@ import java.util.Collection; import com.smartgwt.client.data.Criteria; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.SelectItem; +import com.smartgwt.client.widgets.form.fields.SpacerItem; import com.smartgwt.client.widgets.form.fields.TextItem; import com.smartgwt.client.widgets.grid.ListGridRecord;
@@ -42,13 +43,14 @@ public class ResourceGroupSelector extends AbstractSelector<ResourceGroup> {
protected DynamicForm getAvailableFilterForm() { DynamicForm availableFilterForm = new DynamicForm(); - availableFilterForm.setNumCols(4); + availableFilterForm.setNumCols(5); + final TextItem search = new TextItem("search", "Search");
SelectItem groupCategorySelect = new SelectItem("groupCategory", "Group Category"); groupCategorySelect.setValueMap("Compatible", "Mixed"); groupCategorySelect.setAllowEmptyValue(true); - availableFilterForm.setItems(search, groupCategorySelect); + availableFilterForm.setItems(search, groupCategorySelect, new SpacerItem());
return availableFilterForm; } @@ -67,7 +69,7 @@ public class ResourceGroupSelector extends AbstractSelector<ResourceGroup> { return latestCriteria; }
- protected class SelectedResourceGroupsDataSource extends ResourceGroupsDataSource { + public class SelectedResourceGroupsDataSource extends ResourceGroupsDataSource {
@Override public ListGridRecord[] buildRecords(Collection<ResourceGroup> resourceGroups) {
commit 1f06c2a7368d7014a980191ea7180890495d78f1 Author: Greg Hinkle ghinkle@redhat.com Date: Wed May 12 13:40:27 2010 -0400
Allow a ViewId to have no breadcrumbs at all
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java index 4c1c5a0..8916c0a 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java @@ -55,11 +55,13 @@ public class BreadcrumbTrailPane extends HTMLPane {
for (ViewId viewId : viewPath.getViewPath()) {
- if (!first) { - path.append("/"); - content.append(" > "); - } else { - first = false; + if (!viewId.getBreadcrumbs().isEmpty()) { + if (!first) { + path.append("/"); + content.append(" > "); + } else { + first = false; + } }
boolean firstBC = true;
commit ea56607cd27cb0ce9095951ac14904bc20acb549 Author: Greg Hinkle ghinkle@redhat.com Date: Wed May 12 13:40:03 2010 -0400
Fixed issue with getting updated role-group assignments on saving them
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java index 0bbfff8..42c8353 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java @@ -292,7 +292,10 @@ public class RoleManagerBean implements RoleManagerLocal, RoleManagerRemote { @RequiredPermission(Permission.MANAGE_SECURITY) public Role updateRole(Subject subject, Role role) { processDependentPermissions(role); - return entityManager.merge(role); + Role updatedRole = entityManager.merge(role); + // Load the roles + updatedRole.getResourceGroups().size(); + return updatedRole; }
/**
commit 486454537d1477add25c7d97951f1dfe954ef03c Merge: c1f50e8... 7dc9e86... Author: Ian P. Springer <ips@jetengine.(none)> Date: Wed May 12 07:33:28 2010 -0400
Merge branch 'gwt' of ssh://git.fedorahosted.org/git/rhq/rhq into gwt
commit 7dc9e860d47abb0f1cd364b5ddda4cfdd24c151b Author: John Mazzitelli mazz@redhat.com Date: Tue May 11 17:38:32 2010 -0400
whenever the deployer installs a new current deployment, have it remember what the previous deployment was
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentsMetadata.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentsMetadata.java index b255517..dec7dfa 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentsMetadata.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentsMetadata.java @@ -27,6 +27,8 @@ import java.io.File; import java.util.Set; import java.util.regex.Pattern;
+import org.rhq.core.util.file.FileUtil; + /** * This loads and stores metadata about installs of a particular bundle deployment. * @@ -35,6 +37,7 @@ import java.util.regex.Pattern; public class DeploymentsMetadata { public static final String METADATA_DIR = ".rhqdeployments"; public static final String CURRENT_DEPLOYMENT_FILE = "current-deployment.properties"; + public static final String PREVIOUS_DEPLOYMENT_FILE = "previous-deployment.properties"; public static final String DEPLOYMENT_FILE = "deployment.properties"; public static final String HASHCODES_FILE = "file-hashcodes.dat"; public static final String BACKUP_DIR = "backup"; @@ -271,7 +274,12 @@ public class DeploymentsMetadata { fileHashcodeMap.storeToFile(new File(deploymentMetadataDir, HASHCODES_FILE));
// since we are being told this is the live deployment, this deployment should be considered the current one - deploymentProps.saveToFile(new File(getMetadataDirectory(), CURRENT_DEPLOYMENT_FILE)); + File currentDeploymentPropertiesFile = new File(getMetadataDirectory(), CURRENT_DEPLOYMENT_FILE); + File previousDeploymentPropertiesFile = new File(deploymentMetadataDir, PREVIOUS_DEPLOYMENT_FILE); + if (currentDeploymentPropertiesFile.exists()) { + FileUtil.copyFile(currentDeploymentPropertiesFile, previousDeploymentPropertiesFile); + } + deploymentProps.saveToFile(currentDeploymentPropertiesFile);
return; } diff --git a/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java b/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java index 917861d..a12a8e1 100644 --- a/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java +++ b/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java @@ -479,6 +479,18 @@ public class DeployerTest { } else { assert diff.getRealizedFiles().size() == 0 : diff; } + + File previousDeployment1 = new File(metadir, "1/previous-deployment.properties"); + File previousDeployment2 = new File(metadir, "2/previous-deployment.properties"); + File previousDeployment3 = new File(metadir, "3/previous-deployment.properties"); + File previousDeployment4 = new File(metadir, "4/previous-deployment.properties"); + assert !previousDeployment1.exists() : "there was no previous deployment for #1"; + assert previousDeployment2.exists() : "there was a previous deployment"; + assert previousDeployment3.exists() : "there was a previous deployment"; + assert previousDeployment4.exists() : "there was a previous deployment"; + assert DeploymentProperties.loadFromFile(previousDeployment2).getDeploymentId() == 1; + assert DeploymentProperties.loadFromFile(previousDeployment3).getDeploymentId() == 2; + assert DeploymentProperties.loadFromFile(previousDeployment4).getDeploymentId() == 3; } finally { FileUtil.purge(tmpDir, true); FileUtil.purge(tmpDir2, true);
commit d0e8cddef4d98b873df1a26b18ce309f57865a99 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 11 17:11:28 2010 -0400
Provisioning (Destinations) -- updated some scripts to use destination deployment
diff --git a/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManager.js b/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManager.js index fc50f4f..9496ebb 100644 --- a/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManager.js +++ b/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManager.js @@ -37,7 +37,7 @@ executeAllTests();
rhq.logout();
-function testGroupDeployment() { +function testDeployment() { if ( !TestsEnabled ) { return; } @@ -52,18 +52,22 @@ function testGroupDeployment() {
// there in no required config, it uses only the built in rhq.deploy.dir property
- // create a deployment using the above config - var testDeployment = BundleManager.createBundleDeployment(testBundleVersion.getId(), "Deployment Test", "Deployment Test of testBundle WAR", "/tmp/bundle-test", new Configuration()); - // Find a target platform group var rgc = new ResourceGroupCriteria(); rgc.addFilterName("platforms"); // wINdows, lINux var groups = ResourceGroupManager.findResourceGroupsByCriteria(rgc); Assert.assertTrue( groups.size() > 0 ); var groupId = groups.get(0).getId(); - - var bgd = BundleManager.scheduleBundleGroupDeployment(testDeployment.getId(), groupId); - Assert.assertNotNull( bgd ); + + // create a destination to deploy to + var testDest = BundleManager.createBundleDestination( testBundleVersion.getBundle().getId(), "Deployment Test Dest", "test Dest", "/tmp/bundle-test", groupId); + + // create a deployment using the above config + var testDeployment = BundleManager.createBundleDeployment(testBundleVersion.getId(), testDest.getId(), "Deployment Test", "Deployment Test of testBundle WAR", new Configuration()); + + // deploy to the destination + var bd = BundleManager.scheduleBundleDeployment(testDeployment.getId()); + Assert.assertNotNull( bd );
// delete the test bundle if it exists (after allowing agent audit messages to complete) sleep( 5000 ); diff --git a/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerZip.js b/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerZip.js index 4ceed3b..138e4cd 100644 --- a/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerZip.js +++ b/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerZip.js @@ -37,7 +37,7 @@ executeAllTests();
rhq.logout();
-function testGroupDeployment() { +function testDeployment() { if ( !TestsEnabled ) { return; } @@ -63,18 +63,21 @@ function testGroupDeployment() { var property = new PropertySimple("dummy.description", "FLOPPY!!!"); config.put( property );
- // create a deployment using the above config - var testDeployment = BundleManager.createBundleDeployment(testBundleVersion.getId(), "Deployment Test", "Deployment Test of dummy ZIP", "/tmp/bundle-test", config); - // Find a target platform group var rgc = new ResourceGroupCriteria(); rgc.addFilterName("platforms"); var groups = ResourceGroupManager.findResourceGroupsByCriteria(rgc); Assert.assertTrue( groups.size() > 0 ); var groupId = groups.get(0).getId(); + + // create a destination to deploy to + var testDest = BundleManager.createBundleDestination( testBundleVersion.getBundle().getId(), "Deployment Test Dest", "test Dest", "/tmp/bundle-test", groupId); + + // create a deployment using the above config + var testDeployment = BundleManager.createBundleDeployment(testBundleVersion.getId(), testDest.getId(), "Deployment Test", "Deployment Test of dummy ZIP", config);
- var bgd = BundleManager.scheduleBundleGroupDeployment(testDeployment.getId(), groupId); - Assert.assertNotNull( bgd ); + var bd = BundleManager.scheduleBundleDeployment(testDeployment.getId()); + Assert.assertNotNull( bd ); }
function getBundleType() {
commit c12274ca8e085c91be17458fef69f78e25ef1df0 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 11 16:31:38 2010 -0400
Provisioning Work (Destinations) - unit tests now passing, updated somewhat - db upgrade updated (not yet tested)
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml index 4d24931..8e4e4a0 100644 --- a/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml +++ b/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml @@ -565,7 +565,7 @@ <column name="BUNDLE_VERSION_ID" type="INTEGER" required="true" references="RHQ_BUNDLE_VERSION"/> <column name="BUNDLE_DESTINATION_ID" type="INTEGER" required="true" references="RHQ_BUNDLE_DESTINATION"/> <column name="CONFIG_ID" type="INTEGER" required="false" references="RHQ_CONFIG" /> - <column name="SUBJECT_NAME" type="VARCHAR2" required="true" size="255"/> + <column name="SUBJECT_NAME" type="VARCHAR2" required="false" size="255"/> <column name="STATUS" type="VARCHAR2" required="true" size="16"/> <column name="ERROR_MESSAGE" type="LONGVARCHAR" required="false"/> <column name="IS_LIVE" type="BOOLEAN" required="true"/> @@ -587,12 +587,12 @@
<table name="RHQ_BUNDLE_RES_DEP_HIST"> <column name="ID" default="sequence-only" initial="10001" primarykey="true" required="true" type="INTEGER"/> - <column name="BUNDLE_RES_DEPLOYMENT_ID" type="INTEGER" required="true" references="RHQ_BUNDLE_RES_DEPLOY" /> + <column name="BUNDLE_RES_DEPLOY_ID" type="INTEGER" required="true" references="RHQ_BUNDLE_RES_DEPLOY" /> <column name="SUBJECT_NAME" required="false" size="255" type="VARCHAR2"/> <column name="AUDIT_TIME" required="true" type="LONG"/> <column name="ACTION" required="true" size="128" type="VARCHAR2"/> <column name="INFO" required="true" size="512" type="VARCHAR2"/> - <column name="CATEGORY" required="true" size="32" type="VARCHAR2"/> + <column name="CATEGORY" required="false" size="32" type="VARCHAR2"/> <column name="STATUS" required="true" type="VARCHAR2" size="16"/> <column name="MESSAGE" required="false" type="LONGVARCHAR"/> <column name="ATTACHMENT" required="false" type="LONGVARCHAR"/> diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index a5c7b5e..ff5ae35 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -2480,81 +2480,94 @@ </statement> </schema-directSQL>
- <!-- RHQ_BUNDLE_DEPLOY --> - <schema-createSequence name="RHQ_BUNDLE_DEPLOY_ID_SEQ" initial="10001" /> + <!-- RHQ_BUNDLE_DESTINATION --> + <schema-createSequence name="RHQ_BUNDLE_DESTINATION_ID_SEQ" initial="10001" /> <schema-directSQL> - <statement desc="Creating table RHQ_BUNDLE_DEPLOY"> - CREATE TABLE RHQ_BUNDLE_DEPLOY ( ID INTEGER PRIMARY KEY ) + <statement desc="Creating table RHQ_BUNDLE_DESTINATION"> + CREATE TABLE RHQ_BUNDLE_DESTINATION ( ID INTEGER PRIMARY KEY ) </statement> </schema-directSQL> <schema-alterColumn table="RHQ_BUNDLE_DEPLOY" column="ID" nullable="FALSE" /> <schema-addColumn table="RHQ_BUNDLE_DEPLOY" column="NAME" columnType="VARCHAR2" precision="200" /> <schema-alterColumn table="RHQ_BUNDLE_DEPLOY" column="NAME" nullable="FALSE" /> <schema-addColumn table="RHQ_BUNDLE_DEPLOY" column="DESCRIPTION" columnType="VARCHAR2" precision="500" /> - <schema-addColumn table="RHQ_BUNDLE_DEPLOY" column="INSTALL_DIR" columnType="VARCHAR2" precision="256" /> - <schema-alterColumn table="RHQ_BUNDLE_DEPLOY" column="INSTALL_DIR" nullable="FALSE" /> <schema-addColumn table="RHQ_BUNDLE_DEPLOY" column="CTIME" columnType="LONG" /> <schema-alterColumn table="RHQ_BUNDLE_DEPLOY" column="CTIME" nullable="FALSE" /> <schema-addColumn table="RHQ_BUNDLE_DEPLOY" column="MTIME" columnType="LONG" /> <schema-alterColumn table="RHQ_BUNDLE_DEPLOY" column="MTIME" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_DEPLOY" column="CONFIG_ID" columnType="INTEGER" /> - <schema-addColumn table="RHQ_BUNDLE_DEPLOY" column="BUNDLE_VERSION_ID" columnType="INTEGER" /> - <schema-alterColumn table="RHQ_BUNDLE_DEPLOY" column="BUNDLE_VERSION_ID" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_DEPLOY" column="BUNDLE_ID" columnType="INTEGER" /> + <schema-alterColumn table="RHQ_BUNDLE_DEPLOY" column="BUNDLE_ID" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_DEPLOY" column="GROUP_ID" columnType="INTEGER" /> + <schema-alterColumn table="RHQ_BUNDLE_DEPLOY" column="GROUP_ID" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_DEPLOY" column="DEPLOY_DIR" columnType="VARCHAR2" precision="256" /> + <schema-alterColumn table="RHQ_BUNDLE_DEPLOY" column="DEPLOY_DIR" nullable="FALSE" />
<schema-directSQL> - <statement desc="Creating RHQ_BUNDLE_DEPLOY foreign key relation to RHQ_CONFIG"> - ALTER TABLE RHQ_BUNDLE_DEPLOY - ADD CONSTRAINT RHQ_BD_CONFIG_ID_FK - FOREIGN KEY (CONFIG_ID) - REFERENCES RHQ_CONFIG (ID) + <statement desc="Creating RHQ_BUNDLE_DESTINATION foreign key relation to RHQ_BUNDLE"> + ALTER TABLE RHQ_BUNDLE_DESTINATION + ADD CONSTRAINT RHQ_BD_BUNDLE_ID_FK + FOREIGN KEY (BUNDLE_ID) + REFERENCES RHQ_BUNDLE (ID) </statement> - <statement desc="Creating RHQ_BUNDLE_DEPLOY foreign key relation to RHQ_BUNDLE_VERSION"> - ALTER TABLE RHQ_BUNDLE_DEPLOY - ADD CONSTRAINT RHQ_BD_BUNDLE_VERSION_ID_FK - FOREIGN KEY (BUNDLE_VERSION_ID) - REFERENCES RHQ_BUNDLE_VERSION (ID) + <statement desc="Creating RHQ_BUNDLE_DESTINATION foreign key relation to RHQ_RESOURCE_GROUP"> + ALTER TABLE RHQ_BUNDLE_DESTINATION + ADD CONSTRAINT RHQ_BD_GROUP_ID_FK + FOREIGN KEY (GROUP_ID) + REFERENCES RHQ_RESOURCE_GROUP (ID) </statement> <statement desc="Creating RHQ_BUNDLE_DEPLOY unique constraint"> - CREATE UNIQUE INDEX RHQ_BUNDLE_DEPLOY_UNIQUE - ON RHQ_BUNDLE_DEPLOY (bundle_version_id, name, install_dir) + CREATE UNIQUE INDEX RHQ_BUNDLE_DESTINATION_UNIQUE + ON RHQ_BUNDLE_DEPLOY (bundle_id, name) </statement> </schema-directSQL>
- <!-- RHQ_BUNDLE_GROUP_DEPLOY --> - <schema-createSequence name="RHQ_BUNDLE_GROUP_DEPLOY_ID_SEQ" initial="10001" /> + <!-- RHQ_BUNDLE_DEPLOYMENT --> + <schema-createSequence name="RHQ_BUNDLE_DEPLOYMENT_ID_SEQ" initial="10001" /> <schema-directSQL> - <statement desc="Creating table RHQ_BUNDLE_GROUP_DEPLOY"> - CREATE TABLE RHQ_BUNDLE_GROUP_DEPLOY ( ID INTEGER PRIMARY KEY ) - </statement> + <statement desc="Creating table RHQ_BUNDLE_DEPLOYMENT"> + CREATE TABLE RHQ_BUNDLE_DEPLOYMENT ( ID INTEGER PRIMARY KEY ) + </statement> </schema-directSQL> - <schema-alterColumn table="RHQ_BUNDLE_GROUP_DEPLOY" column="ID" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_GROUP_DEPLOY" column="GROUP_ID" columnType="INTEGER" /> - <schema-alterColumn table="RHQ_BUNDLE_GROUP_DEPLOY" column="GROUP_ID" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_GROUP_DEPLOY" column="BUNDLE_DEPLOY_ID" columnType="INTEGER" /> - <schema-alterColumn table="RHQ_BUNDLE_GROUP_DEPLOY" column="BUNDLE_DEPLOY_ID" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_GROUP_DEPLOY" column="STATUS" columnType="VARCHAR2" precision="16" /> - <schema-alterColumn table="RHQ_BUNDLE_GROUP_DEPLOY" column="STATUS" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_GROUP_DEPLOY" column="ERROR_MESSAGE" columnType="LONGVARCHAR" /> - <schema-addColumn table="RHQ_BUNDLE_GROUP_DEPLOY" column="SUBJECT_NAME" columnType="VARCHAR2" precision="255" /> - <schema-alterColumn table="RHQ_BUNDLE_GROUP_DEPLOY" column="SUBJECT_NAME" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_GROUP_DEPLOY" column="CTIME" columnType="LONG" /> - <schema-alterColumn table="RHQ_BUNDLE_GROUP_DEPLOY" column="CTIME" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_GROUP_DEPLOY" column="MTIME" columnType="LONG" /> - <schema-alterColumn table="RHQ_BUNDLE_GROUP_DEPLOY" column="MTIME" nullable="FALSE" /> - <schema-directSQL> - <statement desc="Creating RHQ_BUNDLE_GROUP_DEPLOY foreign key relation to RHQ_RESOURCE_GROUP"> - ALTER TABLE RHQ_BUNDLE_GROUP_DEPLOY - ADD CONSTRAINT RHQ_BGD_RESOURCE_GROUP_ID_FK - FOREIGN KEY (GROUP_ID) - REFERENCES RHQ_RESOURCE_GROUP (ID) + <schema-alterColumn table="RHQ_BUNDLE_DEPLOYMENT" column="ID" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="NAME" columnType="VARCHAR2" precision="200" /> + <schema-alterColumn table="RHQ_BUNDLE_DEPLOYMENT" column="NAME" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="DESCRIPTION" columnType="VARCHAR2" precision="500" /> + <schema-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="CTIME" columnType="LONG" /> + <schema-alterColumn table="RHQ_BUNDLE_DEPLOYMENT" column="CTIME" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="MTIME" columnType="LONG" /> + <schema-alterColumn table="RHQ_BUNDLE_DEPLOYMENT" column="MTIME" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="BUNDLE_VERSION_ID" columnType="INTEGER" /> + <schema-alterColumn table="RHQ_BUNDLE_DEPLOYMENT" column="BUNDLE_VERSION_ID" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="BUNDLE_DESTINATION_ID" columnType="INTEGER" /> + <schema-alterColumn table="RHQ_BUNDLE_DEPLOYMENT" column="BUNDLE_DESTINATION_ID" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="CONFIG_ID" columnType="INTEGER" /> + <schema-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="STATUS" columnType="VARCHAR2" precision="16" /> + <schema-alterColumn table="RHQ_BUNDLE_DEPLOYMENT" column="STATUS" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="ERROR_MESSAGE" columnType="LONGVARCHAR" /> + <schema-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="SUBJECT_NAME" columnType="VARCHAR2" precision="255" /> + <schema-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="IS_LIVE" columnType="BOOLEAN" /> + <schema-alterColumn table="RHQ_BUNDLE_DEPLOYMENT" column="IS_LIVE" nullable="FALSE" /> + + <schema-directSQL> + <statement desc="Creating RHQ_BUNDLE_DEPLOYMENT foreign key relation to RHQ_BUNDLE_VERSION"> + ALTER TABLE RHQ_BUNDLE_DEPLOYMENT + ADD CONSTRAINT RHQ_BD_BUNDLE_VERSION_ID_FK + FOREIGN KEY (BUNDLE_VERSION_ID) + REFERENCES RHQ_BUNDLE_VERSION (ID) </statement> - <statement desc="Creating RHQ_BUNDLE_GROUP_DEPLOY foreign key relation to RHQ_BUNDLE_DEPLOY"> - ALTER TABLE RHQ_BUNDLE_GROUP_DEPLOY - ADD CONSTRAINT RHQ_BGD_BUNDLE_DEPLOY_ID_FK - FOREIGN KEY (BUNDLE_DEPLOY_ID) - REFERENCES RHQ_BUNDLE_DEPLOY (ID) + <statement desc="Creating RHQ_BUNDLE_DEPLOYMENT foreign key relation to RHQ_BUNDLE_DESTINATION"> + ALTER TABLE RHQ_BUNDLE_DEPLOYMENT + ADD CONSTRAINT RHQ_BD_B_DESTINATION_ID_FK + FOREIGN KEY (BUNDLE_DESTINATION_ID) + REFERENCES RHQ_BUNDLE_DESTINATION (ID) + </statement> + <statement desc="Creating RHQ_BUNDLE_DEPLOYMENT foreign key relation to RHQ_CONFIG"> + ALTER TABLE RHQ_BUNDLE_DEPLOYMENT + ADD CONSTRAINT RHQ_BD_CONFIG_ID_FK + FOREIGN KEY (CONFIG_ID) + REFERENCES RHQ_CONFIG (ID) </statement> - </schema-directSQL> + </schema-directSQL>
<!-- RHQ_BUNDLE_RES_DEPLOY --> <schema-createSequence name="RHQ_BUNDLE_RES_DEPLOY_ID_SEQ" initial="10001" /> @@ -2564,24 +2577,21 @@ </statement> </schema-directSQL> <schema-alterColumn table="RHQ_BUNDLE_RES_DEPLOY" column="ID" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_RES_DEPLOY" column="BUNDLE_DEPLOY_ID" columnType="INTEGER" /> - <schema-alterColumn table="RHQ_BUNDLE_RES_DEPLOY" column="BUNDLE_DEPLOY_ID" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_RES_DEPLOY" column="BUNDLE_DEPLOYMENT_ID" columnType="INTEGER" /> + <schema-alterColumn table="RHQ_BUNDLE_RES_DEPLOY" column="BUNDLE_DEPLOYMENT_ID" nullable="FALSE" /> <schema-addColumn table="RHQ_BUNDLE_RES_DEPLOY" column="RESOURCE_ID" columnType="INTEGER" /> <schema-alterColumn table="RHQ_BUNDLE_RES_DEPLOY" column="RESOURCE_ID" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_RES_DEPLOY" column="IS_CURRENT" columnType="BOOLEAN" /> - <schema-alterColumn table="RHQ_BUNDLE_RES_DEPLOY" column="IS_CURRENT" nullable="FALSE" /> <schema-addColumn table="RHQ_BUNDLE_RES_DEPLOY" column="STATUS" columnType="VARCHAR2" precision="16" /> <schema-alterColumn table="RHQ_BUNDLE_RES_DEPLOY" column="STATUS" nullable="FALSE" /> <schema-addColumn table="RHQ_BUNDLE_RES_DEPLOY" column="CTIME" columnType="LONG" /> <schema-alterColumn table="RHQ_BUNDLE_RES_DEPLOY" column="CTIME" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_RES_DEPLOY" column="BUNDLE_GROUP_DEPLOY_ID" columnType="INTEGER" />
<schema-directSQL> - <statement desc="Creating RHQ_BUNDLE_RES_DEPLOY foreign key relation to BUNDLE_DEPLOY"> + <statement desc="Creating RHQ_BUNDLE_RES_DEPLOY foreign key relation to BUNDLE_DEPLOYMENT"> ALTER TABLE RHQ_BUNDLE_RES_DEPLOY - ADD CONSTRAINT RHQ_BRD_BUNDLE_DEPLOY_ID_FK - FOREIGN KEY (BUNDLE_DEPLOY_ID) - REFERENCES RHQ_BUNDLE_DEPLOY (ID) + ADD CONSTRAINT RHQ_BRD_B_DEPLOYMENT_ID_FK + FOREIGN KEY (BUNDLE_DEPLOYMENT_ID) + REFERENCES RHQ_BUNDLE_DEPLOYMENT (ID) </statement> <statement desc="Creating RHQ_BUNDLE_RES_DEPLOY foreign key relation to RESOURCE"> ALTER TABLE RHQ_BUNDLE_RES_DEPLOY @@ -2589,15 +2599,9 @@ FOREIGN KEY (RESOURCE_ID) REFERENCES RHQ_RESOURCE (ID) </statement> - <statement desc="Creating RHQ_BUNDLE_DEPLOY foreign key relation to RHQ_BUNDLE_GROUP_DEPLOY"> - ALTER TABLE RHQ_BUNDLE_RES_DEPLOY - ADD CONSTRAINT RHQ_BRD_B_GROUP_DEPLOY_ID_FK - FOREIGN KEY (BUNDLE_GROUP_DEPLOY_ID) - REFERENCES RHQ_BUNDLE_GROUP_DEPLOY (ID) - </statement> <statement desc="Creating RHQ_BUNDLE_RES_DEPLOY unique constraint on def-resource mapping"> CREATE UNIQUE INDEX RHQ_BUNDLE_RES_DEPLOY_MAP_IX - ON RHQ_BUNDLE_RES_DEPLOY (BUNDLE_DEPLOY_ID, RESOURCE_ID) + ON RHQ_BUNDLE_RES_DEPLOY (BUNDLE_DEPLOYMENT_ID, RESOURCE_ID) </statement> </schema-directSQL>
@@ -2614,11 +2618,16 @@ <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="SUBJECT_NAME" columnType="VARCHAR2" precision="255" /> <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="AUDIT_TIME" columnType="LONG" /> <schema-alterColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="AUDIT_TIME" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="AUDIT_ACTION" columnType="VARCHAR2" precision="512" /> - <schema-alterColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="AUDIT_ACTION" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="AUDIT_STATUS" columnType="VARCHAR2" precision="16" /> - <schema-alterColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="AUDIT_STATUS" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="AUDIT_MESSAGE" columnType="LONGVARCHAR" /> + <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="ACTION" columnType="VARCHAR2" precision="128" /> + <schema-alterColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="ACTION" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="INFO" columnType="VARCHAR2" precision="512" /> + <schema-alterColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="INFO" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="CATEGORY" columnType="VARCHAR2" precision="32" /> + <schema-alterColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="CATEGORY" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="STATUS" columnType="VARCHAR2" precision="16" /> + <schema-alterColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="STATUS" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="MESSAGE" columnType="LONGVARCHAR" /> + <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="ATTACHMENT" columnType="LONGVARCHAR" /> <schema-directSQL> <statement desc="Creating RHQ_BUNDLE_RES_DEP_HIST foreign key relation to BUNDLE_DEPLOY"> ALTER TABLE RHQ_BUNDLE_RES_DEP_HIST @@ -2870,20 +2879,20 @@ CREATE TABLE RHQ_TAGGING_BUNDLE_DEPLOY_MAP ( BUNDLE_DEPLOY_ID INTEGER ) </statement> </schema-directSQL> - <schema-alterColumn table="RHQ_TAGGING_BUNDLE_DEPLOY_MAP" column="BUNDLE_DEPLOY_ID" nullable="false" /> + <schema-alterColumn table="RHQ_TAGGING_BUNDLE_DEPLOY_MAP" column="BUNDLE_DEPLOYMENT_ID" nullable="false" /> <schema-addColumn table="RHQ_TAGGING_BUNDLE_DEPLOY_MAP" column="TAG_ID" columnType="INTEGER" /> <schema-alterColumn table="RHQ_TAGGING_BUNDLE_DEPLOY_MAP" column="TAG_ID" nullable="false" /> <schema-directSQL> <statement> ALTER TABLE RHQ_TAGGING_BUNDLE_DEPLOY_MAP ADD CONSTRAINT RHQ_TAGGING_BUNDLE_DEP_MAP_KEY - PRIMARY KEY ( BUNDLE_DEPLOY_ID, TAG_ID ) + PRIMARY KEY ( BUNDLE_DEPLOYMENT_ID, TAG_ID ) </statement> <statement> ALTER TABLE RHQ_TAGGING_BUNDLE_DEPLOY_MAP - ADD CONSTRAINT RHQ_TBDM_BUNDLE_DEPLOY_ID_FK - FOREIGN KEY ( BUNDLE_DEPLOY_ID ) - REFERENCES RHQ_BUNDLE_DEPLOY ( ID ) + ADD CONSTRAINT RHQ_TBDM_B_DEPLOYMENT_ID_FK + FOREIGN KEY ( BUNDLE_DEPLOYMENT_ID ) + REFERENCES RHQ_BUNDLE_DEPLOYMENT ( ID ) </statement> <statement> ALTER TABLE RHQ_TAGGING_BUNDLE_DEPLOY_MAP @@ -2892,6 +2901,34 @@ REFERENCES RHQ_TAGGING ( ID ) </statement> </schema-directSQL> + + <schema-directSQL> + <statement> + CREATE TABLE RHQ_TAGGING_BUNDLE_DEST_MAP ( BUNDLE_DESTINATION_ID INTEGER ) + </statement> + </schema-directSQL> + <schema-alterColumn table="RHQ_TAGGING_BUNDLE_DEST_MAP" column="BUNDLE_DESTINATION_ID" nullable="false" /> + <schema-addColumn table="RHQ_TAGGING_BUNDLE_DEST_MAP" column="TAG_ID" columnType="INTEGER" /> + <schema-alterColumn table="RHQ_TAGGING_BUNDLE_DEST_MAP" column="TAG_ID" nullable="false" /> + <schema-directSQL> + <statement> + ALTER TABLE RHQ_TAGGING_BUNDLE_DEST_MAP + ADD CONSTRAINT RHQ_TAGGING_BUNDLE_DES_MAP_KEY + PRIMARY KEY ( BUNDLE_DESTINATION_ID, TAG_ID ) + </statement> + <statement> + ALTER TABLE RHQ_TAGGING_BUNDLE_DEST_MAP + ADD CONSTRAINT RHQ_TBDM_B_DESTINATION_ID_FK + FOREIGN KEY ( BUNDLE_DESTINATION_ID ) + REFERENCES RHQ_BUNDLE_DESTINATION ( ID ) + </statement> + <statement> + ALTER TABLE RHQ_TAGGING_BUNDLE_DEST_MAP + ADD CONSTRAINT RHQ_TBDM_TAG_ID_FK + FOREIGN KEY ( TAG_ID ) + REFERENCES RHQ_TAGGING ( ID ) + </statement> + </schema-directSQL> </schemaSpec>
</dbupgrade> diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java index 17904c6..d255a57 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java @@ -116,7 +116,7 @@ public class BundleDeployment implements Serializable { private BundleDestination destination;
@OneToMany(mappedBy = "bundleDeployment", fetch = FetchType.LAZY, cascade = CascadeType.ALL) - private List<BundleResourceDeployment> resourceDeployments = new ArrayList<BundleResourceDeployment>(); + private List<BundleResourceDeployment> resourceDeployments;
@ManyToMany(mappedBy = "bundleDeployments", fetch = FetchType.LAZY) private Set<Tag> tags; @@ -130,6 +130,7 @@ public class BundleDeployment implements Serializable { this.destination = destination; this.name = name; this.status = BundleDeploymentStatus.PENDING; + this.isLive = false; }
public int getId() { @@ -294,6 +295,9 @@ public class BundleDeployment implements Serializable { }
public void addResourceDeployment(BundleResourceDeployment resourceDeployment) { + if (null == this.resourceDeployments) { + resourceDeployments = new ArrayList<BundleResourceDeployment>(); + } this.resourceDeployments.add(resourceDeployment); resourceDeployment.setBundleDeployment(this); } diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java index d0feee8..fb217a6 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java @@ -95,12 +95,8 @@ public class BundleDestination implements Serializable { @ManyToOne private ResourceGroup group;
- @JoinColumn(name = "BUNDLE_VERSION_ID", referencedColumnName = "ID", nullable = false) - @ManyToOne(fetch = FetchType.LAZY) - private BundleVersion bundleVersion; - - @OneToMany(mappedBy = "bundleDestination", fetch = FetchType.LAZY) - private List<BundleDeployment> deployments = new ArrayList<BundleDeployment>(); + @OneToMany(mappedBy = "destination", fetch = FetchType.LAZY) + private List<BundleDeployment> deployments;
@ManyToMany(mappedBy = "bundleDestinations", fetch = FetchType.LAZY) private Set<Tag> tags; @@ -186,14 +182,6 @@ public class BundleDestination implements Serializable { this.group = group; }
- public BundleVersion getBundleVersion() { - return bundleVersion; - } - - public void setBundleVersion(BundleVersion bundleVersion) { - this.bundleVersion = bundleVersion; - } - public List<BundleDeployment> getDeployments() { return deployments; } @@ -203,6 +191,9 @@ public class BundleDestination implements Serializable { }
public void addDeployment(BundleDeployment deployment) { + if (null == this.deployments) { + this.deployments = new ArrayList<BundleDeployment>(); + } this.deployments.add(deployment); deployment.setDestination(this); } @@ -249,25 +240,25 @@ public class BundleDestination implements Serializable { if (this == obj) { return true; } - if (!(obj instanceof BundleDeployment)) { + if (!(obj instanceof BundleDestination)) { return false; }
BundleDestination other = (BundleDestination) obj;
- if (bundle == null) { + if (this.bundle == null) { if (other.bundle != null) { return false; } - } else if (!bundle.equals(other.bundle)) { + } else if (!this.bundle.equals(other.bundle)) { return false; }
- if (name == null) { + if (this.name == null) { if (other.name != null) { return false; } - } else if (!name.equals(other.name)) { + } else if (!this.name.equals(other.name)) { return false; }
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeploymentHistory.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeploymentHistory.java index 4cbe72a..d528f8b 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeploymentHistory.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeploymentHistory.java @@ -63,7 +63,7 @@ public class BundleResourceDeploymentHistory implements Serializable { @Id private int id;
- @JoinColumn(name = "BUNDLE_RES_DEPLOYMENT_ID", referencedColumnName = "ID", nullable = false) + @JoinColumn(name = "BUNDLE_RES_DEPLOY_ID", referencedColumnName = "ID", nullable = false) @ManyToOne(fetch = FetchType.LAZY) private BundleResourceDeployment resourceDeployment;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleCriteria.java index d6fd9a7..d7fb800 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleCriteria.java @@ -43,6 +43,7 @@ public class BundleCriteria extends Criteria { private String filterPackageTypeName; // needs override
private boolean fetchBundleVersions; + private boolean fetchDestinations; private boolean fetchPackageType; private boolean fetchRepo; private boolean fetchTags; @@ -59,7 +60,7 @@ public class BundleCriteria extends Criteria { }
@Override - public Class getPersistentClass() { + public Class<?> getPersistentClass() { return Bundle.class; }
@@ -95,6 +96,10 @@ public class BundleCriteria extends Criteria { this.fetchBundleVersions = fetchBundleVersions; }
+ public void fetchDestinations(boolean fetchDestinations) { + this.fetchDestinations = fetchDestinations; + } + public void fetchPackageType(boolean fetchPackageType) { this.fetchPackageType = fetchPackageType; } @@ -107,7 +112,6 @@ public class BundleCriteria extends Criteria { this.fetchTags = fetchTags; }
- public void addSortName(PageOrdering sortName) { addSortField("name"); this.sortName = sortName; diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java index 1ad7f05..510eca2 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java @@ -23,6 +23,9 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement;
+import org.rhq.core.domain.bundle.BundleDeployment; +import org.rhq.core.domain.bundle.BundleDeploymentStatus; + /** * @author Jay Shaughnessy */ @@ -33,31 +36,58 @@ public class BundleDeploymentCriteria extends Criteria { private static final long serialVersionUID = 1L;
private Integer filterId; + private Boolean filterIsLive; private String filterName; private String filterDescription; + private Integer filterDestinationId; // needs override + private String filterDestinationName; // needs override + private BundleDeploymentStatus filterStatus; + private String filterSubjectName;
private boolean fetchBundleVersion; private boolean fetchConfiguration; - private boolean fetchDeployments; - private boolean fetchGroupDeployments; + private boolean fetchDestination; + private boolean fetchResourceDeployments; private boolean fetchTags;
public BundleDeploymentCriteria() { + filterOverrides.put("destinationId", "destination.id = ?"); + filterOverrides.put("destinationName", "destination.name like ?"); }
@Override public Class<?> getPersistentClass() { - return BundleDeploymentCriteria.class; + return BundleDeployment.class; }
public void addFilterId(Integer filterId) { this.filterId = filterId; }
+ public void addFilterIsLive(Boolean filterIsLive) { + this.filterIsLive = filterIsLive; + } + public void addFilterName(String filterName) { this.filterName = filterName; }
+ public void addFilterDestinationId(Integer filterDestinationId) { + this.filterDestinationId = filterDestinationId; + } + + public void addFilterDestinationName(String filterDestinationName) { + this.filterDestinationName = filterDestinationName; + } + + public void addFilterStatus(BundleDeploymentStatus filterStatus) { + this.filterStatus = filterStatus; + } + + public void addFilterSubjectName(String filterSubjectName) { + this.filterSubjectName = filterSubjectName; + } + public void addFilterDescription(String filterDescription) { this.filterDescription = filterDescription; } @@ -70,12 +100,12 @@ public class BundleDeploymentCriteria extends Criteria { this.fetchConfiguration = fetchConfiguration; }
- public void fetchDeployments(boolean fetchDeployments) { - this.fetchDeployments = fetchDeployments; + public void fetchDestination(boolean fetchDestination) { + this.fetchDestination = fetchDestination; }
- public void fetchGroupDeployments(boolean fetchGroupDeployments) { - this.fetchGroupDeployments = fetchGroupDeployments; + public void fetchResourceDeployments(boolean fetchResourceDeployments) { + this.fetchResourceDeployments = fetchResourceDeployments; }
public void fetchTags(boolean fetchTags) { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java index 1ecb867..5520e0b 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java @@ -46,8 +46,8 @@ public class BundleResourceDeploymentCriteria extends Criteria { private boolean fetchHistories;
public BundleResourceDeploymentCriteria() { - filterOverrides.put("bundleDeploymentId", "parentResource.id = ?"); - filterOverrides.put("bundleDeploymentName", "parentResource.name like ?"); + filterOverrides.put("bundleDeploymentId", "bundleDeployment.id = ?"); + filterOverrides.put("bundleDeploymentName", "bundleDeployment.name like ?"); filterOverrides.put("resourceId", "resource.id = ?"); filterOverrides.put("resourceName", "resource.name like ?"); } diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java b/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java index f30ab82..ee579ed 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java @@ -41,6 +41,7 @@ import javax.xml.bind.annotation.XmlAccessorType;
import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; +import org.rhq.core.domain.bundle.BundleDestination; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.group.ResourceGroup; @@ -86,10 +87,14 @@ public class Tag implements Serializable { @ManyToMany private Set<BundleVersion> bundleVersions;
- @JoinTable(name = "RHQ_TAGGING_BUNDLE_DEPLOY_MAP", joinColumns = { @JoinColumn(name = "TAG_ID") }, inverseJoinColumns = { @JoinColumn(name = "BUNDLE_DEPLOY_ID") }) + @JoinTable(name = "RHQ_TAGGING_BUNDLE_DEPLOY_MAP", joinColumns = { @JoinColumn(name = "TAG_ID") }, inverseJoinColumns = { @JoinColumn(name = "BUNDLE_DEPLOYMENT_ID") }) @ManyToMany private Set<BundleDeployment> bundleDeployments;
+ @JoinTable(name = "RHQ_TAGGING_BUNDLE_DEST_MAP", joinColumns = { @JoinColumn(name = "TAG_ID") }, inverseJoinColumns = { @JoinColumn(name = "BUNDLE_DESTINATION_ID") }) + @ManyToMany + private Set<BundleDestination> bundleDestinations; + protected Tag() { }
@@ -265,6 +270,31 @@ public class Tag implements Serializable { } }
+ public Set<BundleDestination> getBundleDestinations() { + return bundleDestinations; + } + + public void setBundleDestinations(Set<BundleDestination> bundleDestinations) { + this.bundleDestinations = bundleDestinations; + } + + public void addBundleDestination(BundleDestination bundleDestination) { + if (bundleDestinations == null) { + bundleDestinations = new HashSet<BundleDestination>(); + } + bundleDestination.addTag(this); + bundleDestinations.add(bundleDestination); + } + + public boolean removeBundleDestination(BundleDestination bundleDestination) { + if (bundleDestinations != null) { + bundleDestination.removeTag(this); + return bundleDestinations.remove(bundleDestination); + } else { + return false; + } + } + @Override public String toString() { return (namespace != null ? namespace + ":" : "") + (semantic != null ? semantic + "=" : "") + name; diff --git a/modules/core/domain/src/test/java/org/rhq/core/domain/bundle/test/BundleTest.java b/modules/core/domain/src/test/java/org/rhq/core/domain/bundle/test/BundleTest.java index 357c7bf..8bdb830 100644 --- a/modules/core/domain/src/test/java/org/rhq/core/domain/bundle/test/BundleTest.java +++ b/modules/core/domain/src/test/java/org/rhq/core/domain/bundle/test/BundleTest.java @@ -44,6 +44,10 @@ import org.rhq.core.domain.test.AbstractEJB3Test; @Test @SuppressWarnings("unchecked") public class BundleTest extends AbstractEJB3Test { + + private static final boolean ENABLED = true; + + @Test(enabled = ENABLED) public void testBundleVersionRepo() throws Throwable { getTransactionManager().begin(); EntityManager em = getEntityManager(); @@ -120,6 +124,7 @@ public class BundleTest extends AbstractEJB3Test { } }
+ @Test(enabled = ENABLED) public void testBundleVersion() throws Throwable { getTransactionManager().begin(); EntityManager em = getEntityManager(); @@ -199,6 +204,7 @@ public class BundleTest extends AbstractEJB3Test { } }
+ @Test(enabled = ENABLED) public void testMultipleBundleVersions() throws Throwable { getTransactionManager().begin(); EntityManager em = getEntityManager(); @@ -315,6 +321,7 @@ public class BundleTest extends AbstractEJB3Test { } }
+ @Test(enabled = ENABLED) public void testBundle() throws Throwable { getTransactionManager().begin(); EntityManager em = getEntityManager(); @@ -386,6 +393,7 @@ public class BundleTest extends AbstractEJB3Test { } }
+ @Test(enabled = ENABLED) public void testBundleType() throws Throwable { getTransactionManager().begin(); EntityManager em = getEntityManager(); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java index f62c97d..0a066d1 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java @@ -715,7 +715,6 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot deployment.addResourceDeployment(resourceDeployment); }
- entityManager.persist(deployment); return deployment; }
@@ -767,13 +766,15 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot
// Handle Schedule Failures. This may include deployment failures for immediate deployment request if (!response.isSuccess()) { - history = new BundleResourceDeploymentHistory(subject.getName(), AUDIT_ACTION_DEPLOYMENT, deployment - .getName(), null, BundleResourceDeploymentHistory.Status.FAILURE, response.getErrorMessage(), null); bundleManager.setBundleResourceDeploymentStatus(subject, resourceDeployment.getId(), BundleDeploymentStatus.FAILURE); + history = new BundleResourceDeploymentHistory(subject.getName(), AUDIT_ACTION_DEPLOYMENT, deployment + .getName(), null, BundleResourceDeploymentHistory.Status.FAILURE, response.getErrorMessage(), null); bundleManager.addBundleResourceDeploymentHistory(subject, resourceDeployment.getId(), history); } } else { + bundleManager.setBundleResourceDeploymentStatus(subject, resourceDeployment.getId(), + BundleDeploymentStatus.FAILURE); BundleResourceDeploymentHistory history = new BundleResourceDeploymentHistory(subject.getName(), AUDIT_ACTION_DEPLOYMENT, deployment.getName(), null, BundleResourceDeploymentHistory.Status.FAILURE, "Target resource is not a platform [id=" + resource.getId() + "]. Fix target group for destination [" diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java index c7f0b74..36473c9 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java @@ -65,6 +65,7 @@ import org.rhq.core.domain.content.PackageType; import org.rhq.core.domain.content.PackageVersion; import org.rhq.core.domain.content.Repo; import org.rhq.core.domain.criteria.BundleCriteria; +import org.rhq.core.domain.criteria.BundleDeploymentCriteria; import org.rhq.core.domain.criteria.BundleFileCriteria; import org.rhq.core.domain.criteria.BundleResourceDeploymentCriteria; import org.rhq.core.domain.criteria.BundleVersionCriteria; @@ -85,7 +86,6 @@ import org.rhq.enterprise.server.resource.metadata.test.UpdateSubsytemTestBase; import org.rhq.enterprise.server.test.TestAgentClient; import org.rhq.enterprise.server.test.TestServerCommunicationsService; import org.rhq.enterprise.server.util.LookupUtil; -import org.rhq.enterprise.server.ws.BundleGroupDeployment;
/** * @author John Mazzitelli @@ -155,7 +155,7 @@ public class BundleManagerBeanTest extends UpdateSubsytemTestBase { // clean up any tests that don't already clean up after themselves
// remove bundleversions which cascade remove bundlefiles and bundledeployments - // bundledeployments cascade remove bundleresourcedeployments and bundlegroupdeployments + // bundledeployments cascade remove bundleresourcedeployments // bundleresourcedeployments cascade remove bundleresourcedeploymenthistory q = em.createQuery("SELECT bv FROM BundleVersion bv WHERE bv.name LIKE '" + TEST_PREFIX + "%'"); doomed = q.getResultList(); @@ -179,7 +179,7 @@ public class BundleManagerBeanTest extends UpdateSubsytemTestBase { em.remove(em.getReference(BundleResourceDeploymentHistory.class, ((BundleResourceDeploymentHistory) removeMe).getId())); } - // remove any orphaned bds + // remove any orphaned brds q = em.createQuery("SELECT brd FROM BundleResourceDeployment brd WHERE brd.bundleDeployment.name LIKE '" + TEST_PREFIX + "%'"); doomed = q.getResultList(); @@ -187,14 +187,7 @@ public class BundleManagerBeanTest extends UpdateSubsytemTestBase { em.remove(em .getReference(BundleResourceDeployment.class, ((BundleResourceDeployment) removeMe).getId())); } - // remove any orphaned bgds - q = em.createQuery("SELECT bgd FROM BundleGroupDeployment bgd WHERE bgd.bundleDeployment.name LIKE '" - + TEST_PREFIX + "%'"); - doomed = q.getResultList(); - for (Object removeMe : doomed) { - em.remove(em.getReference(BundleGroupDeployment.class, ((BundleGroupDeployment) removeMe).getId())); - } - // remove any orphaned bdds + // remove any orphaned bds q = em.createQuery("SELECT bd FROM BundleDeployment bd WHERE bd.name LIKE '" + TEST_PREFIX + "%'"); doomed = q.getResultList(); for (Object removeMe : doomed) { @@ -230,7 +223,7 @@ public class BundleManagerBeanTest extends UpdateSubsytemTestBase { em.remove(em.getReference(PackageType.class, ((PackageType) removeMe).getId())); } // remove any orphaned destinations - q = em.createQuery("SELECT bd FROM BundleDestination pt WHERE bd.name LIKE '" + TEST_PREFIX + "%'"); + q = em.createQuery("SELECT bd FROM BundleDestination bd WHERE bd.name LIKE '" + TEST_PREFIX + "%'"); doomed = q.getResultList(); for (Object removeMe : doomed) { em.remove(em.getReference(BundleDestination.class, ((BundleDestination) removeMe).getId())); @@ -733,20 +726,37 @@ public class BundleManagerBeanTest extends UpdateSubsytemTestBase { assertNotNull(dest1); BundleDeployment bd1 = createDeployment("one", bv1, dest1, config); assertNotNull(bd1); + assertEquals(BundleDeploymentStatus.PENDING, bd1.getStatus());
BundleDeployment bd1d = bundleManager.scheduleBundleDeployment(overlord, bd1.getId()); assertNotNull(bd1d); assertEquals(bd1.getId(), bd1d.getId()); - assertEquals(platformResourceGroup.getId(), bd1d.getDestination().getGroup().getId()); - assertEquals(BundleDeploymentStatus.IN_PROGRESS, bd1d.getStatus()); + + BundleDeploymentCriteria bdc = new BundleDeploymentCriteria(); + bdc.addFilterId(bd1d.getId()); + bdc.fetchBundleVersion(true); + bdc.fetchConfiguration(true); + bdc.fetchDestination(true); + bdc.fetchResourceDeployments(true); + bdc.fetchTags(true); + List<BundleDeployment> bds = bundleManager.findBundleDeploymentsByCriteria(overlord, bdc); + assertEquals(1, bds.size()); + bd1d = bds.get(0); + + assertEquals(platformResourceGroup, bd1d.getDestination().getGroup()); + assertEquals(dest1.getId(), bd1d.getDestination().getId()); + BundleResourceDeploymentCriteria c = new BundleResourceDeploymentCriteria(); c.addFilterBundleDeploymentId(bd1d.getId()); + c.fetchBundleDeployment(true); c.fetchHistories(true); + c.fetchResource(true); List<BundleResourceDeployment> brds = bundleManager.findBundleResourceDeploymentsByCriteria(overlord, c); assertEquals(1, brds.size()); assertEquals(1, bd1d.getResourceDeployments().size()); assertEquals(bd1d.getResourceDeployments().get(0).getId(), brds.get(0).getId()); BundleResourceDeployment brd = brds.get(0); + assertNotNull(brd.getBundleResourceDeploymentHistories()); int size = brd.getBundleResourceDeploymentHistories().size(); assertTrue(size > 0); @@ -754,9 +764,10 @@ public class BundleManagerBeanTest extends UpdateSubsytemTestBase { bundleManager.addBundleResourceDeploymentHistory(overlord, brd.getId(), new BundleResourceDeploymentHistory( overlord.getName(), auditMessage, auditMessage, BundleResourceDeploymentHistory.Category.DEPLOY_STEP, BundleResourceDeploymentHistory.Status.SUCCESS, auditMessage, auditMessage)); + brds = bundleManager.findBundleResourceDeploymentsByCriteria(overlord, c); assertEquals(1, brds.size()); - assertEquals(bd1d.getId(), brds.get(0).getId()); + assertEquals(brd.getId(), brds.get(0).getId()); brd = brds.get(0); assertNotNull(brd.getBundleResourceDeploymentHistories()); assertTrue((size + 1) == brd.getBundleResourceDeploymentHistories().size());
commit c1f50e8de159e9248f3b42c2c0ddd48d94426120 Author: Ian P. Springer <ips@jetengine.(none)> Date: Tue May 11 14:16:47 2010 -0400
get as5 plugin working w/ AS 6.0.0.M3 (fix for https://bugzilla.redhat.com/show_bug.cgi?id=591177); add comment in JBossAS5ConnectionTypeDescriptor that explains why getConnectionClasspathEntries() returns an empty array
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 b02bd01..4b39094 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 @@ -90,13 +90,18 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom }
private static final String[] CLIENT_JARS = new String[] { + // NOTE: The jbossall-client.jar aggregates a whole bunch of other jars from the client dir via its + // MANIFEST.MF Class-Path. "client/jbossall-client.jar", "client/trove.jar", "client/javassist.jar", "common/lib/jboss-security-aspects.jar", "lib/jboss-managed.jar", "lib/jboss-metatype.jar", - "lib/jboss-dependency.jar" + "lib/jboss-dependency.jar", + // The below jars are required for JBoss AS 6.0 M1, M2, and M3. + "lib/jboss-classpool.jar", + "lib/jboss-classpool-scoped.jar" };
private final Log log = LogFactory.getLog(this.getClass()); diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JBossAS5ConnectionTypeDescriptor.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JBossAS5ConnectionTypeDescriptor.java index 4a3a5c3..9fa3dea 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JBossAS5ConnectionTypeDescriptor.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JBossAS5ConnectionTypeDescriptor.java @@ -25,58 +25,25 @@ package org.rhq.plugins.jbossas5.helper; import org.mc4j.ems.connection.support.metadata.JBossConnectionTypeDescriptor;
/** - * A connection type descriptor to support jnp connections to JBoss AS 5 through EMS. + * A connection type descriptor to support JNP connections to JBoss AS 5.x/6.x through EMS. * * @author Lukas Krejci */ public class JBossAS5ConnectionTypeDescriptor extends JBossConnectionTypeDescriptor { - private static final long serialVersionUID = 1L;
+ private static final String[] CONNECTION_CLASSPATH_ENTRIES = new String[0]; + @Override public String getRecongnitionPath() { return "lib/jboss-main.jar"; }
+ // NOTE: We return an empty array, because this plugin uses RHQ's new plugin connection classloader facility + // (see org.rhq.core.pluginapi.inventory.ClassLoaderFacet), rather than EMS, to load JBoss AS client jars via + // a connection-scoped classloader. @Override public String[] getConnectionClasspathEntries() { - // This is what Scott recommended using for JBAS 5.1: - // - // <classpath> - // <classpathentry kind="src" path="src"/> - // <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - // <classpathentry kind="var" path="JBOSS/client/jboss-common-core.jar"/> - // <classpathentry kind="var" path="JBOSS/client/jnp-client.jar"/> - // <classpathentry kind="var" path="JBOSS/lib/jboss-profileservice-spi.jar"/> - // <classpathentry kind="var" path="JBOSS/client/jboss-logging-jdk.jar"/> - // <classpathentry kind="var" path="JBOSS/client/jboss-logging-log4j.jar"/> - // <classpathentry kind="var" path="JBOSS/client/log4j.jar"/> - // <classpathentry kind="var" path="JBOSS/client/jboss-logging-spi.jar"/> - // <classpathentry kind="var" path="JBOSS/client/jboss-aop-client.jar"/> - // <classpathentry kind="var" path="JBOSS/client/jboss-remoting.jar"/> - // <classpathentry kind="var" path="JBOSS/common/lib/jboss-security-aspects.jar"/> - // <classpathentry kind="var" path="JBOSS/client/jboss-aspect-jdk50-client.jar"/> - // <classpathentry kind="var" path="JBOSS/client/trove.jar"/> - // <classpathentry kind="var" path="JBOSS/client/javassist.jar"/> - // <classpathentry kind="var" path="JBOSS/client/jboss-mdr.jar"/> - // <classpathentry kind="var" path="JBOSS/client/jboss-security-spi.jar"/> - // <classpathentry kind="var" path="JBOSS/client/jbosssx-client.jar"/> - // <classpathentry kind="var" path="JBOSS/client/jboss-javaee.jar"/> - // <classpathentry kind="var" path="JBOSS/client/concurrent.jar"/> - // <classpathentry kind="output" path="bin"/> - // </classpath> - return new String[0]; - - /*return new String[] { "client/jboss-common-core.jar", "client/jnp-client.jar", - "lib/jboss-profileservice-spi.jar", "client/jboss-logging-jdk.jar", "client/jboss-logging-jdk.jar", - "client/log4j.jar", "client/jboss-logging-spi.jar", "client/jboss-aop-client.jar", - "client/jboss-remoting.jar", "common/lib/jboss-security-aspects.jar", - "client/jboss-aspect-jdk50-client.jar", "client/trove.jar", "client/javassist.jar", "client/jboss-mdr.jar", - "client/jboss-security-spi.jar", "client/jbosssx-client.jar", "client/jboss-javaee.jar", - "client/concurrent.jar", "client/jmx-invoker-adaptor-client.jar", "client/jboss-client.jar", - "client/jboss-integration.jar", "client/jboss-serialization.jar", - //this is to support hibernate plugin out of the box in jboss as 5 - "common/lib/hibernate-core.jar" };*/ + return CONNECTION_CLASSPATH_ENTRIES; } - }
commit 4817fdf44eee381115d82a795389e7c8525a6021 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 11 11:16:22 2010 -0400
Provisioning Work (IN PROGRESS - COMPILING, NOT WORKING) - Introduce BundleDestination - Remove BundleResourceGroupDeployment -- integrated into BundleDeployment and BundleDestination - Make BundleResourceDeploymentHistory more robust
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml index a89ab49..4d24931 100644 --- a/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml +++ b/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml @@ -536,64 +536,68 @@ <column name="PACKAGE_VERSION_ID" type="INTEGER" required="true" references="RHQ_PACKAGE_VERSION"/> </table>
- <!-- A set of configuration values that are used to customize how a bundle version is installed --> - <table name="RHQ_BUNDLE_DEPLOY"> + <!-- A logical destination for a bundle deployment. Defines the platforms and directory on those targets. --> + <table name="RHQ_BUNDLE_DESTINATION"> <column name="ID" default="sequence-only" initial="10001" primarykey="true" required="true" type="INTEGER"/> <column name="NAME" size="200" type="VARCHAR2" required="true"/> <column name="DESCRIPTION" size="500" type="VARCHAR2" required="false"/> <column name="CTIME" type="LONG" required="true"/> <column name="MTIME" type="LONG" required="true"/> - <column name="INSTALL_DIR" size="256" type="VARCHAR2" required="true"/> - <column name="CONFIG_ID" type="INTEGER" required="false" references="RHQ_CONFIG" /> - <column name="BUNDLE_VERSION_ID" type="INTEGER" required="true" references="RHQ_BUNDLE_VERSION"/> + <column name="BUNDLE_ID" type="INTEGER" required="true" references="RHQ_BUNDLE"/> + <column name="GROUP_ID" type="INTEGER" required="true" references="RHQ_RESOURCE_GROUP"/> + <column name="DEPLOY_DIR" size="256" type="VARCHAR2" required="true"/>
<!-- This index is for constraint, not performance --> - <index name="RHQ_BUNDLE_DEPLOY_UNIQUE" unique="true"> - <field ref="BUNDLE_VERSION_ID"/> - <field ref="NAME"/> - <field ref="INSTALL_DIR"/> + <index name="RHQ_BUNDLE_DESTINATION_UNIQUE" unique="true"> + <field ref="BUNDLE_ID"/> + <field ref="NAME"/> </index> </table>
- <table name="RHQ_BUNDLE_GROUP_DEPLOY"> - <column name="ID" type="INTEGER" required="true" default="sequence-only" initial="10001" primarykey="true"/> - <column name="GROUP_ID" type="INTEGER" required="true" references="RHQ_RESOURCE_GROUP"/> - <column name="BUNDLE_DEPLOY_ID" type="INTEGER" required="true" references="RHQ_BUNDLE_DEPLOY" /> - <column name="STATUS" type="VARCHAR2" required="true" size="16"/> - <column name="ERROR_MESSAGE" type="LONGVARCHAR" required="false"/> - <column name="SUBJECT_NAME" type="VARCHAR2" required="true" size="255"/> + <!-- An actual deployment of a bundle version to a destination, with a specific config. Bundle deployments + can differ only on ctime, which is assumed to be different --> + <table name="RHQ_BUNDLE_DEPLOYMENT"> + <column name="ID" default="sequence-only" initial="10001" primarykey="true" required="true" type="INTEGER"/> + <column name="NAME" size="200" type="VARCHAR2" required="true"/> + <column name="DESCRIPTION" size="500" type="VARCHAR2" required="false"/> <column name="CTIME" type="LONG" required="true"/> <column name="MTIME" type="LONG" required="true"/> + <column name="BUNDLE_VERSION_ID" type="INTEGER" required="true" references="RHQ_BUNDLE_VERSION"/> + <column name="BUNDLE_DESTINATION_ID" type="INTEGER" required="true" references="RHQ_BUNDLE_DESTINATION"/> + <column name="CONFIG_ID" type="INTEGER" required="false" references="RHQ_CONFIG" /> + <column name="SUBJECT_NAME" type="VARCHAR2" required="true" size="255"/> + <column name="STATUS" type="VARCHAR2" required="true" size="16"/> + <column name="ERROR_MESSAGE" type="LONGVARCHAR" required="false"/> + <column name="IS_LIVE" type="BOOLEAN" required="true"/> </table>
<!-- Represents a bundle version that is deployed on a platform resource --> <table name="RHQ_BUNDLE_RES_DEPLOY"> <column name="ID" default="sequence-only" initial="10001" primarykey="true" required="true" type="INTEGER"/> - <column name="BUNDLE_DEPLOY_ID" type="INTEGER" required="true" references="RHQ_BUNDLE_DEPLOY" /> + <column name="BUNDLE_DEPLOYMENT_ID" type="INTEGER" required="true" references="RHQ_BUNDLE_DEPLOYMENT" /> <column name="RESOURCE_ID" type="INTEGER" required="true" references="RHQ_RESOURCE" /> - <column name="IS_CURRENT" type="BOOLEAN" required="true"/> <column name="STATUS" type="VARCHAR2" required="true" size="16"/> <column name="CTIME" type="LONG" required="true"/> - <column name="BUNDLE_GROUP_DEPLOY_ID" type="INTEGER" required="false" references="RHQ_BUNDLE_GROUP_DEPLOY"/> - - <index name="RHQ_DEPLOY_DEF_RESOURCE_IDX" unique="true"> - <field ref="BUNDLE_DEPLOY_ID"/> + + <index name="RHQ_BUNDLE_RES_DEP_UNIQUE" unique="true"> + <field ref="BUNDLE_DEPLOYMENT_ID"/> <field ref="RESOURCE_ID"/> </index> </table>
<table name="RHQ_BUNDLE_RES_DEP_HIST"> <column name="ID" default="sequence-only" initial="10001" primarykey="true" required="true" type="INTEGER"/> - <column name="BUNDLE_RES_DEPLOY_ID" type="INTEGER" required="true" references="RHQ_BUNDLE_RES_DEPLOY" /> + <column name="BUNDLE_RES_DEPLOYMENT_ID" type="INTEGER" required="true" references="RHQ_BUNDLE_RES_DEPLOY" /> <column name="SUBJECT_NAME" required="false" size="255" type="VARCHAR2"/> <column name="AUDIT_TIME" required="true" type="LONG"/> - <column name="AUDIT_ACTION" required="true" size="512" type="VARCHAR2"/> - <column name="AUDIT_STATUS" required="true" type="VARCHAR2" size="16"/> - <column name="AUDIT_MESSAGE" required="false" type="LONGVARCHAR"/> + <column name="ACTION" required="true" size="128" type="VARCHAR2"/> + <column name="INFO" required="true" size="512" type="VARCHAR2"/> + <column name="CATEGORY" required="true" size="32" type="VARCHAR2"/> + <column name="STATUS" required="true" type="VARCHAR2" size="16"/> + <column name="MESSAGE" required="false" type="LONGVARCHAR"/> + <column name="ATTACHMENT" required="false" type="LONGVARCHAR"/> </table>
- - <!-- TAG mapping tables added in 2.85 --> <table name="RHQ_TAGGING_BUNDLE_MAP"> <column name="BUNDLE_ID" type="INTEGER" references="RHQ_BUNDLE"/> <column name="TAG_ID" type="INTEGER" references="RHQ_TAGGING"/> @@ -604,6 +608,7 @@ </primaryKey> </constraint> </table> + <table name="RHQ_TAGGING_BUNDLE_VERSION_MAP"> <column name="BUNDLE_VERSION_ID" type="INTEGER" references="RHQ_BUNDLE_VERSION"/> <column name="TAG_ID" type="INTEGER" references="RHQ_TAGGING"/> @@ -616,15 +621,26 @@ </table>
<table name="RHQ_TAGGING_BUNDLE_DEPLOY_MAP"> - <column name="BUNDLE_DEPLOY_ID" type="INTEGER" references="RHQ_BUNDLE_DEPLOY"/> + <column name="BUNDLE_DEPLOYMENT_ID" type="INTEGER" references="RHQ_BUNDLE_DEPLOYMENT"/> <column name="TAG_ID" type="INTEGER" references="RHQ_TAGGING"/> <constraint name="RHQ_TAGGING_BUNDLE_DEP_MAP_KEY"> <primaryKey> - <field ref="BUNDLE_DEPLOY_ID"/> + <field ref="BUNDLE_DEPLOYMENT_ID"/> <field ref="TAG_ID"/> </primaryKey> </constraint> </table> - + + <table name="RHQ_TAGGING_BUNDLE_DEST_MAP"> + <column name="BUNDLE_DESTINATION_ID" type="INTEGER" references="RHQ_BUNDLE_DESTINATION"/> + <column name="TAG_ID" type="INTEGER" references="RHQ_TAGGING"/> + <constraint name="RHQ_TAGGING_BUNDLE_DES_MAP_KEY"> + <primaryKey> + <field ref="BUNDLE_DESTINATION_ID"/> + <field ref="TAG_ID"/> + </primaryKey> + </constraint> + </table> + </dbsetup>
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java index f14fb59..dfeed21 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java @@ -99,12 +99,14 @@ public class Bundle implements Serializable { private PackageType packageType;
@OneToMany(mappedBy = "bundle", fetch = FetchType.LAZY, cascade = CascadeType.ALL) + private List<BundleDestination> destinations = new ArrayList<BundleDestination>(); + + @OneToMany(mappedBy = "bundle", fetch = FetchType.LAZY, cascade = CascadeType.ALL) private List<BundleVersion> bundleVersions = new ArrayList<BundleVersion>();
@ManyToMany(mappedBy = "bundles", fetch = FetchType.LAZY) private Set<Tag> tags;
- public Bundle() { // for JPA use } @@ -177,6 +179,19 @@ public class Bundle implements Serializable { this.bundleVersions = bundleVersions; }
+ public List<BundleDestination> getDestinations() { + return destinations; + } + + public void addDestination(BundleDestination destination) { + this.destinations.add(destination); + destination.setBundle(this); + } + + public void setDestinations(List<BundleDestination> destinations) { + this.destinations = destinations; + } + public Set<Tag> getTags() { return tags; } diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java index 200c2b5..17904c6 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java @@ -31,6 +31,8 @@ import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; @@ -49,6 +51,7 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType;
import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.domain.configuration.ConfigurationUpdateStatus; import org.rhq.core.domain.tagging.Tag;
/** @@ -62,8 +65,8 @@ import org.rhq.core.domain.tagging.Tag; @Entity @NamedQueries( { @NamedQuery(name = BundleDeployment.QUERY_FIND_ALL, query = "SELECT bd FROM BundleDeployment bd") // }) -@SequenceGenerator(name = "SEQ", sequenceName = "RHQ_BUNDLE_DEPLOY_ID_SEQ") -@Table(name = "RHQ_BUNDLE_DEPLOY") +@SequenceGenerator(name = "SEQ", sequenceName = "RHQ_BUNDLE_DEPLOYMENT_ID_SEQ") +@Table(name = "RHQ_BUNDLE_DEPLOYMENT") @XmlAccessorType(XmlAccessType.FIELD) public class BundleDeployment implements Serializable { private static final long serialVersionUID = 1L; @@ -81,15 +84,25 @@ public class BundleDeployment implements Serializable { @Column(name = "DESCRIPTION", nullable = true) private String description;
+ @Column(name = "STATUS", nullable = false) + @Enumerated(EnumType.STRING) + protected BundleDeploymentStatus status; + + @Column(name = "ERROR_MESSAGE") + protected String errorMessage; + + @Column(name = "SUBJECT_NAME") + protected String subjectName; + + @Column(name = "IS_LIVE") + private boolean isLive = false; + @Column(name = "CTIME") private Long ctime = System.currentTimeMillis();
@Column(name = "MTIME") private Long mtime = System.currentTimeMillis();
- @Column(name = "INSTALL_DIR", nullable = false) - private String installDir; - @JoinColumn(name = "CONFIG_ID", referencedColumnName = "ID", nullable = true) @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, optional = true) private Configuration configuration; @@ -98,11 +111,12 @@ public class BundleDeployment implements Serializable { @ManyToOne(fetch = FetchType.LAZY) private BundleVersion bundleVersion;
- @OneToMany(mappedBy = "bundleDeployment", fetch = FetchType.LAZY, cascade = CascadeType.ALL) - private List<BundleResourceDeployment> resourceDeployments = new ArrayList<BundleResourceDeployment>(); + @JoinColumn(name = "BUNDLE_DESTINATION_ID", referencedColumnName = "ID", nullable = false) + @ManyToOne(fetch = FetchType.LAZY) + private BundleDestination destination;
@OneToMany(mappedBy = "bundleDeployment", fetch = FetchType.LAZY, cascade = CascadeType.ALL) - private List<BundleGroupDeployment> groupDeployments = new ArrayList<BundleGroupDeployment>(); + private List<BundleResourceDeployment> resourceDeployments = new ArrayList<BundleResourceDeployment>();
@ManyToMany(mappedBy = "bundleDeployments", fetch = FetchType.LAZY) private Set<Tag> tags; @@ -111,10 +125,11 @@ public class BundleDeployment implements Serializable { // for JPA use }
- public BundleDeployment(BundleVersion bundleVersion, String name, String installDir) { + public BundleDeployment(BundleVersion bundleVersion, BundleDestination destination, String name) { this.bundleVersion = bundleVersion; + this.destination = destination; this.name = name; - this.installDir = installDir; + this.status = BundleDeploymentStatus.PENDING; }
public int getId() { @@ -163,12 +178,87 @@ public class BundleDeployment implements Serializable { this.mtime = mtime; }
- public String getInstallDir() { - return installDir; + /** + * The status of the request which indicates that the request is either still in progress, or it has completed and + * either succeeded or failed. + * + * @return the request status + */ + public BundleDeploymentStatus getStatus() { + return status; + } + + public void setStatus(BundleDeploymentStatus status) { + this.status = status; + } + + /** + * If not <code>null</code>, this is an error message (possibly a full stack trace) to indicate the overall error + * that occurred when the configuration update failed. This will normally be <code>null</code> unless the + * {@link #getStatus() status} indicates a {@link BundleDeploymentStatus#FAILURE}. + * + * @return overall error that occurred + */ + public String getErrorMessage() { + return errorMessage; + } + + /** + * Calling this method with a non-<code>null</code> error message implies that the request's status is + * {@link ConfigurationUpdateStatus#FAILURE}. The inverse is <i>not</i> true - that is, if you set the error message + * to <code>null</code>, the status is left as-is; it will not assume that a <code>null</code> error message means + * the status is successful. + * + * @param errorMessage + */ + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + + if (this.errorMessage != null) { + setStatus(BundleDeploymentStatus.FAILURE); + } + } + + /** + * For auditing purposes, this method tells you the username of the person that created the request. This is not a + * relationship to an actual Subject because we want to maintain the audit trail, even if a Subject has been deleted + * from the database. + * + * @return the actual name string of the submitter of the request + */ + public String getSubjectName() { + return subjectName; + } + + public void setSubjectName(String subjectName) { + this.subjectName = subjectName; }
- public void setInstallDir(String installDir) { - this.installDir = installDir; + public boolean isLive() { + return isLive; + } + + public void setLive(boolean isLive) { + this.isLive = isLive; + } + + /** + * The duration of the configuration update request which simply is the difference between the + * {@link #getCreatedTime()} and the {@link #getModifiedTime()}. If the request hasn't completed yet, this will be + * the difference between the current time and the created time. + * + * @return the duration of time that the request took or is taking to complete + */ + public long getDuration() { + long start = this.ctime; + long end; + if ((status == null) || (status == BundleDeploymentStatus.IN_PROGRESS)) { + end = System.currentTimeMillis(); + } else { + end = this.mtime; + } + + return end - start; }
public Configuration getConfiguration() { @@ -187,6 +277,14 @@ public class BundleDeployment implements Serializable { this.bundleVersion = bundleVersion; }
+ public BundleDestination getDestination() { + return destination; + } + + public void setDestination(BundleDestination destination) { + this.destination = destination; + } + public List<BundleResourceDeployment> getResourceDeployments() { return resourceDeployments; } @@ -200,19 +298,6 @@ public class BundleDeployment implements Serializable { resourceDeployment.setBundleDeployment(this); }
- public List<BundleGroupDeployment> getGroupDeployments() { - return groupDeployments; - } - - public void addGroupDeployment(BundleGroupDeployment groupDeployment) { - this.groupDeployments.add(groupDeployment); - groupDeployment.setBundleDeployment(this); - } - - public void setGroupDeployments(List<BundleGroupDeployment> groupDeployments) { - this.groupDeployments = groupDeployments; - } - public Set<Tag> getTags() { return tags; } @@ -245,9 +330,10 @@ public class BundleDeployment implements Serializable { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + ((bundleVersion == null) ? 0 : bundleVersion.hashCode()); - result = prime * result + ((name == null) ? 0 : name.hashCode()); - result = prime * result + ((installDir == null) ? 0 : installDir.hashCode()); + result = prime * result + ((this.bundleVersion == null) ? 0 : this.bundleVersion.hashCode()); + result = prime * result + ((this.destination == null) ? 0 : this.destination.hashCode()); + result = prime * result + ((this.name == null) ? 0 : this.name.hashCode()); + result = prime * result + ((this.ctime == null) ? 0 : this.ctime.hashCode()); return result; }
@@ -262,27 +348,35 @@ public class BundleDeployment implements Serializable {
BundleDeployment other = (BundleDeployment) obj;
- if (bundleVersion == null) { + if (this.bundleVersion == null) { if (other.bundleVersion != null) { return false; } - } else if (!bundleVersion.equals(other.bundleVersion)) { + } else if (!this.bundleVersion.equals(other.bundleVersion)) { + return false; + } + + if (this.destination == null) { + if (other.destination != null) { + return false; + } + } else if (!this.destination.equals(other.destination)) { return false; }
- if (name == null) { + if (this.name == null) { if (other.name != null) { return false; } - } else if (!name.equals(other.name)) { + } else if (!this.name.equals(other.name)) { return false; }
- if (installDir == null) { - if (other.installDir != null) { + if (this.ctime == null) { + if (other.ctime != null) { return false; } - } else if (!installDir.equals(other.installDir)) { + } else if (!this.ctime.equals(other.ctime)) { return false; }
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeploymentStatus.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeploymentStatus.java index 0c37294..5c9787b 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeploymentStatus.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeploymentStatus.java @@ -31,7 +31,9 @@ package org.rhq.core.domain.bundle; * @author Jay Shaughnessy */ public enum BundleDeploymentStatus { - INPROGRESS("In Progress"), // + PENDING("Pending"), // + IN_PROGRESS("In Progress"), // + MIXED("Mixed"), // SUCCESS("Success"), // FAILURE("Failure"), // WARN("Warning"); diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java new file mode 100644 index 0000000..d0feee8 --- /dev/null +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java @@ -0,0 +1,276 @@ +/* + * 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, 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.domain.bundle; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToMany; +import javax.persistence.ManyToOne; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.OneToMany; +import javax.persistence.PrePersist; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; + +import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.core.domain.tagging.Tag; + +/** + * Defines a logical destination for deployment of a bundle. Defines the target platform group and the + * target deploy directory on those platforms. A Bundle can have several defined destinations although + * Destination is specific to a single Bundle. + * + * @author Jay Shaughnessy + */ +@Entity +@NamedQueries( { @NamedQuery(name = BundleDestination.QUERY_FIND_ALL, query = "SELECT bd FROM BundleDestination bd") // +}) +@SequenceGenerator(name = "SEQ", sequenceName = "RHQ_BUNDLE_DESTINATION_ID_SEQ") +@Table(name = "RHQ_BUNDLE_DESTINATION") +@XmlAccessorType(XmlAccessType.FIELD) +public class BundleDestination implements Serializable { + private static final long serialVersionUID = 1L; + + public static final String QUERY_FIND_ALL = "BundleDestination.findAll"; + + @Column(name = "ID", nullable = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @Id + private int id; + + @Column(name = "NAME", nullable = false) + private String name; + + @Column(name = "DESCRIPTION", nullable = true) + private String description; + + @Column(name = "DEPLOY_DIR", nullable = true) + private String deployDir; + + @Column(name = "CTIME") + private Long ctime = System.currentTimeMillis(); + + @Column(name = "MTIME") + private Long mtime = System.currentTimeMillis(); + + @JoinColumn(name = "BUNDLE_ID", referencedColumnName = "ID", nullable = false) + @ManyToOne + private Bundle bundle; + + @JoinColumn(name = "GROUP_ID", referencedColumnName = "ID", nullable = false) + @ManyToOne + private ResourceGroup group; + + @JoinColumn(name = "BUNDLE_VERSION_ID", referencedColumnName = "ID", nullable = false) + @ManyToOne(fetch = FetchType.LAZY) + private BundleVersion bundleVersion; + + @OneToMany(mappedBy = "bundleDestination", fetch = FetchType.LAZY) + private List<BundleDeployment> deployments = new ArrayList<BundleDeployment>(); + + @ManyToMany(mappedBy = "bundleDestinations", fetch = FetchType.LAZY) + private Set<Tag> tags; + + public BundleDestination() { + // for JPA use + } + + public BundleDestination(Bundle bundle, String name, ResourceGroup group, String deployDir) { + this.bundle = bundle; + this.name = name; + this.group = group; + this.deployDir = deployDir; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDeployDir() { + return deployDir; + } + + public void setDeployDir(String deployDir) { + this.deployDir = deployDir; + } + + public long getCtime() { + return this.ctime; + } + + @PrePersist + void onPersist() { + this.mtime = this.ctime = System.currentTimeMillis(); + } + + /** + * The time that any part of this entity was updated in the database. + * + * @return entity modified time + */ + public long getMtime() { + return this.mtime; + } + + public void setMtime(long mtime) { + this.mtime = mtime; + } + + public Bundle getBundle() { + return bundle; + } + + public void setBundle(Bundle bundle) { + this.bundle = bundle; + } + + public ResourceGroup getGroup() { + return group; + } + + public void setGroup(ResourceGroup group) { + this.group = group; + } + + public BundleVersion getBundleVersion() { + return bundleVersion; + } + + public void setBundleVersion(BundleVersion bundleVersion) { + this.bundleVersion = bundleVersion; + } + + public List<BundleDeployment> getDeployments() { + return deployments; + } + + public void setDeployments(List<BundleDeployment> deployments) { + this.deployments = deployments; + } + + public void addDeployment(BundleDeployment deployment) { + this.deployments.add(deployment); + deployment.setDestination(this); + } + + public Set<Tag> getTags() { + return tags; + } + + public void setTags(Set<Tag> tags) { + this.tags = tags; + } + + public void addTag(Tag tag) { + if (this.tags == null) { + tags = new HashSet<Tag>(); + } + tags.add(tag); + } + + public boolean removeTag(Tag tag) { + if (tags != null) { + return tags.remove(tag); + } else { + return false; + } + } + + @Override + public String toString() { + return "BundleDeployment[id=" + id + ", bundle=" + bundle.getName() + ", name=" + name + "]"; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((bundle == null) ? 0 : bundle.hashCode()); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof BundleDeployment)) { + return false; + } + + BundleDestination other = (BundleDestination) obj; + + if (bundle == null) { + if (other.bundle != null) { + return false; + } + } else if (!bundle.equals(other.bundle)) { + return false; + } + + if (name == null) { + if (other.name != null) { + return false; + } + } else if (!name.equals(other.name)) { + return false; + } + + return true; + } +} \ No newline at end of file diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleGroupDeployment.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleGroupDeployment.java deleted file mode 100644 index 1f8ecb6..0000000 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleGroupDeployment.java +++ /dev/null @@ -1,294 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, 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.domain.bundle; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.PrePersist; -import javax.persistence.PreUpdate; -import javax.persistence.SequenceGenerator; -import javax.persistence.Table; - -import org.rhq.core.domain.configuration.ConfigurationUpdateStatus; -import org.rhq.core.domain.resource.group.ResourceGroup; - -/** - * @author Jay Shaughnessy - */ -@Entity -@SequenceGenerator(name = "SEQ", sequenceName = "RHQ_BUNDLE_GROUP_DEPLOY_ID_SEQ") -@Table(name = "RHQ_BUNDLE_GROUP_DEPLOY") -public class BundleGroupDeployment implements Serializable { - - private static final long serialVersionUID = 1L; - - @GeneratedValue(generator = "SEQ", strategy = GenerationType.AUTO) - @Id - private int id; - - @JoinColumn(name = "GROUP_ID", referencedColumnName = "ID") - @ManyToOne - private ResourceGroup group; - - @JoinColumn(name = "BUNDLE_DEPLOY_ID", referencedColumnName = "ID", nullable = false) - @ManyToOne - protected BundleDeployment bundleDeployment; - - @Column(name = "STATUS", nullable = false) - @Enumerated(EnumType.STRING) - protected BundleDeploymentStatus status; - - @Column(name = "ERROR_MESSAGE") - protected String errorMessage; - - @Column(name = "SUBJECT_NAME") - protected String subjectName; - - @Column(name = "CTIME", nullable = false) - protected long createdTime = System.currentTimeMillis(); - - @Column(name = "MTIME", nullable = false) - protected long modifiedTime = System.currentTimeMillis(); - - @OneToMany(mappedBy = "groupDeployment", fetch = FetchType.LAZY) - private List<BundleResourceDeployment> resourceDeployments = new ArrayList<BundleResourceDeployment>(); - - // For JPA - public BundleGroupDeployment() { - } - - public BundleGroupDeployment(String subjectName, BundleDeployment bundleDeployment, ResourceGroup group) { - this.subjectName = subjectName; - this.bundleDeployment = bundleDeployment; - this.group = group; - this.status = BundleDeploymentStatus.INPROGRESS; - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - /** - * The status of the request which indicates that the request is either still in progress, or it has completed and - * either succeeded or failed. - * - * @return the request status - */ - public BundleDeploymentStatus getStatus() { - return status; - } - - public void setStatus(BundleDeploymentStatus status) { - this.status = status; - } - - public ResourceGroup getGroup() { - return group; - } - - public void setGroup(ResourceGroup group) { - this.group = group; - } - - public BundleDeployment getBundleDeployment() { - return bundleDeployment; - } - - public void setBundleDeployment(BundleDeployment bundleDeployment) { - this.bundleDeployment = bundleDeployment; - } - - /** - * If not <code>null</code>, this is an error message (possibly a full stack trace) to indicate the overall error - * that occurred when the configuration update failed. This will normally be <code>null</code> unless the - * {@link #getStatus() status} indicates a {@link BundleDeploymentStatus#FAILURE}. - * - * @return overall error that occurred - */ - public String getErrorMessage() { - return errorMessage; - } - - /** - * Calling this method with a non-<code>null</code> error message implies that the request's status is - * {@link ConfigurationUpdateStatus#FAILURE}. The inverse is <i>not</i> true - that is, if you set the error message - * to <code>null</code>, the status is left as-is; it will not assume that a <code>null</code> error message means - * the status is successful. - * - * @param errorMessage - */ - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - - if (this.errorMessage != null) { - setStatus(BundleDeploymentStatus.FAILURE); - } - } - - /** - * For auditing purposes, this method tells you the username of the person that created the request. This is not a - * relationship to an actual Subject because we want to maintain the audit trail, even if a Subject has been deleted - * from the database. - * - * @return the actual name string of the submitter of the request - */ - public String getSubjectName() { - return subjectName; - } - - /** - * The time this entity was originally created; in other words, when the request was originally made. - * - * @return creation time - */ - public long getCreatedTime() { - return this.createdTime; - } - - /** - * The time this entity was last modified. This is the last time the status was updated. If the status has never - * been updated, this will be the {@link #getCreatedTime() created time}. - * - * @return last modified time - */ - public long getModifiedTime() { - return this.modifiedTime; - } - - public List<BundleResourceDeployment> getResourceDeployments() { - return resourceDeployments; - } - - public void setResourceDeployments(List<BundleResourceDeployment> resourceDeployments) { - this.resourceDeployments = resourceDeployments; - } - - public void addResourceDeployment(BundleResourceDeployment resourceDeployment) { - resourceDeployment.setGroupDeployment(this); - this.resourceDeployments.add(resourceDeployment); - } - - /** - * The duration of the configuration update request which simply is the difference between the - * {@link #getCreatedTime()} and the {@link #getModifiedTime()}. If the request hasn't completed yet, this will be - * the difference between the current time and the created time. - * - * @return the duration of time that the request took or is taking to complete - */ - public long getDuration() { - long start = this.createdTime; - long end; - if ((status == null) || (status == BundleDeploymentStatus.INPROGRESS)) { - end = System.currentTimeMillis(); - } else { - end = this.modifiedTime; - } - - return end - start; - } - - @Override - public int hashCode() { - final int PRIME = 31; - int result = 1; - result = (PRIME * result) + (int) (createdTime ^ (createdTime >>> 32)); - result = (PRIME * result) + ((subjectName == null) ? 0 : subjectName.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - - if ((obj == null) || !(obj instanceof BundleGroupDeployment)) { - return false; - } - - final BundleGroupDeployment other = (BundleGroupDeployment) obj; - - if (this.createdTime != other.createdTime) { - return false; - } - - if (this.subjectName == null) { - if (other.subjectName != null) { - return false; - } - } else if (!this.subjectName.equals(other.subjectName)) { - return false; - } - - return true; - } - - @PrePersist - void onPersist() { - // don't set createdTime - we use it in equals/hashCode - it is already set at instantiation time - this.modifiedTime = System.currentTimeMillis(); - } - - @PreUpdate - void onUpdate() { - this.modifiedTime = System.currentTimeMillis(); - } - - @Override - public String toString() { - StringBuilder str = new StringBuilder("BundleGroupDeployment ["); - str.append("id=").append(this.id); - str.append(", status=").append(this.status); - str.append(", resourceGroup=").append(this.group); - str.append(", deployment=").append(this.getBundleDeployment()); - str.append(", subjectName=").append(this.subjectName); - str.append(", createdTime=").append(this.createdTime); - str.append(", modifiedTime=").append(this.modifiedTime); - - String err = this.errorMessage; - if ((err != null) && (err.indexOf('\n') > -1)) { - err = err.substring(0, err.indexOf('\n')) + "..."; - } - str.append(", errorMessage=").append(err); - str.append(']'); - - return str.toString(); - } -} diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeployment.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeployment.java index 1a4a9da..67bbd74 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeployment.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeployment.java @@ -74,7 +74,7 @@ public class BundleResourceDeployment implements Serializable { @Id private int id;
- @JoinColumn(name = "BUNDLE_DEPLOY_ID", referencedColumnName = "ID", nullable = false) + @JoinColumn(name = "BUNDLE_DEPLOYMENT_ID", referencedColumnName = "ID", nullable = false) @ManyToOne(fetch = FetchType.LAZY) private BundleDeployment bundleDeployment;
@@ -82,13 +82,6 @@ public class BundleResourceDeployment implements Serializable { @ManyToOne(fetch = FetchType.LAZY) private Resource resource;
- @JoinColumn(name = "BUNDLE_GROUP_DEPLOY_ID", referencedColumnName = "ID", nullable = true) - @ManyToOne - private BundleGroupDeployment groupDeployment; - - @Column(name = "IS_CURRENT") - private boolean isCurrent = false; - @Column(name = "STATUS", nullable = false) @Enumerated(EnumType.STRING) protected BundleDeploymentStatus status; @@ -103,15 +96,9 @@ public class BundleResourceDeployment implements Serializable { }
public BundleResourceDeployment(BundleDeployment bundleDeployment, Resource resource) { - this(bundleDeployment, resource, null); - } - - public BundleResourceDeployment(BundleDeployment bundleDeployment, Resource resource, - BundleGroupDeployment groupDeployment) { this.bundleDeployment = bundleDeployment; this.resource = resource; - this.groupDeployment = groupDeployment; - this.status = BundleDeploymentStatus.INPROGRESS; + this.status = BundleDeploymentStatus.IN_PROGRESS; }
public int getId() { @@ -160,14 +147,6 @@ public class BundleResourceDeployment implements Serializable { this.histories.add(history); }
- public BundleGroupDeployment getGroupDeployment() { - return groupDeployment; - } - - public void setGroupDeployment(BundleGroupDeployment groupDeployment) { - this.groupDeployment = groupDeployment; - } - /** * The status of the request which indicates that the request is either still in progress, or it has completed and * either succeeded or failed. @@ -182,14 +161,6 @@ public class BundleResourceDeployment implements Serializable { this.status = status; }
- public boolean isCurrent() { - return isCurrent; - } - - public void setCurrent(boolean isCurrent) { - this.isCurrent = isCurrent; - } - @Override public String toString() { StringBuilder str = new StringBuilder("BundleResourceDeployment: "); diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeploymentHistory.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeploymentHistory.java index 790de04..4cbe72a 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeploymentHistory.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeploymentHistory.java @@ -40,6 +40,7 @@ import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType;
/** * This is a many-to-one entity that provides audit capability for a bundle deployment (a bundle-platform pairing). @@ -62,7 +63,7 @@ public class BundleResourceDeploymentHistory implements Serializable { @Id private int id;
- @JoinColumn(name = "BUNDLE_RES_DEPLOY_ID", referencedColumnName = "ID", nullable = false) + @JoinColumn(name = "BUNDLE_RES_DEPLOYMENT_ID", referencedColumnName = "ID", nullable = false) @ManyToOne(fetch = FetchType.LAZY) private BundleResourceDeployment resourceDeployment;
@@ -72,27 +73,40 @@ public class BundleResourceDeploymentHistory implements Serializable { @Column(name = "AUDIT_TIME", nullable = false) private Long auditTime = System.currentTimeMillis();
- @Column(name = "AUDIT_ACTION", nullable = false) - private String auditAction; + @Column(name = "ACTION", nullable = false) + private String action;
- @Column(name = "AUDIT_STATUS", nullable = false) + @Column(name = "INFO", nullable = false) + private String info; + + @Column(name = "CATEGORY", nullable = true) + @Enumerated(EnumType.STRING) + private Category category; + + @Column(name = "STATUS", nullable = false) @Enumerated(EnumType.STRING) - private BundleDeploymentStatus auditStatus; + private Status status; + + @Column(name = "MESSAGE", nullable = true) + private String message;
- @Column(name = "AUDIT_MESSAGE", nullable = true) - private String auditMessage; + @Column(name = "ATTACHMENT", nullable = true) + private String attachment;
// required for JPA protected BundleResourceDeploymentHistory() { }
- public BundleResourceDeploymentHistory(String subjectName, String auditAction, BundleDeploymentStatus auditStatus, - String auditMessage) { + public BundleResourceDeploymentHistory(String subjectName, String action, String info, Category category, + Status status, String message, String attachment) {
this.subjectName = subjectName; - this.auditAction = auditAction; - this.auditStatus = auditStatus; - this.auditMessage = auditMessage; + this.action = action; + this.info = info; + this.category = category; + this.status = status; + this.message = message; + this.attachment = attachment; }
public int getId() { @@ -119,28 +133,52 @@ public class BundleResourceDeploymentHistory implements Serializable { this.auditTime = auditTime; }
- public String getAuditAction() { - return auditAction; + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public Category getCategory() { + return category; + } + + public void setCategory(Category category) { + this.category = category; }
- public void setAuditAction(String auditAction) { - this.auditAction = auditAction; + public Status getStatus() { + return status; }
- public BundleDeploymentStatus getAuditStatus() { - return auditStatus; + public void setStatus(Status status) { + this.status = status; }
- public void setAuditStatus(BundleDeploymentStatus auditStatus) { - this.auditStatus = auditStatus; + public String getMessage() { + return message; }
- public String getAuditMessage() { - return this.auditMessage; + public void setMessage(String message) { + this.message = message; }
- public void setAuditMessage(String auditMessage) { - this.auditMessage = auditMessage; + public String getAttachment() { + return attachment; + } + + public void setAttachment(String attachment) { + this.attachment = attachment; }
public BundleResourceDeployment getResourceDeployment() { @@ -156,9 +194,47 @@ public class BundleResourceDeploymentHistory implements Serializable { StringBuilder str = new StringBuilder("BundleDeploymentAudit: "); str.append(", time=[").append(this.auditTime).append("]"); str.append(", rd=[").append(this.resourceDeployment).append("]"); - str.append(", action=[").append(this.auditAction).append("]"); - str.append(", status=[").append(this.auditStatus).append("]"); - str.append(", message=[").append(this.auditMessage).append("]"); + str.append(", action=[").append(this.action).append("]"); + str.append(", info=[").append(this.info).append("]"); + str.append(", category=[").append(this.category).append("]"); + str.append(", status=[").append(this.status).append("]"); return str.toString(); } + + @XmlType(name = "BundleResourceDeploymentHistoryStatus") + public enum Status { + SUCCESS("Success"), // + FAILURE("Failure"), // + WARN("Warning"); + + private String displayName; + + Status(String displayName) { + this.displayName = displayName; + } + + public String toString() { + return displayName; + } + } + + @XmlType(name = "BundleResourceDeploymentHistoryCategory") + public enum Category { + DEPLOY_STEP("Deploy Step"), // + FILE_ADD("File Add"), // + FILE_CHANGE("File Change"), // + FILE_DOWNLOAD("File Download"), // + FILE_REMOVE("File Remove"); + + private String displayName; + + Category(String displayName) { + this.displayName = displayName; + } + + public String toString() { + return displayName; + } + } + } \ No newline at end of file diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java index b9c863b..1ecb867 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java @@ -36,8 +36,7 @@ public class BundleResourceDeploymentCriteria extends Criteria {
private Integer filterId; private Integer filterBundleDeploymentId; // requires override - private String filterBundleDeploymentName; // requires override - private Integer filterGroupDeploymentId; // requires override + private String filterBundleDeploymentName; // requires override private Integer filterResourceId; // requires override private String filterResourceName; // requires override private BundleDeploymentStatus filterStatus; @@ -49,7 +48,6 @@ public class BundleResourceDeploymentCriteria extends Criteria { public BundleResourceDeploymentCriteria() { filterOverrides.put("bundleDeploymentId", "parentResource.id = ?"); filterOverrides.put("bundleDeploymentName", "parentResource.name like ?"); - filterOverrides.put("groupDeploymentId", "groupDeployment.id = ?"); filterOverrides.put("resourceId", "resource.id = ?"); filterOverrides.put("resourceName", "resource.name like ?"); } @@ -71,10 +69,6 @@ public class BundleResourceDeploymentCriteria extends Criteria { this.filterBundleDeploymentName = filterBundleDeploymentName; }
- public void addFilterGroupDeploymentId(Integer filterGroupDeploymentId) { - this.filterGroupDeploymentId = filterGroupDeploymentId; - } - public void addFilterResourceId(Integer filterResourceId) { this.filterResourceId = filterResourceId; } diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java index abe2ca0..c8b7f1d 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java @@ -56,7 +56,7 @@ import org.jetbrains.annotations.NotNull;
import org.rhq.core.domain.alert.AlertDefinition; import org.rhq.core.domain.authz.Role; -import org.rhq.core.domain.bundle.BundleGroupDeployment; +import org.rhq.core.domain.bundle.BundleDestination; import org.rhq.core.domain.configuration.group.AbstractGroupConfigurationUpdate; import org.rhq.core.domain.operation.GroupOperationHistory; import org.rhq.core.domain.resource.Resource; @@ -408,8 +408,8 @@ public class ResourceGroup extends Group {
@OneToMany(mappedBy = "group", cascade = { CascadeType.REMOVE }) @OrderBy - // by primary key which will also put the bundle deployments in chronological order - private List<BundleGroupDeployment> groupDeployments = new ArrayList<BundleGroupDeployment>(); + // by primary key which will also put the bundle destinations in chronological order (not all that useful :) + private List<BundleDestination> bundleDestinations = new ArrayList<BundleDestination>();
@JoinColumn(name = "GROUP_DEFINITION_ID", referencedColumnName = "ID", nullable = true) @ManyToOne @@ -451,7 +451,6 @@ public class ResourceGroup extends Group { @ManyToMany(mappedBy = "resourceGroups", fetch = FetchType.LAZY) private Set<Tag> tags;
- /* no-arg constructor required by EJB spec */ protected ResourceGroup() { } @@ -560,12 +559,12 @@ public class ResourceGroup extends Group { this.configurationUpdates = configurationUpdates; }
- public List<BundleGroupDeployment> getGroupDeployments() { - return groupDeployments; + public List<BundleDestination> getBundleDestinations() { + return bundleDestinations; }
- public void setGroupDeployments(List<BundleGroupDeployment> groupDeployments) { - this.groupDeployments = groupDeployments; + public void setBundleDestinations(List<BundleDestination> bundleDestinations) { + this.bundleDestinations = bundleDestinations; }
public GroupDefinition getGroupDefinition() { diff --git a/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/bundle/BundleManagerProvider.java b/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/bundle/BundleManagerProvider.java index 4dbcadf..5eed5c0 100644 --- a/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/bundle/BundleManagerProvider.java +++ b/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/bundle/BundleManagerProvider.java @@ -21,8 +21,8 @@ package org.rhq.core.pluginapi.bundle; import java.io.OutputStream; import java.util.List;
-import org.rhq.core.domain.bundle.BundleDeploymentStatus; import org.rhq.core.domain.bundle.BundleResourceDeployment; +import org.rhq.core.domain.bundle.BundleResourceDeploymentHistory; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.content.PackageVersion;
@@ -36,13 +36,17 @@ public interface BundleManagerProvider { * Bundle plugins call back into this manager to add progressive auditing of a deployment. * * @param deployment The resource deployment tracking this bundle deployment - * @param action The audit action, a short summary easily displayed + * @param action The audit action, a short summary easily displayed (e.g "File Download") + * @param info Info about the action target, easily displayed (e.g. "myfile.zip") + * @param category A useful categorization of the audit, defaults to null * @param status Optional, defaults to SUCCESS - * @param message Optional, verbose message being audited, failure message, text file, etc + * @param message Optional, verbose message being audited, failure message, etc + * @param attachment Optional, verbose data, such as full file text * @throws Exception */ - void auditDeployment(BundleResourceDeployment deployment, String action, BundleDeploymentStatus status, - String message) throws Exception; + void auditDeployment(BundleResourceDeployment deployment, String action, String info, + BundleResourceDeploymentHistory.Category category, BundleResourceDeploymentHistory.Status status, + String message, String attachment) throws Exception;
/** * Bundle plugins call back into this manager to obtain the bundle files that belong to a given bundle version. diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java index 2eb5b9c..ae584a2 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java @@ -72,9 +72,11 @@ import org.rhq.core.util.MessageDigestGenerator; public class BundleManager extends AgentService implements BundleAgentService, BundleManagerProvider, ContainerService { private final Log log = LogFactory.getLog(BundleManager.class);
- private final String AUDIT_ACTION_DEPLOYMENT = "Deployment"; - private final String AUDIT_ACTION_DEPLOYMENT_SCHEDULED = "Deployment Scheduled"; - private final String AUDIT_ACTION_FILE_DOWNLOAD = "File Download"; + private final String AUDIT_DEPLOYMENT_ENDED = "Deployment Ended"; + private final String AUDIT_DEPLOYMENT_STARTED = "Deployment Started"; + private final String AUDIT_DEPLOYMENT_SCHEDULED = "Deployment Scheduled"; + private final String AUDIT_FILE_DOWNLOAD_ENDED = "File Download Started"; + private final String AUDIT_FILE_DOWNLOAD_STARTED = "File Download Started";
private PluginContainerConfiguration configuration;
@@ -121,7 +123,7 @@ public class BundleManager extends AgentService implements BundleAgentService, B } int bundleHandlerResourceId = resources.iterator().next().getId();
- auditDeployment(resourceDeployment, AUDIT_ACTION_DEPLOYMENT_SCHEDULED, BundleDeploymentStatus.SUCCESS, + auditDeployment(resourceDeployment, AUDIT_DEPLOYMENT_SCHEDULED, bundleDeployment.getName(), "Scheduled deployment time: " + request.getRequestedDeployTimeAsString() + " (immediate)");
// TODO: The logic below this point should be executed asynchronously in response to an actual @@ -145,8 +147,7 @@ public class BundleManager extends AgentService implements BundleAgentService, B // deploy the bundle utilizing the bundle facet object String deploymentMessage = "Deployment [" + bundleDeployment + "] to [" + resourceDeployment.getResource() + "]"; - auditDeployment(resourceDeployment, AUDIT_ACTION_DEPLOYMENT, BundleDeploymentStatus.INPROGRESS, - deploymentMessage); + auditDeployment(resourceDeployment, AUDIT_DEPLOYMENT_STARTED, bundleDeployment.getName(), deploymentMessage);
BundleDeployRequest deployRequest = new BundleDeployRequest(); deployRequest.setBundleManagerProvider(this); @@ -166,13 +167,26 @@ public class BundleManager extends AgentService implements BundleAgentService, B return response; }
- public void auditDeployment(BundleResourceDeployment bundleResourceDeployment, String action, - BundleDeploymentStatus status, String message) { + /** + * convenience method:<br/> + * category defaults to null<br/> + * status defaults to SUCCESS<br/> + * attachement defaults null <br/> + */ + public void auditDeployment(BundleResourceDeployment bundleResourceDeployment, String action, String info, + String message) { + auditDeployment(bundleResourceDeployment, action, info, null, BundleResourceDeploymentHistory.Status.SUCCESS, + message, null); + } + + public void auditDeployment(BundleResourceDeployment bundleResourceDeployment, String action, String info, + BundleResourceDeploymentHistory.Category category, BundleResourceDeploymentHistory.Status status, + String message, String attachment) { if (null == status) { - status = BundleDeploymentStatus.SUCCESS; + status = BundleResourceDeploymentHistory.Status.SUCCESS; } - BundleResourceDeploymentHistory history = new BundleResourceDeploymentHistory("Bundle Plugin", action, status, - message); + BundleResourceDeploymentHistory history = new BundleResourceDeploymentHistory("Bundle Plugin", action, info, + category, status, message, attachment); log.debug("Reporting deployment step [" + history + "] to Server..."); getBundleServerService().addDeploymentHistory(bundleResourceDeployment.getId(), history); } @@ -191,9 +205,6 @@ public class BundleManager extends AgentService implements BundleAgentService, B BundleDeployment bundleDeployment = resourceDeployment.getBundleDeployment(); BundleVersion bundleVersion = bundleDeployment.getBundleVersion();
- // download all the bundle files to the bundle plugin's tmp directory - auditDeployment(resourceDeployment, AUDIT_ACTION_FILE_DOWNLOAD, BundleDeploymentStatus.INPROGRESS, null); - Map<PackageVersion, File> packageVersionFiles = new HashMap<PackageVersion, File>(); List<PackageVersion> packageVersions = getAllBundleVersionPackageVersions(bundleVersion); for (PackageVersion packageVersion : packageVersions) { @@ -207,8 +218,8 @@ public class BundleManager extends AgentService implements BundleAgentService, B packageFile.getParentFile().mkdirs(); FileOutputStream fos = new FileOutputStream(packageFile); try { - auditDeployment(resourceDeployment, "File Download [" + packageVersion.getDisplayName() + "]", - BundleDeploymentStatus.INPROGRESS, "Downloading [" + packageVersion + "]"); + auditDeployment(resourceDeployment, AUDIT_FILE_DOWNLOAD_STARTED, packageVersion.getDisplayName(), + "Downloading [" + packageVersion + "]");
long size = getFileContent(packageVersion, fos);
@@ -216,12 +227,17 @@ public class BundleManager extends AgentService implements BundleAgentService, B String message = "Downloaded bundle file [" + packageVersion + "] but its size was [" + size + "] when it was expected to be [" + packageVersion.getFileSize() + "]."; log.warn(message); - auditDeployment(resourceDeployment, "File Download [" + packageVersion.getDisplayName() + "]", - BundleDeploymentStatus.WARN, message); + auditDeployment(resourceDeployment, AUDIT_FILE_DOWNLOAD_ENDED, packageVersion.getDisplayName(), + null, BundleResourceDeploymentHistory.Status.WARN, message, null); + } else { + auditDeployment(resourceDeployment, AUDIT_FILE_DOWNLOAD_ENDED, packageVersion.getDisplayName(), + "Download complete for [" + packageVersion + "]"); } - auditDeployment(resourceDeployment, "File Download [" + packageVersion.getDisplayName() + "]", - BundleDeploymentStatus.SUCCESS, "Download complete for [" + packageVersion + "]"); - + } catch (Exception e2) { + String message = "Failed to downloaded bundle file [" + packageVersion + "] " + e2; + log.warn(message); + auditDeployment(resourceDeployment, AUDIT_FILE_DOWNLOAD_ENDED, packageVersion.getDisplayName(), + null, BundleResourceDeploymentHistory.Status.FAILURE, message, null); } finally { fos.close(); } @@ -233,15 +249,16 @@ public class BundleManager extends AgentService implements BundleAgentService, B packageVersionFiles.put(packageVersion, packageFile); }
- auditDeployment(resourceDeployment, AUDIT_ACTION_FILE_DOWNLOAD, BundleDeploymentStatus.SUCCESS, null); - return packageVersionFiles; }
private void completeDeployment(BundleResourceDeployment resourceDeployment, BundleDeploymentStatus status, String message) { getBundleServerService().setBundleDeploymentStatus(resourceDeployment.getId(), status); - auditDeployment(resourceDeployment, AUDIT_ACTION_DEPLOYMENT, status, message); + BundleResourceDeploymentHistory.Status auditStatus = BundleDeploymentStatus.SUCCESS.equals(status) ? BundleResourceDeploymentHistory.Status.SUCCESS + : BundleResourceDeploymentHistory.Status.FAILURE; + auditDeployment(resourceDeployment, AUDIT_DEPLOYMENT_ENDED, resourceDeployment.getBundleDeployment().getName(), + null, auditStatus, message, null); }
/** diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java index 4a51bfc..e7611f5 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java @@ -19,7 +19,7 @@ package org.rhq.enterprise.gui.coregui.client.bundle.deploy;
import org.rhq.core.domain.bundle.BundleDeployment; -import org.rhq.core.domain.bundle.BundleGroupDeployment; +import org.rhq.core.domain.bundle.BundleDestination; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.definition.ConfigurationTemplate; @@ -34,12 +34,12 @@ public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard { // the things we build up in the wizard private Integer bundleId; private BundleVersion bundleVersion; + private BundleDestination bundleDestination; private Integer platformGroupId; private BundleDeployment bundleDeployment; - private BundleGroupDeployment groupDeployment; private String name; private String description; - private String installDir; + private String deployDir; private ConfigurationTemplate template; private Configuration config;
@@ -62,6 +62,14 @@ public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard { this.bundleVersion = bundleVersion; }
+ public BundleDestination getBundleDestination() { + return bundleDestination; + } + + public void setBundleDestination(BundleDestination bundleDestination) { + this.bundleDestination = bundleDestination; + } + public String getName() { return name; } @@ -130,20 +138,12 @@ public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard { this.deployNow = deployNow; }
- public BundleGroupDeployment getGroupDeployment() { - return groupDeployment; - } - - public void setGroupDeployment(BundleGroupDeployment groupDeployment) { - this.groupDeployment = groupDeployment; - } - - public String getInstallDir() { - return installDir; + public String getDeployDir() { + return deployDir; }
- public void setInstallDir(String installDir) { - this.installDir = installDir; + public void setDeployDir(String installDir) { + this.deployDir = installDir; }
} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java index baaddc5..d13b045 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java @@ -27,7 +27,6 @@ import com.smartgwt.client.widgets.Img; import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.bundle.BundleDeployment; -import org.rhq.core.domain.bundle.BundleGroupDeployment; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; @@ -73,8 +72,8 @@ public class DeployStep implements WizardStep { canvas.addMember(deployingMessage);
if (wizard.isNewDefinition()) { - bundleServer.createBundleDeployment(wizard.getBundleVersion().getId(), wizard.getName(), wizard - .getDescription(), wizard.getInstallDir(), wizard.getConfig(), false, -1, false, // + bundleServer.createBundleDeployment(wizard.getBundleVersion().getId(), wizard.getBundleDestination() + .getId(), wizard.getName(), wizard.getDescription(), wizard.getConfig(), false, -1, false, // new AsyncCallback<BundleDeployment>() { public void onSuccess(BundleDeployment result) { deployingImage.setSrc("/images/status_complete.gif"); @@ -84,17 +83,16 @@ public class DeployStep implements WizardStep { + result.getDescription(), Severity.Info)); wizard.setBundleDeployment(result);
- bundleServer.scheduleBundleGroupDeployment(wizard.getBundleDeployment().getId(), wizard - .getPlatformGroupId(), // - new AsyncCallback<BundleGroupDeployment>() { - public void onSuccess(BundleGroupDeployment result) { + bundleServer.scheduleBundleDeployment(wizard.getBundleDeployment().getId(), // + new AsyncCallback<BundleDeployment>() { + public void onSuccess(BundleDeployment result) { deployingImage.setSrc("/images/status_complete.gif"); deployingMessage.setText("Bundle Group Deployment Scheduled!"); CoreGUI.getMessageCenter().notify( new Message("Schedule bundle group deployment [" + wizard.getBundleDeployment().getName() + "] resource group [" - + result.getGroup() + "]", Severity.Info)); - wizard.setGroupDeployment(result); + + result.getDestination().getGroup() + "]", Severity.Info)); + wizard.setBundleDeployment(result); }
public void onFailure(Throwable caught) { @@ -102,7 +100,7 @@ public class DeployStep implements WizardStep { deployingMessage.setText("Failed to Schedule Group Deployment!"); CoreGUI.getErrorHandler().handleError( "Failed to schedule group deployment: " + caught.getMessage(), caught); - wizard.setGroupDeployment(null); + wizard.setBundleDeployment(null); } }); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java index 3dc7c2f..a9fbb2e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java @@ -86,7 +86,7 @@ public class GetDeploymentInfoStep implements WizardStep { if (value == null) { value = ""; } - wizard.setInstallDir(value.toString()); + wizard.setDeployDir(value.toString()); } });
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java index 4126e94..acf8058 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java @@ -25,7 +25,6 @@ import com.google.gwt.user.client.rpc.RemoteService;
import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; -import org.rhq.core.domain.bundle.BundleGroupDeployment; import org.rhq.core.domain.bundle.BundleType; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.bundle.composite.BundleWithLatestVersionComposite; @@ -40,9 +39,9 @@ public interface BundleGWTService extends RemoteService {
BundleVersion createBundleVersionViaRecipe(String recipe) throws Exception;
- BundleDeployment createBundleDeployment(int bundleVersionId, String name, String description, String installDir, - Configuration configuration, boolean enforcePolicy, int enforcementInterval, boolean pinToBundle) - throws Exception; + BundleDeployment createBundleDeployment(int bundleVersionId, int bundleDestinationId, String name, + String description, Configuration configuration, boolean enforcePolicy, int enforcementInterval, + boolean pinToBundle) throws Exception;
BundleVersion createBundleVersion(int bundleId, String name, String version, String recipe) throws Exception;
@@ -61,9 +60,5 @@ public interface BundleGWTService extends RemoteService {
ArrayList<BundleType> getAllBundleTypes() throws Exception;
- /* - BundleResourceDeployment scheduleBundleResourceDeployment(int bundleDeploymentId, int resourceId) throws Exception; - */ - - BundleGroupDeployment scheduleBundleGroupDeployment(int bundleDeploymentId, int resourceGroupId) throws Exception; + BundleDeployment scheduleBundleDeployment(int bundleDeploymentId) throws Exception; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java index 39e6f69..2c14167 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java @@ -23,7 +23,6 @@ import java.util.HashMap;
import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; -import org.rhq.core.domain.bundle.BundleGroupDeployment; import org.rhq.core.domain.bundle.BundleType; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.bundle.composite.BundleWithLatestVersionComposite; @@ -62,13 +61,13 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund return SerialUtility.prepare(results, "createBundleVersionViaRecipe"); }
- public BundleDeployment createBundleDeployment(int bundleVersionId, String name, String description, - String installDir, Configuration configuration, boolean enforcePolicy, int enforcementInterval, + public BundleDeployment createBundleDeployment(int bundleVersionId, int bundleDestinationId, String name, + String description, Configuration configuration, boolean enforcePolicy, int enforcementInterval, boolean pinToBundle) throws Exception {
try { - BundleDeployment result = bundleManager.createBundleDeployment(getSessionSubject(), bundleVersionId, name, - description, installDir, configuration); + BundleDeployment result = bundleManager.createBundleDeployment(getSessionSubject(), bundleVersionId, + bundleDestinationId, name, description, configuration);
return SerialUtility.prepare(result, "createBundleDeployment"); } catch (Exception e) { @@ -151,25 +150,10 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund return SerialUtility.prepare(results, "getAllBundleVersionFilenames"); }
- /* - public BundleResourceDeployment scheduleBundleResourceDeployment(int bundleDeploymentId, int resourceId) - throws Exception { + public BundleDeployment scheduleBundleDeployment(int bundleDeploymentId) throws Exception { try { - BundleResourceDeployment result = bundleManager.scheduleBundleResourceDeployment(getSessionSubject(), - bundleDeploymentId, resourceId); - return SerialUtility.prepare(result, "scheduleBundleResourceDeployment"); - } catch (Exception e) { - throw new RuntimeException(ThrowableUtil.getAllMessages(e)); - } - } - */ - - public BundleGroupDeployment scheduleBundleGroupDeployment(int bundleDeploymentId, int resourceGroupId) - throws Exception { - try { - BundleGroupDeployment result = bundleManager.scheduleBundleGroupDeployment(getSessionSubject(), - bundleDeploymentId, resourceGroupId); - return SerialUtility.prepare(result, "scheduleBundleGroupDeployment"); + BundleDeployment result = bundleManager.scheduleBundleDeployment(getSessionSubject(), bundleDeploymentId); + return SerialUtility.prepare(result, "scheduleBundleDeployment"); } catch (Exception e) { throw new RuntimeException(ThrowableUtil.getAllMessages(e)); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java index 8dfd2e6..f62c97d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java @@ -53,8 +53,8 @@ import org.rhq.core.domain.authz.Permission; import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; import org.rhq.core.domain.bundle.BundleDeploymentStatus; +import org.rhq.core.domain.bundle.BundleDestination; import org.rhq.core.domain.bundle.BundleFile; -import org.rhq.core.domain.bundle.BundleGroupDeployment; import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleResourceDeploymentHistory; import org.rhq.core.domain.bundle.BundleType; @@ -73,7 +73,9 @@ import org.rhq.core.domain.criteria.BundleDeploymentCriteria; import org.rhq.core.domain.criteria.BundleFileCriteria; import org.rhq.core.domain.criteria.BundleResourceDeploymentCriteria; import org.rhq.core.domain.criteria.BundleVersionCriteria; +import org.rhq.core.domain.criteria.ResourceGroupCriteria; import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.domain.util.PageList; @@ -90,6 +92,7 @@ import org.rhq.enterprise.server.content.ContentManagerLocal; import org.rhq.enterprise.server.content.RepoManagerLocal; import org.rhq.enterprise.server.core.AgentManagerLocal; import org.rhq.enterprise.server.plugin.pc.bundle.BundleServerPluginManager; +import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal; import org.rhq.enterprise.server.util.CriteriaQueryGenerator; import org.rhq.enterprise.server.util.CriteriaQueryRunner; import org.rhq.enterprise.server.util.HibernateDetachUtility; @@ -130,6 +133,9 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot @EJB private RepoManagerLocal repoManager;
+ @EJB + private ResourceGroupManagerLocal resourceGroupManager; + @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) @RequiredPermission(Permission.MANAGE_INVENTORY) public BundleResourceDeploymentHistory addBundleResourceDeploymentHistory(Subject subject, int bundleDeploymentId, @@ -188,8 +194,8 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot }
@RequiredPermission(Permission.MANAGE_INVENTORY) - public BundleDeployment createBundleDeployment(Subject subject, int bundleVersionId, String name, - String description, String installDir, Configuration configuration) throws Exception { + public BundleDeployment createBundleDeployment(Subject subject, int bundleVersionId, int bundleDestinationId, + String name, String description, Configuration configuration) throws Exception {
if (null == name || "".equals(name.trim())) { throw new IllegalArgumentException("Invalid bundleDeploymentName: " + name); @@ -198,6 +204,10 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot if (null == bundleVersion) { throw new IllegalArgumentException("Invalid bundleVersionId: " + bundleVersionId); } + BundleDestination bundleDestination = entityManager.find(BundleDestination.class, bundleDestinationId); + if (null == bundleDestination) { + throw new IllegalArgumentException("Invalid bundleDestinationId: " + bundleVersionId); + } ConfigurationDefinition configDef = bundleVersion.getConfigurationDefinition(); if (null != configDef) { if (null == configuration) { @@ -210,7 +220,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot } }
- BundleDeployment deployment = new BundleDeployment(bundleVersion, name, installDir); + BundleDeployment deployment = new BundleDeployment(bundleVersion, bundleDestination, name); deployment.setDescription(description); deployment.setConfiguration(configuration);
@@ -220,6 +230,33 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot }
@RequiredPermission(Permission.MANAGE_INVENTORY) + public BundleDestination createBundleDestination(Subject subject, int bundleId, String name, String description, + String deployDir, Integer groupId) throws Exception { + + Bundle bundle = entityManager.find(Bundle.class, bundleId); + if (null == bundle) { + throw new IllegalArgumentException("Invalid bundleId [" + bundleId + "]"); + } + + // validate that the group exists and is a platform group + ResourceGroupCriteria c = new ResourceGroupCriteria(); + c.addFilterId(groupId); + c.addFilterExplicitResourceCategory(ResourceCategory.PLATFORM); + List<ResourceGroup> groups = resourceGroupManager.findResourceGroupsByCriteria(subject, c); + if (null == groups || groups.isEmpty()) { + throw new IllegalArgumentException("Invalid groupId [" + groupId + + "]. Must exist and contain only platform members."); + } + ResourceGroup group = entityManager.find(ResourceGroup.class, groups.get(0).getId()); + + BundleDestination dest = new BundleDestination(bundle, name, group, deployDir); + dest.setDescription(description); + entityManager.persist(dest); + + return dest; + } + + @RequiredPermission(Permission.MANAGE_INVENTORY) public BundleType createBundleType(Subject subject, String name, int resourceTypeId) throws Exception { if (null == name || "".equals(name.trim())) { throw new IllegalArgumentException("Invalid bundleTypeName: " + name); @@ -627,64 +664,8 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot
return scheduleBundleResourceDeployment(subject, deployment, resource, null); } - */ - - private BundleResourceDeployment scheduleBundleResourceDeployment(Subject subject, BundleDeployment deployment, - Resource resource, BundleGroupDeployment groupDeployment) throws Exception { - - int resourceId = resource.getId(); - AgentClient agentClient = agentManager.getAgentClient(resourceId); - BundleAgentService bundleAgentService = agentClient.getBundleAgentService(); - - // The BundleResourceDeployment record must exist in the db before the agent request because the agent may try to - // add History to it during immediate deployments., so create and persist it (requires a new trans). - BundleResourceDeployment resourceDeployment = bundleManager.createBundleResourceDeployment(subject, deployment - .getId(), resourceId, (null == groupDeployment) ? 0 : groupDeployment.getId()); - - // make sure the deployment contains the info required by the schedule service - BundleVersion bundleVersion = entityManager.find(BundleVersion.class, deployment.getBundleVersion().getId()); - Configuration config = entityManager.find(Configuration.class, deployment.getConfiguration().getId()); - Bundle bundle = entityManager.find(Bundle.class, bundleVersion.getBundle().getId()); - BundleType bundleType = entityManager.find(BundleType.class, bundle.getBundleType().getId()); - ResourceType resourceType = entityManager.find(ResourceType.class, bundleType.getResourceType().getId()); - bundleType.setResourceType(resourceType); - bundle.setBundleType(bundleType); - bundleVersion.setBundle(bundle); - deployment.setBundleVersion(bundleVersion); - deployment.setConfiguration(config); - resourceDeployment.setBundleDeployment(deployment); - resourceDeployment.setResource(resource); - - // now scrub the hibernate entity to make it a pojo suitable for sending to the client - HibernateDetachUtility.nullOutUninitializedFields(resourceDeployment, SerializationType.SERIALIZATION); - - BundleScheduleRequest request = new BundleScheduleRequest(resourceDeployment); - - // add the deployment request history (in a new trans) - BundleResourceDeploymentHistory history = new BundleResourceDeploymentHistory(subject.getName(), - AUDIT_ACTION_DEPLOYMENT_REQUESTED, BundleDeploymentStatus.SUCCESS, "Requested deployment time: " - + request.getRequestedDeployTimeAsString()); - bundleManager.addBundleResourceDeploymentHistory(subject, resourceDeployment.getId(), history); - - // Ask the agent to schedule the request. The agent should add history as needed. - BundleScheduleResponse response = bundleAgentService.schedule(request); - - // we don't want to commit the scrubbed entities so clear the changes - this.entityManager.clear(); - - // Handle Schedule Failures. This may include deployment failures for immediate deployment request - if (!response.isSuccess()) { - history = new BundleResourceDeploymentHistory(subject.getName(), AUDIT_ACTION_DEPLOYMENT, - BundleDeploymentStatus.FAILURE, response.getErrorMessage()); - bundleManager.setBundleResourceDeploymentStatus(subject, resourceDeployment.getId(), - BundleDeploymentStatus.FAILURE); - bundleManager.addBundleResourceDeploymentHistory(subject, resourceDeployment.getId(), history); - } - - return resourceDeployment; - }
- @RequiredPermission(Permission.MANAGE_INVENTORY) + @RequiredPermission(Permission.MANAGE_INVENTORY) public BundleGroupDeployment scheduleBundleGroupDeployment(Subject subject, int bundleDeploymentId, int resourceGroupId) throws Exception {
@@ -698,10 +679,10 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot + resourceGroupId); }
- /* - * we need to create the group deployment entity in a new transaction before the rest of the - * processing of this method; the individual deployments need to reference it. - */ + // + // we need to create the group deployment entity in a new transaction before the rest of the + // processing of this method; the individual deployments need to reference it. + // BundleGroupDeployment groupDeployment = new BundleGroupDeployment(subject.getName(), deployment, resourceGroup); groupDeployment = bundleManager.createBundleGroupDeployment(groupDeployment);
@@ -714,11 +695,99 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot
return groupDeployment; } + */ + + @RequiredPermission(Permission.MANAGE_INVENTORY) + public BundleDeployment scheduleBundleDeployment(Subject subject, int bundleDeploymentId) throws Exception { + + BundleDeployment deployment = entityManager.find(BundleDeployment.class, bundleDeploymentId); + if (null == deployment) { + throw new IllegalArgumentException("Invalid bundleDeploymentId: " + bundleDeploymentId); + } + + BundleDestination destination = deployment.getDestination(); + ResourceGroup group = destination.getGroup(); + + // Create and persist updates for each of the group members. + for (Resource resource : group.getExplicitResources()) { + BundleResourceDeployment resourceDeployment = scheduleBundleResourceDeployment(subject, deployment, + resource); + deployment.addResourceDeployment(resourceDeployment); + } + + entityManager.persist(deployment); + return deployment; + } + + private BundleResourceDeployment scheduleBundleResourceDeployment(Subject subject, BundleDeployment deployment, + Resource resource) throws Exception { + + int resourceId = resource.getId(); + AgentClient agentClient = agentManager.getAgentClient(resourceId); + BundleAgentService bundleAgentService = agentClient.getBundleAgentService(); + + // The BundleResourceDeployment record must exist in the db before the agent request because the agent may try to + // add History to it during immediate deployments. So, create and persist it (requires a new trans). + BundleResourceDeployment resourceDeployment = bundleManager.createBundleResourceDeployment(subject, deployment + .getId(), resourceId); + + if (ResourceCategory.PLATFORM.equals(resource.getResourceType().getCategory())) { + // make sure the deployment contains the info required by the schedule service + BundleVersion bundleVersion = entityManager + .find(BundleVersion.class, deployment.getBundleVersion().getId()); + Configuration config = entityManager.find(Configuration.class, deployment.getConfiguration().getId()); + Bundle bundle = entityManager.find(Bundle.class, bundleVersion.getBundle().getId()); + BundleType bundleType = entityManager.find(BundleType.class, bundle.getBundleType().getId()); + ResourceType resourceType = entityManager.find(ResourceType.class, bundleType.getResourceType().getId()); + bundleType.setResourceType(resourceType); + bundle.setBundleType(bundleType); + bundleVersion.setBundle(bundle); + deployment.setBundleVersion(bundleVersion); + deployment.setConfiguration(config); + resourceDeployment.setBundleDeployment(deployment); + resourceDeployment.setResource(resource); + + // now scrub the hibernate entity to make it a pojo suitable for sending to the client + HibernateDetachUtility.nullOutUninitializedFields(resourceDeployment, SerializationType.SERIALIZATION); + + BundleScheduleRequest request = new BundleScheduleRequest(resourceDeployment); + + // add the deployment request history (in a new trans) + BundleResourceDeploymentHistory history = new BundleResourceDeploymentHistory(subject.getName(), + AUDIT_ACTION_DEPLOYMENT_REQUESTED, deployment.getName(), null, + BundleResourceDeploymentHistory.Status.SUCCESS, "Requested deployment time: " + + request.getRequestedDeployTimeAsString(), null); + bundleManager.addBundleResourceDeploymentHistory(subject, resourceDeployment.getId(), history); + + // Ask the agent to schedule the request. The agent should add history as needed. + BundleScheduleResponse response = bundleAgentService.schedule(request); + + // we don't want to commit the scrubbed entities so clear the changes + this.entityManager.clear(); + + // Handle Schedule Failures. This may include deployment failures for immediate deployment request + if (!response.isSuccess()) { + history = new BundleResourceDeploymentHistory(subject.getName(), AUDIT_ACTION_DEPLOYMENT, deployment + .getName(), null, BundleResourceDeploymentHistory.Status.FAILURE, response.getErrorMessage(), null); + bundleManager.setBundleResourceDeploymentStatus(subject, resourceDeployment.getId(), + BundleDeploymentStatus.FAILURE); + bundleManager.addBundleResourceDeploymentHistory(subject, resourceDeployment.getId(), history); + } + } else { + BundleResourceDeploymentHistory history = new BundleResourceDeploymentHistory(subject.getName(), + AUDIT_ACTION_DEPLOYMENT, deployment.getName(), null, BundleResourceDeploymentHistory.Status.FAILURE, + "Target resource is not a platform [id=" + resource.getId() + "]. Fix target group for destination [" + + deployment.getDestination().getName() + "]", null); + bundleManager.addBundleResourceDeploymentHistory(subject, resourceDeployment.getId(), history); + } + + return resourceDeployment; + }
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) @RequiredPermission(Permission.MANAGE_INVENTORY) public BundleResourceDeployment createBundleResourceDeployment(Subject subject, int bundleDeploymentId, - int resourceId, int groupDeploymentId) throws Exception { + int resourceId) throws Exception {
BundleDeployment deployment = entityManager.find(BundleDeployment.class, bundleDeploymentId); if (null == deployment) { @@ -729,11 +798,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot throw new IllegalArgumentException("Invalid resourceId (Resource does not exist): " + resourceId); }
- BundleGroupDeployment groupDeployment = (BundleGroupDeployment) entityManager.find(BundleGroupDeployment.class, - groupDeploymentId); - - BundleResourceDeployment resourceDeployment = new BundleResourceDeployment(deployment, resource, - groupDeployment); + BundleResourceDeployment resourceDeployment = new BundleResourceDeployment(deployment, resource);
entityManager.persist(resourceDeployment); return resourceDeployment; @@ -743,40 +808,49 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot public BundleResourceDeployment setBundleResourceDeploymentStatus(Subject subject, int resourceDeploymentId, BundleDeploymentStatus status) throws Exception {
+ // set the status of the individual resource deployment BundleResourceDeployment resourceDeployment = entityManager.find(BundleResourceDeployment.class, resourceDeploymentId); if (null == resourceDeployment) { throw new IllegalArgumentException("Invalid bundleDeploymentId: " + resourceDeploymentId); }
- resourceDeployment.setStatus(status); - this.entityManager.persist(resourceDeployment); - - // If this is part of a group deployment then update the group status, if necessary. - BundleGroupDeployment groupDeployment = resourceDeployment.getGroupDeployment(); - if ((null != groupDeployment) && (BundleDeploymentStatus.INPROGRESS.equals(groupDeployment.getStatus()))) { - if (BundleDeploymentStatus.FAILURE.equals(status)) { - groupDeployment.setStatus(status); - } else { - BundleResourceDeploymentCriteria c = new BundleResourceDeploymentCriteria(); - c.addFilterGroupDeploymentId(groupDeployment.getId()); - c.addFilterStatus(BundleDeploymentStatus.INPROGRESS); - List<BundleResourceDeployment> inProgressDeployments = findBundleResourceDeploymentsByCriteria(subject, - c); - if (inProgressDeployments.isEmpty()) { - groupDeployment.setStatus(BundleDeploymentStatus.SUCCESS); - } + // set the status on the overall deployment + BundleDeployment deployment = resourceDeployment.getBundleDeployment(); + List<BundleResourceDeployment> deployments = deployment.getResourceDeployments(); + boolean someInProgress = false; + boolean someSuccess = false; + boolean someFailure = false; + for (BundleResourceDeployment rd : deployments) { + switch (rd.getStatus()) { + case SUCCESS: + someSuccess = true; + break; + case FAILURE: + someFailure = true; + break; + case IN_PROGRESS: + someInProgress = true; + break; } } + if (someInProgress) { + // should actually be at this status already by what the heck + deployment.setStatus(BundleDeploymentStatus.IN_PROGRESS); + } else if (someSuccess) { + deployment.setStatus(someFailure ? BundleDeploymentStatus.MIXED : BundleDeploymentStatus.SUCCESS); + } else { + deployment.setStatus(BundleDeploymentStatus.FAILURE); + }
return resourceDeployment; }
- @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) - public BundleGroupDeployment createBundleGroupDeployment(BundleGroupDeployment groupDeployment) throws Exception { - entityManager.persist(groupDeployment); - return groupDeployment; - } + // @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) + // public BundleGroupDeployment createBundleGroupDeployment(BundleGroupDeployment groupDeployment) throws Exception { + // entityManager.persist(groupDeployment); + // return groupDeployment; + //}
@RequiredPermission(Permission.MANAGE_INVENTORY) public Set<String> getBundleVersionFilenames(Subject subject, int bundleVersionId, boolean withoutBundleFileOnly) diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerLocal.java index ee4c373..7bea7c7 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerLocal.java @@ -25,7 +25,6 @@ import javax.ejb.Local; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeploymentStatus; -import org.rhq.core.domain.bundle.BundleGroupDeployment; import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleResourceDeploymentHistory; import org.rhq.core.domain.bundle.BundleType; @@ -117,14 +116,14 @@ public interface BundleManagerLocal extends BundleManagerRemote { * This is typically not called directly, typically scheduleBundleResourceDeployment() is called externally. This executes * in a New Transaction and supports scheduleBundleResourceDeployment. */ - BundleResourceDeployment createBundleResourceDeployment(Subject subject, int bundleDeploymentId, int resourceId, - int groupDeploymentId) throws Exception; + BundleResourceDeployment createBundleResourceDeployment(Subject subject, int bundleDeploymentId, int resourceId) + throws Exception;
/** * This is typically not called directly, typically scheduleBundleGroupDeployment() is called externally. * This executes in a New Transaction and supports scheduleBundleGroupDeployment. */ - BundleGroupDeployment createBundleGroupDeployment(BundleGroupDeployment groupDeployment) throws Exception; + //BundleGroupDeployment createBundleGroupDeployment(BundleGroupDeployment groupDeployment) throws Exception;
// added here because the same method in @Remote was commented out to bypass a WSProvide issue HashMap<String, Boolean> getAllBundleVersionFilenames(Subject subject, int bundleVersionId) throws Exception; diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java index 61ca90f..15af280 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java @@ -32,8 +32,8 @@ import javax.jws.soap.SOAPBinding; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; +import org.rhq.core.domain.bundle.BundleDestination; import org.rhq.core.domain.bundle.BundleFile; -import org.rhq.core.domain.bundle.BundleGroupDeployment; import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleType; import org.rhq.core.domain.bundle.BundleVersion; @@ -121,23 +121,41 @@ public interface BundleManagerRemote { /** * @param subject user that must have proper permissions * @param BundleVersionId the BundleVersion being deployed by this deployment + * @param BundleDestinationId the BundleDestination for the deployment * @param name a name for this deployment. not null or empty * @param description an optional longer description describing this deployment * @param configuration a Configuration (pojo) to be associated with this deployment. Although * it is not enforceable must be that of the associated BundleVersion. - * @param installDir the root dir for the deployment * @return the persisted deployment * @throws Exception */ BundleDeployment createBundleDeployment( // @WebParam(name = "subject") Subject subject, // - @WebParam(name = "bundleVersionid") int bundleVersionId, // + @WebParam(name = "bundleVersionId") int bundleVersionId, // + @WebParam(name = "bundleDestinationId") int bundleDestinationId, // @WebParam(name = "name") String name, // - @WebParam(name = "description") String description, // - @WebParam(name = "installDir") String installDir, // + @WebParam(name = "description") String description, // @WebParam(name = "configuration") Configuration configuration) throws Exception;
/** + * @param subject user must have MANAGE_INVENTORY permission + * @param BundleId the Bundle to be deployed to this Destination + * @param name a name for this destination. not null or empty + * @param description an optional longer description describing this destination + * @param deployDir the root dir for deployments to this destination + * @param groupIf the target platforms for deployments to this destination + * @return the persisted destination + * @throws Exception + */ + BundleDestination createBundleDestination( // + @WebParam(name = "subject") Subject subject, // + @WebParam(name = "bundleId") int bundleId, // + @WebParam(name = "name") String name, // + @WebParam(name = "description") String description, // + @WebParam(name = "deployDir") String deployDir, // + @WebParam(name = "groupId") Integer groupId) throws Exception; + + /** * Creates a bundle version based on single recipe string. The recipe specifies the bundle name, * version, version name and version description. If this is the initial version for the named * bundle the bundle will be implicitly created. The bundle type is discovered by the bundle server @@ -291,22 +309,19 @@ public interface BundleManagerRemote { */
/** - * Deploy the bundle as described in the provided deployment to all of the resources in the - * specified resource group. - * Deployment is asynchronous so return of this method does not indicate deployments are complete. The - * returned BundleGroupDeployment can be used to track the history of the deployments. + * Deploy the bundle to the destination, as described in the provided deployment. + * Deployment is asynchronous so return of this method does not indicate individual resource deployments are + * complete. The returned BundleDeployment can be used to track the history of the individual deployments. * * TODO: Add the scheduling capability, currently it's Immediate. * * @param subject user that must have proper permissions * @param bundleDeploymentId the BundleDeployment being used to guide the deployments - * @param resourceGroupId the target resourceGroup (must exist), typically platforms, for the deployments - * @return the BundleGroupDeployment created to track the deployments. + * @return the BundleDeployment record, updated with status and (resource) deployments. * @throws Exception */ @WebMethod - BundleGroupDeployment scheduleBundleGroupDeployment( // + BundleDeployment scheduleBundleDeployment( // @WebParam(name = "subject") Subject subject, // - @WebParam(name = "bundleDeploymentId") int bundleDeploymentId, // - @WebParam(name = "resourceGroupId") int resourceGroupId) throws Exception; + @WebParam(name = "bundleDeploymentId") int bundleDeploymentId) throws Exception; } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java index ee7e858..6b98f4d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java @@ -40,8 +40,8 @@ import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.authz.Role; import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; +import org.rhq.core.domain.bundle.BundleDestination; import org.rhq.core.domain.bundle.BundleFile; -import org.rhq.core.domain.bundle.BundleGroupDeployment; import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleType; import org.rhq.core.domain.bundle.BundleVersion; @@ -339,12 +339,17 @@ public class WebservicesManagerBean implements WebservicesRemote { return bundleManager.addBundleFileViaPackageVersion(subject, bundleVersionId, name, packageVersionId); }
- public BundleDeployment createBundleDeployment(Subject subject, int bundleVersionId, String name, - String description, String installDir, Configuration configuration) throws Exception { - return bundleManager.createBundleDeployment(subject, bundleVersionId, name, description, installDir, + public BundleDeployment createBundleDeployment(Subject subject, int bundleVersionId, int bundleDestinationId, + String name, String description, Configuration configuration) throws Exception { + return bundleManager.createBundleDeployment(subject, bundleVersionId, bundleDestinationId, name, description, configuration); }
+ public BundleDestination createBundleDestination(Subject subject, int bundleId, String name, String description, + String deployDir, Integer groupId) throws Exception { + return bundleManager.createBundleDestination(subject, bundleId, name, description, deployDir, groupId); + } + public BundleVersion createBundleVersionViaRecipe(Subject subject, String recipe) throws Exception { return bundleManager.createBundleVersionViaRecipe(subject, recipe); } @@ -404,15 +409,8 @@ public class WebservicesManagerBean implements WebservicesRemote { return bundleManager.getBundleVersionFilenames(subject, bundleVersionId, withoutBundleFileOnly); }
- /* - public Map<String, Boolean> getAllBundleVersionFilenames(Subject subject, int bundleVersionId) throws Exception { - return bundleManager.getAllBundleVersionFilenames(subject, bundleVersionId); - } - */ - - public BundleGroupDeployment scheduleBundleGroupDeployment(Subject subject, int bundleDeploymentId, - int resourceGroupId) throws Exception { - return bundleManager.scheduleBundleGroupDeployment(subject, bundleDeploymentId, resourceGroupId); + public BundleDeployment scheduleBundleDeployment(Subject subject, int bundleDeploymentId) throws Exception { + return bundleManager.scheduleBundleDeployment(subject, bundleDeploymentId); }
//BUNDLEMANAGER: END ---------------------------------- diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java index fb55677..c7f0b74 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java @@ -47,8 +47,8 @@ import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; import org.rhq.core.domain.bundle.BundleDeploymentStatus; +import org.rhq.core.domain.bundle.BundleDestination; import org.rhq.core.domain.bundle.BundleFile; -import org.rhq.core.domain.bundle.BundleGroupDeployment; import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleResourceDeploymentHistory; import org.rhq.core.domain.bundle.BundleType; @@ -85,6 +85,7 @@ import org.rhq.enterprise.server.resource.metadata.test.UpdateSubsytemTestBase; import org.rhq.enterprise.server.test.TestAgentClient; import org.rhq.enterprise.server.test.TestServerCommunicationsService; import org.rhq.enterprise.server.util.LookupUtil; +import org.rhq.enterprise.server.ws.BundleGroupDeployment;
/** * @author John Mazzitelli @@ -200,7 +201,7 @@ public class BundleManagerBeanTest extends UpdateSubsytemTestBase { em.remove(em.getReference(BundleDeployment.class, ((BundleDeployment) removeMe).getId())); }
- // remove bundles which cascade remove packageTypes + // remove bundles which cascade remove packageTypes and destinations // packagetypes cascade remove packages // package cascade remove packageversions q = em.createQuery("SELECT b FROM Bundle b WHERE b.name LIKE '" + TEST_PREFIX + "%'"); @@ -228,6 +229,12 @@ public class BundleManagerBeanTest extends UpdateSubsytemTestBase { for (Object removeMe : doomed) { em.remove(em.getReference(PackageType.class, ((PackageType) removeMe).getId())); } + // remove any orphaned destinations + q = em.createQuery("SELECT bd FROM BundleDestination pt WHERE bd.name LIKE '" + TEST_PREFIX + "%'"); + doomed = q.getResultList(); + for (Object removeMe : doomed) { + em.remove(em.getReference(BundleDestination.class, ((BundleDestination) removeMe).getId())); + }
// remove repos no longer referenced by bundles q = em.createQuery("SELECT r FROM Repo r WHERE r.name LIKE '" + TEST_PREFIX + "%'"); @@ -695,16 +702,20 @@ public class BundleManagerBeanTest extends UpdateSubsytemTestBase { assertNotNull(b1); BundleVersion bv1 = createBundleVersion(b1.getName() + "-1", null, b1); assertNotNull(bv1); + ResourceGroup platformResourceGroup = createTestResourceGroup(); + assertNotNull(platformResourceGroup); + BundleDestination dest1 = createDestination(b1, "one", "/test", platformResourceGroup); + assertNotNull(dest1); Configuration config = new Configuration(); BundleDeployment bd1; try { - bd1 = createDeployment("one", bv1, "/test", config); + bd1 = createDeployment("one", bv1, dest1, config); fail("Bad config was accepted"); } catch (Exception e) { // expected due to bad config } config.put(new PropertySimple("bundletest.property", "bundletest.property value")); - bd1 = createDeployment("one", bv1, "/test", config); + bd1 = createDeployment("one", bv1, dest1, config); assertNotNull(bd1); }
@@ -716,45 +727,49 @@ public class BundleManagerBeanTest extends UpdateSubsytemTestBase { assertNotNull(bv1); Configuration config = new Configuration(); config.put(new PropertySimple("bundletest.property", "bundletest.property value")); - BundleDeployment bd1 = createDeployment("one", bv1, "/test", config); - assertNotNull(bd1); ResourceGroup platformResourceGroup = createTestResourceGroup(); - BundleGroupDeployment bgd = bundleManager.scheduleBundleGroupDeployment(overlord, bd1.getId(), - platformResourceGroup.getId()); - assertNotNull(bgd); - assertEquals(bd1.getId(), bgd.getBundleDeployment().getId()); - assertEquals(platformResourceGroup.getId(), bgd.getGroup().getId()); - assertEquals(BundleDeploymentStatus.INPROGRESS, bgd.getStatus()); + assertNotNull(platformResourceGroup); + BundleDestination dest1 = createDestination(b1, "one", "/test", platformResourceGroup); + assertNotNull(dest1); + BundleDeployment bd1 = createDeployment("one", bv1, dest1, config); + assertNotNull(bd1); + + BundleDeployment bd1d = bundleManager.scheduleBundleDeployment(overlord, bd1.getId()); + assertNotNull(bd1d); + assertEquals(bd1.getId(), bd1d.getId()); + assertEquals(platformResourceGroup.getId(), bd1d.getDestination().getGroup().getId()); + assertEquals(BundleDeploymentStatus.IN_PROGRESS, bd1d.getStatus()); BundleResourceDeploymentCriteria c = new BundleResourceDeploymentCriteria(); - c.addFilterGroupDeploymentId(bgd.getId()); + c.addFilterBundleDeploymentId(bd1d.getId()); c.fetchHistories(true); List<BundleResourceDeployment> brds = bundleManager.findBundleResourceDeploymentsByCriteria(overlord, c); assertEquals(1, brds.size()); - assertEquals(1, bgd.getResourceDeployments().size()); - assertEquals(bgd.getResourceDeployments().get(0).getId(), brds.get(0).getId()); + assertEquals(1, bd1d.getResourceDeployments().size()); + assertEquals(bd1d.getResourceDeployments().get(0).getId(), brds.get(0).getId()); BundleResourceDeployment brd = brds.get(0); assertNotNull(brd.getBundleResourceDeploymentHistories()); int size = brd.getBundleResourceDeploymentHistories().size(); assertTrue(size > 0); String auditMessage = "BundleTest-Message"; - bundleManager.addBundleResourceDeploymentHistory(overlord, bgd.getId(), new BundleResourceDeploymentHistory( - overlord.getName(), auditMessage, BundleDeploymentStatus.SUCCESS, auditMessage)); + bundleManager.addBundleResourceDeploymentHistory(overlord, brd.getId(), new BundleResourceDeploymentHistory( + overlord.getName(), auditMessage, auditMessage, BundleResourceDeploymentHistory.Category.DEPLOY_STEP, + BundleResourceDeploymentHistory.Status.SUCCESS, auditMessage, auditMessage)); brds = bundleManager.findBundleResourceDeploymentsByCriteria(overlord, c); assertEquals(1, brds.size()); - assertEquals(bgd.getId(), brds.get(0).getId()); + assertEquals(bd1d.getId(), brds.get(0).getId()); brd = brds.get(0); assertNotNull(brd.getBundleResourceDeploymentHistories()); assertTrue((size + 1) == brd.getBundleResourceDeploymentHistories().size()); BundleResourceDeploymentHistory newHistory = null; for (BundleResourceDeploymentHistory h : brd.getBundleResourceDeploymentHistories()) { - if (auditMessage.equals(h.getAuditMessage())) { + if (auditMessage.equals(h.getMessage())) { newHistory = h; break; } } assertNotNull(newHistory); - assertEquals(auditMessage, newHistory.getAuditAction()); - assertEquals(BundleDeploymentStatus.SUCCESS, newHistory.getAuditStatus()); + assertEquals(auditMessage, newHistory.getAction()); + assertEquals(BundleResourceDeploymentHistory.Status.SUCCESS, newHistory.getStatus()); }
@Test(enabled = TESTS_ENABLED) @@ -926,11 +941,22 @@ public class BundleManagerBeanTest extends UpdateSubsytemTestBase { return bv; }
- private BundleDeployment createDeployment(String name, BundleVersion bv, String installDir, Configuration config) + private BundleDestination createDestination(Bundle bundle, String name, String deployDir, ResourceGroup group) throws Exception { + final String fullName = TEST_PREFIX + "-bundledestination-" + name; + BundleDestination bd = bundleManager.createBundleDestination(overlord, bundle.getId(), fullName, fullName, + deployDir, group.getId()); + + assert bd.getId() > 0; + assert bd.getName().endsWith(fullName); + return bd; + } + + private BundleDeployment createDeployment(String name, BundleVersion bv, BundleDestination dest, + Configuration config) throws Exception { final String fullName = TEST_PREFIX + "-bundledeployment-" + name; - BundleDeployment bd = bundleManager.createBundleDeployment(overlord, bv.getId(), fullName, fullName, - installDir, config); + BundleDeployment bd = bundleManager.createBundleDeployment(overlord, bv.getId(), dest.getId(), fullName, + fullName, config);
assert bd.getId() > 0; assert bd.getName().endsWith(fullName); diff --git a/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java b/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java index 65b151b..fbfbab3 100644 --- a/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java +++ b/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginComponent.java @@ -38,7 +38,6 @@ import org.rhq.bundle.ant.BundleAntProject; import org.rhq.bundle.ant.DeployPropertyNames; import org.rhq.bundle.ant.LoggerAntBuildListener; import org.rhq.core.domain.bundle.BundleDeployment; -import org.rhq.core.domain.bundle.BundleDeploymentStatus; import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.configuration.Configuration; @@ -124,8 +123,8 @@ public class AntBundlePluginComponent implements ResourceComponent, BundleFacet // Send the diffs to the Server so it can store them as an entry in the deployment history. BundleManagerProvider bundleManagerProvider = request.getBundleManagerProvider(); DeployDifferences diffs = project.getDeployDifferences(); - bundleManagerProvider.auditDeployment(resourceDeployment, "Deployment Differences", - BundleDeploymentStatus.SUCCESS, diffs.toString()); + bundleManagerProvider.auditDeployment(resourceDeployment, "Deployment Differences", bundleDeployment + .getName(), null, null, diffs.toString(), null); } catch (Throwable t) { if (log.isDebugEnabled()) { try { @@ -152,11 +151,11 @@ public class AntBundlePluginComponent implements ResourceComponent, BundleFacet private Properties createAntProperties(BundleDeployment bundleDeployment) { Properties antProps = new Properties();
- String installDir = bundleDeployment.getInstallDir(); - if (installDir == null) { + String deployDir = bundleDeployment.getDestination().getDeployDir(); + if (deployDir == null) { throw new IllegalStateException("Bundle deployment does not specify install dir: " + bundleDeployment); } - antProps.setProperty(DeployPropertyNames.DEPLOY_DIR, installDir); + antProps.setProperty(DeployPropertyNames.DEPLOY_DIR, deployDir);
int deploymentId = bundleDeployment.getId(); antProps.setProperty(DeployPropertyNames.DEPLOY_ID, Integer.toString(deploymentId)); diff --git a/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/DeploymentAuditorBuildListener.java b/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/DeploymentAuditorBuildListener.java index d84b061..7f41de8 100644 --- a/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/DeploymentAuditorBuildListener.java +++ b/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/DeploymentAuditorBuildListener.java @@ -26,8 +26,8 @@ import org.apache.tools.ant.BuildEvent; import org.apache.tools.ant.BuildListener; import org.apache.tools.ant.util.StringUtils;
-import org.rhq.core.domain.bundle.BundleDeploymentStatus; import org.rhq.core.domain.bundle.BundleResourceDeployment; +import org.rhq.core.domain.bundle.BundleResourceDeploymentHistory; import org.rhq.core.pluginapi.bundle.BundleManagerProvider;
/** @@ -75,13 +75,13 @@ public class DeploymentAuditorBuildListener implements BuildListener { }
private void auditEvent(BuildEvent event) { - BundleDeploymentStatus status = (event.getException() == null) ? BundleDeploymentStatus.SUCCESS - : BundleDeploymentStatus.FAILURE; + BundleResourceDeploymentHistory.Status status = (event.getException() == null) ? BundleResourceDeploymentHistory.Status.SUCCESS + : BundleResourceDeploymentHistory.Status.FAILURE; String action = createAction(event); String message = createMessage(action, event); try { - this.bundleManagerProvider.auditDeployment(this.bundleResourceDeployment, "Build Event: " + action, status, - message); + this.bundleManagerProvider.auditDeployment(this.bundleResourceDeployment, "Build Event", action, null, + status, message, null); } catch (Exception e) { throw new RuntimeException(e); } 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 d854208..c995939 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 @@ -35,8 +35,9 @@ import org.testng.annotations.Test;
import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; -import org.rhq.core.domain.bundle.BundleDeploymentStatus; +import org.rhq.core.domain.bundle.BundleDestination; import org.rhq.core.domain.bundle.BundleResourceDeployment; +import org.rhq.core.domain.bundle.BundleResourceDeploymentHistory; import org.rhq.core.domain.bundle.BundleType; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.configuration.Configuration; @@ -47,6 +48,7 @@ import org.rhq.core.domain.content.Repo; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.pluginapi.bundle.BundleDeployRequest; import org.rhq.core.pluginapi.bundle.BundleDeployResult; import org.rhq.core.pluginapi.bundle.BundleManagerProvider; @@ -130,6 +132,8 @@ public class AntBundlePluginComponentTest { Bundle bundle = new Bundle("testSimpleBundle", bundleType, repo, packageType); BundleVersion bundleVersion = new BundleVersion("testSimpleBundle", "1.0", bundle, getRecipeFromFile("test-build.xml")); + BundleDestination destination = new BundleDestination(bundle, "testSimpleBundle", new ResourceGroup( + "testSimpleBundle"), "/jboss");
Configuration config = new Configuration(); config.put(new PropertySimple("custom.prop1", "custom property 1")); @@ -138,7 +142,7 @@ public class AntBundlePluginComponentTest { BundleDeployment deployment = new BundleDeployment(); deployment.setBundleVersion(bundleVersion); deployment.setConfiguration(config); - deployment.setInstallDir(USER_HOME + "/jboss"); + deployment.setDestination(destination);
File file1 = new File(tmpDir, "test-v2.properties"); File file2 = new File(tmpDir, "package.zip"); @@ -168,8 +172,9 @@ public class AntBundlePluginComponentTest { }
private class MockBundleManagerProvider implements BundleManagerProvider { - public void auditDeployment(BundleResourceDeployment deployment, String action, BundleDeploymentStatus status, - String message) throws Exception { + public void auditDeployment(BundleResourceDeployment deployment, String action, String info, + BundleResourceDeploymentHistory.Category category, BundleResourceDeploymentHistory.Status status, + String message, String attachment) throws Exception { System.out.println("Auditing deployment step [" + message + "]..."); }
diff --git a/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java b/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java index 8bae89b..cc1d47d 100644 --- a/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java +++ b/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java @@ -23,7 +23,6 @@ import org.apache.commons.logging.LogFactory;
import org.rhq.bundle.filetemplate.recipe.RecipeParser; import org.rhq.core.domain.bundle.BundleDeployment; -import org.rhq.core.domain.bundle.BundleDeploymentStatus; import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.measurement.AvailabilityType; @@ -76,17 +75,17 @@ public class FileTemplateBundlePluginServerComponent implements ResourceComponen .getPackageVersionFiles(), this.resourceContext.getSystemInformation(), request .getBundleFilesLocation().getAbsolutePath(), resourceDeployment, bundleManagerProvider);
- bundleManagerProvider.auditDeployment(resourceDeployment, "Configuration Variable Replacement", - BundleDeploymentStatus.SUCCESS, "setting replacement variable values using [" - + bundleDeployment.getConfiguration().toString(true) + "]"); + bundleManagerProvider.auditDeployment(resourceDeployment, "Configurtion Variable Replacement", + bundleDeployment.getName(), null, null, "setting replacement variable values using [" + + bundleDeployment.getConfiguration().toString(true) + "]", null); recipeContext.setReplacementVariableValues(bundleDeployment.getConfiguration()); - recipeContext.addReplacementVariableValue(DEPLOY_DIR, bundleDeployment.getInstallDir()); + recipeContext.addReplacementVariableValue(DEPLOY_DIR, bundleDeployment.getDestination().getDeployDir()); recipeContext.addReplacementVariableValue(DEPLOY_ID, Integer.toString(bundleDeployment.getId()));
parser.setReplaceReplacementVariables(true);
- bundleManagerProvider.auditDeployment(resourceDeployment, "Parse Recipe", BundleDeploymentStatus.SUCCESS, - "Parsing Recipe using context [" + recipeContext + "]"); + bundleManagerProvider.auditDeployment(resourceDeployment, "Parse Recipe", bundleDeployment.getName(), null, + null, "Parsing Recipe using context [" + recipeContext + "]", null); parser.parseRecipe(recipeContext); } catch (Throwable t) { log.error("Failed to deploy bundle [" + request + "]", t); diff --git a/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/ProcessingRecipeContext.java b/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/ProcessingRecipeContext.java index 89ae39d..ff1a31e 100644 --- a/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/ProcessingRecipeContext.java +++ b/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/ProcessingRecipeContext.java @@ -34,8 +34,8 @@ import org.apache.commons.logging.LogFactory;
import org.rhq.bundle.filetemplate.recipe.RecipeContext; import org.rhq.bundle.filetemplate.recipe.RecipeParser; -import org.rhq.core.domain.bundle.BundleDeploymentStatus; import org.rhq.core.domain.bundle.BundleResourceDeployment; +import org.rhq.core.domain.bundle.BundleResourceDeploymentHistory; import org.rhq.core.domain.content.PackageVersion; import org.rhq.core.pluginapi.bundle.BundleManagerProvider; import org.rhq.core.system.OperatingSystemType; @@ -81,26 +81,27 @@ public class ProcessingRecipeContext extends RecipeContext { ProcessExecutionResults results = this.systemInfo.executeProcess(pe); if (results.getError() != null) { msg = "Could not unbundle file [" + pe + "]: " + results; - audit("deploy", BundleDeploymentStatus.FAILURE, msg); + audit("deploy", BundleResourceDeploymentHistory.Status.FAILURE, msg); throw new RuntimeException(msg, results.getError()); } else if (results.getExitCode() == null || results.getExitCode().intValue() > 0) { msg = "Failed to unbundle file [" + pe + "]: " + results; - audit("deploy", BundleDeploymentStatus.FAILURE, msg); + audit("deploy", BundleResourceDeploymentHistory.Status.FAILURE, msg); throw new RuntimeException(msg); } else { msg = "extracted files from [" + existingFile + "] to [" + directory + "]"; } // existingFile.delete(); WOULD WE WANT TO REMOVE THE COMPRESSED FILE? - audit("deploy", BundleDeploymentStatus.SUCCESS, msg); + audit("deploy", BundleResourceDeploymentHistory.Status.SUCCESS, msg); } else { // not a zipped format - just move the file to the directory as-is File newFile = new File(directory, filename); if (!existingFile.renameTo(newFile)) { msg = "Failed to move [" + existingFile + "] to [" + newFile + "]"; - audit("deploy", BundleDeploymentStatus.FAILURE, msg); + audit("deploy", BundleResourceDeploymentHistory.Status.FAILURE, msg); throw new RuntimeException(msg); } - audit("deploy", BundleDeploymentStatus.SUCCESS, "renamed [" + existingFile + "] to [" + newFile + "]"); + audit("deploy", BundleResourceDeploymentHistory.Status.SUCCESS, "renamed [" + existingFile + "] to [" + + newFile + "]"); } }
@@ -114,11 +115,11 @@ public class ProcessingRecipeContext extends RecipeContext { try { destinationFile.getParentFile().mkdirs(); FileUtil.copyFile(sourceFile, destinationFile); - audit("file", BundleDeploymentStatus.SUCCESS, "copied file [" + sourceFile + "] to [" + destinationFile - + "]"); + audit("file", BundleResourceDeploymentHistory.Status.SUCCESS, "copied file [" + sourceFile + "] to [" + + destinationFile + "]"); } catch (Exception e) { String msg = "Failed to copy file [" + sourceFile + "] to [" + destinationFile + "]"; - audit("file", BundleDeploymentStatus.FAILURE, msg); + audit("file", BundleResourceDeploymentHistory.Status.FAILURE, msg); throw new RuntimeException(msg, e); }
@@ -155,20 +156,20 @@ public class ProcessingRecipeContext extends RecipeContext { reader.close(); reader = null;
- audit("realize", BundleDeploymentStatus.SUCCESS, "realized [" + file + "]"); + audit("realize", BundleResourceDeploymentHistory.Status.SUCCESS, "realized [" + file + "]");
trueFile.delete(); // remove the one with the replacement variables in it if (!realizedTmpFile.renameTo(trueFile)) { msg = "Failed to rename realized tmp file [" + realizedTmpFile + "] to [" + trueFile + "]"; - audit("realize", BundleDeploymentStatus.FAILURE, msg); + audit("realize", BundleResourceDeploymentHistory.Status.FAILURE, msg); throw new RuntimeException(msg); }
- audit("realize", BundleDeploymentStatus.SUCCESS, "renamed realized file [" + realizedTmpFile + "] to [" - + trueFile + "]"); + audit("realize", BundleResourceDeploymentHistory.Status.SUCCESS, "renamed realized file [" + + realizedTmpFile + "] to [" + trueFile + "]"); } catch (Exception e) { msg = "Cannot realize file [" + file + "]"; - audit("realize", BundleDeploymentStatus.FAILURE, msg); + audit("realize", BundleResourceDeploymentHistory.Status.FAILURE, msg); throw new RuntimeException(msg, e); } finally { if (realizedTmpFileWriter != null) { @@ -211,11 +212,11 @@ public class ProcessingRecipeContext extends RecipeContext { ProcessExecutionResults results = this.systemInfo.executeProcess(pe); if (results.getError() != null) { msg = "Could not execute script [" + pe + "]: " + results; - audit("script", BundleDeploymentStatus.FAILURE, msg); + audit("script", BundleResourceDeploymentHistory.Status.FAILURE, msg); throw new RuntimeException(msg, results.getError()); } else { msg = "Executed script [" + pe + "]"; - audit("script", BundleDeploymentStatus.SUCCESS, msg); + audit("script", BundleResourceDeploymentHistory.Status.SUCCESS, msg); }
return; @@ -235,19 +236,20 @@ public class ProcessingRecipeContext extends RecipeContext { ProcessExecutionResults results = this.systemInfo.executeProcess(pe); if (results.getError() != null) { msg = "Could not execute command [" + pe + "]: " + results; - audit("command", BundleDeploymentStatus.FAILURE, msg); + audit("command", BundleResourceDeploymentHistory.Status.FAILURE, msg); throw new RuntimeException(msg, results.getError()); } else { msg = "Executed command [" + pe + "]"; - audit("command", BundleDeploymentStatus.SUCCESS, msg); + audit("command", BundleResourceDeploymentHistory.Status.SUCCESS, msg); }
return; }
- private void audit(String action, BundleDeploymentStatus status, String message) { + private void audit(String action, BundleResourceDeploymentHistory.Status status, String message) { try { - bundleManagerProvider.auditDeployment(bundleResourceDeployment, action, status, message); + bundleManagerProvider.auditDeployment(bundleResourceDeployment, action, "recipe", null, status, message, + null); if (log.isDebugEnabled()) { log.debug("Deployment [" + bundleResourceDeployment.getBundleDeployment().getBundleVersion() + "] audit: action=[" + action + "], status=[" + status + "], message: " + message); @@ -283,7 +285,7 @@ public class ProcessingRecipeContext extends RecipeContext {
if (!success) { String msg = "Cannot ensure that script [" + scriptFile + "] is executable"; - audit("ensureExecutable", BundleDeploymentStatus.FAILURE, msg); + audit("ensureExecutable", BundleResourceDeploymentHistory.Status.FAILURE, msg); throw new RuntimeException(msg); }
diff --git a/modules/plugins/filetemplate-bundle/src/test/java/org/rhq/plugins/filetemplate/ProcessingRecipeContextTest.java b/modules/plugins/filetemplate-bundle/src/test/java/org/rhq/plugins/filetemplate/ProcessingRecipeContextTest.java index c6753bd..fd71508 100644 --- a/modules/plugins/filetemplate-bundle/src/test/java/org/rhq/plugins/filetemplate/ProcessingRecipeContextTest.java +++ b/modules/plugins/filetemplate-bundle/src/test/java/org/rhq/plugins/filetemplate/ProcessingRecipeContextTest.java @@ -42,14 +42,16 @@ import org.rhq.bundle.filetemplate.recipe.RecipeContext; import org.rhq.bundle.filetemplate.recipe.RecipeParser; import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; -import org.rhq.core.domain.bundle.BundleDeploymentStatus; +import org.rhq.core.domain.bundle.BundleDestination; import org.rhq.core.domain.bundle.BundleResourceDeployment; +import org.rhq.core.domain.bundle.BundleResourceDeploymentHistory; import org.rhq.core.domain.bundle.BundleType; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.content.PackageVersion; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.pluginapi.bundle.BundleManagerProvider; import org.rhq.core.pluginapi.util.FileUtils; import org.rhq.core.system.OperatingSystemType; @@ -190,7 +192,9 @@ public class ProcessingRecipeContextTest { BundleVersion bundleVersion = new BundleVersion("bname", "bversion", bundle, ""); String name = "name"; String installDir = "installDir"; - BundleDeployment bundleDeployment = new BundleDeployment(bundleVersion, name, installDir); + BundleDestination bundleDestination = new BundleDestination(bundle, "destName", new ResourceGroup("groupName"), + installDir); + BundleDeployment bundleDeployment = new BundleDeployment(bundleVersion, bundleDestination, name); BundleResourceDeployment deployment = new BundleResourceDeployment(bundleDeployment, resource);
ProcessingRecipeContext context = new ProcessingRecipeContext(getRecipe(), packageVersionFiles, sysinfo, cwd, @@ -273,8 +277,9 @@ public class ProcessingRecipeContextTest { }
private class DummyBundleManagerProvider implements BundleManagerProvider { - public void auditDeployment(BundleResourceDeployment deployment, String action, BundleDeploymentStatus status, - String message) throws Exception { + public void auditDeployment(BundleResourceDeployment deployment, String action, String info, + BundleResourceDeploymentHistory.Category category, BundleResourceDeploymentHistory.Status status, + String message, String attachment) throws Exception { System.out.println("audit: action=[" + action + "], status=[" + status + "], message: " + message); }
diff --git a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/LinuxPlatformComponent.java b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/LinuxPlatformComponent.java index 62652a1..cd4a782 100644 --- a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/LinuxPlatformComponent.java +++ b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/LinuxPlatformComponent.java @@ -32,18 +32,18 @@ import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
-import org.rhq.core.domain.content.transfer.ContentResponseResult; -import org.rhq.core.domain.content.transfer.DeployIndividualPackageResponse; -import org.rhq.core.domain.content.transfer.DeployPackagesResponse; -import org.rhq.core.domain.content.transfer.RemovePackagesResponse; 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.content.PackageType; +import org.rhq.core.domain.content.transfer.ContentResponseResult; +import org.rhq.core.domain.content.transfer.DeployIndividualPackageResponse; import org.rhq.core.domain.content.transfer.DeployPackageStep; +import org.rhq.core.domain.content.transfer.DeployPackagesResponse; import org.rhq.core.domain.content.transfer.RemoveIndividualPackageResponse; +import org.rhq.core.domain.content.transfer.RemovePackagesResponse; import org.rhq.core.domain.content.transfer.ResourcePackageDetails; import org.rhq.core.domain.measurement.MeasurementDataTrait; import org.rhq.core.domain.measurement.MeasurementReport; @@ -256,8 +256,9 @@ public class LinuxPlatformComponent extends PlatformComponent implements Content List<String> pkgs = new ArrayList<String>(); for (ResourcePackageDetails p : packages) { String pkgInfo = p.getName(); - if ((p.getVersion() != null) && (!p.getVersion().isEmpty())) { - pkgInfo = pkgInfo + "-" + p.getVersion(); + String version = p.getVersion(); + if ((version != null) && (!"".equals(version))) { + pkgInfo = pkgInfo + "-" + version; } log.info("Adding <" + pkgInfo + "> to list of packages to deploy, original package object was: " + p); pkgs.add(pkgInfo);
commit a7d79cedf4e652b45c4e3d253c1f448b440125f9 Author: John Mazzitelli mazz@redhat.com Date: Tue May 11 10:05:35 2010 -0400
generate the version properties file without leading spaces on each line
diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml index e718952..840adfb 100644 --- a/modules/enterprise/server/jar/pom.xml +++ b/modules/enterprise/server/jar/pom.xml @@ -428,16 +428,16 @@ </tstamp>
<echo file="${project.build.outputDirectory}/rhq-server-version.properties" append="false">Product-Name=${rhq.product.name} - Product-Version=${project.version} - Module-Name=${pom.name} - Module-Version=${pom.version} - Build-Number=${buildNumber} - Build-Date=${build.time} - Build-Jdk-Vendor=${java.vendor} - Build-Jdk=${java.version} - Build-OS-Name=${os.name} - Build-OS-Version=${os.version} - </echo> +Product-Version=${project.version} +Module-Name=${pom.name} +Module-Version=${pom.version} +Build-Number=${buildNumber} +Build-Date=${build.time} +Build-Jdk-Vendor=${java.vendor} +Build-Jdk=${java.version} +Build-OS-Name=${os.name} +Build-OS-Version=${os.version} +</echo> </tasks> </configuration> <goals>
commit e7770d955a8b0fffbdeb4a937db5cccc1b24731f Author: Ian P. Springer <ips@jetengine.(none)> Date: Mon May 10 13:33:50 2010 -0400
remove use of nexus deprecated repo, which conflicts with the original jboss repo declared in the root pom
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml index 266492d..7ed877c 100644 --- a/modules/core/domain/pom.xml +++ b/modules/core/domain/pom.xml @@ -27,6 +27,7 @@ <jboss-embeddable-ejb3.version>1.0.0.Alpha9</jboss-embeddable-ejb3.version> </properties>
+ <dependencies>
<!-- the notorious util jar --> @@ -224,6 +225,7 @@
</dependencies>
+ <build>
<finalName>rhq-core-domain-ejb3</finalName> @@ -298,6 +300,7 @@ </plugins> </build>
+ <profiles>
<profile> @@ -403,17 +406,7 @@ </profiles>
- <repositories> - - <!-- This is needed for the old version of Hibernate that we use. --> - <repository> - <id>jboss-deprecated-repository</id> - <name>JBoss Deprecated Maven Repository</name> - <url>https://repository.jboss.org/nexus/content/repositories/deprecated/</url> - <snapshots> - <enabled>false</enabled> - </snapshots> - </repository> + <repositories>
<repository> <id>codehaus</id> @@ -424,6 +417,6 @@ </snapshots> </repository>
- </repositories> + </repositories>
</project>
commit 5665b8d4960c3bbc2511dc66df768daafadaaddc Merge: 14ba96a... cd829d6... Author: Ian P. Springer <ips@jetengine.(none)> Date: Mon May 10 13:24:51 2010 -0400
Merge branch 'gwt' of ssh://git.fedorahosted.org/git/rhq/rhq into gwt
commit 14ba96a455ec10be4fe1019b0ab47ed70646a36b Author: Ian P. Springer <ips@jetengine.(none)> Date: Mon May 10 13:13:37 2010 -0400
remove use of nexus deprected repo, which was overriding the original jboss repo in the root pom, which has the same id
diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml index f461b8e..1672828 100644 --- a/modules/enterprise/gui/portal-war/pom.xml +++ b/modules/enterprise/gui/portal-war/pom.xml @@ -19,6 +19,7 @@ <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/gui/portal-war/</developerConnection> </scm>
+ <properties> <scm.module.path>modules/enterprise/gui/portal-war/</scm.module.path>
@@ -40,6 +41,7 @@ <product.help.doc.root>http://support.rhq-project.org/display/RHQ/</product.help.doc.root> </properties>
+ <dependencies>
<!-- Internal Deps --> @@ -392,6 +394,7 @@
</dependencies>
+ <build> <finalName>rhq-portal</finalName> <plugins> @@ -472,6 +475,7 @@
</build>
+ <profiles>
<profile> @@ -581,6 +585,7 @@
</profiles>
+ <repositories>
<repository> @@ -590,22 +595,6 @@ <layout>legacy</layout> </repository>
- <!-- This is needed for the org.jvnet:inflector dep. - TODO: Publish the inflector artifact to the JBoss 3rd party repo. --> - <repository> - <id>jboss-deprecated-repository</id> - <name>JBoss Deprecated Maven Repository</name> - <url>https://repository.jboss.org/nexus/content/repositories/deprecated/</url> - <layout>default</layout> - <releases> - <enabled>true</enabled> - <updatePolicy>never</updatePolicy> - </releases> - <snapshots> - <enabled>false</enabled> - </snapshots> - </repository> - </repositories>
</project>
commit cd829d62b2e3547eba6de06071768ed06c33719b Merge: 51c62cd... f179d8f... Author: John Mazzitelli mazz@redhat.com Date: Mon May 10 12:21:44 2010 -0400
Merge branch 'gwt' of ssh://git.fedorahosted.org/git/rhq/rhq into gwt
commit 51c62cdbb6d16ee552a85bdc1d7aee5ca5ef492a Author: John Mazzitelli mazz@redhat.com Date: Mon May 10 12:20:37 2010 -0400
based on conversations with ghinkle and jshaughn, its been decided to backup files to the new deployment metadata directory, as opposed to the old existing metadata directory
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java index b16380b..13b67a0 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java @@ -157,8 +157,6 @@ public class Deployer { // * if a file is realized on the filesystem before its stored on the file system // * if a current file is backed up
- DeploymentProperties originalDeploymentProps = this.deploymentsMetadata.getCurrentDeploymentProperties(); - FileHashcodeMap original = this.deploymentsMetadata.getCurrentDeploymentFileHashcodes(); ChangesFileHashcodeMap current = original.rescan(this.deploymentData.getDestinationDir(), this.deploymentData .getIgnoreRegex()); @@ -270,10 +268,11 @@ public class Deployer {
// 1. backup the files we want to retain for the admin to review if (!currentFilesToBackup.isEmpty()) { - int deploymentId = originalDeploymentProps.getDeploymentId(); + DeploymentProperties props = this.deploymentData.getDeploymentProps(); // changed from: deploymentsMetadata.getCurrentDeploymentProperties + int backupDeploymentId = props.getDeploymentId(); debug("Backing up files as part of update deployment. dryRun=", dryRun); for (String fileToBackupPath : currentFilesToBackup) { - backupFile(diff, deploymentId, fileToBackupPath, dryRun); + backupFile(diff, backupDeploymentId, fileToBackupPath, dryRun); } }
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentsMetadata.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentsMetadata.java index 0cf7fd6..b255517 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentsMetadata.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentsMetadata.java @@ -27,8 +27,6 @@ import java.io.File; import java.util.Set; import java.util.regex.Pattern;
-import org.rhq.core.util.file.FileUtil; - /** * This loads and stores metadata about installs of a particular bundle deployment. * @@ -258,11 +256,9 @@ public class DeploymentsMetadata { throws Exception {
// determine where we need to put the metadata and create its empty directory - // TODO: if the directory exists, it means somehow we are initializing the same deployment again - // for now I'm just purging the old data, but is that the correct thing to do? + // Don't worry if the directory already exists, we probably backed up files there ahead of time. getMetadataDirectory().mkdirs(); File deploymentMetadataDir = getDeploymentMetadataDirectory(deploymentProps.getDeploymentId()); - FileUtil.purge(deploymentMetadataDir, true); deploymentMetadataDir.mkdirs(); if (!deploymentMetadataDir.isDirectory()) { throw new Exception("Failed to create deployment metadata directory: " + deploymentMetadataDir); diff --git a/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java b/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java index 04031bb..917861d 100644 --- a/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java +++ b/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java @@ -305,12 +305,14 @@ public class DeployerTest { boolean isWindows = File.separatorChar == '\'; String updaterBabsoluteBackupTo1; String updaterBabsoluteBackupTo2; + String updaterBabsoluteBackupTo3; if (!isWindows) { updaterBabsoluteBackupTo1 = new File(metadir, "1/ext-backup/" + updaterBabsolute.getAbsolutePath()) .getAbsolutePath(); updaterBabsoluteBackupTo2 = new File(metadir, "2/ext-backup/" + updaterBabsolute.getAbsolutePath()) .getAbsolutePath(); - assert new File(updaterBabsoluteBackupTo1).exists() : "missing updateB.txt backup"; + updaterBabsoluteBackupTo3 = new File(metadir, "3/ext-backup/" + updaterBabsolute.getAbsolutePath()) + .getAbsolutePath(); } else { StringBuilder str = new StringBuilder(updaterBabsolute.getAbsolutePath()); String driveLetter = FileUtil.stripDriveLetter(str); @@ -323,7 +325,12 @@ public class DeployerTest { .getAbsolutePath(); updaterBabsoluteBackupTo2 = new File(metadir, "2/ext-backup/" + driveLetter + str.toString()) .getAbsolutePath(); + updaterBabsoluteBackupTo3 = new File(metadir, "3/ext-backup/" + driveLetter + str.toString()) + .getAbsolutePath(); } + assert !(new File(updaterBabsoluteBackupTo1).exists()) : "updateB.txt backup should not be in deploy #1"; + assert new File(updaterBabsoluteBackupTo2).exists() : "missing updateB.txt backup from deploy #2"; + String updaterAabsoluteBackupTo1; String updaterAabsoluteBackupTo2; if (!isWindows) { @@ -331,7 +338,6 @@ public class DeployerTest { .getAbsolutePath(); updaterAabsoluteBackupTo2 = new File(metadir, "2/ext-backup/" + updaterAabsolute.getAbsolutePath()) .getAbsolutePath(); - assert new File(updaterAabsoluteBackupTo1).exists() : "missing updateA.txt backup"; } else { StringBuilder str = new StringBuilder(updaterAabsolute.getAbsolutePath()); String driveLetter = FileUtil.stripDriveLetter(str); @@ -345,6 +351,8 @@ public class DeployerTest { updaterAabsoluteBackupTo2 = new File(metadir, "2/ext-backup/" + driveLetter + str.toString()) .getAbsolutePath(); } + assert !(new File(updaterAabsoluteBackupTo1).exists()) : "should not have updateA.txt backup in #1"; + assert new File(updaterAabsoluteBackupTo2).exists() : "missing updateA.txt backup";
assert !(new File(tmpDir, file0).exists()) : "file0 should be deleted"; assert new File(tmpDir, fileA).exists() : "fileA should exist"; @@ -358,16 +366,16 @@ public class DeployerTest { } assert new File(tmpDir, fileB).exists() : "fileB should exist"; assert !"X".equals(new String(StreamUtil.slurp(new FileInputStream(new File(tmpDir, fileB))))); - File fileBbackupTo1 = new File(metadir, "1/backup/" + fileB); - assert fileBbackupTo1.exists() : "should have fileB backed up in deploy 1 backup dir"; - assert "X".equals(new String(StreamUtil.slurp(new FileInputStream(fileBbackupTo1)))); + File fileBbackupTo2 = new File(metadir, "2/backup/" + fileB); + assert fileBbackupTo2.exists() : "should have fileB backed up in deploy 2 backup dir"; + assert "X".equals(new String(StreamUtil.slurp(new FileInputStream(fileBbackupTo2)))); assert new File(tmpDir, fileC).exists() : "fileC should exist"; assert new File(tmpDir, file4).exists() : "file4 should exist"; assert "X".equals(new String(StreamUtil.slurp(new FileInputStream(new File(tmpDir, file1))))); assert new File(tmpDir, file2).exists() : "file2 should exist again"; assert !(new File(tmpDir, file999).exists()) : "file999 should be deleted"; - File file999backupTo1 = new File(metadir, "1/backup/" + file999); - assert file999backupTo1.exists() : "file999 should not be backed up"; + File file999backupTo2 = new File(metadir, "2/backup/" + file999); + assert file999backupTo2.exists() : "file999 should not be backed up"; assert new File(tmpDir, file3).exists() : "file3 should exist"; assert diff.getAddedFiles().size() == 3 : diff; assert diff.getAddedFiles().contains(file2) : diff; @@ -383,14 +391,14 @@ public class DeployerTest { assert diff.getBackedUpFiles().size() == 4 : diff; assert diff.getBackedUpFiles().containsKey(diff.convertPath(updaterAabsolute.getAbsolutePath())) : diff; assert diff.getBackedUpFiles().get(diff.convertPath(updaterAabsolute.getAbsolutePath())).equals( - diff.convertPath(updaterAabsoluteBackupTo1)) : diff; + diff.convertPath(updaterAabsoluteBackupTo2)) : diff; assert diff.getBackedUpFiles().containsKey(diff.convertPath(updaterBabsolute.getAbsolutePath())) : diff; assert diff.getBackedUpFiles().get(diff.convertPath(updaterBabsolute.getAbsolutePath())).equals( - diff.convertPath(updaterBabsoluteBackupTo1)) : diff; + diff.convertPath(updaterBabsoluteBackupTo2)) : diff; assert diff.getBackedUpFiles().containsKey(fileB) : diff; - assert diff.getBackedUpFiles().get(fileB).equals(diff.convertPath(fileBbackupTo1.getAbsolutePath())) : diff; + assert diff.getBackedUpFiles().get(fileB).equals(diff.convertPath(fileBbackupTo2.getAbsolutePath())) : diff; assert diff.getBackedUpFiles().containsKey(file999) : diff; - assert diff.getBackedUpFiles().get(file999).equals(diff.convertPath(file999backupTo1.getAbsolutePath())) : diff; + assert diff.getBackedUpFiles().get(file999).equals(diff.convertPath(file999backupTo2.getAbsolutePath())) : diff; if (realize) { assert diff.getRealizedFiles().size() == 1 : diff; assert diff.getRealizedFiles().containsKey(fileA) : diff; @@ -417,9 +425,9 @@ public class DeployerTest { assert diff.getIgnoredFiles().contains(fileToIgnore.getParentFile().getName()); }
- assert new File(updaterBabsoluteBackupTo2).exists() : "updaterB should be backed up"; + assert new File(updaterBabsoluteBackupTo3).exists() : "updaterB should be backed up"; assert "B1prime".equals(new String(StreamUtil.slurp(new FileInputStream(updaterBabsolute)))); - assert "Y".equals(new String(StreamUtil.slurp(new FileInputStream(new File(updaterBabsoluteBackupTo2))))); + assert "Y".equals(new String(StreamUtil.slurp(new FileInputStream(new File(updaterBabsoluteBackupTo3)))));
assert diff.getAddedFiles().size() == 1 : diff; assert diff.getAddedFiles().contains(diff.convertPath(updaterAabsolute.getAbsolutePath())) : diff; @@ -429,7 +437,7 @@ public class DeployerTest { assert diff.getBackedUpFiles().size() == 1 : diff; assert diff.getBackedUpFiles().containsKey(diff.convertPath(updaterBabsolute.getAbsolutePath())) : diff; assert diff.getBackedUpFiles().get(diff.convertPath(updaterBabsolute.getAbsolutePath())).equals( - diff.convertPath(updaterBabsoluteBackupTo2)) : diff; + diff.convertPath(updaterBabsoluteBackupTo3)) : diff; if (realize) { assert diff.getRealizedFiles().size() == 1 : diff; assert diff.getRealizedFiles().containsKey(fileA) : diff;
commit f179d8f25d47e0247f19f8e4ce8d576202cd00e8 Author: Ian P. Springer <ips@jetengine.(none)> Date: Mon May 10 11:57:31 2010 -0400
fix name of profile used to enable enforcing of Java 5 API
diff --git a/etc/m2/settings.xml b/etc/m2/settings.xml index 55d1862..64b6e35 100644 --- a/etc/m2/settings.xml +++ b/etc/m2/settings.xml @@ -26,9 +26,9 @@ <!-- The 'dev' profile enables automatic copying of artifacts to a dev RHQ container. --> <activeProfile>dev</activeProfile>
- <!-- The 'jdk6' profile can be used to build RHQ using JDK6, while still enforcing that - only Java 5 APIs are used - see the 'jdk6' profile block below. --> - <!--<activeProfile>jdk6</activeProfile>--> + <!-- The 'check-java-api' profile can be used to build RHQ using JDK6, while still enforcing that + only Java 5 APIs are used - see the 'check-java-api' profile block below. --> + <!--<activeProfile>check-java-api</activeProfile>-->
<!-- The 'dist' profile is for release builds and enables things such as JSP precompilation. --> <!--<activeProfile>dist</activeProfile>--> @@ -172,10 +172,10 @@ <!-- This can be used to build RHQ using JDK6, while still enforcing that only Java 5 APIs are used. --> <profile> - <id>jdk6</id> + <id>check-java-api</id> <properties> - <!-- Set this to your a JRE5 installation dir (e.g. /opt/jdk-1.5.0_15/jre). --> - <java5.home>/opt/jdk-1.5.0_15/jre</java5.home> + <!-- Set this to your a JRE5 installation dir (e.g. /usr/java/jdk-1.5.0_21/jre). --> + <java5.home>/usr/java/jdk-1.5.0_21/jre</java5.home> </properties> </profile>
commit 3df98d5b6fc9331da17777e23db1a2557a41bb73 Merge: 788a453... 3c8fc46... Author: Ian P. Springer <ips@jetengine.(none)> Date: Mon May 10 10:56:32 2010 -0400
Merge branch 'gwt' of ssh://git.fedorahosted.org/git/rhq/rhq into gwt
commit 788a453b20c7b50e9c18e69ddbd82e0d9ef49868 Author: Ian P. Springer <ips@jetengine.(none)> Date: Mon May 10 10:54:58 2010 -0400
use /Dashboard.do, rather than /Start.do, as the URL to check to determine if portal-war has been deployed
diff --git a/modules/enterprise/gui/installer-war/src/main/webapp/header.jsp b/modules/enterprise/gui/installer-war/src/main/webapp/header.jsp index 45e86b8..df38c2d 100644 --- a/modules/enterprise/gui/installer-war/src/main/webapp/header.jsp +++ b/modules/enterprise/gui/installer-war/src/main/webapp/header.jsp @@ -20,7 +20,7 @@ <c:if test="<%= new ServerInformation().isFullyDeployed() && request.getRequestURI().indexOf("installer/start") == -1 %>"> <script type="text/javascript" language="JavaScript">
- var startPage = '/Start.do'; + var startPage = '/Dashboard.do'; var xmlRequest = false;
function doLoad()
commit 3c8fc4667e476aae501d945ed74c5d272764e99b Author: John Mazzitelli mazz@redhat.com Date: Mon May 10 10:48:33 2010 -0400
crlf -> lf
diff --git a/modules/core/util/src/test/resources/ini-editor-test.ini b/modules/core/util/src/test/resources/ini-editor-test.ini index c5eeef2..7a6d5f0 100644 --- a/modules/core/util/src/test/resources/ini-editor-test.ini +++ b/modules/core/util/src/test/resources/ini-editor-test.ini @@ -1,36 +1,36 @@ -[main] - # Where Puppet stores dynamic and growing data. - # The default value is '/var/puppet'. - vardir = /var/lib/puppet - - # The Puppet log directory. - # The default value is '$vardir/log'. - logdir = /var/log/puppet - - # Where Puppet PID files are kept. - # The default value is '$vardir/run'. - rundir = /var/run/puppet - - # Where SSL certificates are kept. - # The default value is '$confdir/ssl'. - ssldir = $vardir/ssl - -[puppetd] - # The file in which puppetd stores a list of the classes - # associated with the retrieved configuratiion. Can be loaded in - # the separate ``puppet`` executable using the ``--loadclasses`` - # option. - # The default value is '$confdir/classes.txt'. - classfile = $vardir/classes.txt - - # Where puppetd caches the local configuration. An - # extension indicating the cache format is added automatically. - # The default value is '$confdir/localconfig'. - localconfig = $vardir/localconfig - -[puppetca] -autosign = false - -[puppetmasterd] -ca = true -certname = mycertname +[main] + # Where Puppet stores dynamic and growing data. + # The default value is '/var/puppet'. + vardir = /var/lib/puppet + + # The Puppet log directory. + # The default value is '$vardir/log'. + logdir = /var/log/puppet + + # Where Puppet PID files are kept. + # The default value is '$vardir/run'. + rundir = /var/run/puppet + + # Where SSL certificates are kept. + # The default value is '$confdir/ssl'. + ssldir = $vardir/ssl + +[puppetd] + # The file in which puppetd stores a list of the classes + # associated with the retrieved configuratiion. Can be loaded in + # the separate ``puppet`` executable using the ``--loadclasses`` + # option. + # The default value is '$confdir/classes.txt'. + classfile = $vardir/classes.txt + + # Where puppetd caches the local configuration. An + # extension indicating the cache format is added automatically. + # The default value is '$confdir/localconfig'. + localconfig = $vardir/localconfig + +[puppetca] +autosign = false + +[puppetmasterd] +ca = true +certname = mycertname
commit 848bb5afaad36bc3c3e1653f6a9957b134a4756a Author: Ian P. Springer <ips@jetengine.(none)> Date: Mon May 10 10:39:38 2010 -0400
add old jboss repo as plugin repo, so jboss-packaging plugin can bo obtained from it
diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml index 4db329f..68deca1 100644 --- a/modules/enterprise/server/sars/pom.xml +++ b/modules/enterprise/server/sars/pom.xml @@ -1,4 +1,6 @@ -<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"> +<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%22%3E
<modelVersion>4.0.0</modelVersion>
@@ -12,18 +14,14 @@ <artifactId>rhq-enterprise-server-sars-parent</artifactId> <packaging>pom</packaging>
- <name>RHQ Enterprise Server JBossAS Services</name> - <description>parent POM for all JBossAS services</description> + <name>RHQ Enterprise Server JBoss AS SARs</name> + <description>parent POM for all JBoss AS SARs</description>
<scm> <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/server/sars/</connection> <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/server/sars/</developerConnection> </scm>
- <properties> - <scm.module.path>modules/enterprise/server/sars/</scm.module.path> - </properties> - <build> <plugins>
@@ -37,18 +35,20 @@ </plugins> </build>
- <profiles> + <modules> + <module>agent-sar</module> + </modules>
- <profile> - <id>default</id> - <activation> - <activeByDefault>true</activeByDefault> - </activation> - <modules> - <module>agent-sar</module> - </modules> - </profile> + <pluginRepositories> + <pluginRepository> + <id>jboss-deprecated-repository</id> + <name>JBoss Deprecated</name> + <url>https://repository.jboss.org/maven2/</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories>
- </profiles> +</project>
-</project> \ No newline at end of file
commit e715eb659af3a47d3db99292c518638b3c5a82f3 Author: Greg Hinkle ghinkle@redhat.com Date: Mon May 10 09:45:44 2010 -0400
Fixed issue with url bookmarks that get encoded
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java index dd9e766..9cd7ba7 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java @@ -9,6 +9,7 @@ import com.google.gwt.http.client.RequestBuilder; import com.google.gwt.http.client.RequestCallback; import com.google.gwt.http.client.RequestException; import com.google.gwt.http.client.Response; +import com.google.gwt.http.client.URL; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.History; import com.google.gwt.user.client.rpc.AsyncCallback; @@ -158,8 +159,11 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { }
public void onValueChange(ValueChangeEvent<String> stringValueChangeEvent) { - System.out.println("Handling history event: " + stringValueChangeEvent.getValue()); - currentViewPath = new ViewPath(stringValueChangeEvent.getValue()); + + String event = URL.decodeComponent(stringValueChangeEvent.getValue()); + System.out.println("Handling history event: " + event); + + currentViewPath = new ViewPath(event);
rootCanvas.renderView(currentViewPath);
commit 7ccbb448ade04b2467c20c0fb5a21f41310e4eb5 Author: Greg Hinkle ghinkle@redhat.com Date: Mon May 10 09:45:06 2010 -0400
Fixed a couple bugs in the bundle criteria area Display of bundle deployment step histories Bundle tree work
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java index 1ad7f05..912eab7 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleDeploymentCriteria.java @@ -23,6 +23,8 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement;
+import org.rhq.core.domain.bundle.BundleDeployment; + /** * @author Jay Shaughnessy */ @@ -35,19 +37,26 @@ public class BundleDeploymentCriteria extends Criteria { private Integer filterId; private String filterName; private String filterDescription; + private Integer filterBundleId; // needs override + private Integer filterBundleVersionId; // needs override +
private boolean fetchBundleVersion; private boolean fetchConfiguration; - private boolean fetchDeployments; + private boolean fetchResourceDeployments; private boolean fetchGroupDeployments; private boolean fetchTags;
public BundleDeploymentCriteria() { + + filterOverrides.put("bundleId", "bundleVersion.bundle.id = ?"); + filterOverrides.put("bundleVersionId", "bundleVersion.id = ?"); + }
@Override public Class<?> getPersistentClass() { - return BundleDeploymentCriteria.class; + return BundleDeployment.class; }
public void addFilterId(Integer filterId) { @@ -62,6 +71,16 @@ public class BundleDeploymentCriteria extends Criteria { this.filterDescription = filterDescription; }
+ + public void addFilterBundleId(Integer filterBundleId) { + this.filterBundleId = filterBundleId; + } + + public void addFilterBundleVersionId(Integer filterBundleVersionId) { + this.filterBundleVersionId = filterBundleVersionId; + } + + public void fetchBundleVersion(boolean fetchBundleVersion) { this.fetchBundleVersion = fetchBundleVersion; } @@ -70,8 +89,8 @@ public class BundleDeploymentCriteria extends Criteria { this.fetchConfiguration = fetchConfiguration; }
- public void fetchDeployments(boolean fetchDeployments) { - this.fetchDeployments = fetchDeployments; + public void fetchResourceDeployments(boolean fetchResourceDeployments) { + this.fetchResourceDeployments = fetchResourceDeployments; }
public void fetchGroupDeployments(boolean fetchGroupDeployments) { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java index b9c863b..0620d9e 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java @@ -47,8 +47,8 @@ public class BundleResourceDeploymentCriteria extends Criteria { private boolean fetchHistories;
public BundleResourceDeploymentCriteria() { - filterOverrides.put("bundleDeploymentId", "parentResource.id = ?"); - filterOverrides.put("bundleDeploymentName", "parentResource.name like ?"); + filterOverrides.put("bundleDeploymentId", "bundleDeployment.id = ?"); + filterOverrides.put("bundleDeploymentName", "bundleDeployment.name like ?"); filterOverrides.put("groupDeploymentId", "groupDeployment.id = ?"); filterOverrides.put("resourceId", "resource.id = ?"); filterOverrides.put("resourceName", "resource.name like ?"); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java new file mode 100644 index 0000000..e09cc25 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentDataSource.java @@ -0,0 +1,124 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.bundle.deployment; + +import java.util.Date; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.data.DSRequest; +import com.smartgwt.client.data.DSResponse; +import com.smartgwt.client.data.fields.DataSourceDateTimeField; +import com.smartgwt.client.data.fields.DataSourceIntegerField; +import com.smartgwt.client.data.fields.DataSourceTextField; +import com.smartgwt.client.widgets.grid.ListGridRecord; + +import org.rhq.core.domain.bundle.BundleDeployment; +import org.rhq.core.domain.criteria.BundleDeploymentCriteria; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; + +/** + * @author Greg Hinkle + */ +public class BundleDeploymentDataSource extends RPCDataSource<BundleDeployment> { + + private BundleGWTServiceAsync bundleService = GWTServiceLookup.getBundleService(); + + public BundleDeploymentDataSource() { + + DataSourceIntegerField id = new DataSourceIntegerField("id","ID"); + id.setPrimaryKey(true); + addField(id); + + DataSourceTextField name = new DataSourceTextField("name", "Deployment Name"); + addField(name); + + DataSourceTextField description = new DataSourceTextField("description", "Description"); + addField(description); + + DataSourceDateTimeField created = new DataSourceDateTimeField("createdTime", "Deployment Time"); + addField(created); + + DataSourceTextField bundleVersion = new DataSourceTextField("bundleVersion", "Bundle Version"); + addField(bundleVersion); + + + } + + @Override + protected void executeFetch(final DSRequest request, final DSResponse response) { + BundleDeploymentCriteria criteria = new BundleDeploymentCriteria(); + + + if (request.getCriteria().getValues().containsKey("bundleId")) { + criteria.addFilterBundleId(Integer.parseInt(request.getCriteria().getAttribute("bundleId"))); + } + + if (request.getCriteria().getValues().containsKey("bundleVersionId")) { + criteria.addFilterBundleId(Integer.parseInt(request.getCriteria().getAttribute("bundleVersionId"))); + } + + bundleService.findBundleDeploymentsByCriteria(criteria, new AsyncCallback<PageList<BundleDeployment>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load bundle deployments",caught); + } + + public void onSuccess(PageList<BundleDeployment> result) { + response.setData(buildRecords(result)); + processResponse(request.getRequestId(), response); + } + }); + + + } + + @Override + public BundleDeployment copyValues(ListGridRecord from) { + return null; // TODO: Implement this method. + } + + @Override + public ListGridRecord copyValues(BundleDeployment from) { + + ListGridRecord record = new ListGridRecord(); + + record.setAttribute("id", from.getId()); + record.setAttribute("name", from.getName()); + record.setAttribute("installDir", from.getInstallDir()); + record.setAttribute("description", from.getDescription()); + record.setAttribute("createdTime", new Date(from.getCtime())); + record.setAttribute("configuration", from.getConfiguration()); + + + if (from.getBundleVersion() != null) { + record.setAttribute("bundleVersionVersion", from.getBundleVersion().getVersion()); + record.setAttribute("bundleVersionId", from.getBundleVersion().getId()); + } + + + return record; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentListView.java new file mode 100644 index 0000000..8438cec --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentListView.java @@ -0,0 +1,86 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.bundle.deployment; + +import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.grid.CellFormatter; +import com.smartgwt.client.widgets.grid.ListGridRecord; +import com.smartgwt.client.widgets.layout.VLayout; + +import org.rhq.core.domain.bundle.Bundle; +import org.rhq.core.domain.bundle.BundleVersion; +import org.rhq.enterprise.gui.coregui.client.components.table.Table; + +/** + * @author Greg Hinkle + */ +public class BundleDeploymentListView extends VLayout { + + private int bundleId; + private Bundle bundle; + private BundleVersion bundleVersion; + + + public BundleDeploymentListView(Bundle bundle) { + this.bundle = bundle; + this.bundleId = bundle.getId(); + } + + public BundleDeploymentListView(BundleVersion bundleVersion) { + this.bundleVersion = bundleVersion; + this.bundleId = bundleVersion.getBundle().getId(); + } + + @Override + protected void onInit() { + super.onInit(); + + + String title = "Bundle Versions"; + + Criteria criteria = new Criteria(); + if (bundle != null) { + title = bundle.getName() + " deployments"; + criteria.setAttribute("bundleId",bundle.getId()); + } + if (bundleVersion != null) { + title = bundleVersion.getVersion() + " deployments"; + criteria.setAttribute("bundleVersionId", bundleVersion.getId()); + } + + Table table = new Table(title, criteria); + + table.setDataSource(new BundleDeploymentDataSource()); + + + table.getListGrid().getField("name").setCellFormatter(new CellFormatter() { + public String format(Object o, ListGridRecord record, int i, int i1) { + return "<a href="#Bundles/Bundle/" + bundleId + "/deployments/" + record.getAttribute("id") + "">" + String.valueOf(o) + "</a>"; + } + }); + + addMember(table); + + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java new file mode 100644 index 0000000..d046b9d --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java @@ -0,0 +1,274 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.bundle.deployment; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashSet; + +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.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.CanvasItem; +import com.smartgwt.client.widgets.form.fields.LinkItem; +import com.smartgwt.client.widgets.form.fields.StaticTextItem; +import com.smartgwt.client.widgets.grid.ListGridField; +import com.smartgwt.client.widgets.grid.ListGridRecord; +import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; +import com.smartgwt.client.widgets.grid.events.SelectionEvent; +import com.smartgwt.client.widgets.layout.VLayout; + +import org.rhq.core.domain.bundle.Bundle; +import org.rhq.core.domain.bundle.BundleDeployment; +import org.rhq.core.domain.bundle.BundleResourceDeployment; +import org.rhq.core.domain.bundle.BundleVersion; +import org.rhq.core.domain.criteria.BundleCriteria; +import org.rhq.core.domain.criteria.BundleDeploymentCriteria; +import org.rhq.core.domain.criteria.BundleResourceDeploymentCriteria; +import org.rhq.core.domain.tagging.Tag; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.BookmarkableView; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.ViewId; +import org.rhq.enterprise.gui.coregui.client.ViewPath; +import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel; +import org.rhq.enterprise.gui.coregui.client.components.table.Table; +import org.rhq.enterprise.gui.coregui.client.components.tagging.TagEditorView; +import org.rhq.enterprise.gui.coregui.client.components.tagging.TagsChangedCallback; +import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.util.message.Message; + +/** + * @author Greg Hinkle + */ +public class BundleDeploymentView extends VLayout implements BookmarkableView { + private BundleGWTServiceAsync bundleService; + + private BundleDeployment deployment; + private BundleVersion version; + private Bundle bundle; + + private Canvas detail; + + private void viewBundleDeployment(BundleDeployment bundleDeployment, ViewId current) { + + this.deployment = bundleDeployment; + this.version = bundleDeployment.getBundleVersion(); + this.bundle = bundleDeployment.getBundleVersion().getBundle(); + + + + addMember(new HeaderLabel("<img src="" + Canvas.getImgURL("subsystems/bundle/BundleDeployment_24.png") + ""/> " + deployment.getName())); + + + + DynamicForm form = new DynamicForm(); + form.setNumCols(4); + + LinkItem bundleName = new LinkItem("bundle"); + bundleName.setTarget("#Bundles/Bundle/" + bundle.getId()); + bundleName.setValue(bundle.getName()); + + + + CanvasItem tagItem = new CanvasItem("tag"); + tagItem.setShowTitle(false); + TagEditorView tagEditor = new TagEditorView(version.getTags(), false, new TagsChangedCallback() { + public void tagsChanged(HashSet<Tag> tags) { + GWTServiceLookup.getTagService().updateBundleDeploymentTags(deployment.getId(), tags, new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to update bundle deployment's tags", caught); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify(new Message("Bundle Deployment Tags updated", Message.Severity.Info)); + } + }); + } + }); + tagItem.setCanvas(tagEditor); + tagItem.setRowSpan(4); + + + StaticTextItem deployed = new StaticTextItem("deployed","Deployed"); + deployed.setValue(new Date(deployment.getCtime())); + + + LinkItem destinationGroup = new LinkItem("group"); + destinationGroup.setTarget("#ResourceGroup/" + deployment.getGroupDeployments().get(0).getGroup().getId()); + destinationGroup.setValue("Group"); + + + StaticTextItem path = new StaticTextItem("path","Path"); + path.setValue(deployment.getInstallDir()); + + + form.setFields(bundleName, tagItem, deployed, destinationGroup, path); + + addMember(form); + + + Table deployments = createDeploymentsTable(); + deployments.setHeight100(); + deployments.setShowResizeBar(true); + addMember(createDeploymentsTable()); + + detail = new Canvas(); + detail.setHeight("50%"); + detail.hide(); + addMember(detail); + + } + + private Table createDeploymentsTable() { + Table table = new Table("Deployment Machines"); + + ListGridField resource = new ListGridField("resource", "Resource"); + ListGridField status = new ListGridField("status", "Status"); + + table.getListGrid().setFields(resource, status); + + ArrayList<ListGridRecord> records = new ArrayList<ListGridRecord>(); + for (BundleResourceDeployment rd : deployment.getResourceDeployments()) { + ListGridRecord record = new ListGridRecord(); + record.setAttribute("resource", rd.getResource().getName()); + record.setAttribute("status",rd.getStatus().name()); + record.setAttribute("id",rd.getId()); + record.setAttribute("entity",rd); + records.add(record); + } + + table.getListGrid().setData(records.toArray(new ListGridRecord[records.size()])); + + + table.getListGrid().addSelectionChangedHandler(new SelectionChangedHandler() { + public void onSelectionChanged(SelectionEvent selectionEvent) { + if (selectionEvent.getState()) { + + + BundleResourceDeployment bundleResourceDeployment = + (BundleResourceDeployment) selectionEvent.getRecord().getAttributeAsObject("entity"); + BundleResourceDeploymentHistoryListView detailView = + new BundleResourceDeploymentHistoryListView(bundleResourceDeployment); + + detail.addChild(detailView); + detail.animateShow(AnimationEffect.SLIDE); + + +/* + BundleResourceDeploymentCriteria criteria = new BundleResourceDeploymentCriteria(); + criteria.addFilterId(selectionEvent.getRecord().getAttributeAsInt("id")); + criteria.fetchHistories(true); + criteria.fetchResource(true); + criteria.fetchBundleDeployment(true); + bundleService.findBundleResourceDeploymentsByCriteria(criteria, new AsyncCallback<PageList<BundleResourceDeployment>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load resource deployment history details",caught); + } + + public void onSuccess(PageList<BundleResourceDeployment> result) { + + } + }); +*/ + + + } else { + detail.animateHide(AnimationEffect.SLIDE); + } + } + }); + + return table; + } + + + + public void renderView(final ViewPath viewPath) { + int bundleDeploymentId = Integer.parseInt(viewPath.getCurrent().getPath()); + + + BundleDeploymentCriteria criteria = new BundleDeploymentCriteria(); + criteria.addFilterId(bundleDeploymentId); + criteria.fetchBundleVersion(true); + criteria.fetchConfiguration(true); + criteria.fetchResourceDeployments(true); + criteria.fetchGroupDeployments(true); + criteria.fetchTags(true); + + bundleService = GWTServiceLookup.getBundleService(); + bundleService.findBundleDeploymentsByCriteria(criteria, + new AsyncCallback<PageList<BundleDeployment>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load budle version", caught); + } + + public void onSuccess(PageList<BundleDeployment> result) { + + final BundleDeployment deployment = result.get(0); + + BundleCriteria bundleCriteria = new BundleCriteria(); + bundleCriteria.addFilterId(deployment.getBundleVersion().getBundle().getId()); + bundleService.findBundlesByCriteria(bundleCriteria, new AsyncCallback<PageList<Bundle>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to find bundle",caught); + } + + public void onSuccess(PageList<Bundle> result) { + + deployment.getBundleVersion().setBundle(result.get(0)); + + + BundleResourceDeploymentCriteria criteria = new BundleResourceDeploymentCriteria(); + criteria.addFilterBundleDeploymentId(deployment.getId()); + criteria.fetchHistories(true); + criteria.fetchResource(true); + criteria.fetchBundleDeployment(true); + bundleService.findBundleResourceDeploymentsByCriteria(criteria, new AsyncCallback<PageList<BundleResourceDeployment>>() { + + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load deployment detail",caught); + } + + public void onSuccess(PageList<BundleResourceDeployment> result) { + + deployment.setResourceDeployments(result); + + viewBundleDeployment(deployment, viewPath.getCurrent()); + + } + }); + + } + }); + + } + }); + + + } + + +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java new file mode 100644 index 0000000..1bc11ea --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java @@ -0,0 +1,95 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.bundle.deployment; + +import java.util.ArrayList; + +import com.smartgwt.client.widgets.grid.ListGrid; +import com.smartgwt.client.widgets.grid.ListGridField; +import com.smartgwt.client.widgets.grid.ListGridRecord; +import com.smartgwt.client.widgets.layout.VLayout; + +import org.rhq.core.domain.bundle.BundleResourceDeployment; +import org.rhq.core.domain.bundle.BundleResourceDeploymentHistory; + +/** + * @author Greg Hinkle + */ +public class BundleResourceDeploymentHistoryListView extends VLayout { + + + private BundleResourceDeployment resourceDeployment; + + public BundleResourceDeploymentHistoryListView(BundleResourceDeployment resourceDeployment) { + setWidth100(); + setHeight100(); + this.resourceDeployment = resourceDeployment; + + } + + @Override + protected void onInit() { + super.onInit(); + + + ListGrid grid = new ListGrid(); + grid.setWidth100(); + grid.setHeight100(); + + ListGridField action = new ListGridField("action", "Action"); + ListGridField message = new ListGridField("message", "Message"); + ListGridField status = new ListGridField("status", "status"); + + + grid.setFields(action, message, status); + + grid.setData(buildRecords()); + + addMember(grid); + + + } + + + + public ListGridRecord[] buildRecords() { + ArrayList<ListGridRecord> records = new ArrayList<ListGridRecord>(); + + for (BundleResourceDeploymentHistory step : resourceDeployment.getBundleResourceDeploymentHistories()) { + + ListGridRecord record = new ListGridRecord(); + record.setAttribute("id", step.getId()); + + record.setAttribute("action", step.getAuditAction()); + + record.setAttribute("message",step.getAuditMessage()); + + record.setAttribute("status", step.getAuditStatus().name()); + + records.add(record); + } + + return records.toArray(new ListGridRecord[records.size()]); + + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/resource/BundleResourceDeploymentDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/resource/BundleResourceDeploymentDataSource.java new file mode 100644 index 0000000..a2fa68e --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/resource/BundleResourceDeploymentDataSource.java @@ -0,0 +1,109 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.bundle.deployment.resource; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.data.DSRequest; +import com.smartgwt.client.data.DSResponse; +import com.smartgwt.client.data.fields.DataSourceIntegerField; +import com.smartgwt.client.data.fields.DataSourceTextField; +import com.smartgwt.client.widgets.grid.ListGridRecord; + +import org.rhq.core.domain.bundle.BundleResourceDeployment; +import org.rhq.core.domain.criteria.BundleDeploymentCriteria; +import org.rhq.core.domain.criteria.BundleResourceDeploymentCriteria; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; + +/** + * @author Greg Hinkle + */ +public class BundleResourceDeploymentDataSource extends RPCDataSource<BundleResourceDeployment> { + private BundleGWTServiceAsync bundleService = GWTServiceLookup.getBundleService(); + + + public BundleResourceDeploymentDataSource() { + + DataSourceIntegerField id = new DataSourceIntegerField("id","ID"); + id.setPrimaryKey(true); + addField(id); + + DataSourceTextField resourceName = new DataSourceTextField("resourceName", "Resource"); + addField(resourceName); + + DataSourceTextField status = new DataSourceTextField("status", "Status"); + addField(status); + + } + + @Override + protected void executeFetch(final DSRequest request, final DSResponse response) { + + BundleResourceDeploymentCriteria criteria = new BundleResourceDeploymentCriteria(); + criteria.fetchResource(true); + criteria.fetchBundleDeployment(true); + criteria.fetchHistories(true); + + if (request.getCriteria().getValues().containsKey("bundleDeploymentId")) { + criteria.addFilterBundleDeploymentId(Integer.parseInt(request.getCriteria().getAttribute("bundleDeploymentId"))); + } + + bundleService.findBundleResourceDeploymentsByCriteria(criteria, new AsyncCallback<PageList<BundleResourceDeployment>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load bundle resource deployments",caught); + } + + public void onSuccess(PageList<BundleResourceDeployment> result) { + response.setData(buildRecords(result)); + processResponse(request.getRequestId(), response); + } + }); + + + } + + @Override + public BundleResourceDeployment copyValues(ListGridRecord from) { + return null; // TODO: Implement this method. + } + + @Override + public ListGridRecord copyValues(BundleResourceDeployment from) { + ListGridRecord record = new ListGridRecord(); + record.setAttribute("id", from.getId()); + + record.setAttribute("resourceName", from.getResource().getName()); + record.setAttribute("resourceId", from.getResource().getId()); + record.setAttribute("status",from.getStatus().name()); + + record.setAttribute("histories",from.getBundleResourceDeploymentHistories()); + + + from.getBundleResourceDeploymentHistories(); + + return record; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java index 2acf73c..8925eca 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java @@ -43,6 +43,7 @@ import org.rhq.enterprise.gui.coregui.client.Breadcrumb; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewId; import org.rhq.enterprise.gui.coregui.client.ViewPath; +import org.rhq.enterprise.gui.coregui.client.bundle.deployment.BundleDeploymentView; import org.rhq.enterprise.gui.coregui.client.bundle.version.BundleVersionView; import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel; import org.rhq.enterprise.gui.coregui.client.components.table.Table; @@ -246,6 +247,17 @@ public class BundleView extends VLayout implements BookmarkableView { addMember(view); view.renderView(viewPath.next()); } + } else if (viewPath.getCurrent().getPath().equals("deployments")) { + if (viewPath.isEnd()) { + + // versions list screen + } else { + // one version + removeMembers(getMembers()); + BundleDeploymentView view = new BundleDeploymentView(); + addMember(view); + view.renderView(viewPath.next()); + } } } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeDataSource.java index e20dc58..efc969b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeDataSource.java @@ -38,6 +38,7 @@ import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.criteria.BundleCriteria; +import org.rhq.core.domain.criteria.BundleDeploymentCriteria; import org.rhq.core.domain.criteria.BundleVersionCriteria; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.CoreGUI; @@ -113,7 +114,25 @@ public class BundleTreeDataSource extends RPCDataSource { processResponse(request.getRequestId(), response); } }); + } else if (p.endsWith(":deployments")) { + int bundleId = Integer.parseInt(p.substring(0, p.indexOf(":"))); + BundleDeploymentCriteria criteria = new BundleDeploymentCriteria(); + criteria.fetchBundleVersion(true); + criteria.addFilterBundleId(bundleId); + bundleService.findBundleDeploymentsByCriteria(criteria, new AsyncCallback<PageList<BundleDeployment>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed ot load bundle",caught); + } + + public void onSuccess(PageList<BundleDeployment> result) { + response.setData(buildRecords(result)); + processResponse(request.getRequestId(), response); + } + }); + + } + }
@@ -169,7 +188,7 @@ public class BundleTreeDataSource extends RPCDataSource {
} else if (from instanceof BundleVersion) { BundleVersion version = (BundleVersion) from; - node.setName(version.getName() + " (" + version.getVersion() + ")"); + node.setName(version.getVersion()); node.setID(version.getBundle().getId() + ":versions:" + version.getId()); node.setParentID(version.getBundle().getId() + ":versions"); node.setIsFolder(false); @@ -178,7 +197,7 @@ public class BundleTreeDataSource extends RPCDataSource { } else if (from instanceof BundleDeployment) { BundleDeployment deployment = (BundleDeployment) from; node.setName(deployment.getName() + " (" + deployment.getBundleVersion().getVersion() + ")"); - node.setParentID(deployment.getBundleVersion().getBundle().getId() + ":deployments:" + deployment.getId()); + node.setID(deployment.getBundleVersion().getBundle().getId() + ":deployments:" + deployment.getId()); node.setParentID(deployment.getBundleVersion().getBundle().getId() + ":deployments"); node.setIsFolder(false); node.setIcon("subsystems/bundle/BundleDeployment_16.png"); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java index 751a875..ddc43c3 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java @@ -31,6 +31,8 @@ import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.CanvasItem; import com.smartgwt.client.widgets.form.fields.StaticTextItem; import com.smartgwt.client.widgets.form.fields.TextAreaItem; +import com.smartgwt.client.widgets.grid.ListGrid; +import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.tab.Tab; import com.smartgwt.client.widgets.tab.TabSet; @@ -43,6 +45,7 @@ import org.rhq.enterprise.gui.coregui.client.BookmarkableView; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewId; import org.rhq.enterprise.gui.coregui.client.ViewPath; +import org.rhq.enterprise.gui.coregui.client.bundle.deployment.BundleDeploymentListView; import org.rhq.enterprise.gui.coregui.client.bundle.version.file.FileListView; import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel; import org.rhq.enterprise.gui.coregui.client.components.tagging.TagEditorView; @@ -98,6 +101,7 @@ public class BundleVersionView extends VLayout implements BookmarkableView {
DynamicForm form = new DynamicForm(); form.setWidth100(); + form.setHeight100(); form.setNumCols(4);
StaticTextItem versionItem = new StaticTextItem("version","Version"); @@ -134,9 +138,11 @@ public class BundleVersionView extends VLayout implements BookmarkableView {
TextAreaItem recipeItem = new TextAreaItem("recipe","Recipe"); + recipeItem.setDisabled(true); recipeItem.setTitleOrientation(TitleOrientation.TOP); recipeItem.setColSpan(4); - recipeItem.setWidth("100%"); + recipeItem.setWidth("*"); + recipeItem.setHeight("*"); recipeItem.setValue(version.getRecipe());
@@ -148,7 +154,11 @@ public class BundleVersionView extends VLayout implements BookmarkableView { }
private Tab createLiveDeploymentsTab() { - Tab tab = new Tab("Live Deployments"); + Tab tab = new Tab("Deployments"); + + BundleDeploymentListView table = new BundleDeploymentListView(version); + + tab.setPane(table);
return tab; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java index 4126e94..dcfa08b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java @@ -23,14 +23,18 @@ import java.util.HashMap;
import com.google.gwt.user.client.rpc.RemoteService;
+import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; import org.rhq.core.domain.bundle.BundleGroupDeployment; +import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleType; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.bundle.composite.BundleWithLatestVersionComposite; import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.criteria.BundleCriteria; +import org.rhq.core.domain.criteria.BundleDeploymentCriteria; +import org.rhq.core.domain.criteria.BundleResourceDeploymentCriteria; import org.rhq.core.domain.criteria.BundleVersionCriteria; import org.rhq.core.domain.util.PageList;
@@ -62,8 +66,14 @@ public interface BundleGWTService extends RemoteService { ArrayList<BundleType> getAllBundleTypes() throws Exception;
/* - BundleResourceDeployment scheduleBundleResourceDeployment(int bundleDeploymentId, int resourceId) throws Exception; - */ + BundleResourceDeployment scheduleBundleResourceDeployment(int bundleDeploymentId, int resourceId) + throws Exception; + */
BundleGroupDeployment scheduleBundleGroupDeployment(int bundleDeploymentId, int resourceGroupId) throws Exception; + + PageList<BundleDeployment> findBundleDeploymentsByCriteria(BundleDeploymentCriteria criteria); + + PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria(BundleResourceDeploymentCriteria criteria); + } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java index 39e6f69..2072a56 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java @@ -24,11 +24,14 @@ import java.util.HashMap; import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; import org.rhq.core.domain.bundle.BundleGroupDeployment; +import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleType; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.bundle.composite.BundleWithLatestVersionComposite; import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.criteria.BundleCriteria; +import org.rhq.core.domain.criteria.BundleDeploymentCriteria; +import org.rhq.core.domain.criteria.BundleResourceDeploymentCriteria; import org.rhq.core.domain.criteria.BundleVersionCriteria; import org.rhq.core.domain.util.PageList; import org.rhq.core.util.exception.ThrowableUtil; @@ -174,4 +177,15 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund throw new RuntimeException(ThrowableUtil.getAllMessages(e)); } } + + public PageList<BundleDeployment> findBundleDeploymentsByCriteria(BundleDeploymentCriteria criteria) { + return SerialUtility.prepare(bundleManager.findBundleDeploymentsByCriteria(getSessionSubject(), criteria), + "BundleService.findBundleDeploymentsByCriteria"); + } + + public PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria(BundleResourceDeploymentCriteria criteria) { + return SerialUtility.prepare(bundleManager.findBundleResourceDeploymentsByCriteria(getSessionSubject(), criteria), + "BundleService.findBundleResourceDeploymentsByCriteria"); + + } } \ No newline at end of file
commit c12c7ff5c275991e03cc6c4ae79e7a60e9c4195e Author: Greg Hinkle ghinkle@redhat.com Date: Mon May 10 09:43:14 2010 -0400
resource links in the recently added portlet
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedView.java index 76f6d37..c3a825a 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedView.java @@ -26,7 +26,9 @@ package org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.imported import com.google.gwt.core.client.GWT; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.HTMLFlow; +import com.smartgwt.client.widgets.grid.CellFormatter; import com.smartgwt.client.widgets.grid.ListGridField; +import com.smartgwt.client.widgets.grid.ListGridRecord; import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.tree.TreeGrid;
@@ -52,6 +54,13 @@ public class RecentlyAddedView extends VLayout implements PortletView { treeGrid.setTreeFieldTitle("Resource Name");
ListGridField resourceNameField = new ListGridField("name", "Resource Name"); + + resourceNameField.setCellFormatter(new CellFormatter() { + public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { + return "<a href="#Resource/" + listGridRecord.getAttribute("id") + "">" + String.valueOf(o) + "</a>"; + } + }); + ListGridField timestampField = new ListGridField("timestamp", "Date//Time");
treeGrid.setFields(resourceNameField, timestampField);
commit a63231f197a1dd20b4105cd89846640ca2579b8d Author: Greg Hinkle ghinkle@redhat.com Date: Mon May 10 09:41:01 2010 -0400
Don't blow up favorites button if there are no favorites
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/footer/FavoritesButton.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/footer/FavoritesButton.java index 6ae4186..636c45e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/footer/FavoritesButton.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/footer/FavoritesButton.java @@ -59,48 +59,51 @@ public class FavoritesButton extends IMenuButton {
Set<Integer> favorites = CoreGUI.getUserPreferences().getFavoriteResources();
- Integer[] resourceIds = new Integer[favorites.size()]; - final MenuItem[] items = new MenuItem[favorites.size()]; - final Map<Integer, MenuItem> idToMenuItemMap = new HashMap<Integer, MenuItem>(favorites.size()); - int i = 0; - for (final Integer resourceId : favorites) { - resourceIds[i] = resourceId; - MenuItem item = new MenuItem(String.valueOf(resourceId)); - item.addClickHandler(new com.smartgwt.client.widgets.menu.events.ClickHandler() { - public void onClick(MenuItemClickEvent event) { - History.newItem("Resource/" + resourceId); - } - }); - items[i] = item; - idToMenuItemMap.put(resourceId, item); - i++; - } + if (!favorites.isEmpty()) {
- ResourceCriteria criteria = new ResourceCriteria(); - criteria.addFilterIds(resourceIds); - GWTServiceLookup.getResourceService().findResourcesByCriteria(criteria, - new AsyncCallback<PageList<Resource>>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load favorite Resources.", caught); - } + Integer[] resourceIds = new Integer[favorites.size()]; + final MenuItem[] items = new MenuItem[favorites.size()]; + final Map<Integer, MenuItem> idToMenuItemMap = new HashMap<Integer, MenuItem>(favorites.size()); + int i = 0; + for (final Integer resourceId : favorites) { + resourceIds[i] = resourceId; + MenuItem item = new MenuItem(String.valueOf(resourceId)); + item.addClickHandler(new com.smartgwt.client.widgets.menu.events.ClickHandler() { + public void onClick(MenuItemClickEvent event) { + History.newItem("Resource/" + resourceId); + } + }); + items[i] = item; + idToMenuItemMap.put(resourceId, item); + i++; + }
- public void onSuccess(PageList<Resource> resources) { - for (Resource resource : resources) { - MenuItem item = idToMenuItemMap.get(resource.getId()); - // TODO: Ideally, we should use ResourceManagerLocal.disambiguate() here to obtain - // disambiguated Resource names. - item.setTitle(resource.getName()); + ResourceCriteria criteria = new ResourceCriteria(); + criteria.addFilterIds(resourceIds); + GWTServiceLookup.getResourceService().findResourcesByCriteria(criteria, + new AsyncCallback<PageList<Resource>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load favorite Resources.", caught); + }
- String category = resource.getResourceType().getCategory().getDisplayName(); + public void onSuccess(PageList<Resource> resources) { + for (Resource resource : resources) { + MenuItem item = idToMenuItemMap.get(resource.getId()); + // TODO: Ideally, we should use ResourceManagerLocal.disambiguate() here to obtain + // disambiguated Resource names. + item.setTitle(resource.getName());
- String avail = (resource.getCurrentAvailability() != null && resource.getCurrentAvailability().getAvailabilityType() != null) - ? (resource.getCurrentAvailability().getAvailabilityType().name().toLowerCase()) : "down"; - item.setIcon("types/" + category + "_" + avail + "_16.png"); - } - favoritesMenu.setItems(items); - favoritesMenu.showContextMenu(); - } - }); + String category = resource.getResourceType().getCategory().getDisplayName(); + + String avail = (resource.getCurrentAvailability() != null && resource.getCurrentAvailability().getAvailabilityType() != null) + ? (resource.getCurrentAvailability().getAvailabilityType().name().toLowerCase()) : "down"; + item.setIcon("types/" + category + "_" + avail + "_16.png"); + } + favoritesMenu.setItems(items); + favoritesMenu.showContextMenu(); + } + }); + } } }); }
commit 75bc29ae7a4648ecb5dd12542fa9289984711ab6 Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 6 19:46:02 2010 -0400
Fix NPEs in RGWCI
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java index 20b4c51..28830da 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java @@ -83,7 +83,9 @@ public class RadioGroupWithComponentsItem extends CanvasItem { Canvas value = valueMap.get(label); CanvasItem ci = new CanvasItem(); ci.setShowTitle(false); - ci.setCanvas(value); + if (value != null) { + ci.setCanvas(value); + } ci.setDisabled(true); items.add(ci);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java index a4f0b51..002c8f9 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java @@ -66,9 +66,9 @@ public class GroupCreateStep implements WizardStep {
CheckboxItem recursive = new CheckboxItem("recursive","Recursive");
- LinkedHashMap<String, Object> options = new LinkedHashMap<String, Object>(); + LinkedHashMap<String, Canvas> options = new LinkedHashMap<String, Canvas>();
- options.put("Mixed Resources", null); + options.put("Mixed", null);
IPickTreeItem typeSelectItem = new IPickTreeItem("type", "Type"); typeSelectItem.setDataSource(new ResourceTypePluginTreeDataSource()); @@ -81,10 +81,10 @@ public class GroupCreateStep implements WizardStep { DynamicForm form2 = new DynamicForm(); form2.setValuesManager(form.getValuesManager()); form2.setFields(typeSelectItem); - options.put("Compatible Resources", form2); + options.put("Compatible", form2);
- RadioGroupWithComponentsItem kind = new RadioGroupWithComponentsItem("kind", "Contains", options, form); + RadioGroupWithComponentsItem kind = new RadioGroupWithComponentsItem("kind", "Group Type", options, form); kind.setValue("Mixed Resources");
form.setFields(name, location, description, recursive, kind);
commit e7493e4028da5d6579d7da769105bf99b217a714 Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 6 19:45:31 2010 -0400
Fix group category filter
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java index 40d61a4..debe24d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java @@ -102,7 +102,7 @@ public class ResourceGroupsDataSource extends RPCDataSource<ResourceGroup> {
if (request.getCriteria().getValues().get("category") != null) { criteria.addFilterGroupCategory(GroupCategory.valueOf(((String) request.getCriteria().getValues().get( - "groupCategory")).toUpperCase())); + "category")).toUpperCase())); }
if (request.getCriteria().getValues().get("downMemberCount") != null) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java index c895e3e..f14514f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java @@ -26,8 +26,8 @@ import com.smartgwt.client.widgets.form.fields.SelectItem; import com.smartgwt.client.widgets.form.fields.TextItem; import com.smartgwt.client.widgets.grid.ListGridRecord;
-import org.rhq.core.domain.resource.group.GroupCategory; import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupsDataSource; import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
@@ -45,8 +45,8 @@ public class ResourceGroupSelector extends AbstractSelector<ResourceGroup> { availableFilterForm.setNumCols(4); final TextItem search = new TextItem("search", "Search");
- SelectItem groupCategorySelect = new SelectItem("category", "Category"); - groupCategorySelect.setValueMap(GroupCategory.COMPATIBLE.toString(), GroupCategory.MIXED.toString()); + SelectItem groupCategorySelect = new SelectItem("groupCategory", "Group Category"); + groupCategorySelect.setValueMap("Compatible", "Mixed"); groupCategorySelect.setAllowEmptyValue(true); availableFilterForm.setItems(search, groupCategorySelect);
@@ -60,7 +60,7 @@ public class ResourceGroupSelector extends AbstractSelector<ResourceGroup> { protected Criteria getLatestCriteria(DynamicForm availableFilterForm) { Criteria latestCriteria = new Criteria(); Object search = availableFilterForm.getValue("search"); - Object category = availableFilterForm.getValue("category"); + Object category = availableFilterForm.getValue("groupCategory"); latestCriteria.setAttribute("name", search); latestCriteria.setAttribute("category", category);
commit cf4c81b10079a16d6ca6e4037cf9c70dc7ad2050 Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 6 15:08:59 2010 -0400
Selector enhancments Group create wizard with resource selector tweaks
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java index 1915ec6..c6f5800 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java @@ -41,4 +41,8 @@ public interface ResourceGroupGWTService extends RemoteService { PageList<GroupDefinition> findGroupDefinitionsByCriteria(ResourceGroupDefinitionCriteria criteria);
void ensureMembershipMatches(int groupId, int[] resourceIds); + + ResourceGroup createResourceGroup(ResourceGroup group, int[] resourceIds); + + void deleteResourceGroup(int groupId); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java index a3da094..d66a328 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java @@ -30,6 +30,8 @@ import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.enterprise.gui.coregui.client.components.table.Table; import org.rhq.enterprise.gui.coregui.client.components.table.TableAction; +import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardView; +import org.rhq.enterprise.gui.coregui.client.inventory.groups.wizard.GroupCreateWizard;
/** * @author Greg Hinkle @@ -88,6 +90,14 @@ public class ResourceGroupListView extends VLayout { } });
+ table.addTableAction("New Group", new TableAction() { + public void executeAction(ListGridRecord[] selection) { + WizardView view = new WizardView(new GroupCreateWizard()); + view.displayDialog(); + } + }); + + addMember(table);
} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java new file mode 100644 index 0000000..a4f0b51 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java @@ -0,0 +1,117 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.inventory.groups.wizard; + +import java.util.LinkedHashMap; + +import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.ValuesManager; +import com.smartgwt.client.widgets.form.fields.AutoFitTextAreaItem; +import com.smartgwt.client.widgets.form.fields.BooleanItem; +import com.smartgwt.client.widgets.form.fields.CheckboxItem; +import com.smartgwt.client.widgets.form.fields.IPickTreeItem; +import com.smartgwt.client.widgets.form.fields.TextAreaItem; +import com.smartgwt.client.widgets.form.fields.TextItem; + +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.enterprise.gui.coregui.client.components.form.RadioGroupWithComponentsItem; +import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypePluginTreeDataSource; + +/** + * @author Greg Hinkle + */ +public class GroupCreateStep implements WizardStep { + + + private DynamicForm form; + + public Canvas getCanvas() { + + + if (form == null) { + + form = new DynamicForm(); + form.setValuesManager(new ValuesManager()); + form.setNumCols(4); + + TextItem name = new TextItem("name", "Name"); + name.setRequired(true); + + TextItem location = new TextItem("location", "Location"); + + TextAreaItem description = new AutoFitTextAreaItem("description", "Description"); + + CheckboxItem recursive = new CheckboxItem("recursive","Recursive"); + + LinkedHashMap<String, Object> options = new LinkedHashMap<String, Object>(); + + options.put("Mixed Resources", null); + + IPickTreeItem typeSelectItem = new IPickTreeItem("type", "Type"); + typeSelectItem.setDataSource(new ResourceTypePluginTreeDataSource()); + typeSelectItem.setValueField("id"); + typeSelectItem.setCanSelectParentItems(true); + typeSelectItem.setLoadDataOnDemand(false); + typeSelectItem.setEmptyMenuMessage("Loading..."); + typeSelectItem.setShowIcons(true); + + DynamicForm form2 = new DynamicForm(); + form2.setValuesManager(form.getValuesManager()); + form2.setFields(typeSelectItem); + options.put("Compatible Resources", form2); + + + RadioGroupWithComponentsItem kind = new RadioGroupWithComponentsItem("kind", "Contains", options, form); + kind.setValue("Mixed Resources"); + + form.setFields(name, location, description, recursive, kind); + + } + return form; + } + + public boolean nextPage() { + return form.validate(); + } + + public String getName() { + return "Group Settings"; + } + + public ResourceGroup getGroup() { + ResourceGroup group = new ResourceGroup(form.getValueAsString("name")); + group.setDescription(form.getValueAsString("description")); + group.setLocation(form.getValueAsString("location")); + group.setRecursive(form.getValue("recursive") != null ? true : false); + + if (form.getValue("type") != null) { + ResourceType type = new ResourceType(); + type.setId(Integer.parseInt(form.getValueAsString("type"))); + group.setResourceType(type); + } + return group; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java new file mode 100644 index 0000000..27ad608 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java @@ -0,0 +1,100 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.inventory.groups.wizard; + +import java.util.ArrayList; +import java.util.List; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.widgets.IButton; + +import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.components.wizard.Wizard; +import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +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; +import org.rhq.enterprise.gui.coregui.client.util.message.Message; + +/** + * @author Greg Hinkle + */ +public class GroupCreateWizard implements Wizard { + + private ArrayList<WizardStep> steps; + + private GroupCreateStep createStep; + private GroupMembersStep memberStep; + + public GroupCreateWizard() { + steps = new ArrayList<WizardStep>(); + + steps.add(createStep = new GroupCreateStep()); + steps.add(memberStep = new GroupMembersStep(this)); + } + + public String getWindowTitle() { + return "Create Group"; + } + + public String getTitle() { + return "Create Group"; + } + + public String getSubtitle() { + return null; // TODO: Implement this method. + } + + public List<WizardStep> getSteps() { + return steps; + } + + public List<IButton> getCustomButtons(int step) { + return null; // TODO: Implement this method. + } + + public void cancel() { + // TODO: Implement this method. + } + + public boolean createGroup() { + + ResourceGroupGWTServiceAsync groupService = GWTServiceLookup.getResourceGroupService(); + + groupService.createResourceGroup(createStep.getGroup(), memberStep.getSelectedResourceIds(), + new AsyncCallback<ResourceGroup>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to create resource group",caught); + } + + public void onSuccess(ResourceGroup result) { + CoreGUI.getMessageCenter().notify(new Message("Saved new group " + result.getName(), Message.Severity.Info)); + // TODO: Implement this method. + } + }); + + + return true; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java new file mode 100644 index 0000000..0f5f92c --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java @@ -0,0 +1,69 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.inventory.groups.wizard; + +import java.util.HashSet; + +import com.smartgwt.client.widgets.Canvas; + +import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceSelector; + +/** + * @author Greg Hinkle + */ +public class GroupMembersStep implements WizardStep { + + + private GroupCreateWizard wizard; + private ResourceSelector selector; + + public GroupMembersStep(GroupCreateWizard wizard) { + this.wizard = wizard; + } + + public Canvas getCanvas() { + if (selector == null) { + selector = new ResourceSelector(); + } + return selector; + } + + public boolean nextPage() { + return wizard.createGroup(); + } + + public String getName() { + return "Select Members"; + } + + public int[] getSelectedResourceIds() { + int[] selection = new int[selector.getSelection().size()]; + HashSet<Integer> selectedIds = selector.getSelection(); + int i = 0; + for (Integer id : selectedIds) { + selection[i++] = id; + } + return selection; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java index 214791b..1398aac 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java @@ -117,6 +117,12 @@ public class ResourceDatasource extends RPCDataSource<Resource> { criteria.addFilterResourceTypeId(Integer.parseInt(((String)request.getCriteria().getValues().get("type")))); }
+ if (request.getCriteria().getValues().get("plugin") != null) { + criteria.addFilterPluginName((String)request.getCriteria().getValues().get("plugin")); + } + + + resourceService.findResourcesByCriteria(criteria, new AsyncCallback<PageList<Resource>>() { public void onFailure(Throwable caught) { CoreGUI.getErrorHandler().handleError("Failed to fetch resource data", caught); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java index b1fbcb2..2f2bed2 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java @@ -53,7 +53,7 @@ import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; /** * @author Greg Hinkle */ -public abstract class AbstractSelector<T> extends HLayout { +public abstract class AbstractSelector<T> extends VLayout {
protected HashSet<Integer> selection = new HashSet<Integer>();
@@ -70,14 +70,13 @@ public abstract class AbstractSelector<T> extends HLayout { protected Criteria latestCriteria;
public AbstractSelector() { - setAlign(VerticalAlignment.BOTTOM); - setHeight(380); }
public void setAssigned(ListGridRecord[] assignedRecords) { initialSelection = assignedRecords; }
+ public HashSet<Integer> getSelection() { return selection; } @@ -92,13 +91,17 @@ public abstract class AbstractSelector<T> extends HLayout { protected void onDraw() { super.onDraw();
+ final DynamicForm availableFilterForm = getAvailableFilterForm();
- VLayout availableLayout = new VLayout(); - availableLayout.addMember(new LayoutSpacer()); + addMember(availableFilterForm); +
- availableLayout.addMember(availableFilterForm); + HLayout hlayout = new HLayout(); + hlayout.setAlign(VerticalAlignment.BOTTOM);
+ + // LEFT SIDE availableGrid = new ListGrid(); availableGrid.setHeight(350); availableGrid.setCanDragRecordsOut(true); @@ -111,9 +114,7 @@ public abstract class AbstractSelector<T> extends HLayout { availableGrid.setAutoFetchData(true); availableGrid.setFields(new ListGridField("icon", 50), new ListGridField("name"));
- availableLayout.addMember(availableGrid); - - addMember(availableLayout); + hlayout.addMember(availableGrid);
availableFilterForm.addItemChangedHandler(new ItemChangedHandler() { public void onItemChanged(ItemChangedEvent itemChangedEvent) { @@ -133,6 +134,8 @@ public abstract class AbstractSelector<T> extends HLayout { } });
+ + // CENTER BUTTONS VStack moveButtonStack = new VStack(6); moveButtonStack.setAlign(VerticalAlignment.CENTER); moveButtonStack.setWidth(40); @@ -150,10 +153,10 @@ public abstract class AbstractSelector<T> extends HLayout { moveButtonStack.addMember(addAllButton); moveButtonStack.addMember(removeAllButton);
- addMember(moveButtonStack); + hlayout.addMember(moveButtonStack); +
- VLayout assignedLayout = new VLayout(); - assignedLayout.addMember(new LayoutSpacer()); + // RIGHT SIDE
assignedGrid = new ListGrid(); assignedGrid.setHeight(350); @@ -165,8 +168,7 @@ public abstract class AbstractSelector<T> extends HLayout { iconField.setType(ListGridFieldType.ICON); assignedGrid.setFields(iconField, new ListGridField("name"));
- assignedLayout.addMember(assignedGrid); - addMember(assignedLayout); + hlayout.addMember(assignedGrid);
addButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { @@ -230,6 +232,10 @@ public abstract class AbstractSelector<T> extends HLayout { assignedGrid.setData(initialSelection); select(initialSelection); } + + addMember(hlayout); + + }
protected void updateButtons() { 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 2ed234f..9be9f03 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 @@ -30,6 +30,7 @@ import com.smartgwt.client.widgets.grid.ListGridRecord; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDatasource; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypePluginTreeDataSource; import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeTreeDataSource; import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
@@ -38,25 +39,47 @@ import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; */ public class ResourceSelector extends AbstractSelector {
+ + private Integer requireTypeId; + public ResourceSelector() { super(); }
+ public Integer getRequireTypeId() { + return requireTypeId; + } + + public void setRequireTypeId(Integer requireTypeId) { + this.requireTypeId = requireTypeId; + markForRedraw(); + } + + protected DynamicForm getAvailableFilterForm() { DynamicForm availableFilterForm = new DynamicForm(); availableFilterForm.setNumCols(6); final TextItem search = new TextItem("search", "Search");
IPickTreeItem typeSelectItem = new IPickTreeItem("type", "Type"); - typeSelectItem.setDataSource(new ResourceTypeTreeDataSource()); + typeSelectItem.setDataSource(new ResourceTypePluginTreeDataSource()); typeSelectItem.setValueField("id"); typeSelectItem.setCanSelectParentItems(true); typeSelectItem.setLoadDataOnDemand(false); + typeSelectItem.setEmptyMenuMessage("Loading..."); + typeSelectItem.setShowIcons(true); + + if (requireTypeId != null) { + typeSelectItem.setValue(requireTypeId); + typeSelectItem.setDisabled(true); + availableFilterForm.setItems(search, typeSelectItem); + } else { + SelectItem categorySelect = new SelectItem("category", "Category"); + categorySelect.setValueMap("Platform", "Server", "Service"); + categorySelect.setAllowEmptyValue(true);
- SelectItem categorySelect = new SelectItem("category", "Category"); - categorySelect.setValueMap("Platform", "Server", "Service"); - categorySelect.setAllowEmptyValue(true); - availableFilterForm.setItems(search, typeSelectItem, categorySelect); + availableFilterForm.setItems(search, typeSelectItem, categorySelect); + }
return availableFilterForm; } @@ -68,7 +91,14 @@ public class ResourceSelector extends AbstractSelector { protected Criteria getLatestCriteria(DynamicForm availableFilterForm) { Criteria latestCriteria = new Criteria(); latestCriteria.setAttribute("name", availableFilterForm.getValue("search")); - latestCriteria.setAttribute("type", availableFilterForm.getValue("type")); + + // If its a number its a typeId, otherwise a plugin name + try { + Integer.parseInt((String) availableFilterForm.getValue("type")); + latestCriteria.setAttribute("type", availableFilterForm.getValue("type")); + } catch (NumberFormatException nfe) { + latestCriteria.setAttribute("plugin", availableFilterForm.getValue("type")); + } latestCriteria.setAttribute("category", availableFilterForm.getValue("category"));
return latestCriteria; 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 6f80d45..227e783 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 @@ -18,8 +18,12 @@ */ 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 java.util.HashSet; +import java.util.ListIterator;
import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.DSRequest; @@ -118,18 +122,18 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
HashMap<String, PluginTreeNode> pluginNodes = new HashMap<String, PluginTreeNode>();
- HashSet<TreeNode> nodes = new HashSet<TreeNode>(); + ArrayList<TreeNode> nodes = new ArrayList<TreeNode>(); for (ResourceType type : result) { + if (type.getParentResourceTypes() == null || type.getParentResourceTypes().isEmpty()) {
- PluginTreeNode pluginNode = pluginNodes.get(type.getPlugin()); - if (pluginNode == null) { - pluginNode = new PluginTreeNode(type.getPlugin()); - pluginNodes.put(type.getPlugin(), pluginNode); - nodes.add(pluginNode); - } + PluginTreeNode pluginNode = pluginNodes.get(type.getPlugin()); + if (pluginNode == null) { + pluginNode = new PluginTreeNode(type.getPlugin()); + pluginNodes.put(type.getPlugin(), pluginNode); + nodes.add(pluginNode); + }
- if (type.getParentResourceTypes() == null || type.getParentResourceTypes().isEmpty()) { nodes.add(new ResourceTypeTreeNode(type, type.getPlugin())); } else { for (ResourceType parent : type.getParentResourceTypes()) { @@ -138,6 +142,12 @@ 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; } @@ -184,8 +194,10 @@ public class ResourceTypePluginTreeDataSource extends DataSource { this.id = pluginName; setParentID(null);
- setAttribute("name", pluginName); + setAttribute("name", pluginName + " Plugin"); // setAttribute("plugin",pluginName); + setIcon("types/plugin_16.png"); // todo doesn't work + setEnabled(true); }
@Override @@ -228,6 +240,8 @@ public class ResourceTypePluginTreeDataSource extends DataSource { setAttribute("plugin", resourceType.getPlugin()); setAttribute("category", resourceType.getCategory().getDisplayName());
+ setIcon("types/" + resourceType.getCategory().getDisplayName() + "_up_16.png"); + setIsFolder(true); }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java index e154f45..48e9961 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java @@ -25,6 +25,7 @@ import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTService; import org.rhq.enterprise.gui.coregui.server.util.SerialUtility; +import org.rhq.enterprise.server.resource.group.ResourceGroupDeleteException; import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal; import org.rhq.enterprise.server.resource.group.definition.GroupDefinitionManagerLocal; import org.rhq.enterprise.server.util.LookupUtil; @@ -55,4 +56,19 @@ public class ResourceGroupGWTServiceImpl extends AbstractGWTServiceImpl implemen groupManager.ensureMembershipMatches(getSessionSubject(), groupId, resourceIds); }
+ public ResourceGroup createResourceGroup(ResourceGroup group, int[] resourceIds) { + group = groupManager.createResourceGroup(getSessionSubject(), group); + + ensureMembershipMatches(group.getId(), resourceIds); + + return SerialUtility.prepare(group, "ResourceGroupService.createResourceGroup"); + } + + public void deleteResourceGroup(int groupId) { + try { + groupManager.deleteResourceGroup(getSessionSubject(), groupId); + } catch (ResourceGroupDeleteException e) { + throw new RuntimeException(e.getMessage()); + } + } } \ No newline at end of file
commit 73c9432a7456e43fb6fdddc6820e75b6b66e3af4 Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 6 15:07:28 2010 -0400
Bundle tree preopen
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeView.java index effd488..e36289e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeView.java @@ -22,6 +22,8 @@ */ package org.rhq.enterprise.gui.coregui.client.bundle.tree;
+import com.google.gwt.core.client.GWT; +import com.google.gwt.core.client.RunAsyncCallback; import com.google.gwt.user.client.History; import com.smartgwt.client.types.SelectionStyle; import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; @@ -74,13 +76,27 @@ public class BundleTreeView extends TreeGrid { key += ":";
key += view.getPath(); - }
- TreeNode node = getTree().findById(key); - if (node != null) { - deselectAllRecords(); - selectRecord(node); + TreeNode node = getTree().findById(key); + if (node != null) { + getTree().openFolder(node); + } } + + final String finalKey = key; + GWT.runAsync(new RunAsyncCallback() { + public void onFailure(Throwable reason) { + + } + + public void onSuccess() { + TreeNode node = getTree().findById(finalKey); + if (node != null) { + deselectAllRecords(); + selectRecord(node); + } + } + }); } else { deselectAllRecords(); selectRecord(0);
commit c2a1a862b908c3ce92b14eac30014239f2caaa6a Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 6 15:07:11 2010 -0400
Tag editor tweaks, vertical view, loading for bundle versions
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java index cd23e12..2acf73c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java @@ -191,6 +191,8 @@ public class BundleView extends VLayout implements BookmarkableView { }); } }); + tagEditor.setAlwaysEdit(true); + tagEditor.setVertical(true); layout.addMember(tagEditor);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java index 6a9aa6a..751a875 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java @@ -182,6 +182,7 @@ public class BundleVersionView extends VLayout implements BookmarkableView { criteria.fetchBundleFiles(true); criteria.fetchBundleDeployments(true); criteria.fetchConfigurationDefinition(true); + criteria.fetchTags(true);
GWTServiceLookup.getBundleService().findBundleVersionsByCriteria(criteria, new AsyncCallback<PageList<BundleVersion>>() { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java index 6aba3bf..965d402 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java @@ -24,6 +24,7 @@ package org.rhq.enterprise.gui.coregui.client.components.tagging;
import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; @@ -31,6 +32,7 @@ import java.util.Set; import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.HorizontalPanel; +import com.smartgwt.client.data.DSResponse; import com.smartgwt.client.types.TextMatchStyle; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.HTMLFlow; @@ -46,15 +48,20 @@ import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; import com.smartgwt.client.widgets.form.fields.events.KeyPressEvent; import com.smartgwt.client.widgets.form.fields.events.KeyPressHandler; import com.smartgwt.client.widgets.layout.HLayout; +import com.smartgwt.client.widgets.layout.Layout; +import com.smartgwt.client.widgets.layout.VLayout;
+import org.rhq.core.domain.criteria.TagCriteria; import org.rhq.core.domain.tagging.Tag; +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.gwt.GWTServiceLookup;
/** * @author Greg Hinkle */ -public class TagEditorView extends HLayout { +public class TagEditorView extends Layout {
private LinkedHashSet<Tag> tags = new LinkedHashSet<Tag>();
@@ -64,6 +71,9 @@ public class TagEditorView extends HLayout { private boolean readOnly; private TagsChangedCallback callback;
+ private boolean vertical = false; + private boolean alwaysEdit = false; + public TagEditorView(Set<Tag> tags, boolean readOnly, TagsChangedCallback callback) { if (tags != null) { this.tags.addAll(tags); @@ -81,6 +91,15 @@ public class TagEditorView extends HLayout { setup(); }
+ public void setVertical(boolean vertical) { + this.vertical = vertical; + } + + public void setAlwaysEdit(boolean alwaysEdit) { + this.alwaysEdit = alwaysEdit; + this.editing = true; + } + @Override protected void onDraw() { super.onDraw(); @@ -90,56 +109,92 @@ public class TagEditorView extends HLayout {
private void setup() { - for (Canvas child : getChildren()) { + for (Canvas child : getMembers()) { child.destroy(); }
+ Layout layout = vertical ? new VLayout() : new HLayout(); + layout.setMembersMargin(8); + HTMLFlow title = new HTMLFlow("<b>Tags:</b>"); title.setAutoWidth(); - addMember(title); + layout.addMember(title);
for (final Tag tag : tags) { + HLayout tagLayout = new HLayout(); + //tagLayout.set + HTMLFlow tagString = new HTMLFlow(tag.toString()); tagString.setAutoWidth(); - addMember(tagString); + tagLayout.addMember(tagString); if (editing) { Img remove = new Img("[skin]/images/actions/remove.png", 16, 16); remove.setTooltip("Click to remove this tag"); remove.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { tags.remove(tag); - TagEditorView.this.setup(); + save(); +// TagEditorView.this.setup(); } }); - addMember(remove); + tagLayout.addMember(remove); }
- Canvas spacer = new Canvas(); - spacer.setWidth(8); - addMember(spacer); + tagLayout.setHeight(32); + layout.addMember(tagLayout); + +// +// Canvas spacer = new Canvas(); +// spacer.setWidth(8); +// layout.addMember(spacer); }
+ HLayout editLayout = new HLayout(); + editLayout.setHeight(32); + if (editing) { form = new DynamicForm(); - ComboBoxItem tagInput = new ComboBoxItem("tag"); + final ComboBoxItem tagInput = new ComboBoxItem("tag"); tagInput.setShowTitle(false); tagInput.setHideEmptyPickList(true); - tagInput.setOptionDataSource(new TaggingDataSource()); +// tagInput.setOptionDataSource(new TaggingDataSource()); + TagCriteria criteria = new TagCriteria(); + criteria.addSortNamespace(PageOrdering.ASC); + criteria.addSortSemantic(PageOrdering.ASC); + criteria.addSortName(PageOrdering.ASC); + GWTServiceLookup.getTagService().findTagsByCriteria(criteria, + new AsyncCallback<PageList<Tag>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load tags", caught); + } + + public void onSuccess(PageList<Tag> result) { + String[] values = new String[result.size()]; + int i = 0; + for (Tag tag : result) { + values[i++] = tag.toString(); + } + tagInput.setValueMap(values); + } + }); + + tagInput.setValueField("tag"); tagInput.setDisplayField("tag"); tagInput.setType("comboBox"); tagInput.setTextMatchStyle(TextMatchStyle.SUBSTRING); tagInput.setTooltip("Enter a tag in the format "(namespace:)(semantic=)tagname" (e.g. it:env=QA, or owner=John)"); - tagInput.addBlurHandler(new BlurHandler() { + /*tagInput.addBlurHandler(new BlurHandler() { public void onBlur(BlurEvent blurEvent) { String tag = form.getValueAsString("tag"); if (tag != null) { Tag newTag = new Tag(tag); tags.add(newTag); - TagEditorView.this.setup(); + save(); +// TagEditorView.this.setup(); } } - }); + });*/ tagInput.addKeyPressHandler(new KeyPressHandler() { public void onKeyPress(KeyPressEvent event) { if ((event.getCharacterValue() != null) && (event.getCharacterValue() == KeyCodes.KEY_ENTER)) { @@ -147,14 +202,16 @@ public class TagEditorView extends HLayout { if (tag != null) { Tag newTag = new Tag(tag); tags.add(newTag); - TagEditorView.this.setup(); + save(); +// TagEditorView.this.setup(); } } } });
form.setFields(tagInput); - addMember(form); + + editLayout.addMember(form); }
@@ -166,29 +223,22 @@ public class TagEditorView extends HLayout {
if (editing) { save(); - // save the tags - /* GWTServiceLookup.getTagService().addTags(tags, new AsyncCallback<Set<Tag>>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Tag add failed", caught); - HashMap<String, String> errors = new HashMap<String, String>(); - errors.put("tag", "Tag add failed"); - form.setErrors(errors, true); - } - - public void onSuccess(Set<Tag> result) { - editing = !editing; - tags.addAll(result); - TagEditorView.this.setup(); - } - });*/ - } else { - editing = !editing; - TagEditorView.this.setup(); } + editing = !editing; + TagEditorView.this.setup(); + } }); - addMember(modeImg); + editLayout.addMember(modeImg); } + + + layout.addMember(editLayout); + + + layout.setAutoWidth(); + addMember(layout); + markForRedraw(); }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TaggingDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TaggingDataSource.java index fe6c3c7..1d3f08d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TaggingDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TaggingDataSource.java @@ -42,6 +42,14 @@ public class TaggingDataSource extends RPCDataSource<Tag> { @Override protected void executeFetch(final DSRequest request, final DSResponse response) {
+ TagCriteria criteria = new TagCriteria(); + + String search = (String) request.getCriteria().getValues().get("tag"); + if (search != null) { + // todo +// criteria.addFilter + } + GWTServiceLookup.getTagService().findTagsByCriteria(new TagCriteria(), new AsyncCallback<PageList<Tag>>() { public void onFailure(Throwable caught) {
commit 3981a583975e1694854611a7797ffca9e23302ef Author: Greg Hinkle ghinkle@redhat.com Date: Thu May 6 15:06:18 2010 -0400
Fixed tag unnasignment
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java index 4b34270..e3082dd 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java @@ -113,6 +113,15 @@ public class TagManagerBean implements TagManagerLocal {
Set<Tag> definedTags = addTags(subject, tags); Resource resource = entityManager.find(Resource.class, resourceId); + + Set<Tag> previousTags = new HashSet<Tag>(resource.getTags()); + previousTags.removeAll(definedTags); + for (Tag tag : previousTags) { + tag.removeResource(resource); + } + + + for (Tag tag : definedTags) { tag.addResource(resource); } @@ -125,7 +134,14 @@ public class TagManagerBean implements TagManagerLocal {
Set<Tag> definedTags = addTags(subject, tags); ResourceGroup group = entityManager.find(ResourceGroup.class, resourceGroupId); - group.setTags(definedTags); + + Set<Tag> previousTags = new HashSet<Tag>(group.getTags()); + previousTags.removeAll(definedTags); + for (Tag tag : previousTags) { + tag.removeResourceGroup(group); + } + + for (Tag tag : definedTags) { tag.addResourceGroup(group); } @@ -137,6 +153,14 @@ public class TagManagerBean implements TagManagerLocal {
Set<Tag> definedTags = addTags(subject, tags); Bundle bundle = entityManager.find(Bundle.class, bundleId); + + Set<Tag> previousTags = new HashSet<Tag>(bundle.getTags()); + previousTags.removeAll(definedTags); + for (Tag tag : previousTags) { + tag.removeBundle(bundle); + } + + for (Tag tag : definedTags) { tag.addBundle(bundle); } @@ -148,7 +172,14 @@ public class TagManagerBean implements TagManagerLocal {
Set<Tag> definedTags = addTags(subject, tags); BundleVersion bundleVersion = entityManager.find(BundleVersion.class, bundleVersionId); - bundleVersion.setTags(definedTags); + + Set<Tag> previousTags = new HashSet<Tag>(bundleVersion.getTags()); + previousTags.removeAll(definedTags); + for (Tag tag : previousTags) { + tag.removeBundleVersion(bundleVersion); + } + + for (Tag tag : definedTags) { tag.addBundleVersion(bundleVersion); } @@ -160,7 +191,13 @@ public class TagManagerBean implements TagManagerLocal {
Set<Tag> definedTags = addTags(subject, tags); BundleDeployment bundleDeployment = entityManager.find(BundleDeployment.class, bundleDeploymentId); - bundleDeployment.setTags(definedTags); + + Set<Tag> previousTags = new HashSet<Tag>(bundleDeployment.getTags()); + previousTags.removeAll(definedTags); + for (Tag tag : previousTags) { + tag.removeBundleDeployment(bundleDeployment); + } + for (Tag tag : definedTags) { tag.addBundleDeployment(bundleDeployment); }
commit c5a9c4598bf381205d3e39ffc486132bf866fd5e Merge: 51c6ccb... c2690e4... Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri May 7 14:38:45 2010 -0400
Merge branch 'gwt' into gwt-jay
commit 51c6ccb59ad57ed7c28602379cde6b19874e0338 Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri May 7 14:37:08 2010 -0400
Provisioning Deploy Wizard Work - Restrict platform group selection to groups that *only* contain platform explicit group members.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java index 2f98b5b..62a56bf 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java @@ -28,6 +28,7 @@ import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType;
+import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.resource.group.GroupCategory; import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.domain.util.PageOrdering; @@ -50,6 +51,9 @@ public class ResourceGroupCriteria extends Criteria { private GroupCategory filterGroupCategory; private List<Integer> filterExplicitResourceIds; // requires overrides private List<Integer> filterImplicitResourceIds; // requires overrides + private ResourceCategory filterExplicitResourceCategory; // requires overrides + private Integer filterExplicitResourceTypeId; // requires overrides + private String filterExplicitResourceTypeName; // requires overrides
private boolean fetchExplicitResources; private boolean fetchImplicitResources; @@ -84,6 +88,24 @@ public class ResourceGroupCriteria extends Criteria { + " FROM Resource res " // + " JOIN res.implicitGroups implicitGroup " // + " WHERE res.id IN ( ? ) )"); + filterOverrides.put("explicitResourceCategory", "" // + + "NOT EXISTS " // + + "( SELECT res " // + + " FROM Resource res " // + + " JOIN res.explicitGroups explicitGroup " // + + " WHERE resourcegroup.id = explicitGroup.id AND NOT res.resourceType.category = ? )"); + filterOverrides.put("explicitResourceTypeId", "" // + + "NOT EXISTS " // + + "( SELECT res " // + + " FROM Resource res " // + + " JOIN res.explicitGroups explicitGroup " // + + " WHERE resourcegroup.id = explicitGroup.id AND NOT res.resourceType.id = ? )"); + filterOverrides.put("explicitResourceTypeName", "" // + + "NOT EXISTS " // + + "( SELECT res " // + + " FROM Resource res " // + + " JOIN res.explicitGroups explicitGroup " // + + " WHERE resourcegroup.id = explicitGroup.id AND NOT res.resourceType.name = ? )");
sortOverrides.put("resourceTypeName", "resourceType.name"); } @@ -136,6 +158,33 @@ public class ResourceGroupCriteria extends Criteria { this.filterImplicitResourceIds = Arrays.asList(filterImplicitResourceIds); }
+ /** A somewhat special case filter that ensures that all explicit group members + * are of the specified category (e.g. PLATFORM). Useful for filtering Mixed groups. + * + * @param filterExplicitResourceCategory + */ + public void addFilterExplicitResourceCategory(ResourceCategory filterExplicitResourceCategory) { + this.filterExplicitResourceCategory = filterExplicitResourceCategory; + } + + /** A somewhat special case filter that ensures that all explicit group members + * are of the specified resource type (id). Useful for filtering Mixed groups. + * + * @param filterExplicitResourceTypeId + */ + public void addFilterExplicitResourceTypeId(Integer filterExplicitResourceTypeId) { + this.filterExplicitResourceTypeId = filterExplicitResourceTypeId; + } + + /** A somewhat special case filter that ensures that all explicit group members + * are of the specified resource type (id). Useful for filtering Mixed groups. + * + * @param filterExplicitResourceTypeName + */ + public void addFilterExplicitResourceTypeName(String filterExplicitResourceTypeName) { + this.filterExplicitResourceTypeName = filterExplicitResourceTypeName; + } + public void fetchExplicitResources(boolean fetchExplicitResources) { this.fetchExplicitResources = fetchExplicitResources; } @@ -164,7 +213,6 @@ public class ResourceGroupCriteria extends Criteria { this.fetchTags = fetchTags; }
- /** * Requires MANAGE_SECURITY * @param fetchRoles diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectDestinationStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectDestinationStep.java index 8ec15ca..2954884 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectDestinationStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectDestinationStep.java @@ -24,9 +24,9 @@ import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Canvas;
import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.enterprise.gui.coregui.client.bundle.deploy.selection.PlatformResourceGroupSelector; import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.AbstractSelector; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceGroupSelector;
public class SelectDestinationStep implements WizardStep {
@@ -43,7 +43,7 @@ public class SelectDestinationStep implements WizardStep { }
public Canvas getCanvas() { - this.selector = new ResourceGroupSelector(); + this.selector = new PlatformResourceGroupSelector(); return this.selector; }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/selection/PlatformResourceGroupSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/selection/PlatformResourceGroupSelector.java new file mode 100644 index 0000000..75620bb --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/selection/PlatformResourceGroupSelector.java @@ -0,0 +1,32 @@ +package org.rhq.enterprise.gui.coregui.client.bundle.deploy.selection; + +import com.smartgwt.client.data.DSRequest; + +import org.rhq.core.domain.criteria.ResourceGroupCriteria; +import org.rhq.core.domain.resource.ResourceCategory; +import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceGroupSelector; +import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; + +public class PlatformResourceGroupSelector extends ResourceGroupSelector { + + public PlatformResourceGroupSelector() { + super(); + } + + @Override + protected RPCDataSource<ResourceGroup> getDataSource() { + return new SelectedPlatformResourceGroupsDataSource(); + } + + protected class SelectedPlatformResourceGroupsDataSource extends SelectedResourceGroupsDataSource { + + @Override + protected ResourceGroupCriteria getFetchCriteria(final DSRequest request) { + ResourceGroupCriteria result = super.getFetchCriteria(request); + result.addFilterExplicitResourceCategory(ResourceCategory.PLATFORM); + return result; + } + } + +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java index b652887..40d61a4 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java @@ -55,8 +55,6 @@ public class ResourceGroupsDataSource extends RPCDataSource<ResourceGroup> { }
public ResourceGroupsDataSource() { - // super("ResourceGroups"); - DataSourceField idDataField = new DataSourceIntegerField("id", "ID", 20); idDataField.setPrimaryKey(true);
@@ -77,19 +75,7 @@ public class ResourceGroupsDataSource extends RPCDataSource<ResourceGroup> { public void executeFetch(final DSRequest request, final DSResponse response) { final long start = System.currentTimeMillis();
- ResourceGroupCriteria criteria = new ResourceGroupCriteria(); - criteria.setPageControl(getPageControl(request)); - criteria.addFilterName(query); - - if (request.getCriteria().getValues().get("category") != null) { - criteria.addFilterGroupCategory(GroupCategory.valueOf(((String) request.getCriteria().getValues().get( - "groupCategory")).toUpperCase())); - } - - if (request.getCriteria().getValues().get("downMemberCount") != null) { - criteria.addFilterDownMemberCount(Integer.parseInt((String) request.getCriteria().getValues().get( - "downMemberCount"))); - } + ResourceGroupCriteria criteria = getFetchCriteria(request);
groupService.findResourceGroupsByCriteria(criteria, new AsyncCallback<PageList<ResourceGroup>>() { public void onFailure(Throwable caught) { @@ -108,6 +94,25 @@ public class ResourceGroupsDataSource extends RPCDataSource<ResourceGroup> { }); }
+ protected ResourceGroupCriteria getFetchCriteria(final DSRequest request) { + ResourceGroupCriteria criteria = new ResourceGroupCriteria(); + + criteria.setPageControl(getPageControl(request)); + criteria.addFilterName(query); + + if (request.getCriteria().getValues().get("category") != null) { + criteria.addFilterGroupCategory(GroupCategory.valueOf(((String) request.getCriteria().getValues().get( + "groupCategory")).toUpperCase())); + } + + if (request.getCriteria().getValues().get("downMemberCount") != null) { + criteria.addFilterDownMemberCount(Integer.parseInt((String) request.getCriteria().getValues().get( + "downMemberCount"))); + } + + return criteria; + } + @Override public ResourceGroup copyValues(ListGridRecord from) { return null; // TODO: Implement this method. diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java index 3e3e64d..c895e3e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java @@ -67,7 +67,7 @@ public class ResourceGroupSelector extends AbstractSelector<ResourceGroup> { return latestCriteria; }
- private class SelectedResourceGroupsDataSource extends ResourceGroupsDataSource { + protected class SelectedResourceGroupsDataSource extends ResourceGroupsDataSource {
@Override public ListGridRecord[] buildRecords(Collection<ResourceGroup> resourceGroups) {
commit 9e2b90d2556e57812ad495058e56914aada71c70 Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri May 7 14:36:03 2010 -0400
CriteriaQueryGenerator Work - protect against overrides using an EXISTS condition as opposed the standard "field op expression" syntax (see ResourceGroupCriteria for an example).
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 2272f12..1a774b4 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 @@ -78,8 +78,16 @@ public final class CriteriaQueryGenerator { private String projection; private static String NL = System.getProperty("line.separator");
+ private static List<String> EXPRESSION_START_KEYWORDS; + private List<Field> persistentBagFields = new ArrayList<Field>();
+ static { + EXPRESSION_START_KEYWORDS = new ArrayList<String>(2); + EXPRESSION_START_KEYWORDS.add("NOT"); + EXPRESSION_START_KEYWORDS.add("EXISTS"); + } + public CriteriaQueryGenerator(Criteria criteria) { this.criteria = criteria; this.className = criteria.getPersistentClass().getSimpleName(); @@ -111,12 +119,17 @@ public final class CriteriaQueryGenerator { expression = expression.replaceFirst("\?", replacement); }
- if (wantCaseInsensitiveMatch) { - int indexOfFirstSpace = expression.indexOf(" "); - String filterToken = expression.substring(0, indexOfFirstSpace); - expression = "LOWER( " + alias + "." + filterToken + " ) " + expression.substring(indexOfFirstSpace); - } else { - expression = alias + "." + expression; + // if the override expression does not follow the usual format of ( field operator expression ) + // then don't prepend the alias or deal with other special handling. The override must be left + // explicit. + if (!expressionStartsWithKeyword(expression)) { + if (wantCaseInsensitiveMatch) { + int indexOfFirstSpace = expression.indexOf(" "); + String filterToken = expression.substring(0, indexOfFirstSpace); + expression = "LOWER( " + alias + "." + filterToken + " ) " + expression.substring(indexOfFirstSpace); + } else { + expression = alias + "." + expression; + } }
if (fuzzyMatch) { @@ -126,6 +139,13 @@ public final class CriteriaQueryGenerator { return expression; }
+ private boolean expressionStartsWithKeyword(String expression) { + expression = expression.trim(); + int i = expression.trim().indexOf(" "); + String startToken = expression.substring(0, i); + return EXPRESSION_START_KEYWORDS.contains(startToken.toUpperCase()); + } + public void setAuthorizationResourceFragment(AuthorizationTokenType type, String fragment, int subjectId) { this.authorizationSubjectId = subjectId; if (type == AuthorizationTokenType.RESOURCE) {
commit c2690e43da1ab0100c8c7f988fa404eea87d5b1e Author: John Mazzitelli mazz@redhat.com Date: Fri May 7 13:20:16 2010 -0400
fix the test recipe so it has proper config defs
diff --git a/modules/cli-tests/src/test/resources/test-upgrade-bundle1.zip b/modules/cli-tests/src/test/resources/test-upgrade-bundle1.zip index a333f3d..b7b6d0e 100644 Binary files a/modules/cli-tests/src/test/resources/test-upgrade-bundle1.zip and b/modules/cli-tests/src/test/resources/test-upgrade-bundle1.zip differ diff --git a/modules/cli-tests/src/test/resources/test-upgrade-bundle2.zip b/modules/cli-tests/src/test/resources/test-upgrade-bundle2.zip index 172e366..0cb1998 100644 Binary files a/modules/cli-tests/src/test/resources/test-upgrade-bundle2.zip and b/modules/cli-tests/src/test/resources/test-upgrade-bundle2.zip differ
commit acd4b06e81839ac5db435ba659b2094dbdfdd5c4 Author: John Mazzitelli mazz@redhat.com Date: Fri May 7 13:03:08 2010 -0400
add status to toString output
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeploymentHistory.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeploymentHistory.java index 7064709..790de04 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeploymentHistory.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeploymentHistory.java @@ -157,6 +157,7 @@ public class BundleResourceDeploymentHistory implements Serializable { str.append(", time=[").append(this.auditTime).append("]"); str.append(", rd=[").append(this.resourceDeployment).append("]"); str.append(", action=[").append(this.auditAction).append("]"); + str.append(", status=[").append(this.auditStatus).append("]"); str.append(", message=[").append(this.auditMessage).append("]"); return str.toString(); }
commit 9c7fe001602675c7ab65a8cdb57b344c0313ebaf Author: John Mazzitelli mazz@redhat.com Date: Fri May 7 12:56:15 2010 -0400
add more auditing to file template bundle plugin
diff --git a/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java b/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java index e683613..8bae89b 100644 --- a/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java +++ b/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginServerComponent.java @@ -30,6 +30,7 @@ import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.pluginapi.bundle.BundleDeployRequest; import org.rhq.core.pluginapi.bundle.BundleDeployResult; import org.rhq.core.pluginapi.bundle.BundleFacet; +import org.rhq.core.pluginapi.bundle.BundleManagerProvider; import org.rhq.core.pluginapi.inventory.ResourceComponent; import org.rhq.core.pluginapi.inventory.ResourceContext;
@@ -66,28 +67,26 @@ public class FileTemplateBundlePluginServerComponent implements ResourceComponen BundleResourceDeployment resourceDeployment = request.getResourceDeployment(); BundleDeployment bundleDeployment = resourceDeployment.getBundleDeployment(); BundleVersion bundleVersion = bundleDeployment.getBundleVersion(); + BundleManagerProvider bundleManagerProvider = request.getBundleManagerProvider();
// process the recipe String recipe = bundleVersion.getRecipe(); RecipeParser parser = new RecipeParser(); ProcessingRecipeContext recipeContext = new ProcessingRecipeContext(recipe, request .getPackageVersionFiles(), this.resourceContext.getSystemInformation(), request - .getBundleFilesLocation().getAbsolutePath()); - - request.getBundleManagerProvider().auditDeployment( - resourceDeployment, - "Configuration Variable Replacement", - BundleDeploymentStatus.SUCCESS, - "setting replacement variable values using [" + bundleDeployment.getConfiguration().toString(true) - + "]"); + .getBundleFilesLocation().getAbsolutePath(), resourceDeployment, bundleManagerProvider); + + bundleManagerProvider.auditDeployment(resourceDeployment, "Configuration Variable Replacement", + BundleDeploymentStatus.SUCCESS, "setting replacement variable values using [" + + bundleDeployment.getConfiguration().toString(true) + "]"); recipeContext.setReplacementVariableValues(bundleDeployment.getConfiguration()); recipeContext.addReplacementVariableValue(DEPLOY_DIR, bundleDeployment.getInstallDir()); recipeContext.addReplacementVariableValue(DEPLOY_ID, Integer.toString(bundleDeployment.getId()));
parser.setReplaceReplacementVariables(true);
- request.getBundleManagerProvider().auditDeployment(resourceDeployment, "Parse Recipe", - BundleDeploymentStatus.SUCCESS, "Parsing Recipe using context [" + recipeContext + "]"); + bundleManagerProvider.auditDeployment(resourceDeployment, "Parse Recipe", BundleDeploymentStatus.SUCCESS, + "Parsing Recipe using context [" + recipeContext + "]"); parser.parseRecipe(recipeContext); } catch (Throwable t) { log.error("Failed to deploy bundle [" + request + "]", t); diff --git a/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/ProcessingRecipeContext.java b/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/ProcessingRecipeContext.java index 6d65481..89ae39d 100644 --- a/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/ProcessingRecipeContext.java +++ b/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/ProcessingRecipeContext.java @@ -34,7 +34,10 @@ import org.apache.commons.logging.LogFactory;
import org.rhq.bundle.filetemplate.recipe.RecipeContext; import org.rhq.bundle.filetemplate.recipe.RecipeParser; +import org.rhq.core.domain.bundle.BundleDeploymentStatus; +import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.content.PackageVersion; +import org.rhq.core.pluginapi.bundle.BundleManagerProvider; import org.rhq.core.system.OperatingSystemType; import org.rhq.core.system.ProcessExecution; import org.rhq.core.system.ProcessExecutionResults; @@ -51,39 +54,53 @@ public class ProcessingRecipeContext extends RecipeContext { private final Log log = LogFactory.getLog(this.getClass());
private final SystemInfo systemInfo; - private String baseWorkingDirectory; + private final String baseWorkingDirectory; + private final BundleResourceDeployment bundleResourceDeployment; + private final BundleManagerProvider bundleManagerProvider;
public ProcessingRecipeContext(String recipe, Map<PackageVersion, File> packageVersionFiles, SystemInfo systemInfo, - String baseWorkingDirectory) { + String baseWorkingDirectory, BundleResourceDeployment bundleResourceDeployment, + BundleManagerProvider bundleManagerProvider) {
super(recipe); this.systemInfo = systemInfo; this.baseWorkingDirectory = baseWorkingDirectory; // the directory that existing bundle filenames will be relative to + this.bundleResourceDeployment = bundleResourceDeployment; + this.bundleManagerProvider = bundleManagerProvider; }
@Override public void addDeployFile(String filename, String directory) { super.addDeployFile(filename, directory);
+ String msg; File existingFile = new File(this.baseWorkingDirectory, filename); - ProcessExecution pe = getUnzipExecution(existingFile, directory); + if (pe != null) { ProcessExecutionResults results = this.systemInfo.executeProcess(pe); if (results.getError() != null) { - throw new RuntimeException("Could not unbundle file [" + pe + "]: " + results, results.getError()); + msg = "Could not unbundle file [" + pe + "]: " + results; + audit("deploy", BundleDeploymentStatus.FAILURE, msg); + throw new RuntimeException(msg, results.getError()); } else if (results.getExitCode() == null || results.getExitCode().intValue() > 0) { - throw new RuntimeException("Failed to unbundle file [" + pe + "]: " + results); + msg = "Failed to unbundle file [" + pe + "]: " + results; + audit("deploy", BundleDeploymentStatus.FAILURE, msg); + throw new RuntimeException(msg); + } else { + msg = "extracted files from [" + existingFile + "] to [" + directory + "]"; } // existingFile.delete(); WOULD WE WANT TO REMOVE THE COMPRESSED FILE? - log.debug("bundle deploy: unzipped [" + existingFile + "] to [" + directory + "]"); + audit("deploy", BundleDeploymentStatus.SUCCESS, msg); } else { // not a zipped format - just move the file to the directory as-is File newFile = new File(directory, filename); if (!existingFile.renameTo(newFile)) { - throw new RuntimeException("Failed to move [" + existingFile + "] to [" + newFile + "]"); + msg = "Failed to move [" + existingFile + "] to [" + newFile + "]"; + audit("deploy", BundleDeploymentStatus.FAILURE, msg); + throw new RuntimeException(msg); } - log.debug("bundle deploy: renamed [" + existingFile + "] to [" + newFile + "]"); + audit("deploy", BundleDeploymentStatus.SUCCESS, "renamed [" + existingFile + "] to [" + newFile + "]"); } }
@@ -97,10 +114,12 @@ public class ProcessingRecipeContext extends RecipeContext { try { destinationFile.getParentFile().mkdirs(); FileUtil.copyFile(sourceFile, destinationFile); - - log.debug("bundle file: copied [" + sourceFile + "] to [" + destinationFile + "]"); + audit("file", BundleDeploymentStatus.SUCCESS, "copied file [" + sourceFile + "] to [" + destinationFile + + "]"); } catch (Exception e) { - throw new RuntimeException("Failed to copy file [" + sourceFile + "] to [" + destinationFile + "]", e); + String msg = "Failed to copy file [" + sourceFile + "] to [" + destinationFile + "]"; + audit("file", BundleDeploymentStatus.FAILURE, msg); + throw new RuntimeException(msg, e); }
return; @@ -110,6 +129,7 @@ public class ProcessingRecipeContext extends RecipeContext { public void addRealizedFile(String file) { super.addRealizedFile(file);
+ String msg; File trueFile = new File(file); RecipeParser parser = getParser(); File realizedTmpFile = null; @@ -135,14 +155,21 @@ public class ProcessingRecipeContext extends RecipeContext { reader.close(); reader = null;
+ audit("realize", BundleDeploymentStatus.SUCCESS, "realized [" + file + "]"); + trueFile.delete(); // remove the one with the replacement variables in it if (!realizedTmpFile.renameTo(trueFile)) { - throw new RuntimeException("Failed to rename realized tmp file [" + realizedTmpFile + "]"); + msg = "Failed to rename realized tmp file [" + realizedTmpFile + "] to [" + trueFile + "]"; + audit("realize", BundleDeploymentStatus.FAILURE, msg); + throw new RuntimeException(msg); }
- log.debug("bundle realize file: renamed realized [" + realizedTmpFile + "] to [" + trueFile + "]"); + audit("realize", BundleDeploymentStatus.SUCCESS, "renamed realized file [" + realizedTmpFile + "] to [" + + trueFile + "]"); } catch (Exception e) { - throw new RuntimeException("Cannot realize file [" + file + "]", e); + msg = "Cannot realize file [" + file + "]"; + audit("realize", BundleDeploymentStatus.FAILURE, msg); + throw new RuntimeException(msg, e); } finally { if (realizedTmpFileWriter != null) { try { @@ -180,12 +207,18 @@ public class ProcessingRecipeContext extends RecipeContext { pe.setWaitForCompletion(30 * 60 * 1000L); pe.setWorkingDirectory(scriptFile.getParent());
+ String msg; ProcessExecutionResults results = this.systemInfo.executeProcess(pe); if (results.getError() != null) { - throw new RuntimeException("Could not execute script [" + pe + "]: " + results, results.getError()); + msg = "Could not execute script [" + pe + "]: " + results; + audit("script", BundleDeploymentStatus.FAILURE, msg); + throw new RuntimeException(msg, results.getError()); + } else { + msg = "Executed script [" + pe + "]"; + audit("script", BundleDeploymentStatus.SUCCESS, msg); }
- log.debug("bundle script: executed script [" + pe + "]"); + return; }
@Override @@ -198,12 +231,32 @@ public class ProcessingRecipeContext extends RecipeContext { pe.setCheckExecutableExists(false); pe.setWorkingDirectory(this.baseWorkingDirectory);
+ String msg; ProcessExecutionResults results = this.systemInfo.executeProcess(pe); if (results.getError() != null) { - throw new RuntimeException("Could not execute command [" + pe + "]: " + results, results.getError()); + msg = "Could not execute command [" + pe + "]: " + results; + audit("command", BundleDeploymentStatus.FAILURE, msg); + throw new RuntimeException(msg, results.getError()); + } else { + msg = "Executed command [" + pe + "]"; + audit("command", BundleDeploymentStatus.SUCCESS, msg); }
- log.debug("bundle command: executed command [" + pe + "]"); + return; + } + + private void audit(String action, BundleDeploymentStatus status, String message) { + try { + bundleManagerProvider.auditDeployment(bundleResourceDeployment, action, status, message); + if (log.isDebugEnabled()) { + log.debug("Deployment [" + bundleResourceDeployment.getBundleDeployment().getBundleVersion() + + "] audit: action=[" + action + "], status=[" + status + "], message: " + message); + } + } catch (Exception e) { + log.warn("Failed to send audit message for deployment of [" + + bundleResourceDeployment.getBundleDeployment().getBundleVersion() + "]. audit action=[" + action + + "], status=[" + status + "], message: " + message); + } }
private void ensureExecutable(File scriptFile) { @@ -229,7 +282,9 @@ public class ProcessingRecipeContext extends RecipeContext { }
if (!success) { - throw new RuntimeException("Cannot ensure that script [" + scriptFile + "] is executable"); + String msg = "Cannot ensure that script [" + scriptFile + "] is executable"; + audit("ensureExecutable", BundleDeploymentStatus.FAILURE, msg); + throw new RuntimeException(msg); }
return; diff --git a/modules/plugins/filetemplate-bundle/src/test/java/org/rhq/plugins/filetemplate/ProcessingRecipeContextTest.java b/modules/plugins/filetemplate-bundle/src/test/java/org/rhq/plugins/filetemplate/ProcessingRecipeContextTest.java index 9b830db..c6753bd 100644 --- a/modules/plugins/filetemplate-bundle/src/test/java/org/rhq/plugins/filetemplate/ProcessingRecipeContextTest.java +++ b/modules/plugins/filetemplate-bundle/src/test/java/org/rhq/plugins/filetemplate/ProcessingRecipeContextTest.java @@ -27,6 +27,8 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; +import java.util.List; import java.util.Map; import java.util.Set; import java.util.zip.ZipEntry; @@ -38,7 +40,17 @@ import org.testng.annotations.Test;
import org.rhq.bundle.filetemplate.recipe.RecipeContext; import org.rhq.bundle.filetemplate.recipe.RecipeParser; +import org.rhq.core.domain.bundle.Bundle; +import org.rhq.core.domain.bundle.BundleDeployment; +import org.rhq.core.domain.bundle.BundleDeploymentStatus; +import org.rhq.core.domain.bundle.BundleResourceDeployment; +import org.rhq.core.domain.bundle.BundleType; +import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.content.PackageVersion; +import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.ResourceCategory; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.pluginapi.bundle.BundleManagerProvider; import org.rhq.core.pluginapi.util.FileUtils; import org.rhq.core.system.OperatingSystemType; import org.rhq.core.system.SystemInfo; @@ -168,7 +180,21 @@ public class ProcessingRecipeContextTest { Map<PackageVersion, File> packageVersionFiles = null; // TODO not used yet SystemInfo sysinfo = SystemInfoFactory.createSystemInfo(); String cwd = testDir.getAbsolutePath(); - ProcessingRecipeContext context = new ProcessingRecipeContext(getRecipe(), packageVersionFiles, sysinfo, cwd); + + // need a dummy deployment + + ResourceType resourceType = new ResourceType("name", "plugin", ResourceCategory.PLATFORM, null); + Resource resource = new Resource("key", "name", resourceType); + BundleType bundleType = new BundleType("name", resourceType); + Bundle bundle = new Bundle("name", bundleType, null, null); + BundleVersion bundleVersion = new BundleVersion("bname", "bversion", bundle, ""); + String name = "name"; + String installDir = "installDir"; + BundleDeployment bundleDeployment = new BundleDeployment(bundleVersion, name, installDir); + BundleResourceDeployment deployment = new BundleResourceDeployment(bundleDeployment, resource); + + ProcessingRecipeContext context = new ProcessingRecipeContext(getRecipe(), packageVersionFiles, sysinfo, cwd, + deployment, new DummyBundleManagerProvider()); return context; }
@@ -245,4 +271,20 @@ public class ProcessingRecipeContextTest { } } } + + private class DummyBundleManagerProvider implements BundleManagerProvider { + public void auditDeployment(BundleResourceDeployment deployment, String action, BundleDeploymentStatus status, + String message) throws Exception { + System.out.println("audit: action=[" + action + "], status=[" + status + "], message: " + message); + } + + public List<PackageVersion> getAllBundleVersionPackageVersions(BundleVersion bundleVersion) throws Exception { + return null; + } + + public long getFileContent(PackageVersion packageVersion, OutputStream outputStream) throws Exception { + return 0; + } + + } }
commit fe6a52443487da4cc1ae86055fa19374ca60f85b Author: John Mazzitelli mazz@redhat.com Date: Fri May 7 12:16:10 2010 -0400
put the file downloads in a specific agent tmp directory
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java index 9fc338c..2eb5b9c 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/bundle/BundleManager.java @@ -134,7 +134,8 @@ public class BundleManager extends AgentService implements BundleAgentService, B + bundleType + "]. Ensure it is imported into inventory."); } File pluginTmpDir = resourceContainer.getResourceContext().getTemporaryDirectory(); - File bundleFilesDir = new File(pluginTmpDir, "" + bundleDeployment.getBundleVersion().getId()); + File bundleFilesDir = new File(pluginTmpDir, "bundle-versions/" + + bundleDeployment.getBundleVersion().getId()); Map<PackageVersion, File> downloadedFiles = downloadBundleFiles(resourceDeployment, bundleFilesDir);
// get the bundle facet object that will process the bundle
commit 0df42241e823df52e439ce49915c103df8d4bc46 Author: John Mazzitelli mazz@redhat.com Date: Fri May 7 10:55:35 2010 -0400
in case the server plugin didn't define a display name of recipe config props, set them as the same as the property name. this is required because if we don't ensure display name is not null, the ui may show "null" as the name of the property
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/BundleServerPluginManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/BundleServerPluginManager.java index 2ec9aeb..71c24c9 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/BundleServerPluginManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/BundleServerPluginManager.java @@ -20,6 +20,9 @@ package org.rhq.enterprise.server.plugin.pc.bundle;
import java.io.File;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; +import org.rhq.core.domain.configuration.definition.PropertyDefinition; +import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple; import org.rhq.enterprise.server.bundle.BundleDistributionInfo; import org.rhq.enterprise.server.bundle.RecipeParseResults; import org.rhq.enterprise.server.plugin.pc.ServerPluginComponent; @@ -114,6 +117,7 @@ public class BundleServerPluginManager extends ServerPluginManager { try { Thread.currentThread().setContextClassLoader(pluginEnv.getPluginClassLoader()); RecipeParseResults results = facet.parseRecipe(recipe); + ensureDisplayNameIsSet(results); return results; } finally { Thread.currentThread().setContextClassLoader(originalContextClassLoader); @@ -168,6 +172,8 @@ public class BundleServerPluginManager extends ServerPluginManager { throw new IllegalArgumentException("Invalid recipe not recognized by any deployed server bundle plugin."); }
+ ensureDisplayNameIsSet(info.getRecipeParseResults()); + return info; }
@@ -219,6 +225,22 @@ public class BundleServerPluginManager extends ServerPluginManager { "Invalid bundle distribution file. BundleType/Recipe not recognized by any deployed server bundle plugin."); }
+ ensureDisplayNameIsSet(info.getRecipeParseResults()); + return info; } + + private void ensureDisplayNameIsSet(RecipeParseResults recipeParseResults) { + if (recipeParseResults != null && recipeParseResults.getConfigurationDefinition() != null) { + ConfigurationDefinition configDef = recipeParseResults.getConfigurationDefinition(); + for (PropertyDefinition propDef : configDef.getPropertyDefinitions().values()) { + if (propDef instanceof PropertyDefinitionSimple) { + if (propDef.getDisplayName() == null) { + propDef.setDisplayName(propDef.getName()); + } + } + } + } + return; + } } \ No newline at end of file
commit d07fb6c9a6c52f1b01cd8a16c41422818ca3733c Author: John Mazzitelli mazz@redhat.com Date: Fri May 7 09:45:34 2010 -0400
some simple ant bundle distros we can use to test upgrades via ant bundle system
diff --git a/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant1.zip b/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant1.zip new file mode 100644 index 0000000..aa060d9 Binary files /dev/null and b/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant1.zip differ diff --git a/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant2.zip b/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant2.zip new file mode 100644 index 0000000..6f22cdb Binary files /dev/null and b/modules/cli-tests/src/test/resources/test-upgrade-bundle-ant2.zip differ diff --git a/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerUpgradeAnt.js b/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerUpgradeAnt.js new file mode 100644 index 0000000..2c4f96d --- /dev/null +++ b/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerUpgradeAnt.js @@ -0,0 +1,117 @@ +/* + * 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, 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. + */ + +/** + * Thus test script works with a real env including at least one platform resource and a running agent on + * said platform. It will deploy an original distro file then upgrade it, utilitizing the + * Ant bundle system. + */ + +var TestsEnabled = true; + +var bundleName = 'test-bundle-upgrade-ant'; +var bundleZipFile1 = 'src/test/resources/test-upgrade-bundle-ant1.zip'; +var bundleZipFile2 = 'src/test/resources/test-upgrade-bundle-ant2.zip'; + +// note, super-user, will not test any security constraints +var subject = rhq.login('rhqadmin', 'rhqadmin'); + +executeAllTests(); + +rhq.logout(); + +function testGroupDeployment() { + if ( !TestsEnabled ) { + return; + } + + var groupId = getGroupId(); + var bundleType = getBundleType(); + Assert.assertNotNull(bundleType, "need ant bundle plugin installed for this test"); + + // delete the test bundle if it exists + var bc = new BundleCriteria(); + bc.addFilterName( bundleName ); + var bundles = BundleManager.findBundlesByCriteria( bc ); + if ( null != bundles && bundles.size() > 0 ) { + print( "\nDeleting existing test ant bundle in order to test a fresh deploy...") + BundleManager.deleteBundle( bundles.get(0).getId() ); + } + + // create bundleVersion 1.0 + var distributionFile1 = new java.io.File(bundleZipFile1); + distributionFile1 = new java.io.File(distributionFile1.getAbsolutePath()); + Assert.assertTrue(distributionFile1.exists(), "missing ant bundle file 1: " + distributionFile1); + var testBundleVersion1 = BundleManager.createBundleVersionViaFile( distributionFile1 ); + + // create bundleVersion 2.0 + var distributionFile2 = new java.io.File(bundleZipFile2); + distributionFile2 = new java.io.File(distributionFile2.getAbsolutePath()); + Assert.assertTrue(distributionFile2.exists(), "missing ant bundle file 2: " + distributionFile2); + var testBundleVersion2 = BundleManager.createBundleVersionViaFile( distributionFile2 ); + + // create 1.0 config, setting the required properties for recipe in distro 1.0 + var config1 = new Configuration(); + var property11 = new PropertySimple("upgrade.test.name", "Original Name"); + config1.put( property11 ); + var property12 = new PropertySimple("upgrade.test.port", "12345"); + config1.put( property12 ); + + // create 2.0 config, setting the required properties for recipe in distro 2.0 + var config2 = new Configuration(); + var property21 = new PropertySimple("upgrade.test.name", "UPGRADED NAME!"); + config2.put( property21 ); + var property22 = new PropertySimple("upgrade.test.port", "9876"); + config2.put( property22 ); + var property23 = new PropertySimple("upgrade.test.new", "A NEW REPLACEMENT"); + config2.put( property23 ); + + // create a deployment of 1.0 using the 1.0 config + var testDeployment = BundleManager.createBundleDeployment(testBundleVersion1.getId(), "Upgrade Deployment with Ant Test 1", "Creating initial ant bundle deployment to be upgraded", "/tmp/upgrade-bundle-ant-test", config1); + var bgd = BundleManager.scheduleBundleGroupDeployment(testDeployment.getId(), groupId); + Assert.assertNotNull( bgd, "Failed to create 1.0 deployment" ); + + // upgrade the deployment to 2.0 using the 2.0 config + testDeployment = BundleManager.createBundleDeployment(testBundleVersion2.getId(), "Upgrade Deployment with Ant Test 2", "Testing ant bundle upgrade deployment", "/tmp/upgrade-bundle-ant-test", config2); + bgd = BundleManager.scheduleBundleGroupDeployment(testDeployment.getId(), groupId); + Assert.assertNotNull( bgd, "Failed to upgrade to 2.0 deployment" ); +} + +function getGroupId() { + // Find a target platform group + var rgc = new ResourceGroupCriteria(); + rgc.addFilterName("platforms"); + var groups = ResourceGroupManager.findResourceGroupsByCriteria(rgc); + Assert.assertTrue( groups.size() > 0, "need a group called platforms for this test" ); + return groups.get(0).getId(); +} + +function getBundleType() { + var types = BundleManager.getAllBundleTypes(); + for (i=0; ( i < types.size()); ++i ) { + if ( types.get(i).getName().equals( "Ant Bundle" )) { + return types.get(i).getId(); + } + } + return null; +}
commit 55f4f1e17f1768bc0a14d92fd4f259bb4d885e00 Author: John Mazzitelli mazz@redhat.com Date: Fri May 7 09:15:53 2010 -0400
keep going even if we can't load in the thirdparty ant tasks, that just means they can't use those third party tasks but if they don't we should still work
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java index e8391b7..03daae0 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java @@ -22,12 +22,25 @@ */ package org.rhq.bundle.ant;
-import java.io.*; -import java.util.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.Vector;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.tools.ant.*; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.BuildListener; +import org.apache.tools.ant.MagicNames; +import org.apache.tools.ant.ProjectHelper; +import org.apache.tools.ant.Target; +import org.apache.tools.ant.Task; +import org.apache.tools.ant.UnknownElement; import org.apache.tools.ant.helper.AntXMLContext; import org.apache.tools.ant.helper.ProjectHelper2;
@@ -42,7 +55,7 @@ import org.rhq.bundle.ant.task.InputPropertyTask; * @author John Mazzitelli * @author Ian Springer */ -public class AntLauncher { +public class AntLauncher { private final Log log = LogFactory.getLog(this.getClass());
// "out of box" we will provide the ant contrib optional tasks (from ant-contrib.jar) @@ -72,10 +85,9 @@ public class AntLauncher { * @throws InvalidBuildFileException if the build file is invalid */ public BundleAntProject executeBundleDeployFile(File buildFile, String targetName, Properties buildProperties, - List<BuildListener> buildListeners) - throws InvalidBuildFileException { + List<BuildListener> buildListeners) throws InvalidBuildFileException { parseBundleDeployFile(buildFile); - + BundleAntProject project = new BundleAntProject(); ClassLoader classLoader = getClass().getClassLoader(); project.setCoreLoader(classLoader); @@ -91,10 +103,8 @@ public class AntLauncher { "\\")); } } - project.setUserProperty(MagicNames.ANT_FILE, - buildFile.getAbsolutePath()); - project.setUserProperty(MagicNames.ANT_FILE_TYPE, - MagicNames.ANT_FILE_TYPE_FILE); + project.setUserProperty(MagicNames.ANT_FILE, buildFile.getAbsolutePath()); + project.setUserProperty(MagicNames.ANT_FILE_TYPE, MagicNames.ANT_FILE_TYPE_FILE); ProjectHelper.configureProject(project, buildFile);
if (buildListeners != null) { @@ -116,7 +126,8 @@ public class AntLauncher {
return project; } catch (Exception e) { - throw new RuntimeException("Failed to execute bundle deploy file [" + buildFile.getAbsolutePath() + "]. Cause: " + e, e); + throw new RuntimeException("Failed to execute bundle deploy file [" + buildFile.getAbsolutePath() + + "]. Cause: " + e, e); } }
@@ -162,13 +173,13 @@ public class AntLauncher { private void addTaskDefsForBundledTasks(BundleAntProject project) throws IOException, ClassNotFoundException { Properties taskDefs = buildTaskDefProperties(project.getCoreLoader()); for (Map.Entry<Object, Object> taskDef : taskDefs.entrySet()) { - project.addTaskDefinition(taskDef.getKey().toString(), Class.forName(taskDef.getValue().toString(), - true, project.getCoreLoader())); + project.addTaskDefinition(taskDef.getKey().toString(), Class.forName(taskDef.getValue().toString(), true, + project.getCoreLoader())); } }
private Properties buildTaskDefProperties(ClassLoader classLoader) throws IOException { - Set<String> customTaskDefs = new HashSet<String>(1); + Set<String> customTaskDefs = new HashSet<String>(2);
customTaskDefs.add(ANTCONTRIB_ANT_TASKS); customTaskDefs.add(LIQUIBASE_ANT_TASKS); @@ -176,10 +187,17 @@ public class AntLauncher { Properties taskDefProps = new Properties(); for (String customTaskDef : customTaskDefs) { InputStream taskDefsStream = classLoader.getResourceAsStream(customTaskDef); - try { - taskDefProps.load(taskDefsStream); - } finally { - taskDefsStream.close(); + if (taskDefsStream != null) { + try { + taskDefProps.load(taskDefsStream); + } catch (Exception e) { + log.warn("Ant task definitions [" + customTaskDef + + "] failed to load - ant bundles cannot use their tasks", e); + } finally { + taskDefsStream.close(); + } + } else { + log.warn("Missing ant task definitions [" + customTaskDef + "] - ant bundles cannot use their tasks"); } } return taskDefProps;
commit 91c48b1aee54cde4dd1c9dd2ed59d35dd40c516d Author: John Mazzitelli mazz@redhat.com Date: Fri May 7 01:54:38 2010 -0400
this provides two simple bundle distros with simple file template recipes. to test, you can run the CLI test script (see below) or use the two test .zips to upload via the GUI
cd modules/cli-test mvn -Dtest=test_bundleManagerUpgrade.js test
diff --git a/modules/cli-tests/src/test/resources/test-upgrade-bundle1.zip b/modules/cli-tests/src/test/resources/test-upgrade-bundle1.zip new file mode 100644 index 0000000..a333f3d Binary files /dev/null and b/modules/cli-tests/src/test/resources/test-upgrade-bundle1.zip differ diff --git a/modules/cli-tests/src/test/resources/test-upgrade-bundle2.zip b/modules/cli-tests/src/test/resources/test-upgrade-bundle2.zip new file mode 100644 index 0000000..172e366 Binary files /dev/null and b/modules/cli-tests/src/test/resources/test-upgrade-bundle2.zip differ diff --git a/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerUpgrade.js b/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerUpgrade.js new file mode 100644 index 0000000..fb19a06 --- /dev/null +++ b/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManagerUpgrade.js @@ -0,0 +1,116 @@ +/* + * 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, 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. + */ + +/** + * Thus test script works with a real env including at least one platform resource and a running agent on + * said platform. It will deploy an original distro file then upgrade it. + */ + +var TestsEnabled = true; + +var bundleName = 'test-bundle-upgrade'; +var bundleZipFile1 = 'src/test/resources/test-upgrade-bundle1.zip'; +var bundleZipFile2 = 'src/test/resources/test-upgrade-bundle2.zip'; + +// note, super-user, will not test any security constraints +var subject = rhq.login('rhqadmin', 'rhqadmin'); + +executeAllTests(); + +rhq.logout(); + +function testGroupDeployment() { + if ( !TestsEnabled ) { + return; + } + + var groupId = getGroupId(); + var bundleType = getBundleType(); + Assert.assertNotNull(bundleType, "need bundle plugin installed for this test"); + + // delete the test bundle if it exists + var bc = new BundleCriteria(); + bc.addFilterName( bundleName ); + var bundles = BundleManager.findBundlesByCriteria( bc ); + if ( null != bundles && bundles.size() > 0 ) { + print( "\nDeleting existing test bundle in order to test a fresh deploy...") + BundleManager.deleteBundle( bundles.get(0).getId() ); + } + + // create bundleVersion 1.0 + var distributionFile1 = new java.io.File(bundleZipFile1); + distributionFile1 = new java.io.File(distributionFile1.getAbsolutePath()); + Assert.assertTrue(distributionFile1.exists(), "missing bundle file 1: " + distributionFile1); + var testBundleVersion1 = BundleManager.createBundleVersionViaFile( distributionFile1 ); + + // create bundleVersion 2.0 + var distributionFile2 = new java.io.File(bundleZipFile2); + distributionFile2 = new java.io.File(distributionFile2.getAbsolutePath()); + Assert.assertTrue(distributionFile2.exists(), "missing bundle file 2: " + distributionFile2); + var testBundleVersion2 = BundleManager.createBundleVersionViaFile( distributionFile2 ); + + // create 1.0 config, setting the required properties for recipe in distro 1.0 + var config1 = new Configuration(); + var property11 = new PropertySimple("upgrade.test.name", "Original Name"); + config1.put( property11 ); + var property12 = new PropertySimple("upgrade.test.port", "12345"); + config1.put( property12 ); + + // create 2.0 config, setting the required properties for recipe in distro 2.0 + var config2 = new Configuration(); + var property21 = new PropertySimple("upgrade.test.name", "UPGRADED NAME!"); + config2.put( property21 ); + var property22 = new PropertySimple("upgrade.test.port", "9876"); + config2.put( property22 ); + var property23 = new PropertySimple("upgrade.test.new", "A NEW REPLACEMENT"); + config2.put( property23 ); + + // create a deployment of 1.0 using the 1.0 config + var testDeployment = BundleManager.createBundleDeployment(testBundleVersion1.getId(), "Upgrade Deployment Test 1", "Creating initial deployment to be upgraded", "/tmp/upgrade-bundle-test", config1); + var bgd = BundleManager.scheduleBundleGroupDeployment(testDeployment.getId(), groupId); + Assert.assertNotNull( bgd, "Failed to create 1.0 deployment" ); + + // upgrade the deployment to 2.0 using the 2.0 config + testDeployment = BundleManager.createBundleDeployment(testBundleVersion2.getId(), "Upgrade Deployment Test 2", "Testing upgrade deployment", "/tmp/upgrade-bundle-test", config2); + bgd = BundleManager.scheduleBundleGroupDeployment(testDeployment.getId(), groupId); + Assert.assertNotNull( bgd, "Failed to upgrade to 2.0 deployment" ); +} + +function getGroupId() { + // Find a target platform group + var rgc = new ResourceGroupCriteria(); + rgc.addFilterName("platforms"); + var groups = ResourceGroupManager.findResourceGroupsByCriteria(rgc); + Assert.assertTrue( groups.size() > 0, "need a group called platforms for this test" ); + return groups.get(0).getId(); +} + +function getBundleType() { + var types = BundleManager.getAllBundleTypes(); + for (i=0; ( i < types.size()); ++i ) { + if ( types.get(i).getName().equals( "File Template Bundle" )) { + return types.get(i).getId(); + } + } + return null; +}
commit 1509c2493be52292c3730bc91592a9904b50a38e Author: John Mazzitelli mazz@redhat.com Date: Thu May 6 17:31:29 2010 -0400
introduce UnknownRecipeException so bundle plugins can tell us if the recipe it was given was not of the proper type (vs. it was the proper type, it just had a syntax error in it)
diff --git a/modules/common/filetemplate-bundle/src/main/java/org/rhq/bundle/filetemplate/recipe/RecipeContext.java b/modules/common/filetemplate-bundle/src/main/java/org/rhq/bundle/filetemplate/recipe/RecipeContext.java index f9beadb..e147e45 100644 --- a/modules/common/filetemplate-bundle/src/main/java/org/rhq/bundle/filetemplate/recipe/RecipeContext.java +++ b/modules/common/filetemplate-bundle/src/main/java/org/rhq/bundle/filetemplate/recipe/RecipeContext.java @@ -43,6 +43,7 @@ public class RecipeContext {
private RecipeParser parser; private final String recipe; + private boolean unknownRecipe; private final DeploymentProperties deploymentProperties; private final Map<String, String> deployFiles; private final Map<String, String> files; @@ -64,6 +65,7 @@ public class RecipeContext { this.scripts = new ArrayList<Script>(); this.commands = new ArrayList<Command>(); this.deploymentProperties = new DeploymentProperties(); + this.unknownRecipe = true; // will be false if the recipe at least looks like one we understand }
/** @@ -79,6 +81,22 @@ public class RecipeContext { }
/** + * Returns true if the recipe content does not look like a valid type that can be at least attempted + * to be parsed. In other words, this returns true if the recipe does not look like a file template + * recipe. This returns false if it looks like its file template recipe (even though it may have + * syntax errors in it). + * + * @return flag to indicate if the recipe looks like it might be a file template recipe + */ + public boolean isUnknownRecipe() { + return unknownRecipe; + } + + public void setUnknownRecipe(boolean unknownRecipe) { + this.unknownRecipe = unknownRecipe; + } + + /** * The full recipe that this context represents. * * @return the actual recipe text diff --git a/modules/common/filetemplate-bundle/src/main/java/org/rhq/bundle/filetemplate/recipe/RecipeParser.java b/modules/common/filetemplate-bundle/src/main/java/org/rhq/bundle/filetemplate/recipe/RecipeParser.java index 57fa1f3..f08b0c5 100644 --- a/modules/common/filetemplate-bundle/src/main/java/org/rhq/bundle/filetemplate/recipe/RecipeParser.java +++ b/modules/common/filetemplate-bundle/src/main/java/org/rhq/bundle/filetemplate/recipe/RecipeParser.java @@ -86,13 +86,17 @@ public class RecipeParser { }
public void parseRecipe(RecipeContext context) throws Exception { - context.setParser(this); try { BufferedReader recipeReader = new BufferedReader(new StringReader(context.getRecipe())); String line = recipeReader.readLine(); while (line != null) { - parseRecipeCommandLine(context, line); + line = line.trim(); + if (line.length() > 0 && !line.startsWith("#")) { + // only process lines that aren't blank or aren't comment lines that start with # + parseRecipeCommandLine(context, line); + context.setUnknownRecipe(false); // we've successfully processed at least one line, this must be a file template recipe + } line = recipeReader.readLine(); } } finally { @@ -103,11 +107,6 @@ public class RecipeParser { }
protected void parseRecipeCommandLine(RecipeContext context, String line) throws Exception { - line = (null == line) ? line : line.trim(); - // ignore blank lines or comment lines that start with # - if (null == line || line.length() == 0 || line.startsWith("#")) { - return; - }
if (isReplaceReplacementVariables()) { line = replaceReplacementVariables(context, line); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/BundleServerPluginFacet.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/BundleServerPluginFacet.java index db616d8..101defa 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/BundleServerPluginFacet.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/BundleServerPluginFacet.java @@ -36,9 +36,14 @@ public interface BundleServerPluginFacet { * * @param recipe the content of the recipe to be parsed * @return the information gleened from the recipe after being parsed - * @throws Exception if the recipe could not be successfully parsed + * @throws UnknownRecipeException if the recipe is not understood by the plugin (i.e. + * it is a recipe that some other bundle plugin probably + * can process) + * @throws Exception if the recipe could not be successfully parsed - this exception + * usually means the recipe type is known to the plugin but it just + * had some error that caused it to fail to parse successfully */ - RecipeParseResults parseRecipe(String recipe) throws Exception; + RecipeParseResults parseRecipe(String recipe) throws UnknownRecipeException, Exception;
/** * The server side plugin is being given an bundle distribution file that must be procssed. @@ -48,7 +53,13 @@ public interface BundleServerPluginFacet { * * @param distributionFile * @return the information gleened by cracking open the bundle distribution file and examining its contents - * @throws Exception if the bundle distribution file could not be processed successfully + * @throws UnknownRecipeException if the recipe in the distribution file is not understood by the + * plugin (i.e. the distribution file can probably be processed by some other + * bundle plugin). + * @throws Exception if the bundle distribution file could not be successfully processed - this exception + * usually means the distribution file is of a known type to the plugin but it just + * had some error that caused it to fail to be processed successfully. */ - BundleDistributionInfo processBundleDistributionFile(File distributionFile) throws Exception; + BundleDistributionInfo processBundleDistributionFile(File distributionFile) throws UnknownRecipeException, + Exception; } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/BundleServerPluginManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/BundleServerPluginManager.java index 55e833f..2ec9aeb 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/BundleServerPluginManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/BundleServerPluginManager.java @@ -155,7 +155,8 @@ public class BundleServerPluginManager extends ServerPluginManager { info = new BundleDistributionInfo(recipe, results, null); info.setBundleTypeName(descriptor.getBundle().getType()); break; - } catch (Exception e) { + } catch (UnknownRecipeException ure) { + // the recipe is not a type that the plugin can handle, go on to the next info = null; } } finally { @@ -205,7 +206,8 @@ public class BundleServerPluginManager extends ServerPluginManager { info = facet.processBundleDistributionFile(distributionFile); info.setBundleTypeName(descriptor.getBundle().getType()); break; - } catch (Exception e) { + } catch (UnknownRecipeException ure) { + // the recipe is not a type that the plugin can handle, go on to the next info = null; } } finally { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/UnknownRecipeException.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/UnknownRecipeException.java new file mode 100644 index 0000000..2eb60da --- /dev/null +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/UnknownRecipeException.java @@ -0,0 +1,55 @@ +/* + * 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, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.rhq.enterprise.server.plugin.pc.bundle; + +/** + * This exception is thrown when a bundle server plugin has been asked to parse a recipe but + * that recipe is not one that is recognized by the plugin. For example, if a plugin accepts + * an Ant script as its recipe, this exception should be thrown if the given recipe is + * not an Ant XML file in the first place. A different exception should be thrown if the + * recipe was an actual Ant script, but it had a syntax error or some other error that the + * Ant parser found and reported. + * + * @author John Mazzitelli + */ +public class UnknownRecipeException extends Exception { + + private static final long serialVersionUID = 1L; + + public UnknownRecipeException() { + super(); + } + + public UnknownRecipeException(String message) { + super(message); + } + + public UnknownRecipeException(Throwable cause) { + super(cause); + } + + public UnknownRecipeException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/modules/enterprise/server/plugins/ant-bundle/src/main/java/org/rhq/enterprise/server/plugins/ant/AntBundleServerPluginComponent.java b/modules/enterprise/server/plugins/ant-bundle/src/main/java/org/rhq/enterprise/server/plugins/ant/AntBundleServerPluginComponent.java index 4efcb84..e4bc366 100644 --- a/modules/enterprise/server/plugins/ant-bundle/src/main/java/org/rhq/enterprise/server/plugins/ant/AntBundleServerPluginComponent.java +++ b/modules/enterprise/server/plugins/ant-bundle/src/main/java/org/rhq/enterprise/server/plugins/ant/AntBundleServerPluginComponent.java @@ -45,6 +45,7 @@ import org.rhq.enterprise.server.bundle.RecipeParseResults; import org.rhq.enterprise.server.plugin.pc.ServerPluginComponent; import org.rhq.enterprise.server.plugin.pc.ServerPluginContext; import org.rhq.enterprise.server.plugin.pc.bundle.BundleServerPluginFacet; +import org.rhq.enterprise.server.plugin.pc.bundle.UnknownRecipeException;
/** * A bundle server-side plugin component that the server uses to process Ant-based bundles. @@ -81,7 +82,13 @@ public class AntBundleServerPluginComponent implements ServerPluginComponent, Bu log.debug("The Ant bundle plugin has been shut down: " + this); }
- public RecipeParseResults parseRecipe(String recipe) throws Exception { + public RecipeParseResults parseRecipe(String recipe) throws UnknownRecipeException, Exception { + + // all Ant recipes must use the RHQ custom ant library; if the recipe doesn't have the + // string of that antlib URI, that means this probably isn't an Ant recipe in the first place + if (!recipe.contains("antlib:org.rhq.bundle")) { + throw new UnknownRecipeException("Not a valid Ant recipe"); + }
DeploymentProperties deploymentProps; Set<String> bundleFiles; @@ -123,7 +130,8 @@ public class AntBundleServerPluginComponent implements ServerPluginComponent, Bu return results; }
- public BundleDistributionInfo processBundleDistributionFile(File distributionFile) throws Exception { + public BundleDistributionInfo processBundleDistributionFile(File distributionFile) throws UnknownRecipeException, + Exception { if (null == distributionFile) { throw new IllegalArgumentException("distributionFile == null"); } @@ -139,7 +147,7 @@ public class AntBundleServerPluginComponent implements ServerPluginComponent, Bu recipeParseResults = recipeVisitor.getResults();
if (null == recipeParseResults) { - throw new IllegalArgumentException("Not an Ant Bundle"); + throw new UnknownRecipeException("Not an Ant Bundle"); }
// if we parsed the recipe then this is a distribution we can deal with, get the bundle file Map @@ -170,12 +178,8 @@ public class AntBundleServerPluginComponent implements ServerPluginComponent, Bu StreamUtil.copy(stream, out, false); this.recipe = new String(out.toByteArray()); out = null; // no need for this anymore, help out GC - try { - this.results = this.facet.parseRecipe(this.recipe); - } catch (Throwable t) { - this.results = null; - } - return false; // whether we parsed it or not, we found the file we are looking for so stop walking + this.results = this.facet.parseRecipe(this.recipe); + return false; // we found the file we are looking for so stop walking } return true; } diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/src/main/java/org/rhq/enterprise/server/plugins/filetemplate/BundleServerPluginComponent.java b/modules/enterprise/server/plugins/filetemplate-bundle/src/main/java/org/rhq/enterprise/server/plugins/filetemplate/BundleServerPluginComponent.java index 84fe381..e9b82d2 100644 --- a/modules/enterprise/server/plugins/filetemplate-bundle/src/main/java/org/rhq/enterprise/server/plugins/filetemplate/BundleServerPluginComponent.java +++ b/modules/enterprise/server/plugins/filetemplate-bundle/src/main/java/org/rhq/enterprise/server/plugins/filetemplate/BundleServerPluginComponent.java @@ -52,6 +52,7 @@ import org.rhq.enterprise.server.plugin.pc.ControlResults; import org.rhq.enterprise.server.plugin.pc.ServerPluginComponent; import org.rhq.enterprise.server.plugin.pc.ServerPluginContext; import org.rhq.enterprise.server.plugin.pc.bundle.BundleServerPluginFacet; +import org.rhq.enterprise.server.plugin.pc.bundle.UnknownRecipeException;
/** * A bundle server-side plugin component that the server uses to process file template bundles. @@ -81,10 +82,17 @@ public class BundleServerPluginComponent implements ServerPluginComponent, Bundl log.debug("The filetemplate bundle plugin has been shut down!!! : " + this); }
- public RecipeParseResults parseRecipe(String recipe) throws Exception { + public RecipeParseResults parseRecipe(String recipe) throws UnknownRecipeException, Exception { RecipeParser parser = new RecipeParser(); RecipeContext recipeContext = new RecipeContext(recipe); - parser.parseRecipe(recipeContext); + try { + parser.parseRecipe(recipeContext); + } catch (Exception e) { + if (recipeContext.isUnknownRecipe()) { + throw new UnknownRecipeException("Not a valid file template recipe"); + } + throw e; + }
DeploymentProperties bundleMetadata = recipeContext.getDeploymentProperties();
@@ -112,7 +120,8 @@ public class BundleServerPluginComponent implements ServerPluginComponent, Bundl
}
- public BundleDistributionInfo processBundleDistributionFile(File distributionFile) throws Exception { + public BundleDistributionInfo processBundleDistributionFile(File distributionFile) throws UnknownRecipeException, + Exception { if (null == distributionFile) { throw new IllegalArgumentException("distributionFile == null"); } @@ -133,19 +142,14 @@ public class BundleServerPluginComponent implements ServerPluginComponent, Bundl // so see if we can parse it, but note that we don't even bother if its a really big file since // that's probably not a recipe file and we don't want to risk loading in a huge file in memory if (distributionFile.length() < 50000L) { - try { - byte[] content = StreamUtil.slurp(new FileInputStream(distributionFile)); - recipe = new String(content); - content = null; - recipeParseResults = parseRecipe(recipe); - } catch (Exception e) { - throw new IllegalArgumentException("Not a File Template Bundle"); // nope, its not a recipe file either - } + byte[] content = StreamUtil.slurp(new FileInputStream(distributionFile)); + recipe = new String(content); + content = null; + recipeParseResults = parseRecipe(recipe); // if it isn't a recipe either, this will throw UnknownRecipeException } else { - throw new IllegalArgumentException("Not a File Template Bundle"); + throw new UnknownRecipeException("Not a File Template Bundle"); } } else { - // if we parsed the recipe, then this is a distribution zip we can deal with, get the bundle file Map BundleFileVisitor bundleFileVisitor = new BundleFileVisitor(recipeParseResults.getBundleMetadata() .getBundleName(), recipeParseResults.getBundleFileNames()); @@ -211,11 +215,7 @@ public class BundleServerPluginComponent implements ServerPluginComponent, Bundl StreamUtil.copy(stream, out, false); this.recipe = new String(out.toByteArray()); out = null; // no need for this anymore, help out GC - try { - this.results = this.facet.parseRecipe(this.recipe); - } catch (Throwable t) { - this.results = null; - } + this.results = this.facet.parseRecipe(this.recipe); return false; // whether we parsed it or not, we found the file we are looking for so stop walking } return true;
commit a2f489fbff0f978b701b329a8ee2879d15f4a6f6 Author: John Mazzitelli mazz@redhat.com Date: Thu May 6 14:12:03 2010 -0400
no need for uploadDistroFormHandlersInstalled since the handlers are only ever installed immediately after the form is newly instantiated (i.e. we never add handlers to a single form instance more than once)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java index 499eac8..496268b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java @@ -56,7 +56,6 @@ public class BundleUploadDistroFileStep implements WizardStep { private TextItem urlTextItem; private BundleDistributionFileUploadForm uploadDistroForm; private DynamicCallbackForm recipeForm; - private boolean uploadDistroFormHandlersInstalled = false; private RadioGroupWithComponentsItem radioGroup;
public BundleUploadDistroFileStep(AbstractBundleCreateWizard bundleCreationWizard) { @@ -127,19 +126,16 @@ public class BundleUploadDistroFileStep implements WizardStep { private BundleDistributionFileUploadForm createUploadForm() { uploadDistroForm = new BundleDistributionFileUploadForm(false); uploadDistroForm.setPadding(20); - if (!uploadDistroFormHandlersInstalled) { - uploadDistroForm.addFormHandler(new DynamicFormHandler() { - public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) { - processUpload(); - } - }); - uploadDistroForm.addFormSubmitFailedHandler(new FormSubmitFailedHandler() { - public void onFormSubmitFailed(FormSubmitFailedEvent event) { - return; // the distro form component will log an error for us - } - }); - uploadDistroFormHandlersInstalled = true; - } + uploadDistroForm.addFormHandler(new DynamicFormHandler() { + public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) { + processUpload(); + } + }); + uploadDistroForm.addFormSubmitFailedHandler(new FormSubmitFailedHandler() { + public void onFormSubmitFailed(FormSubmitFailedEvent event) { + return; // the distro form component will log an error for us + } + }); return uploadDistroForm; }
commit db7e2c86decc1e6185dc899f9bd2d6a4d5ae693a Merge: 11ab7d4... dba73ab... Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 6 13:06:47 2010 -0400
Merge branch 'gwt' into gwt-jay
Conflicts: modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
diff --cc modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java index ae34ecc,c49000e..499eac8 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java @@@ -55,7 -55,7 +55,8 @@@ public class BundleUploadDistroFileSte private DynamicForm mainCanvasForm; private TextItem urlTextItem; private BundleDistributionFileUploadForm uploadDistroForm; + private DynamicCallbackForm recipeForm; + private boolean uploadDistroFormHandlersInstalled = false; private RadioGroupWithComponentsItem radioGroup;
public BundleUploadDistroFileStep(AbstractBundleCreateWizard bundleCreationWizard) { @@@ -79,19 -86,38 +87,25 @@@ }
public boolean nextPage() { - String selected = radioGroup.getSelected(); - - if ("URL".equals(selected)) { - processUrl(); - } else if ("Upload".equals(selected)) { - uploadDistroForm.submitForm(); - } else if ("Recipe".equals(selected)) { - processRecipe(); - } else { + if (wizard.getBundleVersion() == null) { + String selected = radioGroup.getSelected(); + + if ("URL".equals(selected)) { + processUrl(); + } else if ("Upload".equals(selected)) { - if (!uploadDistroFormHandlersInstalled) { - uploadDistroForm.addFormHandler(new DynamicFormHandler() { - public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) { - processUpload(); - } - }); - uploadDistroForm.addFormSubmitFailedHandler(new FormSubmitFailedHandler() { - public void onFormSubmitFailed(FormSubmitFailedEvent event) { - return; // the distro form component will log an error for us - } - }); - uploadDistroFormHandlersInstalled = true; - } + uploadDistroForm.submitForm(); + } else if ("Recipe".equals(selected)) { + processRecipe(); + } else { + return false; + } return false; + } else { + // there is already a bundle version, so we must have created it already + // and the user must have reached here after hitting the previous button earlier; + // just move to the next step to let the user peruse the wizard steps + return true; } - - return false; }
public String getName() { @@@ -113,17 -138,8 +127,19 @@@ private BundleDistributionFileUploadForm createUploadForm() { uploadDistroForm = new BundleDistributionFileUploadForm(false); uploadDistroForm.setPadding(20); - uploadDistroForm.addFormHandler(new DynamicFormHandler() { - public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) { - processUpload(); - } - }); - uploadDistroForm.addFormSubmitFailedHandler(new FormSubmitFailedHandler() { - public void onFormSubmitFailed(FormSubmitFailedEvent event) { - return; // the distro form component will log an error for us - } - }); - - uploadDistroForm.setWidth100(); - uploadDistroFormHandlersInstalled = false; ++ if (!uploadDistroFormHandlersInstalled) { ++ uploadDistroForm.addFormHandler(new DynamicFormHandler() { ++ public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) { ++ processUpload(); ++ } ++ }); ++ uploadDistroForm.addFormSubmitFailedHandler(new FormSubmitFailedHandler() { ++ public void onFormSubmitFailed(FormSubmitFailedEvent event) { ++ return; // the distro form component will log an error for us ++ } ++ }); ++ uploadDistroFormHandlersInstalled = true; ++ } return uploadDistroForm; }
commit 11ab7d48c7729221b25975e434aedfd5cec3c1ee Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 6 13:03:34 2010 -0400
Ensure gwt component that declares formHandler can ensure it exeutes before handlers added by users of the component.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java index ba8946c..ae34ecc 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java @@ -123,6 +123,7 @@ public class BundleUploadDistroFileStep implements WizardStep { return; // the distro form component will log an error for us } }); + return uploadDistroForm; }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java index cfa3603..9df0a6d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java @@ -146,7 +146,8 @@ public class BundleDistributionFileUploadForm extends DynamicCallbackForm {
setItems(sessionIdField, bundleUploadItem, uploadButton, icon);
- addFormHandler(new DynamicFormHandler() { + // make sure this handler is executed first + pushFormHandler(new DynamicFormHandler() { public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) { String results = event.getResults(); bundleVersionId = parseIdFromResponse(results); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/DynamicCallbackForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/DynamicCallbackForm.java index 102dfda..81f48fe 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/DynamicCallbackForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/DynamicCallbackForm.java @@ -51,26 +51,18 @@ public class DynamicCallbackForm extends DynamicForm implements DynamicCallbackF createFrame(); Document.get().getBody().appendChild(synthesizedFrame); // - // Hook up the underlying iframe's onLoad event when attached to the - // DOM. - // Making this connection only when attached avoids memory-leak - // issues. - // The FormPanel cannot use the built-in GWT event-handling - // mechanism - // because there is no standard onLoad event on iframes that works - // across - // browsers. + // Hook up the underlying iframe's onLoad event when attached to the DOM. + // Making this connection only when attached avoids memory-leak issues. + // The FormPanel cannot use the built-in GWT event-handling mechanism + // because there is no standard onLoad event on iframes that works across browsers. impl.hookEvents(synthesizedFrame, this); } }
private void createFrame() { - // Attach a hidden IFrame to the form. This is the target iframe to - // which - // the form will be submitted. We have to create the iframe using - // innerHTML, - // because setting an iframe's 'name' property dynamically doesn't work - // on + // Attach a hidden IFrame to the form. This is the target iframe to which + // the form will be submitted. We have to create the iframe using innerHTML, + // because setting an iframe's 'name' property dynamically doesn't work on // most browsers. Element dummy = Document.get().createDivElement(); dummy.setInnerHTML("<iframe src="javascript:''" name='" + frameName @@ -131,13 +123,20 @@ public class DynamicCallbackForm extends DynamicForm implements DynamicCallbackF super.destroy(); }
- public void addFormHandler(DynamicFormHandler handler) { + public synchronized void addFormHandler(DynamicFormHandler handler) { if (formHandlers == null) { formHandlers = new DynamicCallbackFormHandlerCollection(); } formHandlers.add(handler); }
+ public synchronized void pushFormHandler(DynamicFormHandler handler) { + if (formHandlers == null) { + formHandlers = new DynamicCallbackFormHandlerCollection(); + } + formHandlers.add(0, handler); + } + public void removeFormHandler(DynamicFormHandler handler) { if (formHandlers != null) { formHandlers.remove(handler);
commit dba73ab584afacbee4aa87ab3fafb81e899ccf3f Author: John Mazzitelli mazz@redhat.com Date: Thu May 6 12:50:55 2010 -0400
fix things so the previous button works properly. move the distro upload form callbacks inside nextPage because it seems like they have to be added then minor fix - get the subtitle to be the bundle name/version when its created
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java index eec703d..eac3c65 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java @@ -51,6 +51,9 @@ public abstract class AbstractBundleCreateWizard extends AbstractBundleWizard {
public void setBundleVersion(BundleVersion bv) { this.bundleVersion = bv; + if (bv != null) { + setSubtitle(bv.getName() + " (" + bv.getVersion() + ")"); + } }
public HashMap<String, Boolean> getAllBundleFilesStatus() { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java index dfb2099..2d767d3 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java @@ -65,9 +65,17 @@ public class BundleUploadDataStep implements WizardStep { public void onSuccess(HashMap<String, Boolean> result) { wizard.setAllBundleFilesStatus(result); prepareForm(mainLayout); + // If no files need to be uploaded, we could skip immediately to the next step. + // I commented this out because if we do this, it prohibits someone + // going from the summary step back (via previous button) to here + // without it immediately going forward again to summary. I think its + // OK for the user to see a page that says, "no more files need to be uploaded" + // and have to hit the Next button to see the summary. + /* if (noFilesNeedToBeUploaded) { wizard.getView().incrementStep(); } + */ }
public void onFailure(Throwable caught) { @@ -128,7 +136,7 @@ public class BundleUploadDataStep implements WizardStep { }
if (noFilesNeedToBeUploaded) { - HeaderLabel label = new HeaderLabel("No files need to be uploaded for this bundle"); + HeaderLabel label = new HeaderLabel("No additional files need to be uploaded for this bundle"); label.setWidth100(); mainLayout.addMember(label); uploadForms = null; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java index 3fe2e27..c49000e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java @@ -55,6 +55,7 @@ public class BundleUploadDistroFileStep implements WizardStep { private DynamicForm mainCanvasForm; private TextItem urlTextItem; private BundleDistributionFileUploadForm uploadDistroForm; + private boolean uploadDistroFormHandlersInstalled = false; private RadioGroupWithComponentsItem radioGroup;
public BundleUploadDistroFileStep(AbstractBundleCreateWizard bundleCreationWizard) { @@ -74,23 +75,49 @@ public class BundleUploadDistroFileStep implements WizardStep { radioGroup.setShowTitle(false); mainCanvasForm.setItems(radioGroup); } + + // If we've already created a bundle verison, don't allow the user to submit something else. + // The user must hit the cancel button and start over if they want to use a different bundle distribution file. + if (wizard.getBundleVersion() != null) { + mainCanvasForm.setDisabled(true); + } + return mainCanvasForm; }
public boolean nextPage() { - String selected = radioGroup.getSelected(); - - if ("URL".equals(selected)) { - processUrl(); - } else if ("Upload".equals(selected)) { - uploadDistroForm.submitForm(); - } else if ("Recipe".equals(selected)) { - processRecipe(); - } else { + if (wizard.getBundleVersion() == null) { + String selected = radioGroup.getSelected(); + + if ("URL".equals(selected)) { + processUrl(); + } else if ("Upload".equals(selected)) { + if (!uploadDistroFormHandlersInstalled) { + uploadDistroForm.addFormHandler(new DynamicFormHandler() { + public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) { + processUpload(); + } + }); + uploadDistroForm.addFormSubmitFailedHandler(new FormSubmitFailedHandler() { + public void onFormSubmitFailed(FormSubmitFailedEvent event) { + return; // the distro form component will log an error for us + } + }); + uploadDistroFormHandlersInstalled = true; + } + uploadDistroForm.submitForm(); + } else if ("Recipe".equals(selected)) { + processRecipe(); + } else { + return false; + } return false; + } else { + // there is already a bundle version, so we must have created it already + // and the user must have reached here after hitting the previous button earlier; + // just move to the next step to let the user peruse the wizard steps + return true; } - - return false; }
public String getName() { @@ -112,16 +139,7 @@ public class BundleUploadDistroFileStep implements WizardStep { uploadDistroForm = new BundleDistributionFileUploadForm(false); uploadDistroForm.setPadding(20); uploadDistroForm.setWidth100(); - uploadDistroForm.addFormHandler(new DynamicFormHandler() { - public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) { - processUpload(); - } - }); - uploadDistroForm.addFormSubmitFailedHandler(new FormSubmitFailedHandler() { - public void onFormSubmitFailed(FormSubmitFailedEvent event) { - return; // the distro form component will log an error for us - } - }); + uploadDistroFormHandlersInstalled = false; return uploadDistroForm; }
commit 7be8729c3f9a51be4c1769a77822622774c9e666 Merge: b0dfd8b... b724ee9... Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 6 12:26:08 2010 -0400
Merge branch 'gwt' into gwt-jay
Conflicts: modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java
diff --cc modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java index 88f7969,3fe2e27..ba8946c --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java @@@ -124,6 -111,17 +113,16 @@@ public class BundleUploadDistroFileSte private BundleDistributionFileUploadForm createUploadForm() { uploadDistroForm = new BundleDistributionFileUploadForm(false); uploadDistroForm.setPadding(20); - uploadDistroForm.setWidth100(); + uploadDistroForm.addFormHandler(new DynamicFormHandler() { + public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) { + processUpload(); + } + }); + uploadDistroForm.addFormSubmitFailedHandler(new FormSubmitFailedHandler() { + public void onFormSubmitFailed(FormSubmitFailedEvent event) { + return; // the distro form component will log an error for us + } + }); return uploadDistroForm; }
commit b0dfd8b28872971dba3c313a6f77db950c1b5c83 Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 6 12:21:39 2010 -0400
Provisioning CreateWizard Work - get recipe distro creation working
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java index beeb8f4..88f7969 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java @@ -55,6 +55,7 @@ public class BundleUploadDistroFileStep implements WizardStep { private DynamicForm mainCanvasForm; private TextItem urlTextItem; private BundleDistributionFileUploadForm uploadDistroForm; + private DynamicCallbackForm recipeForm; private RadioGroupWithComponentsItem radioGroup;
public BundleUploadDistroFileStep(AbstractBundleCreateWizard bundleCreationWizard) { @@ -112,6 +113,7 @@ public class BundleUploadDistroFileStep implements WizardStep { urlTextItem = new TextItem("url", "URL"); urlTextItem.setRequired(false); urlTextItem.setShowTitle(false); + urlTextItem.setWidth(400); DynamicForm urlForm = new DynamicForm(); urlForm.setPadding(20); urlForm.setWidth100(); @@ -122,15 +124,13 @@ public class BundleUploadDistroFileStep implements WizardStep { private BundleDistributionFileUploadForm createUploadForm() { uploadDistroForm = new BundleDistributionFileUploadForm(false); uploadDistroForm.setPadding(20); - uploadDistroForm.setWidth100(); return uploadDistroForm; }
private DynamicForm createRecipeForm() { - final DynamicCallbackForm form = new DynamicCallbackForm("recipeForm"); - form.setWidth100(); - form.setMargin(Integer.valueOf(20)); - form.setShowInlineErrors(false); + recipeForm = new DynamicCallbackForm("recipeForm"); + recipeForm.setMargin(Integer.valueOf(20)); + recipeForm.setShowInlineErrors(false);
final LinkItem showUpload = new LinkItem("recipeUploadLink"); showUpload.setValue("Click To Upload A Recipe File"); @@ -145,8 +145,8 @@ public class BundleUploadDistroFileStep implements WizardStep {
showUpload.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { - form.hideItem(showUpload.getName()); - form.showItem(upload.getName()); + recipeForm.hideItem(showUpload.getName()); + recipeForm.showItem(upload.getName()); } });
@@ -154,7 +154,7 @@ public class BundleUploadDistroFileStep implements WizardStep { recipe.setShowTitle(false); recipe.setRequired(false); recipe.setColSpan(4); - recipe.setWidth("*"); + recipe.setWidth(400); recipe.setHeight(150);
textFileRetrieverForm.addFormHandler(new DynamicFormHandler() { @@ -162,14 +162,14 @@ public class BundleUploadDistroFileStep implements WizardStep { wizard.setRecipe(event.getResults()); recipe.setValue(event.getResults()); textFileRetrieverForm.retrievalStatus(true); - form.showItem(showUpload.getName()); - form.hideItem(upload.getName()); + recipeForm.showItem(showUpload.getName()); + recipeForm.hideItem(upload.getName()); } });
- form.setItems(showUpload, upload, recipe); + recipeForm.setItems(showUpload, upload, recipe);
- return form; + return recipeForm; }
private void processUrl() { @@ -226,6 +226,7 @@ public class BundleUploadDistroFileStep implements WizardStep { }
private void processRecipe() { + this.wizard.setRecipe((String) this.recipeForm.getItem("recipeText").getValue()); BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); bundleServer.createBundleVersionViaRecipe(this.wizard.getRecipe(), new AsyncCallback<BundleVersion>() { public void onSuccess(BundleVersion result) {
commit b724ee97df3c1faa589de40ae9f67c37acdd69ad Author: John Mazzitelli mazz@redhat.com Date: Thu May 6 11:26:29 2010 -0400
only add the handler once, at create time. nextPage() may be called more than one time which would add multiple handlers
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java index beeb8f4..3fe2e27 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java @@ -83,18 +83,7 @@ public class BundleUploadDistroFileStep implements WizardStep { if ("URL".equals(selected)) { processUrl(); } else if ("Upload".equals(selected)) { - uploadDistroForm.addFormHandler(new DynamicFormHandler() { - public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) { - processUpload(); - } - }); - uploadDistroForm.addFormSubmitFailedHandler(new FormSubmitFailedHandler() { - public void onFormSubmitFailed(FormSubmitFailedEvent event) { - return; - } - }); uploadDistroForm.submitForm(); - } else if ("Recipe".equals(selected)) { processRecipe(); } else { @@ -123,6 +112,16 @@ public class BundleUploadDistroFileStep implements WizardStep { uploadDistroForm = new BundleDistributionFileUploadForm(false); uploadDistroForm.setPadding(20); uploadDistroForm.setWidth100(); + uploadDistroForm.addFormHandler(new DynamicFormHandler() { + public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) { + processUpload(); + } + }); + uploadDistroForm.addFormSubmitFailedHandler(new FormSubmitFailedHandler() { + public void onFormSubmitFailed(FormSubmitFailedEvent event) { + return; // the distro form component will log an error for us + } + }); return uploadDistroForm; }
commit 04913b7602c2bc5ca98877868bcc8cfd24fa3831 Author: John Mazzitelli mazz@redhat.com Date: Thu May 6 11:03:21 2010 -0400
minor refactoring to remove unused code and rearrange existing code
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java index e4a29f7..dfb2099 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java @@ -114,29 +114,24 @@ public class BundleUploadDataStep implements WizardStep { }
private void prepareForm(VLayout mainLayout) { - // if there are no files to upload, immediately skip this step + final HashMap<String, Boolean> allFilesStatus = wizard.getAllBundleFilesStatus(); noFilesNeedToBeUploaded = Boolean.TRUE;
- if (null == allFilesStatus || allFilesStatus.isEmpty()) { - return; - } - for (Map.Entry<String, Boolean> entry : allFilesStatus.entrySet()) { - if (!entry.getValue()) { - noFilesNeedToBeUploaded = Boolean.FALSE; - break; + if (null != allFilesStatus && !allFilesStatus.isEmpty()) { + for (Map.Entry<String, Boolean> entry : allFilesStatus.entrySet()) { + if (!entry.getValue()) { + noFilesNeedToBeUploaded = Boolean.FALSE; + break; + } } } - if (noFilesNeedToBeUploaded) { - return; - }
- if (allFilesStatus != null && allFilesStatus.size() == 0) { + if (noFilesNeedToBeUploaded) { HeaderLabel label = new HeaderLabel("No files need to be uploaded for this bundle"); label.setWidth100(); mainLayout.addMember(label); uploadForms = null; - noFilesNeedToBeUploaded = Boolean.TRUE; return; }
commit 7d86d0c11bed4ac4147351533a13dc8fa157fc8a Author: John Mazzitelli mazz@redhat.com Date: Thu May 6 10:43:09 2010 -0400
no need for this "New Version" button - the "New" button allows one to create a new one
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleCreateWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleCreateWizard.java index 00769d4..238ca4b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleCreateWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleCreateWizard.java @@ -30,8 +30,6 @@ public class BundleCreateWizard extends AbstractBundleCreateWizard {
ArrayList<WizardStep> steps = new ArrayList<WizardStep>(); steps.add(new BundleUploadDistroFileStep(this)); - //steps.add(new BundleInfoStep(this)); - //steps.add(new BundleUploadRecipeStep(this)); steps.add(new BundleUploadDataStep(this)); steps.add(new BundleSummaryStep(this)); setSteps(steps); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java index c68ddac..92707b2 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java @@ -26,14 +26,11 @@ import com.smartgwt.client.widgets.grid.ListGridRecord; import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.bundle.Bundle; -import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.bundle.composite.BundleWithLatestVersionComposite; import org.rhq.core.domain.criteria.BundleCriteria; -import org.rhq.core.domain.criteria.BundleVersionCriteria; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.bundle.create.BundleCreateWizard; -import org.rhq.enterprise.gui.coregui.client.bundle.create.BundleUpdateWizard; import org.rhq.enterprise.gui.coregui.client.bundle.deploy.BundleDeployWizard; import org.rhq.enterprise.gui.coregui.client.components.table.Table; import org.rhq.enterprise.gui.coregui.client.components.table.TableAction; @@ -103,35 +100,6 @@ public class BundlesListView extends VLayout { } });
- table.addTableAction("New Version", Table.SelectionEnablement.SINGLE, null, new TableAction() { - public void executeAction(ListGridRecord[] selection) { - BundlesWithLatestVersionDataSource ds = (BundlesWithLatestVersionDataSource) table.getDataSource(); - final BundleWithLatestVersionComposite object = ds.copyValues(selection[0]); - BundleVersionCriteria bvc = new BundleVersionCriteria(); - bvc.addFilterBundleId(object.getBundleId()); - bvc.addFilterVersion(object.getLatestVersion()); - BundleGWTServiceAsync bundleManager = GWTServiceLookup.getBundleService(); - bundleManager.findBundleVersionsByCriteria(bvc, new AsyncCallback<PageList<BundleVersion>>() { - public void onSuccess(PageList<BundleVersion> result) { - if (result == null || result.size() != 1) { - CoreGUI.getMessageCenter().notify( - new Message("Failed to get last bundle version [" + object.getLatestVersion() + "]", - Severity.Error)); - return; - } - - BundleUpdateWizard bundleUpdateWizard = new BundleUpdateWizard(result.get(0)); - bundleUpdateWizard.startBundleWizard(); - } - - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError( - "Failed to load last bundle version [" + object.getLatestVersion() + "]", caught); - } - }); - } - }); - // can change this back to SINGLE selection when we feel like it. currently allowing the wizard to // select the bundle. table.addTableAction("Deploy", Table.SelectionEnablement.ALWAYS, null, new TableAction() {
commit ab592af01dc7602b778ec46b4f8b3bb719a9701f Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 6 10:08:28 2010 -0400
Provisioning CreateWizard Work - ensure FilUpload of Distro loads BundleVersion with Bundle info for Summary display
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java index bd23710..beeb8f4 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java @@ -199,6 +199,7 @@ public class BundleUploadDistroFileStep implements WizardStep { int bvId = uploadDistroForm.getBundleVersionId(); BundleVersionCriteria criteria = new BundleVersionCriteria(); criteria.addFilterId(bvId); + criteria.fetchBundle(true); BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); bundleServer.findBundleVersionsByCriteria(criteria, new AsyncCallback<PageList<BundleVersion>>() { public void onSuccess(PageList<BundleVersion> result) {
commit 6b2008149907d7ff101184033e44a22c0af717d0 Merge: e036122... 7f890cc... Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 6 10:03:47 2010 -0400
Merge branch 'gwt' into gwt-jay
commit e0361225411c33e6d7a1ea650ac4f58ad10dd983 Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu May 6 10:02:40 2010 -0400
Provisioning CreateWizard Work - removed obsolete fields in Abstract wizard - removed obsolete wizard (step) classes - changed Summary step to get info via the BundleVersion - now byasses BundleUploadDataStep if all files are provided in distro - upload distro logic worked on --- ensure upload completes prior to processing --- fixed issue with hidden BundleVersionId - added message only constructor for ErrorHandler - fixed decl of BundleDistributionFileUploadServlet
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java index 60b4b4b..dd9e766 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java @@ -1,10 +1,5 @@ package org.rhq.enterprise.gui.coregui.client;
-import java.util.Arrays; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; - import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; import com.google.gwt.event.logical.shared.ValueChangeEvent; @@ -58,6 +53,7 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
private static MessageCenter messageCenter;
+ @SuppressWarnings("unused") private static Canvas content;
private RootCanvas rootCanvas; @@ -88,9 +84,8 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
messageCenter = new MessageCenter();
- RequestBuilder b = new RequestBuilder(RequestBuilder.GET, - "/j_security_check.do?j_username=rhqadmin&j_password=rhqadmin"); + "/j_security_check.do?j_username=rhqadmin&j_password=rhqadmin"); try { b.setCallback(new RequestCallback() { public void onResponseReceived(Request request, Response response) { @@ -106,7 +101,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. }
- SubjectGWTServiceAsync subjectService = SubjectGWTServiceAsync.Util.getInstance();
subjectService.login("rhqadmin", "rhqadmin", new AsyncCallback<Subject>() { @@ -163,7 +157,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { History.fireCurrentHistoryState(); }
- public void onValueChange(ValueChangeEvent<String> stringValueChangeEvent) { System.out.println("Handling history event: " + stringValueChangeEvent.getValue()); currentViewPath = new ViewPath(stringValueChangeEvent.getValue()); @@ -172,7 +165,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
}
- public Canvas createContent(String breadcrumbName) { Canvas canvas;
@@ -202,7 +194,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { return messageCenter; }
- public static ErrorHandler getErrorHandler() { return errorHandler; } @@ -215,7 +206,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { return userPreferences; }
- public static void setSessionSubject(Subject subject) { GWTServiceLookup.registerSession(String.valueOf(subject.getSessionId()));
@@ -248,7 +238,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { breadCrumbTrailPane.refresh(currentViewPath); }
- private class RootCanvas extends VLayout implements BookmarkableView {
ViewId currentViewId; @@ -259,7 +248,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { setHeight100(); }
- public void renderView(ViewPath viewPath) { if (viewPath.isEnd()) { // default view diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java index c33e4d5..eec703d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java @@ -22,7 +22,6 @@ import java.util.HashMap;
import com.google.gwt.user.client.rpc.AsyncCallback;
-import org.rhq.core.domain.bundle.BundleType; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.bundle.AbstractBundleWizard; @@ -34,46 +33,10 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity; public abstract class AbstractBundleCreateWizard extends AbstractBundleWizard {
// the things we build up in the wizard - private BundleType bundleType; - private String bundleName; - private String bundleVersionString; - private String bundleDescription; private String recipe; private BundleVersion bundleVersion; private HashMap<String, Boolean> allBundleFilesStatus; // bundle file names with their upload status (true=they were uploaded)
- public BundleType getBundleType() { - return bundleType; - } - - public void setBundleType(BundleType bundleType) { - this.bundleType = bundleType; - } - - public String getBundleName() { - return bundleName; - } - - public void setBundleName(String bundleName) { - this.bundleName = bundleName; - } - - public String getBundleVersionString() { - return bundleVersionString; - } - - public void setBundleVersionString(String bundleVersionString) { - this.bundleVersionString = bundleVersionString; - } - - public String getBundleDescription() { - return bundleDescription; - } - - public void setBundleDescription(String desc) { - this.bundleDescription = desc; - } - public String getRecipe() { return recipe; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleInfoStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleInfoStep.java deleted file mode 100644 index 58c4e66..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleInfoStep.java +++ /dev/null @@ -1,208 +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.bundle.create; - -import java.util.ArrayList; -import java.util.HashMap; - -import com.google.gwt.user.client.rpc.AsyncCallback; -import com.smartgwt.client.types.Alignment; -import com.smartgwt.client.types.TitleOrientation; -import com.smartgwt.client.widgets.Canvas; -import com.smartgwt.client.widgets.form.DynamicForm; -import com.smartgwt.client.widgets.form.fields.SelectItem; -import com.smartgwt.client.widgets.form.fields.TextAreaItem; -import com.smartgwt.client.widgets.form.fields.TextItem; -import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; -import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; - -import org.rhq.core.domain.bundle.BundleType; -import org.rhq.core.domain.bundle.BundleVersion; -import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; -import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; -import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; -import org.rhq.enterprise.gui.coregui.client.util.message.Message; -import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity; - -/** - * @author John Mazzitelli - */ -public class BundleInfoStep implements WizardStep { - - private DynamicForm form; - private final AbstractBundleCreateWizard wizard; - - private final BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); - private final HashMap<String, BundleType> knownBundleTypes = new HashMap<String, BundleType>(); - - private TextItem nameTextItem; - private TextItem versionTextItem; - private TextAreaItem descriptionTextAreaItem; - private SelectItem bundleTypeDropDownMenu; - - public BundleInfoStep(AbstractBundleCreateWizard bundleCreationWizard) { - this.wizard = bundleCreationWizard; - } - - public Canvas getCanvas() { - if (form == null) { - form = new DynamicForm(); - form.setPadding(20); - form.setWidth100(); - form.setNumCols(2); - - bundleTypeDropDownMenu = new SelectItem("bundleTypeDropDownMenu", "Bundle Type"); - bundleTypeDropDownMenu.setVisible(false); - bundleTypeDropDownMenu.setDisabled(true); - bundleTypeDropDownMenu.setTitleAlign(Alignment.LEFT); - bundleTypeDropDownMenu.setAllowEmptyValue(false); - bundleTypeDropDownMenu.setMultiple(false); - bundleTypeDropDownMenu.addChangedHandler(new ChangedHandler() { - public void onChanged(ChangedEvent event) { - BundleType bundleType = knownBundleTypes.get(event.getValue()); - wizard.setBundleType(bundleType); - } - }); - - nameTextItem = new TextItem("name", "Name"); - nameTextItem.setRequired(true); - nameTextItem.setTitleAlign(Alignment.LEFT); - nameTextItem.addChangedHandler(new ChangedHandler() { - public void onChanged(ChangedEvent event) { - String value = getValueAsString(event.getValue()); - wizard.setSubtitle(value); - } - }); - - final TextItem previousVersionTextItem = new TextItem("previousVersion", "Previous Version"); - previousVersionTextItem.setTitleAlign(Alignment.LEFT); - - versionTextItem = new TextItem("version"); - versionTextItem.setRequired(true); - versionTextItem.setTitleAlign(Alignment.LEFT); - - descriptionTextAreaItem = new TextAreaItem("description", "Description"); - descriptionTextAreaItem.setTitleOrientation(TitleOrientation.TOP); - descriptionTextAreaItem.setColSpan(2); - descriptionTextAreaItem.setWidth(300); - - form.setItems(bundleTypeDropDownMenu, nameTextItem, previousVersionTextItem, versionTextItem, - descriptionTextAreaItem); - - BundleVersion initialBundleVersion = wizard.getBundleVersion(); - if (initialBundleVersion != null) { - nameTextItem.setValue(initialBundleVersion.getName()); - nameTextItem.setDisabled(true); - wizard.setSubtitle(initialBundleVersion.getName()); - - previousVersionTextItem.setValue(initialBundleVersion.getVersion()); - previousVersionTextItem.setDisabled(true); - - versionTextItem.setTitle("New Version"); - String versionSuggestion = autoIncrementVersion(initialBundleVersion.getVersion()); - versionTextItem.setValue(versionSuggestion); - - descriptionTextAreaItem.setValue(initialBundleVersion.getDescription()); - - } else { - previousVersionTextItem.setVisible(Boolean.FALSE); - versionTextItem.setTitle("Initial Version"); - versionTextItem.setValue("1.0"); - } - - if (wizard.getBundleType() == null) { - bundleServer.getAllBundleTypes(new AsyncCallback<ArrayList<BundleType>>() { - public void onSuccess(ArrayList<BundleType> result) { - if (result == null || result.size() == 0) { - wizard.setBundleType(null); - CoreGUI.getMessageCenter().notify( - new Message("No bundle types are supported", Severity.Error)); - return; - } - - for (BundleType bundleType : result) { - knownBundleTypes.put(bundleType.getName(), bundleType); - if (wizard.getBundleType() == null) { - wizard.setBundleType(bundleType); - bundleTypeDropDownMenu.setDefaultValue(bundleType.getName()); - bundleTypeDropDownMenu.setValue(bundleType.getName()); - } - } - bundleTypeDropDownMenu.setValueMap(knownBundleTypes.keySet().toArray(new String[0])); - bundleTypeDropDownMenu.setDisabled(false); - // don't bother showing the menu if there is only one item - if (knownBundleTypes.size() > 1) { - bundleTypeDropDownMenu.setVisible(true); - bundleTypeDropDownMenu.show(); // in case we've already been rendered - } - } - - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("No bundle types available", caught); - } - }); - } - - } else { - if (wizard.getBundleVersion() != null) { - // we are traversing back to this step - don't allow changes if we've already created the bundle version - bundleTypeDropDownMenu.setDisabled(true); - nameTextItem.setDisabled(true); - versionTextItem.setDisabled(true); - descriptionTextAreaItem.setDisabled(true); - } - } - - return form; - } - - public boolean nextPage() { - if (form.validate() && this.wizard.getBundleType() != null) { - wizard.setBundleName(getValueAsString(nameTextItem.getValue())); - wizard.setBundleVersionString(getValueAsString(versionTextItem.getValue())); - wizard.setBundleDescription(getValueAsString(descriptionTextAreaItem.getValue())); - return true; - } - return false; - } - - public String getName() { - return "Provide Bundle Information"; - } - - private String autoIncrementVersion(String oldVersion) { - String newVersion = "1.0"; - if (oldVersion != null && oldVersion.length() != 0) { - String[] parts = oldVersion.split("[^a-zA-Z0-9]"); - String lastPart = parts[parts.length - 1]; - try { - int lastNumber = Integer.parseInt(lastPart); - newVersion = oldVersion.substring(0, oldVersion.length() - lastPart.length()) + (lastNumber + 1); - } catch (NumberFormatException nfe) { - newVersion = oldVersion + ".1"; - } - } - return newVersion; - } - - private String getValueAsString(Object obj) { - return (obj != null) ? obj.toString() : ""; - } -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleSummaryStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleSummaryStep.java index c010952..d2507dd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleSummaryStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleSummaryStep.java @@ -47,26 +47,26 @@ public class BundleSummaryStep implements WizardStep { bundleTypeLabel.setTitleAlign(Alignment.LEFT); bundleTypeLabel.setAlign(Alignment.LEFT); bundleTypeLabel.setWrap(false); - bundleTypeLabel.setValue(wizard.getBundleType().getName()); + bundleTypeLabel.setValue(wizard.getBundleVersion().getBundle().getBundleType().getName());
StaticTextItem nameLabel = new StaticTextItem("name", "Name"); nameLabel.setTitleAlign(Alignment.LEFT); nameLabel.setAlign(Alignment.LEFT); nameLabel.setWrap(false); - nameLabel.setValue(wizard.getBundleName()); + nameLabel.setValue(wizard.getBundleVersion().getBundle().getName());
StaticTextItem versionLabel = new StaticTextItem("Version"); versionLabel.setTitleAlign(Alignment.LEFT); versionLabel.setTitleAlign(Alignment.LEFT); versionLabel.setAlign(Alignment.LEFT); versionLabel.setWrap(false); - versionLabel.setValue(wizard.getBundleVersionString()); + versionLabel.setValue(wizard.getBundleVersion().getVersion());
StaticTextItem descriptionLabel = new StaticTextItem("Description"); descriptionLabel.setTitleAlign(Alignment.LEFT); descriptionLabel.setAlign(Alignment.LEFT); descriptionLabel.setWrap(false); - descriptionLabel.setValue(wizard.getBundleDescription()); + descriptionLabel.setValue(wizard.getBundleVersion().getBundle().getDescription());
StaticTextItem filesLabel = new StaticTextItem("Files"); filesLabel.setTitleVAlign(VerticalAlignment.TOP); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUpdateWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUpdateWizard.java deleted file mode 100644 index 95152bc..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUpdateWizard.java +++ /dev/null @@ -1,40 +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.bundle.create; - -import java.util.ArrayList; - -import org.rhq.core.domain.bundle.BundleVersion; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; - -public class BundleUpdateWizard extends AbstractBundleCreateWizard { - - public BundleUpdateWizard(BundleVersion bv) { - setWindowTitle("Bundle Update Wizard"); - setTitle("Update a Bundle"); - setSubtitle(bv.getName()); - setBundleVersion(bv); - - ArrayList<WizardStep> steps = new ArrayList<WizardStep>(); - steps.add(new BundleInfoStep(this)); - steps.add(new BundleUploadRecipeStep(this)); - steps.add(new BundleUploadDataStep(this)); - setSteps(steps); - } -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java index 7baec2f..e4a29f7 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java @@ -65,6 +65,9 @@ public class BundleUploadDataStep implements WizardStep { public void onSuccess(HashMap<String, Boolean> result) { wizard.setAllBundleFilesStatus(result); prepareForm(mainLayout); + if (noFilesNeedToBeUploaded) { + wizard.getView().incrementStep(); + } }
public void onFailure(Throwable caught) { @@ -111,8 +114,22 @@ public class BundleUploadDataStep implements WizardStep { }
private void prepareForm(VLayout mainLayout) { - // if there are no files to upload, immediately skip this step + // if there are no files to upload, immediately skip this step final HashMap<String, Boolean> allFilesStatus = wizard.getAllBundleFilesStatus(); + noFilesNeedToBeUploaded = Boolean.TRUE; + + if (null == allFilesStatus || allFilesStatus.isEmpty()) { + return; + } + for (Map.Entry<String, Boolean> entry : allFilesStatus.entrySet()) { + if (!entry.getValue()) { + noFilesNeedToBeUploaded = Boolean.FALSE; + break; + } + } + if (noFilesNeedToBeUploaded) { + return; + }
if (allFilesStatus != null && allFilesStatus.size() == 0) { HeaderLabel label = new HeaderLabel("No files need to be uploaded for this bundle"); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java index 33f06d4..bd23710 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java @@ -23,6 +23,8 @@ import java.util.LinkedHashMap; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.events.FormSubmitFailedEvent; +import com.smartgwt.client.widgets.form.events.FormSubmitFailedHandler; import com.smartgwt.client.widgets.form.fields.CanvasItem; import com.smartgwt.client.widgets.form.fields.LinkItem; import com.smartgwt.client.widgets.form.fields.TextAreaItem; @@ -49,9 +51,7 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity; public class BundleUploadDistroFileStep implements WizardStep {
private final AbstractBundleCreateWizard wizard; - private final BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService();
- private BundleDistributionFileUploadForm distroUploadForm; private DynamicForm mainCanvasForm; private TextItem urlTextItem; private BundleDistributionFileUploadForm uploadDistroForm; @@ -81,11 +81,22 @@ public class BundleUploadDistroFileStep implements WizardStep { String selected = radioGroup.getSelected();
if ("URL".equals(selected)) { - this.processUrl(); + processUrl(); } else if ("Upload".equals(selected)) { - this.processUpload(); + uploadDistroForm.addFormHandler(new DynamicFormHandler() { + public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) { + processUpload(); + } + }); + uploadDistroForm.addFormSubmitFailedHandler(new FormSubmitFailedHandler() { + public void onFormSubmitFailed(FormSubmitFailedEvent event) { + return; + } + }); + uploadDistroForm.submitForm(); + } else if ("Recipe".equals(selected)) { - this.processRecipe(); + processRecipe(); } else { return false; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java index 6625904..cfa3603 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java @@ -54,7 +54,7 @@ public class BundleDistributionFileUploadForm extends DynamicCallbackForm { this.showUploadButton = showUploadButton;
setEncoding(Encoding.MULTIPART); - setAction(GWT.getModuleBaseURL() + "/BundleDistributionFileUploadServlet"); + setAction(GWT.getModuleBaseURL() + "BundleDistributionFileUploadServlet");
iconLoading = new FormItemIcon(); iconLoading.setSrc("ajax-loader.gif"); @@ -149,7 +149,7 @@ public class BundleDistributionFileUploadForm extends DynamicCallbackForm { addFormHandler(new DynamicFormHandler() { public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) { String results = event.getResults(); - int bundleVersionId = parseIdFromResponse(results); + bundleVersionId = parseIdFromResponse(results); if (bundleVersionId > 0) { uploadResults = Boolean.TRUE; icon.setIcons(iconGreen); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java index b2d5009..d842ae2 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java @@ -30,9 +30,18 @@ public class ErrorHandler {
private ArrayList<String> errors = new ArrayList<String>();
+ public void handleError(String message) { + + // SC.say(message); + + CoreGUI.getMessageCenter().notify(new Message(message, Message.Severity.Error)); + + this.errors.add(message); + } + public void handleError(String message, Throwable t) {
-// SC.say(message); + // SC.say(message);
CoreGUI.getMessageCenter().notify(new Message(message, t.toString(), Message.Severity.Error));
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml index 87b0f0e..9c7e0bc 100644 --- a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml +++ b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml @@ -60,8 +60,8 @@ <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.BundleFileUploadServlet</servlet-class> </servlet> <servlet> - <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI UberBundleFileUploadServlet</servlet-name> - <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.UberBundleFileUploadServlet</servlet-class> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI BundleDistributionFileUploadServlet</servlet-name> + <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.BundleDistributionFileUploadServlet</servlet-class> </servlet>
<servlet> @@ -134,8 +134,8 @@ <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/BundleFileUploadServlet</url-pattern> </servlet-mapping> <servlet-mapping> - <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI UberBundleFileUploadServlet</servlet-name> - <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/UberBundleFileUploadServlet</url-pattern> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI BundleDistributionFileUploadServlet</servlet-name> + <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/BundleDistributionFileUploadServlet</url-pattern> </servlet-mapping>
<servlet-mapping>
commit 7f890cc1f27ff4207d9dddd092884ffa45dd5d01 Author: John Mazzitelli mazz@redhat.com Date: Thu May 6 09:46:58 2010 -0400
a component that provides a drop down for bundle type - if only 1 type is deployed, this drop down is hidden from the user; only if more than 1 bundle type exists will this drop down be visible.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleTypeDropDownSelectItem.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleTypeDropDownSelectItem.java new file mode 100644 index 0000000..540d13e --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleTypeDropDownSelectItem.java @@ -0,0 +1,103 @@ +/* + * 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.bundle.create; + +import java.util.ArrayList; +import java.util.HashMap; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.types.Alignment; +import com.smartgwt.client.widgets.form.fields.SelectItem; +import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; +import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; + +import org.rhq.core.domain.bundle.BundleType; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.util.message.Message; +import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity; + +/** + * Provides a drop down menu that allows one to select a bundle type. + */ +public class BundleTypeDropDownSelectItem extends SelectItem { + + private final HashMap<String, BundleType> knownBundleTypes = new HashMap<String, BundleType>(); + private BundleType selected = null; + + public BundleTypeDropDownSelectItem(String name) { + super(name, "Bundle Type"); + buildDropDownMenu(); + } + + public BundleType getSelected() { + return selected; + } + + private void setSelected(BundleType selected) { + this.selected = selected; + } + + private void buildDropDownMenu() { + setVisible(false); + setDisabled(true); + setTitleAlign(Alignment.LEFT); + setAllowEmptyValue(false); + setMultiple(false); + + addChangedHandler(new ChangedHandler() { + public void onChanged(ChangedEvent event) { + BundleType bundleType = knownBundleTypes.get(event.getValue()); + setSelected(bundleType); + } + }); + + BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); + bundleServer.getAllBundleTypes(new AsyncCallback<ArrayList<BundleType>>() { + public void onSuccess(ArrayList<BundleType> result) { + if (result == null || result.size() == 0) { + setSelected(null); + CoreGUI.getMessageCenter().notify(new Message("No bundle types are supported", Severity.Error)); + return; + } + + for (BundleType bundleType : result) { + knownBundleTypes.put(bundleType.getName(), bundleType); + if (getSelected() == null) { + setSelected(bundleType); + setDefaultValue(bundleType.getName()); + setValue(bundleType.getName()); + } + } + setValueMap(knownBundleTypes.keySet().toArray(new String[0])); + setDisabled(false); + // don't bother showing the menu if there is only one item + if (knownBundleTypes.size() > 1) { + setVisible(true); + show(); // in case we've already been rendered + } + } + + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("No bundle types available", caught); + } + }); + } +}
commit df782e1d4932e14dff365b40243cde406d3979dc Author: John Mazzitelli mazz@redhat.com Date: Wed May 5 17:33:34 2010 -0400
use a new DeploymentData API and specify raw files that need to be replaced, rather than using a map that maps raw files to regex (which doesn't makes sense to do and hence why I change the map of raw file regexs to a set of raw files
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/DeployTask.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/DeployTask.java index 8258e52..1f8b5c3 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/DeployTask.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/DeployTask.java @@ -40,6 +40,7 @@ import org.rhq.core.system.SystemInfoFactory; import org.rhq.core.template.TemplateEngine; import org.rhq.core.util.updater.DeployDifferences; import org.rhq.core.util.updater.Deployer; +import org.rhq.core.util.updater.DeploymentData; import org.rhq.core.util.updater.DeploymentProperties;
/** @@ -78,15 +79,14 @@ public class DeployTask extends AbstractBundleTask { }
// for now, apply the pattern to all files in the deployment - Map<File, Pattern> fileReplacePatterns = new HashMap<File, Pattern>(); - for (File file : this.files.keySet()) { - fileReplacePatterns.put(file, this.replacePattern); - } + Map<File, Pattern> archiveReplacePatterns = new HashMap<File, Pattern>(); for (File file : this.archives) { - fileReplacePatterns.put(file, this.replacePattern); + archiveReplacePatterns.put(file, this.replacePattern); } - Deployer deployer = new Deployer(deploymentProps, this.archives, this.files, deployDir, fileReplacePatterns, - templateEngine, this.ignorePattern); + Set<File> rawFilesToReplace = this.files.keySet(); // TODO: CHANGE ME! only replace those raw files marked as "replace=true" + DeploymentData dd = new DeploymentData(deploymentProps, this.archives, this.files, deployDir, + archiveReplacePatterns, rawFilesToReplace, templateEngine, this.ignorePattern); + Deployer deployer = new Deployer(dd); try { DeployDifferences diffs = getProject().getDeployDifferences(); deployer.deploy(diffs); diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java index 752ac00..b16380b 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java @@ -37,7 +37,6 @@ import java.util.regex.Pattern; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
-import org.rhq.core.template.TemplateEngine; import org.rhq.core.util.MessageDigestGenerator; import org.rhq.core.util.ZipUtil; import org.rhq.core.util.file.FileUtil; @@ -89,69 +88,21 @@ import org.rhq.core.util.stream.StreamUtil; public class Deployer { private final Log log = LogFactory.getLog(Deployer.class);
- private final DeploymentProperties deploymentProps; - private final Set<File> zipFiles; - private final Map<File, File> rawFiles; - private final File destDir; - private final Map<File, Pattern> filesToRealizeRegex; - private final TemplateEngine templateEngine; - private final Pattern ignoreRegex; + private final DeploymentData deploymentData; private final DeploymentsMetadata deploymentsMetadata;
/** - * Constructors that prepares this object to deploy the given archive's content to the destination directory. + * Constructors that prepares this object to deploy content to a destination on the local file system. * - * @param deploymentProps metadata about this deployment - * @param zipFiles the archives containing the content to be deployed - * @param rawFiles files that are to be copied into the destination directory - the keys are the current - * locations of the files, the values are where the files should be copied (the values may be relative - * in which case they are relative to destDir and can have subdirectories and/or a different filename - * than what the file is named currently) - * @param destDir the root directory where the content is to be deployed - * @param filesToRealizeRegex the patterns of files (whose paths are relative to destDir) that - * must have replacement variables within them replaced with values - * obtained via the given template engine. The key is the name of the zip or raw - * file that the regex must be applied to. - * @param templateEngine if one or more filesToRealize are specified, this template engine is used to determine - * the values that should replace all replacement variables found in those files - * @param ignoreRegex the files/directories to ignore when updating an existing deployment + * @param deploymentData the data needed to know what to do for this deployment */ - public Deployer(DeploymentProperties deploymentProps, Set<File> zipFiles, Map<File, File> rawFiles, File destDir, - Map<File, Pattern> filesToRealizeRegex, TemplateEngine templateEngine, Pattern ignoreRegex) { - - if (deploymentProps == null) { - throw new IllegalArgumentException("deploymentProps == null"); - } - if (destDir == null) { - throw new IllegalArgumentException("destDir == null"); - } - - if (zipFiles == null) { - zipFiles = new HashSet<File>(); - } - if (rawFiles == null) { - rawFiles = new HashMap<File, File>(); - } - if ((zipFiles.size() == 0) && (rawFiles.size() == 0)) { - throw new IllegalArgumentException("zipFiles/rawFiles are empty - nothing to do"); + public Deployer(DeploymentData deploymentData) { + if (deploymentData == null) { + throw new IllegalArgumentException("deploymentData == null"); }
- this.deploymentProps = deploymentProps; - this.zipFiles = zipFiles; - this.rawFiles = rawFiles; - this.destDir = destDir; - this.ignoreRegex = ignoreRegex; - - if (filesToRealizeRegex == null || templateEngine == null) { - // we don't need these if there is nothing to realize or we have no template engine to obtain replacement values - this.filesToRealizeRegex = null; - this.templateEngine = null; - } else { - this.filesToRealizeRegex = filesToRealizeRegex; - this.templateEngine = templateEngine; - } - - this.deploymentsMetadata = new DeploymentsMetadata(destDir); + this.deploymentData = deploymentData; + this.deploymentsMetadata = new DeploymentsMetadata(deploymentData.getDestinationDir()); return; }
@@ -209,7 +160,8 @@ public class Deployer { DeploymentProperties originalDeploymentProps = this.deploymentsMetadata.getCurrentDeploymentProperties();
FileHashcodeMap original = this.deploymentsMetadata.getCurrentDeploymentFileHashcodes(); - ChangesFileHashcodeMap current = original.rescan(this.destDir, this.ignoreRegex); + ChangesFileHashcodeMap current = original.rescan(this.deploymentData.getDestinationDir(), this.deploymentData + .getIgnoreRegex()); FileHashcodeMap newFiles = getNewDeploymentFileHashcodeMap();
if (current.getUnknownContent() != null) { @@ -331,7 +283,7 @@ public class Deployer { for (String fileToDeletePath : currentFilesToDelete) { File doomedFile = new File(fileToDeletePath); if (!doomedFile.isAbsolute()) { - doomedFile = new File(this.destDir, fileToDeletePath); + doomedFile = new File(this.deploymentData.getDestinationDir(), fileToDeletePath); } boolean deleted; if (!dryRun) { @@ -386,19 +338,21 @@ public class Deployer { } else { File backupDir = this.deploymentsMetadata.getDeploymentBackupDirectory(deploymentId); if (isWindows && driveLetter != null) { - StringBuilder destDirAbsPathBuilder = new StringBuilder(this.destDir.getAbsolutePath()); + StringBuilder destDirAbsPathBuilder = new StringBuilder(this.deploymentData.getDestinationDir() + .getAbsolutePath()); String destDirDriveLetter = FileUtil.stripDriveLetter(destDirAbsPathBuilder); if (destDirDriveLetter == null || driveLetter.equals(destDirDriveLetter)) { bakFile = new File(backupDir, fileToBackupPath); - fileToBackup = new File(this.destDir, fileToBackupPathNoDriveLetter.toString()); + fileToBackup = new File(this.deploymentData.getDestinationDir(), fileToBackupPathNoDriveLetter + .toString()); } else { throw new Exception("Cannot backup relative path [" + fileToBackupPath + "] whose drive letter is different than the destination directory [" - + this.destDir.getAbsolutePath() + "]"); + + this.deploymentData.getDestinationDir().getAbsolutePath() + "]"); } } else { bakFile = new File(backupDir, fileToBackupPath); - fileToBackup = new File(this.destDir, fileToBackupPath); + fileToBackup = new File(this.deploymentData.getDestinationDir(), fileToBackupPath); } }
@@ -425,22 +379,22 @@ public class Deployer {
// extract all zip files ExtractorZipFileVisitor visitor; - for (File zipFile : this.zipFiles) { + for (File zipFile : this.deploymentData.getZipFiles()) { debug("Extracting zip [", zipFile, "] entries. dryRun=", dryRun);
Pattern realizeRegex = null; - if (this.filesToRealizeRegex != null) { - realizeRegex = this.filesToRealizeRegex.get(zipFile); + if (this.deploymentData.getZipEntriesToRealizeRegex() != null) { + realizeRegex = this.deploymentData.getZipEntriesToRealizeRegex().get(zipFile); } - visitor = new ExtractorZipFileVisitor(this.destDir, realizeRegex, this.templateEngine, - currentFilesToLeaveAlone.keySet(), diff, dryRun); + visitor = new ExtractorZipFileVisitor(this.deploymentData.getDestinationDir(), realizeRegex, + this.deploymentData.getTemplateEngine(), currentFilesToLeaveAlone.keySet(), diff, dryRun); ZipUtil.walkZipFile(zipFile, visitor); newFileHashCodeMap.putAll(visitor.getFileHashcodeMap()); }
// copy all raw files StreamCopyDigest copyDigester = new StreamCopyDigest(); - for (Map.Entry<File, File> rawFile : this.rawFiles.entrySet()) { + for (Map.Entry<File, File> rawFile : this.deploymentData.getRawFiles().entrySet()) { // determine where the original file is and where it needs to go File currentLocationFile = rawFile.getKey(); File newLocationFile = rawFile.getValue(); @@ -450,7 +404,7 @@ public class Deployer { continue; } if (!newLocationFile.isAbsolute()) { - newLocationFile = new File(this.destDir, newLocationFile.getPath()); + newLocationFile = new File(this.deploymentData.getDestinationDir(), newLocationFile.getPath()); }
if (!dryRun) { @@ -463,19 +417,19 @@ public class Deployer {
String hashcode;
- Pattern realizeRegex = null; - if (this.filesToRealizeRegex != null) { - realizeRegex = this.filesToRealizeRegex.get(currentLocationFile); + boolean realize = false; + if (this.deploymentData.getRawFilesToRealize() != null) { + realize = this.deploymentData.getRawFilesToRealize().contains(currentLocationFile); }
- if (realizeRegex != null && realizeRegex.matcher(newLocationPath).matches()) { + if (realize) { debug("Realizing file [", currentLocationFile, "] to [", newLocationFile, "]. dryRun=", dryRun);
// this entry needs to be realized, do it now in-memory (we assume realizable files will not be large) // note: tempateEngine will never be null if we got here FileInputStream in = new FileInputStream(currentLocationFile); byte[] rawFileContent = StreamUtil.slurp(in); - String content = this.templateEngine.replaceTokens(new String(rawFileContent)); + String content = this.deploymentData.getTemplateEngine().replaceTokens(new String(rawFileContent));
if (diff != null) { diff.addRealizedFile(newLocationPath, content); @@ -527,7 +481,7 @@ public class Deployer { newFileHashCodeMap.putAll(currentFilesToLeaveAlone); // remember that these are still there
if (!dryRun) { - this.deploymentsMetadata.setCurrentDeployment(deploymentProps, newFileHashCodeMap); + this.deploymentsMetadata.setCurrentDeployment(this.deploymentData.getDeploymentProps(), newFileHashCodeMap); }
return newFileHashCodeMap; @@ -545,13 +499,13 @@ public class Deployer {
// perform in-memory extraction and calculate hashcodes for all zip files InMemoryZipFileVisitor visitor; - for (File zipFile : this.zipFiles) { + for (File zipFile : this.deploymentData.getZipFiles()) { debug("Extracting zip [", zipFile, "] in-memory to determine hashcodes for all entries"); Pattern realizeRegex = null; - if (this.filesToRealizeRegex != null) { - realizeRegex = this.filesToRealizeRegex.get(zipFile); + if (this.deploymentData.getZipEntriesToRealizeRegex() != null) { + realizeRegex = this.deploymentData.getZipEntriesToRealizeRegex().get(zipFile); } - visitor = new InMemoryZipFileVisitor(realizeRegex, this.templateEngine); + visitor = new InMemoryZipFileVisitor(realizeRegex, this.deploymentData.getTemplateEngine()); ZipUtil.walkZipFile(zipFile, visitor); fileHashcodeMap.putAll(visitor.getFileHashcodeMap()); } @@ -559,30 +513,30 @@ public class Deployer { MessageDigestGenerator generator = new MessageDigestGenerator();
// calculate hashcodes for all raw files, perform in-memory realization when necessary - for (Map.Entry<File, File> rawFile : this.rawFiles.entrySet()) { + for (Map.Entry<File, File> rawFile : this.deploymentData.getRawFiles().entrySet()) { // determine where the original file is and where it would go if we were writing it to disk File currentLocationFile = rawFile.getKey(); File newLocationFile = rawFile.getValue(); String newLocationPath = rawFile.getValue().getPath(); if (!newLocationFile.isAbsolute()) { - newLocationFile = new File(this.destDir, newLocationFile.getPath()); + newLocationFile = new File(this.deploymentData.getDestinationDir(), newLocationFile.getPath()); }
String hashcode;
- Pattern realizeRegex = null; - if (this.filesToRealizeRegex != null) { - realizeRegex = this.filesToRealizeRegex.get(currentLocationFile); + boolean realize = false; + if (this.deploymentData.getRawFilesToRealize() != null) { + realize = this.deploymentData.getRawFilesToRealize().contains(currentLocationFile); }
- if (realizeRegex != null && realizeRegex.matcher(newLocationPath).matches()) { + if (realize) { debug("Realizing file [", currentLocationFile, "] in-memory to determine its hashcode");
// this entry needs to be realized, do it now in-memory (we assume realizable files will not be large) // note: tempateEngine will never be null if we got here FileInputStream in = new FileInputStream(currentLocationFile); byte[] rawFileContent = StreamUtil.slurp(in); - String content = this.templateEngine.replaceTokens(new String(rawFileContent)); + String content = this.deploymentData.getTemplateEngine().replaceTokens(new String(rawFileContent));
// now calculate the hashcode of the realized content generator.add(content.getBytes()); @@ -612,9 +566,9 @@ public class Deployer { private void debug(Object... objs) { if (log.isDebugEnabled()) { StringBuilder str = new StringBuilder(); - String bundleName = this.deploymentProps.getBundleName(); - String bundleVersion = this.deploymentProps.getBundleVersion(); - int deploymentId = this.deploymentProps.getDeploymentId(); + String bundleName = this.deploymentData.getDeploymentProps().getBundleName(); + String bundleVersion = this.deploymentData.getDeploymentProps().getBundleVersion(); + int deploymentId = this.deploymentData.getDeploymentProps().getDeploymentId(); str.append("Bundle [").append(bundleName).append(" v").append(bundleVersion).append(']'); str.append("; Deployment [").append(deploymentId).append("]: "); for (Object o : objs) { 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 new file mode 100644 index 0000000..3ace2f9 --- /dev/null +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/DeploymentData.java @@ -0,0 +1,146 @@ +/* + * 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, 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.File; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.regex.Pattern; + +import org.rhq.core.template.TemplateEngine; + +/** + * Data that describes a particular deployment. In effect, this provides the + * data needed to fully deploy something. + * + * @author John Mazzitelli + */ +public class DeploymentData { + + private final DeploymentProperties deploymentProps; + private final Set<File> zipFiles; + private final Map<File, File> rawFiles; + private final File destinationDir; + private final Map<File, Pattern> zipEntriesToRealizeRegex; + private final Set<File> rawFilesToRealize; + private final TemplateEngine templateEngine; + private final Pattern ignoreRegex; + + /** + * Constructors that prepares this object with the data that is necessary in order to deploy archive/file content + * a destination directory. + * + * @param deploymentProps metadata about this deployment + * @param zipFiles the archives containing the content to be deployed + * @param rawFiles files that are to be copied into the destination directory - the keys are the current + * locations of the files, the values are where the files should be copied (the values may be relative + * in which case they are relative to destDir and can have subdirectories and/or a different filename + * than what the file is named currently) + * @param destinationDir the root directory where the content is to be deployed + * @param zipEntriesToRealizeRegex the patterns of files (whose paths are relative to destDir) that + * must have replacement variables within them replaced with values + * obtained via the given template engine. The key is the name of the zip file + * that the regex must be applied to - in other words, the regex value is only applied + * to relative file names as found in their associated zip file. + * @param rawFilesToRealize identifies the raw files that need to be realized; note that each item in this set + * must match a <code>rawFiles</code> entry + * @param templateEngine if one or more filesToRealize are specified, this template engine is used to determine + * the values that should replace all replacement variables found in those files + * @param ignoreRegex the files/directories to ignore when updating an existing deployment + */ + public DeploymentData(DeploymentProperties deploymentProps, Set<File> zipFiles, Map<File, File> rawFiles, + File destinationDir, Map<File, Pattern> zipEntriesToRealizeRegex, Set<File> rawFilesToRealize, + TemplateEngine templateEngine, Pattern ignoreRegex) { + + if (deploymentProps == null) { + throw new IllegalArgumentException("deploymentProps == null"); + } + if (destinationDir == null) { + throw new IllegalArgumentException("destDir == null"); + } + + if (zipFiles == null) { + zipFiles = new HashSet<File>(); + } + if (rawFiles == null) { + rawFiles = new HashMap<File, File>(); + } + if ((zipFiles.size() == 0) && (rawFiles.size() == 0)) { + throw new IllegalArgumentException("zipFiles/rawFiles are empty - nothing to do"); + } + + this.deploymentProps = deploymentProps; + this.zipFiles = zipFiles; + this.rawFiles = rawFiles; + this.destinationDir = destinationDir; + this.ignoreRegex = ignoreRegex; + + // if there is nothing to realize or we have no template engine to obtain replacement values, then we null things out + if (templateEngine == null || (zipEntriesToRealizeRegex == null && rawFilesToRealize == null)) { + this.zipEntriesToRealizeRegex = null; + this.rawFilesToRealize = null; + this.templateEngine = null; + } else { + this.zipEntriesToRealizeRegex = zipEntriesToRealizeRegex; + this.rawFilesToRealize = rawFilesToRealize; + this.templateEngine = templateEngine; + } + + return; + } + + public DeploymentProperties getDeploymentProps() { + return deploymentProps; + } + + public Set<File> getZipFiles() { + return zipFiles; + } + + public Map<File, File> getRawFiles() { + return rawFiles; + } + + public File getDestinationDir() { + return destinationDir; + } + + public Map<File, Pattern> getZipEntriesToRealizeRegex() { + return zipEntriesToRealizeRegex; + } + + public Set<File> getRawFilesToRealize() { + return rawFilesToRealize; + } + + public TemplateEngine getTemplateEngine() { + return templateEngine; + } + + public Pattern getIgnoreRegex() { + return ignoreRegex; + } + +} diff --git a/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java b/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java index b8bc2bc..04031bb 100644 --- a/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java +++ b/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java @@ -255,8 +255,9 @@ public class DeployerTest { File destDir = tmpDir; Map<File, Pattern> filesToRealizeRegex1 = new HashMap<File, Pattern>(1); filesToRealizeRegex1.put(testZipFile1, realizeRegex); - Deployer deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, filesToRealizeRegex1, - templateEngine, ignoreRegex); + DeploymentData dd = new DeploymentData(deploymentProps, zipFiles, rawFiles, destDir, filesToRealizeRegex1, + null, templateEngine, ignoreRegex); + Deployer deployer = new Deployer(dd); diff = new DeployDifferences(); deployer.deploy(diff);
@@ -284,8 +285,9 @@ public class DeployerTest { rawFiles.put(testRawFileB, updaterBabsolute); // raw file to absolute path Map<File, Pattern> filesToRealizeRegex2 = new HashMap<File, Pattern>(1); filesToRealizeRegex2.put(testZipFile2, realizeRegex); - deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, filesToRealizeRegex2, templateEngine, - ignoreRegex); + dd = new DeploymentData(deploymentProps, zipFiles, rawFiles, destDir, filesToRealizeRegex2, null, + templateEngine, ignoreRegex); + deployer = new Deployer(dd); diff = new DeployDifferences(); deployer.deploy(diff);
@@ -403,8 +405,9 @@ public class DeployerTest { rawFiles = new HashMap<File, File>(2); rawFiles.put(testRawFileA, updaterAabsolute); // source raw file to absolute path rawFiles.put(testRawFileBChange1, updaterBabsolute); // source raw file to absolute path - deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, filesToRealizeRegex2, templateEngine, - ignoreRegex); + dd = new DeploymentData(deploymentProps, zipFiles, rawFiles, destDir, filesToRealizeRegex2, null, + templateEngine, ignoreRegex); + deployer = new Deployer(dd); diff = new DeployDifferences(); deployer.deploy(diff);
@@ -442,8 +445,9 @@ public class DeployerTest { rawFiles = new HashMap<File, File>(2); rawFiles.put(testRawFileAChange, updaterAabsolute); // source raw file to absolute path rawFiles.put(testRawFileBChange2, updaterBabsolute); // source raw file to absolute path - deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, filesToRealizeRegex2, templateEngine, - ignoreRegex); + dd = new DeploymentData(deploymentProps, zipFiles, rawFiles, destDir, filesToRealizeRegex2, null, + templateEngine, ignoreRegex); + deployer = new Deployer(dd); diff = new DeployDifferences(); deployer.deploy(diff);
@@ -493,10 +497,11 @@ public class DeployerTest { rawFiles.put(testRawFileB, rawFileDestination); // we will realize this one File destDir = tmpDir; Pattern ignoreRegex = null; - Map<File, Pattern> realizeRegex1 = new HashMap<File, Pattern>(1); - realizeRegex1.put(testRawFileB, filesToRealizeRegex); - Deployer deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, realizeRegex1, - templateEngine, ignoreRegex); + Set<File> realizeRawFiles1 = new HashSet<File>(1); + realizeRawFiles1.add(testRawFileB); + DeploymentData dd = new DeploymentData(deploymentProps, zipFiles, rawFiles, destDir, null, + realizeRawFiles1, templateEngine, ignoreRegex); + Deployer deployer = new Deployer(dd); DeployDifferences diff = new DeployDifferences(); FileHashcodeMap map = deployer.deploy(diff);
@@ -544,12 +549,13 @@ public class DeployerTest { File destDir = tmpDir; Pattern ignoreRegex = null;
- Map<File, Pattern> realizeRegex1 = new HashMap<File, Pattern>(3); - realizeRegex1.put(testZipFile1, filesToRealizeRegex); - realizeRegex1.put(testZipFile2, filesToRealizeRegex); - realizeRegex1.put(testRawFileB, filesToRealizeRegex); - Deployer deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, realizeRegex1, - templateEngine, ignoreRegex); + Set<File> realizeRawFiles1 = new HashSet<File>(3); + realizeRawFiles1.add(testZipFile1); + realizeRawFiles1.add(testZipFile2); + realizeRawFiles1.add(testRawFileB); + DeploymentData dd = new DeploymentData(deploymentProps, zipFiles, rawFiles, destDir, null, + realizeRawFiles1, templateEngine, ignoreRegex); + Deployer deployer = new Deployer(dd); DeployDifferences listener = new DeployDifferences(); deployer.deploy(listener);
@@ -645,8 +651,9 @@ public class DeployerTest { Map<File, Pattern> realizeRegex1 = new HashMap<File, Pattern>(1); realizeRegex1.put(testZipFile1, filesToRealizeRegex);
- Deployer deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, realizeRegex1, + DeploymentData dd = new DeploymentData(deploymentProps, zipFiles, rawFiles, destDir, realizeRegex1, null, templateEngine, ignoreRegex); + Deployer deployer = new Deployer(dd); DeployDifferences listener = new DeployDifferences(); deployer.deploy(listener);
diff --git a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawFileTest.java b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawFileTest.java index 85c4b8d..40e9c70 100644 --- a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawFileTest.java +++ b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawFileTest.java @@ -92,7 +92,9 @@ public class SimpleDeployerRawFileTest { this.sourceRawFiles = new HashMap<File, File>(1); this.sourceRawFiles.put(sourceRawFile, new File(extDir, originalFileName)); // note we name it different than the source file this.originalDeployProps = new DeploymentProperties(1, "simple", "1.0", "original test deployment"); - Deployer deployer = new Deployer(originalDeployProps, null, sourceRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(originalDeployProps, null, sourceRawFiles, deployDir, null, null, null, + null); + Deployer deployer = new Deployer(dd); this.originalFileHashcodeMap = deployer.deploy(null); this.currentFile = sourceRawFiles.get(sourceRawFile); this.currentAbsPath = this.currentFile.getAbsolutePath(); @@ -196,7 +198,8 @@ public class SimpleDeployerRawFileTest { }
private void baseX_X_X(boolean dryRun) throws Exception { - Deployer deployer = new Deployer(newDeployProps, null, sourceRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, null, sourceRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -235,7 +238,8 @@ public class SimpleDeployerRawFileTest { Map<File, File> newRawFiles = new HashMap<File, File>(1); newRawFiles.put(newRawFile, this.currentFile);
- Deployer deployer = new Deployer(newDeployProps, null, newRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, null, newRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -280,7 +284,8 @@ public class SimpleDeployerRawFileTest { String newHashcode = MessageDigestGenerator.getDigestString(newContent); writeFile(newContent, this.currentFile);
- Deployer deployer = new Deployer(newDeployProps, null, sourceRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, null, sourceRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -327,7 +332,8 @@ public class SimpleDeployerRawFileTest { Map<File, File> newRawFiles = new HashMap<File, File>(1); newRawFiles.put(newRawFile, this.currentFile);
- Deployer deployer = new Deployer(newDeployProps, null, newRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, null, newRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -374,7 +380,8 @@ public class SimpleDeployerRawFileTest { Map<File, File> newRawFiles = new HashMap<File, File>(1); newRawFiles.put(newRawFile, this.currentFile);
- Deployer deployer = new Deployer(newDeployProps, null, newRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, null, newRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -436,7 +443,8 @@ public class SimpleDeployerRawFileTest { File newDestRawFile = new File(extDir, newFileName); newRawFiles.put(newRawFile, newDestRawFile);
- Deployer deployer = new Deployer(newDeployProps, null, newRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, null, newRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -497,7 +505,8 @@ public class SimpleDeployerRawFileTest { String inTheWayHashcode = MessageDigestGenerator.getDigestString(inTheWayContent); writeFile(inTheWayContent, inTheWayFile);
- Deployer deployer = new Deployer(newDeployProps, null, newRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, null, newRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -556,7 +565,8 @@ public class SimpleDeployerRawFileTest { private void baseNoCurrent(boolean dryRun) throws Exception { assert this.currentFile.delete() : "Failed to delete the current file, cannot prepare the test";
- Deployer deployer = new Deployer(newDeployProps, null, sourceRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, null, sourceRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -606,7 +616,8 @@ public class SimpleDeployerRawFileTest { File newDestRawFile = new File(extDir, newFileName); newRawFiles.put(newRawFile, newDestRawFile);
- Deployer deployer = new Deployer(newDeployProps, null, newRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, null, newRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -669,7 +680,8 @@ public class SimpleDeployerRawFileTest { File newDestRawFile = new File(extDir, newFileName); newRawFiles.put(newRawFile, newDestRawFile);
- Deployer deployer = new Deployer(newDeployProps, null, newRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, null, newRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); diff --git a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawRelativeFileTest.java b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawRelativeFileTest.java index add1cca..3dc27e3 100644 --- a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawRelativeFileTest.java +++ b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerRawRelativeFileTest.java @@ -90,7 +90,9 @@ public class SimpleDeployerRawRelativeFileTest { this.sourceRawFiles = new HashMap<File, File>(1); this.sourceRawFiles.put(sourceRawFile, new File(originalFileName)); // RELATIVE! note we name it different than the source file this.originalDeployProps = new DeploymentProperties(1, "simple", "1.0", "original test deployment"); - Deployer deployer = new Deployer(originalDeployProps, null, sourceRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(originalDeployProps, null, sourceRawFiles, deployDir, null, null, null, + null); + Deployer deployer = new Deployer(dd); this.originalFileHashcodeMap = deployer.deploy(null); this.currentFile = sourceRawFiles.get(sourceRawFile); this.currentRelativePath = this.currentFile.getPath(); @@ -195,7 +197,8 @@ public class SimpleDeployerRawRelativeFileTest { }
private void baseX_X_X(boolean dryRun) throws Exception { - Deployer deployer = new Deployer(newDeployProps, null, sourceRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, null, sourceRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -234,7 +237,8 @@ public class SimpleDeployerRawRelativeFileTest { Map<File, File> newRawFiles = new HashMap<File, File>(1); newRawFiles.put(newRawFile, this.currentFile);
- Deployer deployer = new Deployer(newDeployProps, null, newRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, null, newRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -279,7 +283,8 @@ public class SimpleDeployerRawRelativeFileTest { String newHashcode = MessageDigestGenerator.getDigestString(newContent); writeFile(newContent, this.currentFile);
- Deployer deployer = new Deployer(newDeployProps, null, sourceRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, null, sourceRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -326,7 +331,8 @@ public class SimpleDeployerRawRelativeFileTest { Map<File, File> newRawFiles = new HashMap<File, File>(1); newRawFiles.put(newRawFile, this.currentFile);
- Deployer deployer = new Deployer(newDeployProps, null, newRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, null, newRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -373,7 +379,8 @@ public class SimpleDeployerRawRelativeFileTest { Map<File, File> newRawFiles = new HashMap<File, File>(1); newRawFiles.put(newRawFile, this.currentFile);
- Deployer deployer = new Deployer(newDeployProps, null, newRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, null, newRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -435,7 +442,8 @@ public class SimpleDeployerRawRelativeFileTest { File newDestRawFile = new File(newFileName); // RELATIVE! newRawFiles.put(newRawFile, newDestRawFile);
- Deployer deployer = new Deployer(newDeployProps, null, newRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, null, newRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -496,7 +504,8 @@ public class SimpleDeployerRawRelativeFileTest { String inTheWayHashcode = MessageDigestGenerator.getDigestString(inTheWayContent); writeFile(inTheWayContent, inTheWayFile);
- Deployer deployer = new Deployer(newDeployProps, null, newRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, null, newRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -554,7 +563,8 @@ public class SimpleDeployerRawRelativeFileTest { private void baseNoCurrent(boolean dryRun) throws Exception { assert this.currentFileWithAbsolutePath.delete() : "Failed to delete the current file, cannot prepare the test";
- Deployer deployer = new Deployer(newDeployProps, null, sourceRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, null, sourceRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -604,7 +614,8 @@ public class SimpleDeployerRawRelativeFileTest { File newDestRawFile = new File(newFileName); // RELATIVE! newRawFiles.put(newRawFile, newDestRawFile);
- Deployer deployer = new Deployer(newDeployProps, null, newRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, null, newRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -667,7 +678,8 @@ public class SimpleDeployerRawRelativeFileTest { File newDestRawFile = new File(newFileName); // RELATIVE! newRawFiles.put(newRawFile, newDestRawFile);
- Deployer deployer = new Deployer(newDeployProps, null, newRawFiles, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, null, newRawFiles, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); diff --git a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java index dcabd2a..3b2d670 100644 --- a/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java +++ b/modules/core/util/src/test/java/org/rhq/core/util/updater/SimpleDeployerTest.java @@ -85,7 +85,9 @@ public class SimpleDeployerTest { this.originalZipFiles = new HashSet<File>(1); this.originalZipFiles.add(originalZipFile); this.originalDeployProps = new DeploymentProperties(1, "simple", "1.0", "original test deployment"); - Deployer deployer = new Deployer(originalDeployProps, originalZipFiles, null, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(originalDeployProps, originalZipFiles, null, deployDir, null, null, + null, null); + Deployer deployer = new Deployer(dd); this.originalFileHashcodeMap = deployer.deploy(null); this.currentFile = new File(deployDir, originalFileName);
@@ -187,7 +189,9 @@ public class SimpleDeployerTest { }
private void baseX_X_X(boolean dryRun) throws Exception { - Deployer deployer = new Deployer(newDeployProps, originalZipFiles, null, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, originalZipFiles, null, deployDir, null, null, null, + null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -226,7 +230,8 @@ public class SimpleDeployerTest { Set<File> newZipFiles = new HashSet<File>(1); newZipFiles.add(newZipFile);
- Deployer deployer = new Deployer(newDeployProps, newZipFiles, null, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, newZipFiles, null, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -271,7 +276,9 @@ public class SimpleDeployerTest { String newHashcode = MessageDigestGenerator.getDigestString(newContent); writeFile(newContent, this.currentFile);
- Deployer deployer = new Deployer(newDeployProps, originalZipFiles, null, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, originalZipFiles, null, deployDir, null, null, null, + null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -318,7 +325,8 @@ public class SimpleDeployerTest { Set<File> newZipFiles = new HashSet<File>(1); newZipFiles.add(newZipFile);
- Deployer deployer = new Deployer(newDeployProps, newZipFiles, null, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, newZipFiles, null, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -365,7 +373,8 @@ public class SimpleDeployerTest { Set<File> newZipFiles = new HashSet<File>(1); newZipFiles.add(newZipFile);
- Deployer deployer = new Deployer(newDeployProps, newZipFiles, null, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, newZipFiles, null, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -426,7 +435,8 @@ public class SimpleDeployerTest { Set<File> newZipFiles = new HashSet<File>(1); newZipFiles.add(newZipFile);
- Deployer deployer = new Deployer(newDeployProps, newZipFiles, null, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, newZipFiles, null, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -486,7 +496,8 @@ public class SimpleDeployerTest { String inTheWayHashcode = MessageDigestGenerator.getDigestString(inTheWayContent); writeFile(inTheWayContent, inTheWayFile);
- Deployer deployer = new Deployer(newDeployProps, newZipFiles, null, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, newZipFiles, null, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -544,7 +555,9 @@ public class SimpleDeployerTest { private void baseNoCurrent(boolean dryRun) throws Exception { assert this.currentFile.delete() : "Failed to delete the current file, cannot prepare the test";
- Deployer deployer = new Deployer(newDeployProps, originalZipFiles, null, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, originalZipFiles, null, deployDir, null, null, null, + null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -593,7 +606,8 @@ public class SimpleDeployerTest { Set<File> newZipFiles = new HashSet<File>(1); newZipFiles.add(newZipFile);
- Deployer deployer = new Deployer(newDeployProps, newZipFiles, null, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, newZipFiles, null, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff); @@ -655,7 +669,8 @@ public class SimpleDeployerTest { Set<File> newZipFiles = new HashSet<File>(1); newZipFiles.add(newZipFile);
- Deployer deployer = new Deployer(newDeployProps, newZipFiles, null, deployDir, null, null, null); + DeploymentData dd = new DeploymentData(newDeployProps, newZipFiles, null, deployDir, null, null, null, null); + Deployer deployer = new Deployer(dd); FileHashcodeMap newFileHashcodeMap; if (dryRun) { newFileHashcodeMap = deployer.dryRun(this.diff);
commit 512c106fbb6b10647aced9e5f8f6c11805694c51 Merge: d485e3a... aebeb24... Author: John Mazzitelli mazz@redhat.com Date: Wed May 5 16:38:40 2010 -0400
Merge branch 'gwt' of ssh://git.fedorahosted.org/git/rhq/rhq into gwt
commit d485e3aabfd0150b977eb2d25f4b1d725cc2c36f Author: John Mazzitelli mazz@redhat.com Date: Wed May 5 16:38:30 2010 -0400
be able to support realize regex on a per-zip file, per-raw-file basis i plan on changing the api, this won't be the final version, but this works and all tests pass
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/DeployTask.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/DeployTask.java index d9f4118..8258e52 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/DeployTask.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/DeployTask.java @@ -18,6 +18,7 @@ package org.rhq.bundle.ant.task;
import java.io.File; +import java.util.HashMap; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; @@ -75,7 +76,16 @@ public class DeployTask extends AbstractBundleTask { if (!this.archives.isEmpty()) { log("Deploying archives " + this.archives + "...", Project.MSG_VERBOSE); } - Deployer deployer = new Deployer(deploymentProps, this.archives, this.files, deployDir, this.replacePattern, + + // for now, apply the pattern to all files in the deployment + Map<File, Pattern> fileReplacePatterns = new HashMap<File, Pattern>(); + for (File file : this.files.keySet()) { + fileReplacePatterns.put(file, this.replacePattern); + } + for (File file : this.archives) { + fileReplacePatterns.put(file, this.replacePattern); + } + Deployer deployer = new Deployer(deploymentProps, this.archives, this.files, deployDir, fileReplacePatterns, templateEngine, this.ignorePattern); try { DeployDifferences diffs = getProject().getDeployDifferences(); diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java index 6ee1971..752ac00 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java @@ -93,7 +93,7 @@ public class Deployer { private final Set<File> zipFiles; private final Map<File, File> rawFiles; private final File destDir; - private final Pattern filesToRealizeRegex; + private final Map<File, Pattern> filesToRealizeRegex; private final TemplateEngine templateEngine; private final Pattern ignoreRegex; private final DeploymentsMetadata deploymentsMetadata; @@ -110,13 +110,14 @@ public class Deployer { * @param destDir the root directory where the content is to be deployed * @param filesToRealizeRegex the patterns of files (whose paths are relative to destDir) that * must have replacement variables within them replaced with values - * obtained via the given template engine + * obtained via the given template engine. The key is the name of the zip or raw + * file that the regex must be applied to. * @param templateEngine if one or more filesToRealize are specified, this template engine is used to determine * the values that should replace all replacement variables found in those files * @param ignoreRegex the files/directories to ignore when updating an existing deployment */ public Deployer(DeploymentProperties deploymentProps, Set<File> zipFiles, Map<File, File> rawFiles, File destDir, - Pattern filesToRealizeRegex, TemplateEngine templateEngine, Pattern ignoreRegex) { + Map<File, Pattern> filesToRealizeRegex, TemplateEngine templateEngine, Pattern ignoreRegex) {
if (deploymentProps == null) { throw new IllegalArgumentException("deploymentProps == null"); @@ -426,7 +427,12 @@ public class Deployer { ExtractorZipFileVisitor visitor; for (File zipFile : this.zipFiles) { debug("Extracting zip [", zipFile, "] entries. dryRun=", dryRun); - visitor = new ExtractorZipFileVisitor(this.destDir, this.filesToRealizeRegex, this.templateEngine, + + Pattern realizeRegex = null; + if (this.filesToRealizeRegex != null) { + realizeRegex = this.filesToRealizeRegex.get(zipFile); + } + visitor = new ExtractorZipFileVisitor(this.destDir, realizeRegex, this.templateEngine, currentFilesToLeaveAlone.keySet(), diff, dryRun); ZipUtil.walkZipFile(zipFile, visitor); newFileHashCodeMap.putAll(visitor.getFileHashcodeMap()); @@ -457,7 +463,12 @@ public class Deployer {
String hashcode;
- if (this.filesToRealizeRegex != null && this.filesToRealizeRegex.matcher(newLocationPath).matches()) { + Pattern realizeRegex = null; + if (this.filesToRealizeRegex != null) { + realizeRegex = this.filesToRealizeRegex.get(currentLocationFile); + } + + if (realizeRegex != null && realizeRegex.matcher(newLocationPath).matches()) { debug("Realizing file [", currentLocationFile, "] to [", newLocationFile, "]. dryRun=", dryRun);
// this entry needs to be realized, do it now in-memory (we assume realizable files will not be large) @@ -536,7 +547,11 @@ public class Deployer { InMemoryZipFileVisitor visitor; for (File zipFile : this.zipFiles) { debug("Extracting zip [", zipFile, "] in-memory to determine hashcodes for all entries"); - visitor = new InMemoryZipFileVisitor(this.filesToRealizeRegex, this.templateEngine); + Pattern realizeRegex = null; + if (this.filesToRealizeRegex != null) { + realizeRegex = this.filesToRealizeRegex.get(zipFile); + } + visitor = new InMemoryZipFileVisitor(realizeRegex, this.templateEngine); ZipUtil.walkZipFile(zipFile, visitor); fileHashcodeMap.putAll(visitor.getFileHashcodeMap()); } @@ -555,7 +570,12 @@ public class Deployer {
String hashcode;
- if (this.filesToRealizeRegex != null && this.filesToRealizeRegex.matcher(newLocationPath).matches()) { + Pattern realizeRegex = null; + if (this.filesToRealizeRegex != null) { + realizeRegex = this.filesToRealizeRegex.get(currentLocationFile); + } + + if (realizeRegex != null && realizeRegex.matcher(newLocationPath).matches()) { debug("Realizing file [", currentLocationFile, "] in-memory to determine its hashcode");
// this entry needs to be realized, do it now in-memory (we assume realizable files will not be large) diff --git a/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java b/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java index 963f805..b8bc2bc 100644 --- a/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java +++ b/modules/core/util/src/test/java/org/rhq/core/util/updater/DeployerTest.java @@ -207,7 +207,7 @@ public class DeployerTest { private void baseUpdateTest(boolean realize, boolean ignore) throws Exception { DeployDifferences diff;
- final Pattern filesToRealizeRegex = realize ? Pattern.compile("fileA") : null; + final Pattern realizeRegex = realize ? Pattern.compile("fileA") : null; final Pattern ignoreRegex = ignore ? Pattern.compile("ignoreme.*") : null; File fileToIgnore = null;
@@ -253,7 +253,9 @@ public class DeployerTest { Map<File, File> rawFiles = new HashMap<File, File>(1); rawFiles.put(testRawFileA, updaterAabsolute); // raw file to absolute path File destDir = tmpDir; - Deployer deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, filesToRealizeRegex, + Map<File, Pattern> filesToRealizeRegex1 = new HashMap<File, Pattern>(1); + filesToRealizeRegex1.put(testZipFile1, realizeRegex); + Deployer deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, filesToRealizeRegex1, templateEngine, ignoreRegex); diff = new DeployDifferences(); deployer.deploy(diff); @@ -280,7 +282,9 @@ public class DeployerTest { zipFiles.add(testZipFile2); rawFiles = new HashMap<File, File>(1); rawFiles.put(testRawFileB, updaterBabsolute); // raw file to absolute path - deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, filesToRealizeRegex, templateEngine, + Map<File, Pattern> filesToRealizeRegex2 = new HashMap<File, Pattern>(1); + filesToRealizeRegex2.put(testZipFile2, realizeRegex); + deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, filesToRealizeRegex2, templateEngine, ignoreRegex); diff = new DeployDifferences(); deployer.deploy(diff); @@ -399,7 +403,7 @@ public class DeployerTest { rawFiles = new HashMap<File, File>(2); rawFiles.put(testRawFileA, updaterAabsolute); // source raw file to absolute path rawFiles.put(testRawFileBChange1, updaterBabsolute); // source raw file to absolute path - deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, filesToRealizeRegex, templateEngine, + deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, filesToRealizeRegex2, templateEngine, ignoreRegex); diff = new DeployDifferences(); deployer.deploy(diff); @@ -438,7 +442,7 @@ public class DeployerTest { rawFiles = new HashMap<File, File>(2); rawFiles.put(testRawFileAChange, updaterAabsolute); // source raw file to absolute path rawFiles.put(testRawFileBChange2, updaterBabsolute); // source raw file to absolute path - deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, filesToRealizeRegex, templateEngine, + deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, filesToRealizeRegex2, templateEngine, ignoreRegex); diff = new DeployDifferences(); deployer.deploy(diff); @@ -489,8 +493,9 @@ public class DeployerTest { rawFiles.put(testRawFileB, rawFileDestination); // we will realize this one File destDir = tmpDir; Pattern ignoreRegex = null; - - Deployer deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, filesToRealizeRegex, + Map<File, Pattern> realizeRegex1 = new HashMap<File, Pattern>(1); + realizeRegex1.put(testRawFileB, filesToRealizeRegex); + Deployer deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, realizeRegex1, templateEngine, ignoreRegex); DeployDifferences diff = new DeployDifferences(); FileHashcodeMap map = deployer.deploy(diff); @@ -539,7 +544,11 @@ public class DeployerTest { File destDir = tmpDir; Pattern ignoreRegex = null;
- Deployer deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, filesToRealizeRegex, + Map<File, Pattern> realizeRegex1 = new HashMap<File, Pattern>(3); + realizeRegex1.put(testZipFile1, filesToRealizeRegex); + realizeRegex1.put(testZipFile2, filesToRealizeRegex); + realizeRegex1.put(testRawFileB, filesToRealizeRegex); + Deployer deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, realizeRegex1, templateEngine, ignoreRegex); DeployDifferences listener = new DeployDifferences(); deployer.deploy(listener); @@ -633,7 +642,10 @@ public class DeployerTest { File destDir = tmpDir; Pattern ignoreRegex = null;
- Deployer deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, filesToRealizeRegex, + Map<File, Pattern> realizeRegex1 = new HashMap<File, Pattern>(1); + realizeRegex1.put(testZipFile1, filesToRealizeRegex); + + Deployer deployer = new Deployer(deploymentProps, zipFiles, rawFiles, destDir, realizeRegex1, templateEngine, ignoreRegex); DeployDifferences listener = new DeployDifferences(); deployer.deploy(listener);
commit aebeb24df57e7e4614837557b604c23264f53f39 Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 5 15:17:30 2010 -0400
CreateWizard - add some NextPage logic based on the selected create info
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java index 891fc8f..33f06d4 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java @@ -55,6 +55,7 @@ public class BundleUploadDistroFileStep implements WizardStep { private DynamicForm mainCanvasForm; private TextItem urlTextItem; private BundleDistributionFileUploadForm uploadDistroForm; + private RadioGroupWithComponentsItem radioGroup;
public BundleUploadDistroFileStep(AbstractBundleCreateWizard bundleCreationWizard) { this.wizard = bundleCreationWizard; @@ -68,8 +69,8 @@ public class BundleUploadDistroFileStep implements WizardStep { radioItems.put("Recipe", createRecipeForm());
mainCanvasForm = new DynamicForm(); - RadioGroupWithComponentsItem radioGroup = new RadioGroupWithComponentsItem("bundleDistroRadioGroup", - "Bundle Distribution", radioItems, mainCanvasForm); + radioGroup = new RadioGroupWithComponentsItem("bundleDistroRadioGroup", "Bundle Distribution", radioItems, + mainCanvasForm); radioGroup.setShowTitle(false); mainCanvasForm.setItems(radioGroup); } @@ -77,7 +78,19 @@ public class BundleUploadDistroFileStep implements WizardStep { }
public boolean nextPage() { - return true; + String selected = radioGroup.getSelected(); + + if ("URL".equals(selected)) { + this.processUrl(); + } else if ("Upload".equals(selected)) { + this.processUpload(); + } else if ("Recipe".equals(selected)) { + this.processRecipe(); + } else { + return false; + } + + return false; }
public String getName() { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java index c4040bb..6519937 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java @@ -36,8 +36,6 @@ import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-/** Temporary step pending creation of BundleVersion navigation screen */ - public class SelectBundleVersionStep implements WizardStep {
static private final String LATEST_VERSION = "latest";
commit 25877b719c2aa6ad86df531b58f322d4475b6941 Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 5 15:16:31 2010 -0400
Work on radioGroupWithComponents - improve enablement/disablement - clear disabled fields - add getter for the selected component
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java index 13183ce..20b4c51 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java @@ -37,6 +37,7 @@ public class RadioGroupWithComponentsItem extends CanvasItem { private final LinkedHashMap<String, ? extends Canvas> valueMap; private final RGWCCanvas canvas; private final DynamicForm form; + private String selected;
public RadioGroupWithComponentsItem(String name, String title, LinkedHashMap<String, ? extends Canvas> valueMap, DynamicForm form) { @@ -45,9 +46,22 @@ public class RadioGroupWithComponentsItem extends CanvasItem { this.valueMap = valueMap; this.form = form; this.canvas = new RGWCCanvas(); + this.selected = null; setCanvas(this.canvas); }
+ public String getSelected() { + return this.selected; + } + + public Canvas getSelectedComponent() { + if (null == this.selected) { + return null; + } + + return valueMap.get(this.selected); + } + public class RGWCCanvas extends DynamicForm { public RGWCCanvas() { setNumCols(3); @@ -60,7 +74,7 @@ public class RadioGroupWithComponentsItem extends CanvasItem { ArrayList<FormItem> items = new ArrayList<FormItem>();
for (final String label : valueMap.keySet()) { - RadioGroupItem button = new RadioGroupItem(getName(), label); + RadioGroupItem button = new RadioGroupItem(label, label); button.setShowTitle(false); button.setStartRow(true); button.setValueMap(label); @@ -70,25 +84,37 @@ public class RadioGroupWithComponentsItem extends CanvasItem { CanvasItem ci = new CanvasItem(); ci.setShowTitle(false); ci.setCanvas(value); + ci.setDisabled(true); items.add(ci);
button.addChangedHandler(new ChangedHandler() { public void onChanged(ChangedEvent changedEvent) { - form.setValue(getName(), label); + selected = (String) changedEvent.getValue(); updateEnablement(); + form.markForRedraw(); } }); } - setItems(items.toArray(new FormItem[items.size()])); + this.setItems(items.toArray(new FormItem[items.size()])); }
public void updateEnablement() { - String formValue = form.getValueAsString(getName()); + for (String key : valueMap.keySet()) { Canvas value = valueMap.get(key); + Boolean disabled = !selected.equals(key); + if (disabled) { + canvas.getItem(key).clearValue(); + canvas.getItem(key).redraw(); + } if (value != null && value instanceof DynamicForm) { - for (FormItem item : ((DynamicForm) value).getFields()) { - item.setDisabled(!formValue.equals(key)); + if (!disabled.equals(value.isDisabled())) { + value.setDisabled(disabled); + for (FormItem item : ((DynamicForm) value).getFields()) { + item.clearValue(); + item.redraw(); + } + value.markForRedraw(); } } }
commit de8feef28547a579b1c2aeb69911b4bbd58bf2b9 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 4 17:41:06 2010 -0400
refactored the use of URL out of the bundle manager API as it caused a gitfit.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java index bef3a9c..891fc8f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java @@ -18,7 +18,6 @@ */ package org.rhq.enterprise.gui.coregui.client.bundle.create;
-import java.net.URL; import java.util.LinkedHashMap;
import com.google.gwt.user.client.rpc.AsyncCallback; @@ -151,18 +150,9 @@ public class BundleUploadDistroFileStep implements WizardStep {
private void processUrl() { String urlString = (String) this.urlTextItem.getValue(); - URL url; - try { - url = new URL(urlString); - } catch (Exception e) { - CoreGUI.getErrorHandler().handleError("Invalid URL [" + urlString + "]", e); - wizard.setBundleVersion(null); - setButtonsDisableMode(false); - return; - }
BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); - bundleServer.createBundleVersionViaURL(url, new AsyncCallback<BundleVersion>() { + bundleServer.createBundleVersionViaURL(urlString, new AsyncCallback<BundleVersion>() { public void onSuccess(BundleVersion result) { CoreGUI.getMessageCenter().notify( new Message("Created bundle [" + result.getName() + "] version [" + result.getVersion() + "]", diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java index 5911957..4126e94 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java @@ -18,7 +18,6 @@ */ package org.rhq.enterprise.gui.coregui.client.gwt;
-import java.net.URL; import java.util.ArrayList; import java.util.HashMap;
@@ -37,7 +36,7 @@ import org.rhq.core.domain.util.PageList;
public interface BundleGWTService extends RemoteService {
- BundleVersion createBundleVersionViaURL(URL url) throws Exception; + BundleVersion createBundleVersionViaURL(String url) throws Exception;
BundleVersion createBundleVersionViaRecipe(String recipe) throws Exception;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java index 57eab54..39e6f69 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java @@ -18,7 +18,6 @@ */ package org.rhq.enterprise.gui.coregui.server.gwt;
-import java.net.URL; import java.util.ArrayList; import java.util.HashMap;
@@ -43,7 +42,7 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund
private BundleManagerLocal bundleManager = LookupUtil.getBundleManager();
- public BundleVersion createBundleVersionViaURL(URL url) throws Exception { + public BundleVersion createBundleVersionViaURL(String url) throws Exception { BundleVersion results; try { results = bundleManager.createBundleVersionViaURL(getSessionSubject(), url); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java index e6d7f4f..8dfd2e6 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java @@ -351,7 +351,10 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot
@RequiredPermission(Permission.MANAGE_INVENTORY) @TransactionAttribute(TransactionAttributeType.NEVER) - public BundleVersion createBundleVersionViaURL(Subject subject, URL distributionFileUrl) throws Exception { + public BundleVersion createBundleVersionViaURL(Subject subject, String distributionFileUrl) throws Exception { + + // validate by immediately creating a URL + URL url = new URL(distributionFileUrl);
// get the distro file into a tmp dir // create temp file @@ -363,7 +366,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot try { tempDistributionFile = File.createTempFile("bundle-distribution", ".zip");
- is = distributionFileUrl.openStream(); + is = url.openStream(); os = new FileOutputStream(tempDistributionFile); long len = StreamUtil.copy(is, os); is = null; @@ -572,7 +575,10 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot
@RequiredPermission(Permission.MANAGE_INVENTORY) public BundleFile addBundleFileViaURL(Subject subject, int bundleVersionId, String name, String version, - Architecture architecture, URL url) throws Exception { + Architecture architecture, String bundleFileUrl) throws Exception { + + // validate by immediately creating a URL + URL url = new URL(bundleFileUrl);
return addBundleFile(subject, bundleVersionId, name, version, architecture, url.openStream()); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java index 1c9c12e..61ca90f 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java @@ -20,7 +20,6 @@ package org.rhq.enterprise.server.bundle;
import java.io.File; import java.io.InputStream; -import java.net.URL; import java.util.List; import java.util.Set;
@@ -96,7 +95,7 @@ public interface BundleManagerRemote { @WebParam(name = "fileBytes") byte[] fileBytes) throws Exception;
/** - * A convenience method taking a URL whose content will be streamed to the server and used for the file bits. + * A convenience method taking a URL String whose content will be streamed to the server and used for the file bits. * * @see {@link addBundleFile(Subject, int, String, String, Architecture, InputStream, boolean)} */ @@ -106,7 +105,7 @@ public interface BundleManagerRemote { @WebParam(name = "name") String name, // @WebParam(name = "version") String version, // @WebParam(name = "architecture") Architecture architecture, // - @WebParam(name = "url") URL url) throws Exception; + @WebParam(name = "bundleFileUrl") String bundleFileUrl) throws Exception;
/** * A convenience method taking an existing PackageVersion as opposed to a stream for the file bits. @@ -179,7 +178,7 @@ public interface BundleManagerRemote { * Note, if the file is local it is more efficient to use {@link createBundleVersionViaFile(Subject,File)}. * * @param subject - * @param distributionFileUrl a URL to the Bundle Distribution file. It must be live, resolvable and read accessible + * @param distributionFileUrl a URL String to the Bundle Distribution file. It must be live, resolvable and read accessible * by the RHQ server process. * * @return the persisted BundleVersion with alot of the internal relationships filled in to help the caller @@ -187,7 +186,7 @@ public interface BundleManagerRemote { */ BundleVersion createBundleVersionViaURL( // @WebParam(name = "subject") Subject subject, // - @WebParam(name = "distributionFileUrl") URL distributionFileUrl) throws Exception; + @WebParam(name = "distributionFileUrl") String distributionFileUrl) throws Exception;
/** * Remove everything associated with the Bundle with the exception of files laid down by related deployments. diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java index 1be4bcc..ee7e858 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java @@ -330,8 +330,8 @@ public class WebservicesManagerBean implements WebservicesRemote { }
public BundleFile addBundleFileViaURL(Subject subject, int bundleVersionId, String name, String version, - Architecture architecture, URL url) throws Exception { - return bundleManager.addBundleFileViaURL(subject, bundleVersionId, name, version, architecture, url); + Architecture architecture, String bundleFileUrl) throws Exception { + return bundleManager.addBundleFileViaURL(subject, bundleVersionId, name, version, architecture, bundleFileUrl); }
public BundleFile addBundleFileViaPackageVersion(Subject subject, int bundleVersionId, String name, @@ -353,7 +353,7 @@ public class WebservicesManagerBean implements WebservicesRemote { return bundleManager.createBundleVersionViaFile(subject, distributionFile); }
- public BundleVersion createBundleVersionViaURL(Subject subject, URL distributionFileUrl) throws Exception { + public BundleVersion createBundleVersionViaURL(Subject subject, String distributionFileUrl) throws Exception { return bundleManager.createBundleVersionViaURL(subject, distributionFileUrl); }
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java index 56a994b..fb55677 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java @@ -320,7 +320,8 @@ public class BundleManagerBeanTest extends UpdateSubsytemTestBase { ps.processBundleDistributionFile_returnValue.setBundleTypeName(bt1.getName());
// now ask the SLSB to persist our bundle data given our mock distribution - BundleVersion bv1 = bundleManager.createBundleVersionViaURL(overlord, bundleDistroFile.toURI().toURL()); + BundleVersion bv1 = bundleManager.createBundleVersionViaURL(overlord, bundleDistroFile.toURI().toURL() + .toString());
// to a db lookup to make sure our bundle version is queryable BundleVersionCriteria criteria = new BundleVersionCriteria();
commit 7db32fb2b2edeab0e6217eb8d690e326816c4ee9 Merge: 97f2587... 826746d... Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 4 16:27:35 2010 -0400
Merge branch 'gwt' of ssh://git.fedorahosted.org/git/rhq/rhq into gwt
commit 97f2587a2e0296dd4084ad9ec55f3ad98e92bf86 Merge: 9efb1e1... 8a35f87... Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 4 16:26:42 2010 -0400
Merge branch 'gwt' into gwt-jay
commit 826746d72ba6a8d3c7b3c7995b4a250b8fdb6761 Author: John Mazzitelli mazz@redhat.com Date: Tue May 4 16:26:35 2010 -0400
start of the new bundle create wizard impl - not close to being done
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleCreateWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleCreateWizard.java index 43f7407..00769d4 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleCreateWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleCreateWizard.java @@ -29,8 +29,9 @@ public class BundleCreateWizard extends AbstractBundleCreateWizard { setTitle("Create Bundle");
ArrayList<WizardStep> steps = new ArrayList<WizardStep>(); - steps.add(new BundleInfoStep(this)); - steps.add(new BundleUploadRecipeStep(this)); + steps.add(new BundleUploadDistroFileStep(this)); + //steps.add(new BundleInfoStep(this)); + //steps.add(new BundleUploadRecipeStep(this)); steps.add(new BundleUploadDataStep(this)); steps.add(new BundleSummaryStep(this)); setSteps(steps); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java new file mode 100644 index 0000000..bef3a9c --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java @@ -0,0 +1,239 @@ +/* + * 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.bundle.create; + +import java.net.URL; +import java.util.LinkedHashMap; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.CanvasItem; +import com.smartgwt.client.widgets.form.fields.LinkItem; +import com.smartgwt.client.widgets.form.fields.TextAreaItem; +import com.smartgwt.client.widgets.form.fields.TextItem; +import com.smartgwt.client.widgets.form.fields.events.ClickEvent; +import com.smartgwt.client.widgets.form.fields.events.ClickHandler; + +import org.rhq.core.domain.bundle.BundleVersion; +import org.rhq.core.domain.criteria.BundleVersionCriteria; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.components.form.RadioGroupWithComponentsItem; +import org.rhq.enterprise.gui.coregui.client.components.upload.BundleDistributionFileUploadForm; +import org.rhq.enterprise.gui.coregui.client.components.upload.DynamicCallbackForm; +import org.rhq.enterprise.gui.coregui.client.components.upload.DynamicFormHandler; +import org.rhq.enterprise.gui.coregui.client.components.upload.DynamicFormSubmitCompleteEvent; +import org.rhq.enterprise.gui.coregui.client.components.upload.TextFileRetrieverForm; +import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.util.message.Message; +import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity; + +public class BundleUploadDistroFileStep implements WizardStep { + + private final AbstractBundleCreateWizard wizard; + private final BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); + + private BundleDistributionFileUploadForm distroUploadForm; + private DynamicForm mainCanvasForm; + private TextItem urlTextItem; + private BundleDistributionFileUploadForm uploadDistroForm; + + public BundleUploadDistroFileStep(AbstractBundleCreateWizard bundleCreationWizard) { + this.wizard = bundleCreationWizard; + } + + public Canvas getCanvas() { + if (mainCanvasForm == null) { + LinkedHashMap<String, DynamicForm> radioItems = new LinkedHashMap<String, DynamicForm>(); + radioItems.put("URL", createUrlForm()); + radioItems.put("Upload", createUploadForm()); + radioItems.put("Recipe", createRecipeForm()); + + mainCanvasForm = new DynamicForm(); + RadioGroupWithComponentsItem radioGroup = new RadioGroupWithComponentsItem("bundleDistroRadioGroup", + "Bundle Distribution", radioItems, mainCanvasForm); + radioGroup.setShowTitle(false); + mainCanvasForm.setItems(radioGroup); + } + return mainCanvasForm; + } + + public boolean nextPage() { + return true; + } + + public String getName() { + return "Provide A Bundle Distribution"; + } + + private DynamicForm createUrlForm() { + urlTextItem = new TextItem("url", "URL"); + urlTextItem.setRequired(false); + urlTextItem.setShowTitle(false); + DynamicForm urlForm = new DynamicForm(); + urlForm.setPadding(20); + urlForm.setWidth100(); + urlForm.setItems(urlTextItem); + return urlForm; + } + + private BundleDistributionFileUploadForm createUploadForm() { + uploadDistroForm = new BundleDistributionFileUploadForm(false); + uploadDistroForm.setPadding(20); + uploadDistroForm.setWidth100(); + return uploadDistroForm; + } + + private DynamicForm createRecipeForm() { + final DynamicCallbackForm form = new DynamicCallbackForm("recipeForm"); + form.setWidth100(); + form.setMargin(Integer.valueOf(20)); + form.setShowInlineErrors(false); + + final LinkItem showUpload = new LinkItem("recipeUploadLink"); + showUpload.setValue("Click To Upload A Recipe File"); + showUpload.setShowTitle(false); + + final CanvasItem upload = new CanvasItem("recipeUploadCanvas"); + upload.setShowTitle(false); + upload.setVisible(false); + + final TextFileRetrieverForm textFileRetrieverForm = new TextFileRetrieverForm(); + upload.setCanvas(textFileRetrieverForm); + + showUpload.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + form.hideItem(showUpload.getName()); + form.showItem(upload.getName()); + } + }); + + final TextAreaItem recipe = new TextAreaItem("recipeText"); + recipe.setShowTitle(false); + recipe.setRequired(false); + recipe.setColSpan(4); + recipe.setWidth("*"); + recipe.setHeight(150); + + textFileRetrieverForm.addFormHandler(new DynamicFormHandler() { + public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) { + wizard.setRecipe(event.getResults()); + recipe.setValue(event.getResults()); + textFileRetrieverForm.retrievalStatus(true); + form.showItem(showUpload.getName()); + form.hideItem(upload.getName()); + } + }); + + form.setItems(showUpload, upload, recipe); + + return form; + } + + private void processUrl() { + String urlString = (String) this.urlTextItem.getValue(); + URL url; + try { + url = new URL(urlString); + } catch (Exception e) { + CoreGUI.getErrorHandler().handleError("Invalid URL [" + urlString + "]", e); + wizard.setBundleVersion(null); + setButtonsDisableMode(false); + return; + } + + BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); + bundleServer.createBundleVersionViaURL(url, new AsyncCallback<BundleVersion>() { + public void onSuccess(BundleVersion result) { + CoreGUI.getMessageCenter().notify( + new Message("Created bundle [" + result.getName() + "] version [" + result.getVersion() + "]", + Message.Severity.Info)); + wizard.setBundleVersion(result); + setButtonsDisableMode(false); + wizard.getView().incrementStep(); // go to the next step + } + + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to create bundle", caught); + wizard.setBundleVersion(null); + setButtonsDisableMode(false); + } + }); + } + + private void processUpload() { + if (Boolean.TRUE.equals(uploadDistroForm.getUploadResults())) { + int bvId = uploadDistroForm.getBundleVersionId(); + BundleVersionCriteria criteria = new BundleVersionCriteria(); + criteria.addFilterId(bvId); + BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); + bundleServer.findBundleVersionsByCriteria(criteria, new AsyncCallback<PageList<BundleVersion>>() { + public void onSuccess(PageList<BundleVersion> result) { + BundleVersion bv = result.get(0); + CoreGUI.getMessageCenter().notify( + new Message("Created bundle [" + bv.getName() + "] version [" + bv.getVersion() + "]", + Message.Severity.Info)); + wizard.setBundleVersion(bv); + setButtonsDisableMode(false); + wizard.getView().incrementStep(); // go to the next step + } + + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to create bundle", caught); + wizard.setBundleVersion(null); + setButtonsDisableMode(false); + } + }); + } else { + CoreGUI.getMessageCenter().notify(new Message("Failed to upload bundle distribution file", Severity.Error)); + wizard.setBundleVersion(null); + setButtonsDisableMode(false); + } + } + + private void processRecipe() { + BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); + bundleServer.createBundleVersionViaRecipe(this.wizard.getRecipe(), new AsyncCallback<BundleVersion>() { + public void onSuccess(BundleVersion result) { + CoreGUI.getMessageCenter().notify( + new Message("Created bundle [" + result.getName() + "] version [" + result.getVersion() + "]", + Message.Severity.Info)); + wizard.setBundleVersion(result); + setButtonsDisableMode(false); + wizard.getView().incrementStep(); // go to the next step + } + + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to create bundle", caught); + wizard.setBundleVersion(null); + wizard.setRecipe(""); + setButtonsDisableMode(false); + } + }); + } + + private void setButtonsDisableMode(boolean disabled) { + wizard.getView().getCancelButton().setDisabled(disabled); + wizard.getView().getNextButton().setDisabled(disabled); + wizard.getView().getPreviousButton().setDisabled(disabled); + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadRecipeStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadRecipeStep.java index e729d25..5c6fa3d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadRecipeStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadRecipeStep.java @@ -134,32 +134,30 @@ public class BundleUploadRecipeStep implements WizardStep { wizard.setRecipe(recipe.getValue().toString());
BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); - bundleServer.createBundleAndBundleVersion(this.wizard.getBundleName(), this.wizard.getBundleType().getId(), - this.wizard.getBundleName(), this.wizard.getBundleVersionString(), this.wizard.getBundleDescription(), - this.wizard.getRecipe(), new AsyncCallback<BundleVersion>() { - public void onSuccess(BundleVersion result) { - form.hideItem(validatingItem.getName()); - - CoreGUI.getMessageCenter().notify( - new Message("Created bundle [" + result.getName() + "] version [" + result.getVersion() + "]", - Message.Severity.Info)); - wizard.setBundleVersion(result); - wizard.getView().incrementStep(); - setButtonsDisableMode(false); - } + bundleServer.createBundleVersionViaRecipe(this.wizard.getRecipe(), new AsyncCallback<BundleVersion>() { + public void onSuccess(BundleVersion result) { + form.hideItem(validatingItem.getName()); + + CoreGUI.getMessageCenter().notify( + new Message("Created bundle [" + result.getName() + "] version [" + result.getVersion() + "]", + Message.Severity.Info)); + wizard.setBundleVersion(result); + wizard.getView().incrementStep(); + setButtonsDisableMode(false); + }
- public void onFailure(Throwable caught) { - form.hideItem(validatingItem.getName()); + public void onFailure(Throwable caught) { + form.hideItem(validatingItem.getName());
- HashMap<String, String> errors = new HashMap<String, String>(); - errors.put(recipe.getName(), "Invalid Recipe: " + caught.getMessage()); - form.setErrors(errors, true); - CoreGUI.getErrorHandler().handleError("Failed to create bundle", caught); - wizard.setBundleVersion(null); - wizard.setRecipe(""); - setButtonsDisableMode(false); - } - }); + HashMap<String, String> errors = new HashMap<String, String>(); + errors.put(recipe.getName(), "Invalid Recipe: " + caught.getMessage()); + form.setErrors(errors, true); + CoreGUI.getErrorHandler().handleError("Failed to create bundle", caught); + wizard.setBundleVersion(null); + wizard.setRecipe(""); + setButtonsDisableMode(false); + } + }); }
private void setButtonsDisableMode(boolean disabled) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java index e9942bb..13183ce 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java @@ -22,17 +22,10 @@ import java.util.ArrayList; import java.util.LinkedHashMap;
import com.smartgwt.client.widgets.Canvas; -import com.smartgwt.client.widgets.Window; import com.smartgwt.client.widgets.form.DynamicForm; -import com.smartgwt.client.widgets.form.ValuesManager; -import com.smartgwt.client.widgets.form.events.ItemChangedEvent; -import com.smartgwt.client.widgets.form.events.ItemChangedHandler; import com.smartgwt.client.widgets.form.fields.CanvasItem; import com.smartgwt.client.widgets.form.fields.FormItem; import com.smartgwt.client.widgets.form.fields.RadioGroupItem; -import com.smartgwt.client.widgets.form.fields.SelectItem; -import com.smartgwt.client.widgets.form.fields.SpacerItem; -import com.smartgwt.client.widgets.form.fields.TextItem; import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
@@ -41,22 +34,21 @@ import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; */ public class RadioGroupWithComponentsItem extends CanvasItem {
- LinkedHashMap valueMap = new LinkedHashMap(); - RGWCCanvas canvas; + private final LinkedHashMap<String, ? extends Canvas> valueMap; + private final RGWCCanvas canvas; + private final DynamicForm form;
- DynamicForm form; + public RadioGroupWithComponentsItem(String name, String title, LinkedHashMap<String, ? extends Canvas> valueMap, + DynamicForm form) {
- public RadioGroupWithComponentsItem(String name, String title, LinkedHashMap valueMap, DynamicForm form) { super(name, title); this.valueMap = valueMap; this.form = form; - canvas = new RGWCCanvas(); - setCanvas(canvas); + this.canvas = new RGWCCanvas(); + setCanvas(this.canvas); }
- public class RGWCCanvas extends DynamicForm { - public RGWCCanvas() { setNumCols(3); } @@ -67,26 +59,18 @@ public class RadioGroupWithComponentsItem extends CanvasItem {
ArrayList<FormItem> items = new ArrayList<FormItem>();
- for (final Object key : valueMap.keySet()) { - - final String label = (String) key; - + for (final String label : valueMap.keySet()) { RadioGroupItem button = new RadioGroupItem(getName(), label); button.setShowTitle(false); button.setStartRow(true); button.setValueMap(label); - items.add(button);
- - - Object value = valueMap.get(key); - if (value instanceof Canvas) { - CanvasItem ci = new CanvasItem(); - ci.setShowTitle(false); - ci.setCanvas((Canvas) value); - items.add(ci); - } + Canvas value = valueMap.get(label); + CanvasItem ci = new CanvasItem(); + ci.setShowTitle(false); + ci.setCanvas(value); + items.add(ci);
button.addChangedHandler(new ChangedHandler() { public void onChanged(ChangedEvent changedEvent) { @@ -96,36 +80,19 @@ public class RadioGroupWithComponentsItem extends CanvasItem { }); } setItems(items.toArray(new FormItem[items.size()])); - - - - addItemChangedHandler(new ItemChangedHandler() { - public void onItemChanged(ItemChangedEvent changedEvent) { - if (getName().equals(changedEvent.getItem().getName())) { - updateEnablement(); - } - } - }); }
public void updateEnablement() { String formValue = form.getValueAsString(getName()); - for (Object key : valueMap.keySet()) { - Object value = valueMap.get(key); + for (String key : valueMap.keySet()) { + Canvas value = valueMap.get(key); if (value != null && value instanceof DynamicForm) { - for (FormItem item : ((DynamicForm)value).getFields()) { + for (FormItem item : ((DynamicForm) value).getFields()) { item.setDisabled(!formValue.equals(key)); - } - -// ((DynamicForm) value).setDisabled(!formValue.equals(key)); } } } }
- - - - } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java new file mode 100644 index 0000000..6625904 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java @@ -0,0 +1,206 @@ +/* + * 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.components.upload; + +import com.google.gwt.core.client.GWT; +import com.smartgwt.client.types.Encoding; +import com.smartgwt.client.widgets.form.events.FormSubmitFailedEvent; +import com.smartgwt.client.widgets.form.events.FormSubmitFailedHandler; +import com.smartgwt.client.widgets.form.fields.ButtonItem; +import com.smartgwt.client.widgets.form.fields.FormItemIcon; +import com.smartgwt.client.widgets.form.fields.HiddenItem; +import com.smartgwt.client.widgets.form.fields.StaticTextItem; +import com.smartgwt.client.widgets.form.fields.UploadItem; +import com.smartgwt.client.widgets.form.fields.events.ClickEvent; +import com.smartgwt.client.widgets.form.fields.events.ClickHandler; + +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.util.message.Message; +import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity; + +public class BundleDistributionFileUploadForm extends DynamicCallbackForm { + + private UploadItem bundleUploadItem; + private ButtonItem uploadButton; + private StaticTextItem icon; + + private Boolean uploadResults; + private int bundleVersionId; + + private final FormItemIcon iconLoading; + private final FormItemIcon iconGreen; + private final FormItemIcon iconRed; + private final boolean showUploadButton; + + public BundleDistributionFileUploadForm(boolean showUploadButton) { + + super("Distribution File"); + this.showUploadButton = showUploadButton; + + setEncoding(Encoding.MULTIPART); + setAction(GWT.getModuleBaseURL() + "/BundleDistributionFileUploadServlet"); + + iconLoading = new FormItemIcon(); + iconLoading.setSrc("ajax-loader.gif"); + iconLoading.setWidth(16); + iconLoading.setHeight(16); + + iconGreen = new FormItemIcon(); + iconGreen.setSrc("/images/icons/availability_green_16.png"); + iconGreen.setWidth(16); + iconGreen.setHeight(16); + + iconRed = new FormItemIcon(); + iconRed.setSrc("/images/icons/availability_red_16.png"); + iconRed.setWidth(16); + iconRed.setHeight(16); + } + + /** + * If this component successfully uploaded a bundle distribution file, this will return + * the new bundle version's ID. Otherwise, 0 is returned. + * + * @return the new bundle version ID + */ + public int getBundleVersionId() { + return this.bundleVersionId; + } + + /** + * Returns true if the file was successfully uploaded, false if an error occurred. + * Returns null if this upload form has not be submitted yet (see {@link #submitForm()}). + * @return status of the upload request + */ + public Boolean getUploadResults() { + return uploadResults; + } + + @Override + public void submitForm() { + Object value = bundleUploadItem.getValue(); + if (value == null || value.toString().length() == 0) { + icon.setIcons(iconRed); + icon.setTooltip("Please select a bundle distribution file to upload"); + } else { + icon.setIcons(iconLoading); + icon.setTooltip("Processing..."); + super.submitForm(); + } + } + + @Override + protected void onDraw() { + super.onDraw(); + + HiddenItem sessionIdField = new HiddenItem("sessionid"); + sessionIdField.setValue(CoreGUI.getSessionSubject().getSessionId().intValue()); + + setNumCols(4); + + bundleUploadItem = new UploadItem("bundleFileUploadItem", "Distribution File"); + bundleUploadItem.setEndRow(false); + bundleUploadItem.setShowTitle(false); + + uploadButton = new ButtonItem("Upload"); + uploadButton.setVisible(this.showUploadButton); + uploadButton.setStartRow(false); + uploadButton.setEndRow(false); + uploadButton.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + submitForm(); + } + }); + + icon = new StaticTextItem("icon"); + icon.setStartRow(false); + icon.setShowTitle(false); + if (uploadResults != null) { + if (uploadResults.booleanValue()) { + icon.setIcons(iconGreen); + icon.setTooltip("Bundle distribution file has already been uploaded"); + } else { + icon.setIcons(iconRed); + icon.setTooltip("Bundle distribution file upload has previously failed"); + } + } else { + icon.setIcons((FormItemIcon) null); + icon.setTooltip("Select a file to upload, then click the 'Upload' button or 'Next'"); + } + icon.setShowIcons(true); + + setItems(sessionIdField, bundleUploadItem, uploadButton, icon); + + addFormHandler(new DynamicFormHandler() { + public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) { + String results = event.getResults(); + int bundleVersionId = parseIdFromResponse(results); + if (bundleVersionId > 0) { + uploadResults = Boolean.TRUE; + icon.setIcons(iconGreen); + icon.setTooltip("Uploaded bundle distribution file successfully"); + CoreGUI.getMessageCenter().notify( + new Message("Uploaded bundle distribution file successfully", results, Severity.Info)); + icon.hide(); + icon.show(); + } else { + uploadResults = Boolean.FALSE; + icon.setIcons(iconRed); + icon.setTooltip("Bundle distribution file upload failed"); + CoreGUI.getMessageCenter().notify( + new Message("Bundle distribution file upload failed", results, Severity.Error)); + icon.hide(); + icon.show(); + } + } + }); + + addFormSubmitFailedHandler(new FormSubmitFailedHandler() { + public void onFormSubmitFailed(FormSubmitFailedEvent event) { + uploadResults = Boolean.FALSE; + icon.setIcons(iconRed); + icon.setTooltip("File upload failed"); + CoreGUI.getMessageCenter().notify( + new Message("Bundle distribution file upload request failed", Severity.Error)); + icon.hide(); + icon.show(); + } + }); + } + + private int parseIdFromResponse(String results) { + String successMsgPrefix = "success ["; // the upload servlet will respond with "success [bundleVersionId]" on success + int startSuccessMsgPrefix = results.indexOf(successMsgPrefix); + if (startSuccessMsgPrefix < 0) { + return 0; // must mean it wasn't a success - results is probably an error message + } + int endSuccessMsgPrefix = startSuccessMsgPrefix + successMsgPrefix.length(); + int startSuccessMsgPostfix = results.indexOf(']', endSuccessMsgPrefix); + if (startSuccessMsgPostfix < 0) { + return 0; // this should never happen, if we have "success [" we should always have the ending "]" bracket + } + String bundleVersionIdString = results.substring(endSuccessMsgPrefix, startSuccessMsgPostfix); + int id = 0; + try { + id = Integer.parseInt(bundleVersionIdString); + } catch (Exception e) { + CoreGUI.getErrorHandler().handleError("Bad distribution file upload results", e); + } + return id; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java index 056caea..5911957 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java @@ -18,6 +18,7 @@ */ package org.rhq.enterprise.gui.coregui.client.gwt;
+import java.net.URL; import java.util.ArrayList; import java.util.HashMap;
@@ -36,10 +37,9 @@ import org.rhq.core.domain.util.PageList;
public interface BundleGWTService extends RemoteService {
- Bundle createBundle(String name, int bundleTypeId) throws Exception; + BundleVersion createBundleVersionViaURL(URL url) throws Exception;
- BundleVersion createBundleAndBundleVersion(String bundleName, int bundleTypeId, String name, String version, - String description, String recipe) throws Exception; + BundleVersion createBundleVersionViaRecipe(String recipe) throws Exception;
BundleDeployment createBundleDeployment(int bundleVersionId, String name, String description, String installDir, Configuration configuration, boolean enforcePolicy, int enforcementInterval, boolean pinToBundle) @@ -63,9 +63,8 @@ public interface BundleGWTService extends RemoteService { ArrayList<BundleType> getAllBundleTypes() throws Exception;
/* - BundleResourceDeployment scheduleBundleResourceDeployment(int bundleDeploymentId, int resourceId) - throws Exception; - */ + BundleResourceDeployment scheduleBundleResourceDeployment(int bundleDeploymentId, int resourceId) throws Exception; + */
BundleGroupDeployment scheduleBundleGroupDeployment(int bundleDeploymentId, int resourceGroupId) throws Exception; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java index c76dd44..57eab54 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleGWTServiceImpl.java @@ -18,6 +18,7 @@ */ package org.rhq.enterprise.gui.coregui.server.gwt;
+import java.net.URL; import java.util.ArrayList; import java.util.HashMap;
@@ -42,27 +43,24 @@ public class BundleGWTServiceImpl extends AbstractGWTServiceImpl implements Bund
private BundleManagerLocal bundleManager = LookupUtil.getBundleManager();
- public Bundle createBundle(String name, int bundleTypeId) throws Exception { - Bundle results; + public BundleVersion createBundleVersionViaURL(URL url) throws Exception { + BundleVersion results; try { - results = bundleManager.createBundle(getSessionSubject(), name, null, bundleTypeId); + results = bundleManager.createBundleVersionViaURL(getSessionSubject(), url); } catch (Exception e) { - throw new Exception(ThrowableUtil.getAllMessages(e)); + throw new RuntimeException(ThrowableUtil.getAllMessages(e)); } - return SerialUtility.prepare(results, "createBundle"); + return SerialUtility.prepare(results, "createBundleVersionViaURL"); }
- public BundleVersion createBundleAndBundleVersion(String bundleName, int bundleTypeId, String name, String version, - String description, String recipe) throws Exception { - + public BundleVersion createBundleVersionViaRecipe(String recipe) throws Exception { BundleVersion results; try { - results = bundleManager.createBundleAndBundleVersion(getSessionSubject(), bundleName, description, - bundleTypeId, name, null, version, recipe); + results = bundleManager.createBundleVersionViaRecipe(getSessionSubject(), recipe); } catch (Exception e) { throw new RuntimeException(ThrowableUtil.getAllMessages(e)); } - return SerialUtility.prepare(results, "createBundleAndBundleVersion"); + return SerialUtility.prepare(results, "createBundleVersionViaRecipe"); }
public BundleDeployment createBundleDeployment(int bundleVersionId, String name, String description, diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java index 1c40606..e6d7f4f 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java @@ -329,6 +329,16 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot }
@RequiredPermission(Permission.MANAGE_INVENTORY) + public BundleVersion createBundleVersionViaRecipe(Subject subject, String recipe) throws Exception { + + BundleServerPluginManager manager = BundleManagerHelper.getPluginContainer().getBundleServerPluginManager(); + BundleDistributionInfo info = manager.parseRecipe(recipe); + BundleVersion bundleVersion = createBundleVersionViaDistributionInfo(subject, info); + + return bundleVersion; + } + + @RequiredPermission(Permission.MANAGE_INVENTORY) @TransactionAttribute(TransactionAttributeType.NEVER) public BundleVersion createBundleVersionViaFile(Subject subject, File distributionFile) throws Exception {
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java index 3ebf90b..1c9c12e 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java @@ -139,6 +139,21 @@ public interface BundleManagerRemote { @WebParam(name = "configuration") Configuration configuration) throws Exception;
/** + * Creates a bundle version based on single recipe string. The recipe specifies the bundle name, + * version, version name and version description. If this is the initial version for the named + * bundle the bundle will be implicitly created. The bundle type is discovered by the bundle server + * plugin that can parse the recipe. + * + * @param subject + * @param recipe the recipe that defines the bundle version to be created + * @return the persisted BundleVersion with alot of the internal relationships filled in to help the caller + * understand all that this method did. + */ + BundleVersion createBundleVersionViaRecipe( // + @WebParam(name = "subject") Subject subject, // + @WebParam(name = "recipe") String recipe) throws Exception; + + /** * Creates a bundle version based on a Bundle Distribution file. Typically a zip file, the bundle distribution * contains the recipe for a supported bundle type, along with 0, 1 or more bundle files that will be associated * with the bundle version. The recipe specifies the bundle name, version, version name and version description. diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/BundleServerPluginManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/BundleServerPluginManager.java index 0122720..55e833f 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/BundleServerPluginManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/bundle/BundleServerPluginManager.java @@ -121,6 +121,56 @@ public class BundleServerPluginManager extends ServerPluginManager { }
/** + * Given just a recipe, this will attempt to parse the given recipe by asking all the + * bundle plugins to see if any can parse it successfully. If the recipe cannot be + * parsed by any plugin, an exception is thrown, otherwise, results are returned. + * + * @param recipe the recipe to parse + * + * @return the results of the parse, which also includes the bundle type + * + * @throws Exception if the recipe could not be parsed successfully + */ + public BundleDistributionInfo parseRecipe(String recipe) throws Exception { + + if (recipe == null) { + throw new IllegalArgumentException("recipe == null"); + } + + BundleDistributionInfo info = null; + + for (ServerPluginEnvironment env : getPluginEnvironments()) { + BundlePluginDescriptorType descriptor = (BundlePluginDescriptorType) env.getPluginDescriptor(); + + // get the facet and see if this plugin can deal with the recipe + String pluginName = env.getPluginKey().getPluginName(); + ServerPluginComponent component = getServerPluginComponent(pluginName); + BundleServerPluginFacet facet = (BundleServerPluginFacet) component; // we know this cast will work because our loadPlugin ensured so + getLog().debug("Bundle server plugin [" + pluginName + "] is parsing a recipe"); + ClassLoader originalContextClassLoader = Thread.currentThread().getContextClassLoader(); + try { + Thread.currentThread().setContextClassLoader(env.getPluginClassLoader()); + try { + RecipeParseResults results = facet.parseRecipe(recipe); + info = new BundleDistributionInfo(recipe, results, null); + info.setBundleTypeName(descriptor.getBundle().getType()); + break; + } catch (Exception e) { + info = null; + } + } finally { + Thread.currentThread().setContextClassLoader(originalContextClassLoader); + } + } + + if (null == info) { + throw new IllegalArgumentException("Invalid recipe not recognized by any deployed server bundle plugin."); + } + + return info; + } + + /** * Given an bundle distribution file, this will find the appropriate server side plugin that can process it * and will ask that plugin to crack open the bundle distribution file and return information about it. * diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java index c3fb229..1be4bcc 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java @@ -345,6 +345,10 @@ public class WebservicesManagerBean implements WebservicesRemote { configuration); }
+ public BundleVersion createBundleVersionViaRecipe(Subject subject, String recipe) throws Exception { + return bundleManager.createBundleVersionViaRecipe(subject, recipe); + } + public BundleVersion createBundleVersionViaFile(Subject subject, File distributionFile) throws Exception { return bundleManager.createBundleVersionViaFile(subject, distributionFile); }
commit 9efb1e1ab362e66399b907d862e632001769e3d5 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 4 16:25:43 2010 -0400
Deploy Wizard Work - updated test scripts and test bundle distributions to fully utilize rhq.deploy.dir and to declare all necessary properties - fixed recipe parser to ignore rhq.deploy.dir replacement var - updated get config step to be skipped if no prop defs are defined
diff --git a/modules/cli-tests/src/test/resources/cli-test-bundle-zip.zip b/modules/cli-tests/src/test/resources/cli-test-bundle-zip.zip index a431142..a370838 100644 Binary files a/modules/cli-tests/src/test/resources/cli-test-bundle-zip.zip and b/modules/cli-tests/src/test/resources/cli-test-bundle-zip.zip differ diff --git a/modules/cli-tests/src/test/resources/cli-test-bundle.zip b/modules/cli-tests/src/test/resources/cli-test-bundle.zip index 9469e02..7260baf 100644 Binary files a/modules/cli-tests/src/test/resources/cli-test-bundle.zip and b/modules/cli-tests/src/test/resources/cli-test-bundle.zip differ diff --git a/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManager.js b/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManager.js index 42b8225..fc50f4f 100644 --- a/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManager.js +++ b/modules/cli-tests/src/test/script/org/rhq/enterprise/remoting/cli/test_bundleManager.js @@ -50,13 +50,10 @@ function testGroupDeployment() { distributionFile = new java.io.File(distributionFile.getAbsolutePath()); var testBundleVersion = BundleManager.createBundleVersionViaFile( distributionFile );
- // create the config, setting the required properties from the recipe - var config = new Configuration(); - var property = new PropertySimple("bundleTest.deployHome", "/tmp/bundle-test"); - config.put( property ); + // there in no required config, it uses only the built in rhq.deploy.dir property
// create a deployment using the above config - var testDeployment = BundleManager.createBundleDeployment(testBundleVersion.getId(), "Deployment Test", "Deployment Test of testBundle WAR", "/tmp/bundle-test", config); + var testDeployment = BundleManager.createBundleDeployment(testBundleVersion.getId(), "Deployment Test", "Deployment Test of testBundle WAR", "/tmp/bundle-test", new Configuration());
// Find a target platform group var rgc = new ResourceGroupCriteria(); diff --git a/modules/common/filetemplate-bundle/src/main/java/org/rhq/bundle/filetemplate/recipe/RecipeParser.java b/modules/common/filetemplate-bundle/src/main/java/org/rhq/bundle/filetemplate/recipe/RecipeParser.java index 54ae226..57fa1f3 100644 --- a/modules/common/filetemplate-bundle/src/main/java/org/rhq/bundle/filetemplate/recipe/RecipeParser.java +++ b/modules/common/filetemplate-bundle/src/main/java/org/rhq/bundle/filetemplate/recipe/RecipeParser.java @@ -48,6 +48,11 @@ import org.rhq.core.template.TemplateEngine; * */ public class RecipeParser { + + private final static String PROPERTY_DEPLOY_DIR = "rhq.deploy.dir"; + /** properties that will be set by the deployment automatically and do not need user definition */ + private final static Set<String> IGNORE_PROPERTIES; + private Map<String, RecipeCommand> recipeCommands;
private Pattern replacementVariableDeclarationPattern; @@ -55,6 +60,11 @@ public class RecipeParser { private String systemReplacementVariablePrefix; private boolean replaceVariables = false;
+ static { + IGNORE_PROPERTIES = new HashSet<String>(); + IGNORE_PROPERTIES.add(PROPERTY_DEPLOY_DIR); + } + public RecipeParser() { this.recipeCommands = createRecipeCommands(); setupReplacementPatterns(); @@ -163,6 +173,9 @@ public class RecipeParser { } }
+ if (null != replacementVariables) { + replacementVariables.removeAll(IGNORE_PROPERTIES); + } return replacementVariables; }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java index 5b8fd90..26db38a 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java @@ -41,9 +41,17 @@ public class GetDeploymentConfigStep implements WizardStep { public Canvas getCanvas() { if (null == editor) { ConfigurationDefinition configDef = wizard.getBundleVersion().getConfigurationDefinition(); - Configuration startingConfig = (null != wizard.getTemplate()) ? wizard.getTemplate().getConfiguration() - : new Configuration(); + Configuration startingConfig = (null != this.wizard.getTemplate()) ? this.wizard.getTemplate() + .getConfiguration() : new Configuration();
+ // if there are no prop defs for this config def then we can skip this step entirely. just + // set an empty config. + if (configDef.getPropertyDefinitions().isEmpty()) { + this.wizard.setConfig(startingConfig); + this.wizard.getView().incrementStep(); + } + + // otherwise, pop up the config editor to get the needed config editor = new ConfigurationEditor(configDef, startingConfig); }
commit 6f2efdd350fa0e050aa22d20e304967ece6c25b3 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 4 14:09:03 2010 -0400
Deplow Wizard Work - remove single resource deploy - added install dir to deployment info - disabled config template selection - disabled scheduled deployment - added bundle selection (probably useful mostly for testing) - re-ordered workflow - renamed/refactored for clarity
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java new file mode 100644 index 0000000..1a32d4b --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java @@ -0,0 +1,103 @@ +/* + * 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.bundle; + +import java.util.ArrayList; +import java.util.Collection; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.SelectItem; +import com.smartgwt.client.widgets.form.fields.TextItem; +import com.smartgwt.client.widgets.grid.ListGridRecord; + +import org.rhq.core.domain.bundle.Bundle; +import org.rhq.core.domain.bundle.BundleType; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.bundle.list.BundlesDataSource; +import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.AbstractSelector; +import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; + +/** + * @author Jay Shaughnessy + */ +public class BundleSelector extends AbstractSelector<Bundle> { + + private BundleGWTServiceAsync bundleService = GWTServiceLookup.getBundleService(); + + public BundleSelector() { + super(); + } + + protected DynamicForm getAvailableFilterForm() { + DynamicForm availableFilterForm = new DynamicForm(); + availableFilterForm.setNumCols(4); + final TextItem search = new TextItem("search", "Search"); + + final SelectItem bundleTypeSelect = new SelectItem("bundleType", "Bundle Type"); + bundleService.getAllBundleTypes(new AsyncCallback<ArrayList<BundleType>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load Bundle data", caught); + } + + public void onSuccess(ArrayList<BundleType> result) { + String[] values = new String[result.size()]; + for (int i = 0, size = result.size(); (i < size); ++i) { + values[i] = result.get(i).getName(); + } + bundleTypeSelect.setValueMap(values); + } + }); + bundleTypeSelect.setAllowEmptyValue(true); + availableFilterForm.setItems(search, bundleTypeSelect); + + return availableFilterForm; + } + + protected RPCDataSource<Bundle> getDataSource() { + return new SelectedBundleDataSource(); + } + + protected Criteria getLatestCriteria(DynamicForm availableFilterForm) { + Criteria latestCriteria = new Criteria(); + Object search = availableFilterForm.getValue("search"); + Object bundleType = availableFilterForm.getValue("bundleType"); + latestCriteria.setAttribute("name", search); + latestCriteria.setAttribute("bundleType", bundleType); + + return latestCriteria; + } + + private class SelectedBundleDataSource extends BundlesDataSource { + + @Override + public ListGridRecord[] buildRecords(Collection<Bundle> bundles) { + ListGridRecord[] records = super.buildRecords(bundles); + for (ListGridRecord record : records) { + if (selection.contains(record.getAttributeAsInt("id"))) { + record.setEnabled(false); + } + } + return records; + } + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java index fde6047..4a51bfc 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java @@ -18,10 +18,8 @@ */ package org.rhq.enterprise.gui.coregui.client.bundle.deploy;
-import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; import org.rhq.core.domain.bundle.BundleGroupDeployment; -import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.definition.ConfigurationTemplate; @@ -34,27 +32,26 @@ import org.rhq.enterprise.gui.coregui.client.bundle.AbstractBundleWizard; public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard {
// the things we build up in the wizard - private Bundle bundle; + private Integer bundleId; private BundleVersion bundleVersion; + private Integer platformGroupId; private BundleDeployment bundleDeployment; - private BundleResourceDeployment resourceDeployment; private BundleGroupDeployment groupDeployment; private String name; private String description; private String installDir; private ConfigurationTemplate template; private Configuration config; - private Integer deployTargetId; + private Boolean newDefinition = Boolean.TRUE; private boolean deployNow = true; - private boolean resourceDeploy = true;
- public Bundle getBundle() { - return bundle; + public Integer getBundleId() { + return bundleId; }
- public void setBundle(Bundle bundle) { - this.bundle = bundle; + public void setBundleId(Integer bundleId) { + this.bundleId = bundleId; }
public BundleVersion getBundleVersion() { @@ -118,23 +115,11 @@ public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard { }
public Integer getPlatformGroupId() { - return deployTargetId; + return platformGroupId; }
public void setPlatformGroupId(Integer platformGroupId) { - this.deployTargetId = platformGroupId; - } - - public Integer getDeployTargetId() { - return deployTargetId; - } - - public void setDeployTargetId(Integer deployTargetId) { - this.deployTargetId = deployTargetId; - } - - public boolean isResourceDeploy() { - return resourceDeploy; + this.platformGroupId = platformGroupId; }
public Boolean isDeployNow() { @@ -145,18 +130,6 @@ public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard { this.deployNow = deployNow; }
- public void setResourceDeploy(boolean resourceDeploy) { - this.resourceDeploy = resourceDeploy; - } - - public BundleResourceDeployment getResourceDeployment() { - return resourceDeployment; - } - - public void setResourceDeployment(BundleResourceDeployment resourceDeployment) { - this.resourceDeployment = resourceDeployment; - } - public BundleGroupDeployment getGroupDeployment() { return groupDeployment; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java index 4c674c0..b84602a 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java @@ -21,50 +21,96 @@ package org.rhq.enterprise.gui.coregui.client.bundle.deploy; import java.util.ArrayList; import java.util.List;
-import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleDeployment; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
public class BundleDeployWizard extends AbstractBundleDeployWizard {
- public BundleDeployWizard(Bundle bundle) { + public BundleDeployWizard() { List<WizardStep> steps = init(); - setBundle(bundle); + steps.add(new SelectDestinationStep(this)); + steps.add(new SelectBundleStep(this)); + steps.add(new SelectBundleVersionStep(this)); + steps.add(new GetDeploymentInfoStep(this)); + steps.add(new GetDeploymentConfigStep(this)); + steps.add(new DeployStep(this)); + } + + public BundleDeployWizard(Integer platformGroupId) { + this.setPlatformGroupId(platformGroupId);
+ List<WizardStep> steps = init(); + if (null == this.getPlatformGroupId()) { + steps.add(new SelectDestinationStep(this)); + } + steps.add(new SelectBundleStep(this)); steps.add(new SelectBundleVersionStep(this)); - steps.add(new BundleDeploymentInfoStep(this)); - steps.add(new SelectTemplateStep(this)); - steps.add(new CreateConfigStep(this)); - steps.add(new DeployOptionsStep(this)); - steps.add(new DeployTargetStep(this)); + steps.add(new GetDeploymentInfoStep(this)); + steps.add(new GetDeploymentConfigStep(this)); steps.add(new DeployStep(this)); }
- public BundleDeployWizard(Bundle bundle, BundleVersion bundleVersion) { + public BundleDeployWizard(Integer platformGroupId, Integer bundleId) { + this.setPlatformGroupId(platformGroupId); + this.setBundleId(bundleId); + List<WizardStep> steps = init(); - setBundle(bundle); - setBundleVersion(bundleVersion); - - steps.add(new BundleDeploymentInfoStep(this)); - steps.add(new SelectTemplateStep(this)); - steps.add(new CreateConfigStep(this)); - steps.add(new DeployOptionsStep(this)); - steps.add(new DeployTargetStep(this)); + if (null == this.getPlatformGroupId()) { + steps.add(new SelectDestinationStep(this)); + } + if (null == this.getBundleId()) { + steps.add(new SelectBundleStep(this)); + } + steps.add(new SelectBundleVersionStep(this)); + steps.add(new GetDeploymentInfoStep(this)); + steps.add(new GetDeploymentConfigStep(this)); steps.add(new DeployStep(this)); }
- public BundleDeployWizard(Bundle bundle, BundleVersion bundleVersion, BundleDeployment bundleDeployment) { + public BundleDeployWizard(Integer platformGroupId, Integer bundleId, BundleVersion bundleVersion) { + this.setPlatformGroupId(platformGroupId); + this.setBundleId(bundleId); + this.setBundleVersion(bundleVersion); + List<WizardStep> steps = init(); - setBundle(bundle); - setBundleVersion(bundleVersion); - setBundleDeployment(bundleDeployment); + if (null == this.getPlatformGroupId()) { + steps.add(new SelectDestinationStep(this)); + } + if (null == this.getBundleId()) { + steps.add(new SelectBundleStep(this)); + } + if (null == this.getBundleVersion()) { + steps.add(new SelectBundleVersionStep(this)); + } + steps.add(new GetDeploymentInfoStep(this)); + steps.add(new GetDeploymentConfigStep(this)); + steps.add(new DeployStep(this)); + } + + public BundleDeployWizard(BundleDeployment bundleDeployment) { + List<WizardStep> steps = init(); + this.setBundleId(bundleDeployment.getBundleVersion().getBundle().getId()); + this.setBundleVersion(bundleDeployment.getBundleVersion()); + this.setBundleDeployment(bundleDeployment); + setNewDefinition(Boolean.FALSE); + + steps.add(new SelectDestinationStep(this)); + steps.add(new GetDeploymentConfigStep(this)); + steps.add(new DeployStep(this)); + } + + public BundleDeployWizard(Integer platformGroupId, BundleDeployment bundleDeployment) { + List<WizardStep> steps = init(); + this.setBundleId(bundleDeployment.getBundleVersion().getBundle().getId()); + this.setBundleVersion(bundleDeployment.getBundleVersion()); + this.setBundleDeployment(bundleDeployment); setNewDefinition(Boolean.FALSE);
- steps.add(new SelectTemplateStep(this)); - steps.add(new CreateConfigStep(this)); - steps.add(new DeployOptionsStep(this)); - steps.add(new DeployTargetStep(this)); + if (null == this.getPlatformGroupId()) { + steps.add(new SelectDestinationStep(this)); + } + steps.add(new GetDeploymentConfigStep(this)); steps.add(new DeployStep(this)); }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeploymentInfoStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeploymentInfoStep.java deleted file mode 100644 index 70a94ee..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeploymentInfoStep.java +++ /dev/null @@ -1,89 +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.bundle.deploy; - -import com.smartgwt.client.widgets.Canvas; -import com.smartgwt.client.widgets.form.DynamicForm; -import com.smartgwt.client.widgets.form.fields.TextAreaItem; -import com.smartgwt.client.widgets.form.fields.TextItem; -import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; -import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; - -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; - -/** - * @author Jay Shaughnessy - * - */ -public class BundleDeploymentInfoStep implements WizardStep { - - private DynamicForm form; - private final BundleDeployWizard wizard; - - // private final BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); - - public BundleDeploymentInfoStep(BundleDeployWizard bundleDeployWizard) { - this.wizard = bundleDeployWizard; - } - - public String getName() { - return "Provide Deployment Information"; - } - - public Canvas getCanvas() { - if (form == null) { - form = new DynamicForm(); - form.setWidth100(); - form.setNumCols(2); - form.setColWidths("50%", "*"); - - final TextItem nameTextItem = new TextItem("name", "Name"); - nameTextItem.setRequired(true); - nameTextItem.addChangedHandler(new ChangedHandler() { - public void onChanged(ChangedEvent event) { - Object value = event.getValue(); - if (value == null) { - value = ""; - } - wizard.setSubtitle(value.toString()); - wizard.setName(value.toString()); - } - }); - - final TextAreaItem descriptionTextAreaItem = new TextAreaItem("description", "Description"); - descriptionTextAreaItem.addChangedHandler(new ChangedHandler() { - public void onChanged(ChangedEvent event) { - Object value = event.getValue(); - if (value == null) { - value = ""; - } - wizard.setDescription(value.toString()); - } - }); - - form.setItems(nameTextItem, descriptionTextAreaItem); - } - - return form; - } - - public boolean nextPage() { - return form.validate(); - } -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/CreateConfigStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/CreateConfigStep.java deleted file mode 100644 index 7456625..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/CreateConfigStep.java +++ /dev/null @@ -1,57 +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.bundle.deploy; - -import com.smartgwt.client.widgets.Canvas; - -import org.rhq.core.domain.configuration.Configuration; -import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; -import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; - -public class CreateConfigStep implements WizardStep { - - private final BundleDeployWizard wizard; - private ConfigurationEditor editor; - - public CreateConfigStep(BundleDeployWizard bundleCreationWizard) { - this.wizard = bundleCreationWizard; - } - - public String getName() { - return "Set Deployment Configuration"; - } - - public Canvas getCanvas() { - if (null == editor) { - ConfigurationDefinition configDef = wizard.getBundleVersion().getConfigurationDefinition(); - Configuration startingConfig = (null != wizard.getTemplate()) ? wizard.getTemplate().getConfiguration() - : new Configuration(); - - editor = new ConfigurationEditor(configDef, startingConfig); - } - - return editor; - } - - public boolean nextPage() { - wizard.setConfig(editor.getConfiguration()); - return true; - } -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployOptionsStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployOptionsStep.java deleted file mode 100644 index 730a466..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployOptionsStep.java +++ /dev/null @@ -1,96 +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.bundle.deploy; - -import java.util.LinkedHashMap; - -import com.smartgwt.client.widgets.Canvas; -import com.smartgwt.client.widgets.form.DynamicForm; -import com.smartgwt.client.widgets.form.fields.RadioGroupItem; -import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; -import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; - -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; - -public class DeployOptionsStep implements WizardStep { - - static private final String DEPLOY_LATER = "later"; - static private final String DEPLOY_NOW = "now"; - - static private final String DEPLOY_GROUP = "group"; - static private final String DEPLOY_RESOURCE = "resource"; - - private final BundleDeployWizard wizard; - private DynamicForm form; - private RadioGroupItem rgDeployTimeItem; - private RadioGroupItem rgDeployTypeItem; - - public DeployOptionsStep(BundleDeployWizard bundleCreationWizard) { - this.wizard = bundleCreationWizard; - } - - public String getName() { - return "Deploy Options"; - } - - public Canvas getCanvas() { - if (form == null) { - form = new DynamicForm(); - form.setWidth100(); - form.setNumCols(2); - form.setColWidths("50%", "*"); - - rgDeployTimeItem = new RadioGroupItem("deployTime", "Deployment Time"); - LinkedHashMap<String, String> deployTimeValues = new LinkedHashMap<String, String>(); - deployTimeValues.put(DEPLOY_NOW, "Deploy Now"); - deployTimeValues.put(DEPLOY_LATER, "Deploy Later"); - rgDeployTimeItem.setRequired(true); - rgDeployTimeItem.setValueMap(deployTimeValues); - rgDeployTimeItem.setValue(DEPLOY_NOW); - wizard.setDeployNow(true); - rgDeployTimeItem.addChangedHandler(new ChangedHandler() { - public void onChanged(ChangedEvent event) { - wizard.setDeployNow(DEPLOY_NOW.equals(event.getValue())); - rgDeployTypeItem.setDisabled(!wizard.isDeployNow()); - } - }); - - rgDeployTypeItem = new RadioGroupItem("deployTarget", "Deployment Target"); - LinkedHashMap<String, String> deployTypeValues = new LinkedHashMap<String, String>(); - deployTypeValues.put(DEPLOY_RESOURCE, "Deploy to Single Resource"); - deployTypeValues.put(DEPLOY_GROUP, "Deploy to Group of Resources"); - rgDeployTypeItem.setRequired(true); - rgDeployTypeItem.setValueMap(deployTypeValues); - rgDeployTypeItem.setValue(DEPLOY_RESOURCE); - wizard.setResourceDeploy(true); - rgDeployTypeItem.addChangedHandler(new ChangedHandler() { - public void onChanged(ChangedEvent event) { - wizard.setResourceDeploy(DEPLOY_RESOURCE.equals(event.getValue())); - } - }); - - form.setItems(rgDeployTimeItem, rgDeployTypeItem); - } - return form; - } - - public boolean nextPage() { - return form.validate(); - } -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java index 32bedf2..baaddc5 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java @@ -51,7 +51,7 @@ public class DeployStep implements WizardStep { }
public String getName() { - return "Deploy Bundle to Target Platforms"; + return "Deploy Bundle to Destination Platforms"; }
public Canvas getCanvas() { @@ -84,53 +84,27 @@ public class DeployStep implements WizardStep { + result.getDescription(), Severity.Info)); wizard.setBundleDeployment(result);
- if (wizard.isResourceDeploy()) { - /* - bundleServer.scheduleBundleResourceDeployment(wizard.getBundleDeployment().getId(), - wizard.getDeployTargetId(), // - new AsyncCallback<BundleResourceDeployment>() { - public void onSuccess(BundleResourceDeployment result) { - deployingImage.setSrc("/images/status_complete.gif"); - deployingMessage.setText("Bundle Deployment Scheduled!"); - CoreGUI.getMessageCenter().notify( - new Message("Schedule bundle deployment [" - + wizard.getBundleDeployment().getName() + "] resource [" - + result.getResource() + "]", Severity.Info)); - wizard.setResourceDeployment(result); - } - - public void onFailure(Throwable caught) { - deployingImage.setSrc("/images/status_error.gif"); - deployingMessage.setText("Failed to Schedule Deployment!"); - CoreGUI.getErrorHandler().handleError( - "Failed to schedule deployment: " + caught.getMessage(), caught); - wizard.setResourceDeployment(null); - } - }); - */ - } else { - bundleServer.scheduleBundleGroupDeployment(wizard.getBundleDeployment().getId(), wizard - .getDeployTargetId(), // - new AsyncCallback<BundleGroupDeployment>() { - public void onSuccess(BundleGroupDeployment result) { - deployingImage.setSrc("/images/status_complete.gif"); - deployingMessage.setText("Bundle Group Deployment Scheduled!"); - CoreGUI.getMessageCenter().notify( - new Message("Schedule bundle group deployment [" - + wizard.getBundleDeployment().getName() + "] resource group [" - + result.getGroup() + "]", Severity.Info)); - wizard.setGroupDeployment(result); - } - - public void onFailure(Throwable caught) { - deployingImage.setSrc("/images/status_error.gif"); - deployingMessage.setText("Failed to Schedule Group Deployment!"); - CoreGUI.getErrorHandler().handleError( - "Failed to schedule group deployment: " + caught.getMessage(), caught); - wizard.setGroupDeployment(null); - } - }); - } + bundleServer.scheduleBundleGroupDeployment(wizard.getBundleDeployment().getId(), wizard + .getPlatformGroupId(), // + new AsyncCallback<BundleGroupDeployment>() { + public void onSuccess(BundleGroupDeployment result) { + deployingImage.setSrc("/images/status_complete.gif"); + deployingMessage.setText("Bundle Group Deployment Scheduled!"); + CoreGUI.getMessageCenter().notify( + new Message("Schedule bundle group deployment [" + + wizard.getBundleDeployment().getName() + "] resource group [" + + result.getGroup() + "]", Severity.Info)); + wizard.setGroupDeployment(result); + } + + public void onFailure(Throwable caught) { + deployingImage.setSrc("/images/status_error.gif"); + deployingMessage.setText("Failed to Schedule Group Deployment!"); + CoreGUI.getErrorHandler().handleError( + "Failed to schedule group deployment: " + caught.getMessage(), caught); + wizard.setGroupDeployment(null); + } + }); }
public void onFailure(Throwable caught) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployTargetStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployTargetStep.java deleted file mode 100644 index b6803bb..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployTargetStep.java +++ /dev/null @@ -1,68 +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.bundle.deploy; - -import java.util.HashSet; - -import com.smartgwt.client.util.SC; -import com.smartgwt.client.widgets.Canvas; - -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.AbstractSelector; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceGroupSelector; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceSelector; - -public class DeployTargetStep implements WizardStep { - - private final BundleDeployWizard wizard; - - private AbstractSelector selector; - - public DeployTargetStep(BundleDeployWizard bundleCreationWizard) { - this.wizard = bundleCreationWizard; - } - - public String getName() { - return this.wizard.isResourceDeploy() ? "Select Target Resource" : "Select Target Group"; - } - - public Canvas getCanvas() { - if ((null == selector) || isMismatch()) { - selector = this.wizard.isResourceDeploy() ? new ResourceSelector() : new ResourceGroupSelector(); - } - - return selector; - } - - private boolean isMismatch() { - return ((selector instanceof ResourceSelector && !this.wizard.isResourceDeploy()) || (selector instanceof ResourceGroupSelector && this.wizard - .isResourceDeploy())); - } - - public boolean nextPage() { - HashSet<Integer> selection = selector.getSelection(); - if (selection.size() != 1) { - SC.warn("Select only a single target resource for deployment. Use group deploy for multiple targets."); - return false; - } - - wizard.setDeployTargetId(selection.iterator().next()); - return true; - } -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java new file mode 100644 index 0000000..5b8fd90 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java @@ -0,0 +1,57 @@ +/* + * 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.bundle.deploy; + +import com.smartgwt.client.widgets.Canvas; + +import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; +import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor; +import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; + +public class GetDeploymentConfigStep implements WizardStep { + + private final BundleDeployWizard wizard; + private ConfigurationEditor editor; + + public GetDeploymentConfigStep(BundleDeployWizard bundleCreationWizard) { + this.wizard = bundleCreationWizard; + } + + public String getName() { + return "Set Deployment Configuration"; + } + + public Canvas getCanvas() { + if (null == editor) { + ConfigurationDefinition configDef = wizard.getBundleVersion().getConfigurationDefinition(); + Configuration startingConfig = (null != wizard.getTemplate()) ? wizard.getTemplate().getConfiguration() + : new Configuration(); + + editor = new ConfigurationEditor(configDef, startingConfig); + } + + return editor; + } + + public boolean nextPage() { + wizard.setConfig(editor.getConfiguration()); + return true; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java new file mode 100644 index 0000000..3dc7c2f --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java @@ -0,0 +1,102 @@ +/* + * 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.bundle.deploy; + +import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.TextAreaItem; +import com.smartgwt.client.widgets.form.fields.TextItem; +import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; +import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; + +import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; + +/** + * @author Jay Shaughnessy + * + */ +public class GetDeploymentInfoStep implements WizardStep { + + private DynamicForm form; + private final BundleDeployWizard wizard; + + // private final BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); + + public GetDeploymentInfoStep(BundleDeployWizard bundleDeployWizard) { + this.wizard = bundleDeployWizard; + } + + public String getName() { + return "Provide Deployment Information"; + } + + public Canvas getCanvas() { + if (form == null) { + form = new DynamicForm(); + form.setWidth100(); + form.setNumCols(2); + form.setColWidths("50%", "*"); + + final TextItem nameTextItem = new TextItem("name", "Deployment Name"); + nameTextItem.setRequired(true); + nameTextItem.addChangedHandler(new ChangedHandler() { + public void onChanged(ChangedEvent event) { + Object value = event.getValue(); + if (value == null) { + value = ""; + } + wizard.setSubtitle(value.toString()); + wizard.setName(value.toString()); + } + }); + + final TextAreaItem descriptionTextAreaItem = new TextAreaItem("description", "Deployment Description"); + descriptionTextAreaItem.addChangedHandler(new ChangedHandler() { + public void onChanged(ChangedEvent event) { + Object value = event.getValue(); + if (value == null) { + value = ""; + } + wizard.setDescription(value.toString()); + } + }); + + final TextItem installDirTextItem = new TextItem("installDir", + "Root Installation Directory (on destination platform)"); + installDirTextItem.setRequired(true); + installDirTextItem.addChangedHandler(new ChangedHandler() { + public void onChanged(ChangedEvent event) { + Object value = event.getValue(); + if (value == null) { + value = ""; + } + wizard.setInstallDir(value.toString()); + } + }); + + form.setItems(nameTextItem, descriptionTextAreaItem, installDirTextItem); + } + + return form; + } + + public boolean nextPage() { + return form.validate(); + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java new file mode 100644 index 0000000..1256135 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java @@ -0,0 +1,77 @@ +/* + * 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.bundle.deploy; + +import java.util.LinkedHashMap; + +import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.RadioGroupItem; +import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; +import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; + +import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; + +public class GetDeploymentOptionsStep implements WizardStep { + + static private final String DEPLOY_LATER = "later"; + static private final String DEPLOY_NOW = "now"; + + private final BundleDeployWizard wizard; + private DynamicForm form; + private RadioGroupItem rgDeployTimeItem; + + public GetDeploymentOptionsStep(BundleDeployWizard bundleCreationWizard) { + this.wizard = bundleCreationWizard; + } + + public String getName() { + return "Deploy Options"; + } + + public Canvas getCanvas() { + if (form == null) { + form = new DynamicForm(); + form.setWidth100(); + form.setNumCols(2); + form.setColWidths("50%", "*"); + + rgDeployTimeItem = new RadioGroupItem("deployTime", "Deployment Time"); + LinkedHashMap<String, String> deployTimeValues = new LinkedHashMap<String, String>(); + deployTimeValues.put(DEPLOY_NOW, "Deploy Now"); + deployTimeValues.put(DEPLOY_LATER, "Deploy Later"); + rgDeployTimeItem.setRequired(true); + rgDeployTimeItem.setValueMap(deployTimeValues); + rgDeployTimeItem.setValue(DEPLOY_NOW); + wizard.setDeployNow(true); + rgDeployTimeItem.addChangedHandler(new ChangedHandler() { + public void onChanged(ChangedEvent event) { + wizard.setDeployNow(DEPLOY_NOW.equals(event.getValue())); + } + }); + + form.setItems(rgDeployTimeItem); + } + return form; + } + + public boolean nextPage() { + return form.validate(); + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java new file mode 100644 index 0000000..f038e81 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java @@ -0,0 +1,60 @@ +/* + * 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.bundle.deploy; + +import java.util.HashSet; + +import com.smartgwt.client.util.SC; +import com.smartgwt.client.widgets.Canvas; + +import org.rhq.core.domain.bundle.Bundle; +import org.rhq.enterprise.gui.coregui.client.bundle.BundleSelector; +import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.AbstractSelector; + +public class SelectBundleStep implements WizardStep { + + private final BundleDeployWizard wizard; + + private AbstractSelector<Bundle> selector; + + public SelectBundleStep(BundleDeployWizard bundleCreationWizard) { + this.wizard = bundleCreationWizard; + } + + public String getName() { + return "Select Deployment Bundle"; + } + + public Canvas getCanvas() { + this.selector = new BundleSelector(); + return this.selector; + } + + public boolean nextPage() { + HashSet<Integer> selection = this.selector.getSelection(); + if (selection.size() != 1) { + SC.warn("Select only a single bundle for deployment."); + return false; + } + + this.wizard.setBundleId(selection.iterator().next()); + return true; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java index 700104f..c4040bb 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java @@ -59,7 +59,7 @@ public class SelectBundleVersionStep implements WizardStep { }
public String getName() { - return "Select Bundle Version"; + return "Select Deployment Bundle Version"; }
public Canvas getCanvas() { @@ -106,7 +106,7 @@ public class SelectBundleVersionStep implements WizardStep {
private void setItemValues() { BundleVersionCriteria criteria = new BundleVersionCriteria(); - criteria.addFilterBundleId(wizard.getBundle().getId()); + criteria.addFilterBundleId(wizard.getBundleId()); criteria.fetchConfigurationDefinition(true); bundleServer.findBundleVersionsByCriteria(criteria, // new AsyncCallback<PageList<BundleVersion>>() { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectDestinationStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectDestinationStep.java new file mode 100644 index 0000000..8ec15ca --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectDestinationStep.java @@ -0,0 +1,60 @@ +/* + * 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.bundle.deploy; + +import java.util.HashSet; + +import com.smartgwt.client.util.SC; +import com.smartgwt.client.widgets.Canvas; + +import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.AbstractSelector; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceGroupSelector; + +public class SelectDestinationStep implements WizardStep { + + private final BundleDeployWizard wizard; + + private AbstractSelector<ResourceGroup> selector; + + public SelectDestinationStep(BundleDeployWizard bundleCreationWizard) { + this.wizard = bundleCreationWizard; + } + + public String getName() { + return "Select Destination Platform Group"; + } + + public Canvas getCanvas() { + this.selector = new ResourceGroupSelector(); + return this.selector; + } + + public boolean nextPage() { + HashSet<Integer> selection = this.selector.getSelection(); + if (selection.size() != 1) { + SC.warn("Select only a single destination group for deployment."); + return false; + } + + this.wizard.setPlatformGroupId(selection.iterator().next()); + return true; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesDataSource.java index c24bf0c..9b70e92 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesDataSource.java @@ -52,6 +52,8 @@ public class BundlesDataSource extends RPCDataSource<Bundle> { DataSourceTextField descriptionField = new DataSourceTextField("description", "Description"); addField(descriptionField);
+ DataSourceTextField bundleTypeDataField = new DataSourceTextField("bundleType", "Bundle Type"); + addField(bundleTypeDataField); }
@Override @@ -88,12 +90,11 @@ public class BundlesDataSource extends RPCDataSource<Bundle> { record.setAttribute("id", from.getId()); record.setAttribute("name", from.getName()); record.setAttribute("description", from.getDescription()); - record.setAttribute("bundleType", from.getBundleType()); - record.setAttribute("repos", from.getRepo()); + record.setAttribute("bundleType", from.getBundleType().getName()); + record.setAttribute("repo", from.getRepo().getName());
record.setAttribute("object", from);
return record; - } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java index 2d49a44..c68ddac 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java @@ -19,13 +19,10 @@ package org.rhq.enterprise.gui.coregui.client.bundle.list;
import com.google.gwt.user.client.rpc.AsyncCallback; -import com.smartgwt.client.types.Overflow; import com.smartgwt.client.types.SelectionAppearance; import com.smartgwt.client.types.SelectionStyle; import com.smartgwt.client.widgets.grid.CellFormatter; import com.smartgwt.client.widgets.grid.ListGridRecord; -import com.smartgwt.client.widgets.grid.events.RecordClickEvent; -import com.smartgwt.client.widgets.grid.events.RecordClickHandler; import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.bundle.Bundle; @@ -71,8 +68,6 @@ public class BundlesListView extends VLayout { } });
- - table.getListGrid().getField("description").setWidth("25%"); table.getListGrid().getField("latestVersion").setWidth("25%"); table.getListGrid().getField("versionsCount").setWidth("*"); @@ -137,8 +132,15 @@ public class BundlesListView extends VLayout { } });
- table.addTableAction("Deploy", Table.SelectionEnablement.SINGLE, null, new TableAction() { + // can change this back to SINGLE selection when we feel like it. currently allowing the wizard to + // select the bundle. + table.addTableAction("Deploy", Table.SelectionEnablement.ALWAYS, null, new TableAction() { public void executeAction(ListGridRecord[] selection) { + if (selection.length == 0) { + new BundleDeployWizard().startBundleWizard(); + return; + } + BundlesWithLatestVersionDataSource ds = (BundlesWithLatestVersionDataSource) table.getDataSource(); final BundleWithLatestVersionComposite object = ds.copyValues(selection[0]); BundleCriteria bc = new BundleCriteria(); @@ -153,11 +155,11 @@ public class BundlesListView extends VLayout { public void onSuccess(PageList<Bundle> result) { if (result == null || result.size() != 1) { CoreGUI.getMessageCenter().notify( - new Message("Failed to get bundle to deploy [" + object.getBundleName() + "]", + new Message("Failed to get single bundle to deploy [" + object.getBundleName() + "]", Severity.Error)); return; } - new BundleDeployWizard(result.get(0)).startBundleWizard(); + new BundleDeployWizard(null, result.get(0).getId()).startBundleWizard(); } }); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java index 5738bd4..b652887 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java @@ -55,7 +55,7 @@ public class ResourceGroupsDataSource extends RPCDataSource<ResourceGroup> { }
public ResourceGroupsDataSource() { -// super("ResourceGroups"); + // super("ResourceGroups");
DataSourceField idDataField = new DataSourceIntegerField("id", "ID", 20); idDataField.setPrimaryKey(true); @@ -83,7 +83,7 @@ public class ResourceGroupsDataSource extends RPCDataSource<ResourceGroup> {
if (request.getCriteria().getValues().get("category") != null) { criteria.addFilterGroupCategory(GroupCategory.valueOf(((String) request.getCriteria().getValues().get( - "category")).toUpperCase())); + "groupCategory")).toUpperCase())); }
if (request.getCriteria().getValues().get("downMemberCount") != null) { @@ -120,7 +120,7 @@ public class ResourceGroupsDataSource extends RPCDataSource<ResourceGroup> { record.setAttribute("id", from.getId()); record.setAttribute("name", from.getName()); record.setAttribute("description", from.getDescription()); - record.setAttribute("groupCategory", from.getGroupCategory()); + record.setAttribute("category", from.getGroupCategory().toString());
if (from.getResourceType() != null) { record.setAttribute("resourceType", from.getResourceType()); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java index e4d9a5b..3e3e64d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java @@ -26,8 +26,8 @@ import com.smartgwt.client.widgets.form.fields.SelectItem; import com.smartgwt.client.widgets.form.fields.TextItem; import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.core.domain.resource.group.GroupCategory; import org.rhq.core.domain.resource.group.ResourceGroup; -import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupsDataSource; import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
@@ -45,8 +45,8 @@ public class ResourceGroupSelector extends AbstractSelector<ResourceGroup> { availableFilterForm.setNumCols(4); final TextItem search = new TextItem("search", "Search");
- SelectItem groupCategorySelect = new SelectItem("groupCategory", "Group Category"); - groupCategorySelect.setValueMap("Compatible", "Mixed"); + SelectItem groupCategorySelect = new SelectItem("category", "Category"); + groupCategorySelect.setValueMap(GroupCategory.COMPATIBLE.toString(), GroupCategory.MIXED.toString()); groupCategorySelect.setAllowEmptyValue(true); availableFilterForm.setItems(search, groupCategorySelect);
@@ -60,9 +60,9 @@ public class ResourceGroupSelector extends AbstractSelector<ResourceGroup> { protected Criteria getLatestCriteria(DynamicForm availableFilterForm) { Criteria latestCriteria = new Criteria(); Object search = availableFilterForm.getValue("search"); - Object category = availableFilterForm.getValue("groupCategory"); + Object category = availableFilterForm.getValue("category"); latestCriteria.setAttribute("name", search); - latestCriteria.setAttribute("groupCategory", category); + latestCriteria.setAttribute("category", category);
return latestCriteria; }
commit 8a35f876ae14dc7753f876e5b70278d6c89d6457 Author: Ian P. Springer <ips@jetengine.(none)> Date: Tue May 4 14:07:24 2010 -0400
fix mistakes in display name and description of proxyURL content source config property
diff --git a/modules/enterprise/server/plugins/jboss-software/src/main/resources/META-INF/rhq-serverplugin.xml b/modules/enterprise/server/plugins/jboss-software/src/main/resources/META-INF/rhq-serverplugin.xml index 9f98351..229db64 100644 --- a/modules/enterprise/server/plugins/jboss-software/src/main/resources/META-INF/rhq-serverplugin.xml +++ b/modules/enterprise/server/plugins/jboss-software/src/main/resources/META-INF/rhq-serverplugin.xml @@ -18,7 +18,8 @@ apiClass="org.rhq.enterprise.server.plugins.jboss.software.JBossSoftwareContentSourceAdapter">
<configuration> - <c:group name="csp" displayName="CSP Feed Settings"> + + <c:group name="csp" displayName="CSP Feed Settings"> <c:simple-property name="url" displayName="Feed URL" type="string" required="true" description="URL of the RSS feed."/> <c:simple-property name="username" displayName="Username" type="string" required="false" @@ -28,18 +29,21 @@ <c:simple-property name="active" displayName="Active" type="boolean" required="true" default="true" description="Indicates if this instance should go out and check the feed for packages."/> </c:group> + <c:group name="proxy" displayName="Proxy Settings" hiddenByDefault="true"> - <c:simple-property name="proxyUrl" displayName="Proxy URL" type="string" required="false" - description="Optional. URL of the proxy server to use for this connection."/> + <c:simple-property name="proxyUrl" displayName="Proxy Host" type="string" required="false" + description="Optional. Hostname or IP address of the HTTP proxy server to use for this connection."/> <c:simple-property name="proxyPort" displayName="Proxy Port" type="string" required="false" - description="Optional. Port of the proxy server to use for this connection."/> + description="Optional. TCP port of the HTTP proxy server to use for this connection."/> <c:simple-property name="proxyUsername" displayName="Proxy Username" type="string" required="false" - description="Optional. If the proxy requires authentication, this is the user to log in as."/> + description="Optional. If the proxy server requires authentication, this is the user to log in as."/> <c:simple-property name="proxyPassword" displayName="Proxy Password" type="password" required="false" - description="Optional. If the proxy requires authentication, this is the password for the user."/> + description="Optional. If the proxy server requires authentication, this is the password for the user."/> </c:group> + </configuration>
</contentSourceType>
-</content-plugin> \ No newline at end of file +</content-plugin> + \ No newline at end of file
commit 2d0a8e1fcce735df4d8e18712f49d46faf24957a Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 4 13:58:46 2010 -0400
make the mem settings configurable via property for the maven gwt plugin.
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index 3c87ff0..cdfdc83 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -35,6 +35,10 @@ <product.support.email>info@rhq-project.org</product.support.email> <product.version>${project.version}</product.version> <product.help.doc.root>http://support.rhq-project.org/display/RHQ/</product.help.doc.root> + + <!-- If this is too much memory to allocate to your gwt:debug process then override this property in + in your settings.xml --> + <gwt-plugin.extraJvmArgs>-Xms1024M -Xmx1024M -XX:PermSize=256M -XX:MaxPermSize=256M</gwt-plugin.extraJvmArgs> </properties>
@@ -211,7 +215,7 @@ <inplace>false</inplace> <logLevel>INFO</logLevel> <runTarget>http://localhost:7080/coregui/CoreGUI.html</runTarget> - <extraJvmArgs>-Xms1024M -Xmx1024M -XX:PermSize=256M -XX:MaxPermSize=256M</extraJvmArgs> + <extraJvmArgs>${gwt-plugin.extraJvmArgs}</extraJvmArgs> <localWorkers>2</localWorkers> <draftCompile>true</draftCompile> <buildOutputDirectory>target/gwtclasses</buildOutputDirectory>
commit c93f28158facdb7dd6b7627148689490e7ca4858 Author: Ian P. Springer <ips@jetengine.(none)> Date: Tue May 4 12:31:28 2010 -0400
add commented-out enforcer.skip prop to show how enforcer plugin checks can be bypassed
diff --git a/etc/m2/settings.xml b/etc/m2/settings.xml index b01c472..55d1862 100644 --- a/etc/m2/settings.xml +++ b/etc/m2/settings.xml @@ -57,6 +57,9 @@ some possible values: agent-comm,comm-client,native-system,postgres-plugin --> <rhq.testng.excludedGroups>agent-comm,comm-client,native-system,postgres-plugin</rhq.testng.excludedGroups>
+ <!-- *** enforcer plugin settings *** --> + <!--<enforcer.skip>true</enforcer.skip>--> + <!-- *** surefire plugin settings *** --> <!--<maven.test.skip>true</maven.test.skip>--> <!--<maven.test.failure.ignore>true</maven.test.failure.ignore>-->
commit 6261da7f85ffbc00386495ffdf6e080871355237 Author: Ian P. Springer <ips@jetengine.(none)> Date: Tue May 4 12:30:31 2010 -0400
as5 plugin's getAvailability() now handles the case then AS5/AS6 instance is listening on an AS4 Server Resource's JNP URL (https://bugzilla.redhat.com/show_bug.cgi?id=588803)
diff --git a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java index 69d96d0..7effdd5 100644 --- a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java +++ b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java @@ -30,6 +30,8 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.net.URISyntaxException; +import java.net.URL; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -203,6 +205,8 @@ public class JBossASServerComponent implements MeasurementFacet, OperationFacet,
private AvailabilityCollectorRunnable availCollector;
+ private boolean loggedHijackedJnpUrlError; + // ResourceComponent Implementation --------------------------------------------
public void start(ResourceContext context) throws Exception { @@ -293,6 +297,8 @@ public class JBossASServerComponent implements MeasurementFacet, OperationFacet, } this.connection = null; } + + this.loggedHijackedJnpUrlError = false; }
public AvailabilityType getAvailability() { @@ -305,26 +311,61 @@ public class JBossASServerComponent implements MeasurementFacet, OperationFacet,
private AvailabilityType getAvailabilityNow() { try { - EmsConnection connection = loadConnection(); - EmsBean bean = connection.getBean("jboss.system:type=ServerConfig"); - - File serverHomeViaJNP = (File) bean.getAttribute("ServerHomeDir").refresh(); - if (this.configPath.getCanonicalPath().equals(serverHomeViaJNP.getCanonicalPath())) { + File serverHomeViaJnp = getServerHome(); + if (this.configPath.getCanonicalPath().equals(serverHomeViaJnp.getCanonicalPath())) { + this.loggedHijackedJnpUrlError = false; return AvailabilityType.UP; } else { - // a different server must have been started on our jnp url - if (log.isDebugEnabled()) { - log.debug("Availability check for JBAS resource with configPath [" + this.configPath - + "] is trying to connect to a different running JBAS which is installed at [" - + serverHomeViaJNP + "]. Returning AvailabilityType.DOWN for the former resource."); + // A different server must have been started on our JNP URL - this is definitely something about which + // the user should be informed. + if (!this.loggedHijackedJnpUrlError) { + String namingURL = this.resourceContext.getPluginConfiguration(). + getSimpleValue(NAMING_URL_CONFIG_PROP, null); + String message = "Availability check for JBoss AS Resource with configPath [" + this.configPath + + "] has connected to a different running JBoss AS instance which is installed at [" + + serverHomeViaJnp + "] using namingURL [" + namingURL + + "] - returning AvailabilityType.DOWN..."; + log.error(message); + this.loggedHijackedJnpUrlError = true; + // Throw an exception, so the PC can send the message to the Server for display in the GUI. + throw new RuntimeException(message); } + return AvailabilityType.DOWN; } - return AvailabilityType.DOWN; } catch (Exception e) { return AvailabilityType.DOWN; } }
+ private File getServerHome() throws Exception { + EmsConnection connection = loadConnection(); + EmsBean bean = connection.getBean("jboss.system:type=ServerConfig"); + File serverHomeViaJnp; + EmsAttribute serverHomeDirAttrib = bean.getAttribute("ServerHomeDir"); + if (serverHomeDirAttrib != null) { + serverHomeViaJnp = (File)serverHomeDirAttrib.refresh(); + } else { + // We have a non-null MBean but a null ServerHomeDir attribute. This most likely means we're + // connected to a JBoss 5.x or 6.x instance, because in those versions the ServerConfig MBean no + // longer has a ServerHomeDir attribute. It instead has a ServerHomeLocation attribute, so give + // that a try, so getAvailabilityNow() can print a more intelligent warning. + EmsAttribute serverHomeLocationAttrib = bean.getAttribute("ServerHomeLocation"); + URL serverHomeLocation = (URL) serverHomeLocationAttrib.refresh(); + serverHomeViaJnp = toFile(serverHomeLocation); + } + return serverHomeViaJnp; + } + + private static File toFile(URL url) { + File file; + try { + file = new File(url.toURI()); + } catch(URISyntaxException e) { + file = new File(url.getPath()); + } + return file; + } + // MeasurementFacet Implementation --------------------------------------------
public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) {
commit 597bb2bdbf010ff41472af6675f2db6841a2f662 Merge: edabf3f... 7d7c717... Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon May 3 13:30:29 2010 -0400
Merge branch 'master-jay' into gwt-jay
commit edabf3fde3fa00050cb2aa5891d4cd404772be0c Merge: fa72822... 30625b5... Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon May 3 13:29:15 2010 -0400
Merge branch 'master' into gwt-jay
do we still want -o in the launch, removing, put back if you like.
Conflicts: etc/eclipse-tools/maven/RHQ Maven Build - Dev Profile Core GUI.launch etc/eclipse-tools/maven/RHQ Maven Build - Dev Profile Web UI Only.launch
commit fa728221254f10e23ed31da925b1d7e87d476896 Merge: be5680b... 2d2005f... Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon May 3 13:27:16 2010 -0400
Merge branch 'gwt' into gwt-jay
commit 2d2005f54dc3b256aabaf00e0d413a11f43b6466 Author: Ian P. Springer <ips@jetengine.(none)> Date: Mon May 3 12:16:27 2010 -0400
include remoting/client-api module in reactor by default (previously it was only included when the enterprise profile was active)
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml index 7b3f967..3b0dbb8 100644 --- a/modules/enterprise/pom.xml +++ b/modules/enterprise/pom.xml @@ -40,6 +40,7 @@ <module>server/jar</module> <module>server/safe-invoker</module> <module>server/sars</module> + <module>remoting</module> <module>gui</module> <module>server/plugins</module> <module>server/ear</module> diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml index 198c17b..910b617 100644 --- a/modules/enterprise/remoting/pom.xml +++ b/modules/enterprise/remoting/pom.xml @@ -15,11 +15,11 @@ <description>RHQ Enterprise Remoting Parent POM</description>
<modules> - <module>webservices</module> <module>client-api</module> </modules>
<profiles> + <profile> <id>cli</id>
@@ -31,6 +31,22 @@ <module>cli</module> </modules> </profile> + + <profile> + <id>enterprise</id> + + <activation> + <property> + <name>enterprise</name> + </property> + </activation> + + <modules> + <module>webservices</module> + </modules> + </profile> + </profiles>
</project> +
commit 631d52f893d81cb735e574d1b19098a6396ed77a Merge: 590dd35... 28f0e62... Author: Ian P. Springer <ips@jetengine.(none)> Date: Mon May 3 12:09:42 2010 -0400
Merge branch 'gwt' of ssh://git.fedorahosted.org/git/rhq/rhq into gwt
commit 590dd351cd79ecdee71febbc28757cf34462dfb2 Author: Ian P. Springer <ips@jetengine.(none)> Date: Mon May 3 12:08:51 2010 -0400
various updates/improvements to the sample settings.xml
diff --git a/etc/m2/settings.xml b/etc/m2/settings.xml index 863f49c..b01c472 100644 --- a/etc/m2/settings.xml +++ b/etc/m2/settings.xml @@ -13,6 +13,7 @@ a more convenient location under Windows. --> <!--<localRepository>C:\.m2-repo</localRepository>-->
+ <!--**************************** PROFILES ****************************-->
<!-- See: http://maven.apache.org/guides/introduction/introduction-to-profiles.html @@ -25,12 +26,16 @@ <!-- The 'dev' profile enables automatic copying of artifacts to a dev RHQ container. --> <activeProfile>dev</activeProfile>
- <!-- The 'jdk6' profile can be used to build RHQ using JDK6. See the 'jdk6' profile block below. --> + <!-- The 'jdk6' profile can be used to build RHQ using JDK6, while still enforcing that + only Java 5 APIs are used - see the 'jdk6' profile block below. --> <!--<activeProfile>jdk6</activeProfile>-->
- <!-- The 'dist' profile is for binary distribution builds and enables things such as JSP precompilation. --> + <!-- The 'dist' profile is for release builds and enables things such as JSP precompilation. --> <!--<activeProfile>dist</activeProfile>-->
+ <!-- Profiles to configure database connection settings. Use separate profiles for + Postgres and Oracle to allow easily switching back and forth between them. --> + <activeProfile>postgres</activeProfile> <!--<activeProfile>oracle</activeProfile>--> </activeProfiles>
@@ -39,60 +44,34 @@ <profile> <id>overrides</id> <properties> - <!-- NOTE: Add properties here that you always want set, to avoid --> - <!-- having to explicitly pass them on the command line. Note, --> - <!-- you can still override them via the command line. --> - - <!-- Set the below property to your SVN username - used by the deploy plugin. --> - <maven.username>your_svn_user_name_here</maven.username> - <!-- Set the below property to your SVN username - used by the release plugin. --> - <username>your_svn_user_name_here</username> + <!-- NOTE: Add properties here that you always want set, to avoid + having to explicitly pass them on the command line. Note, + you can still override the values set here via the command + line. --> + + <!-- *** RHQ-specific properties *** --> <!-- tells the dbutils tests not to fail --> <DatabaseTest.nofail>true</DatabaseTest.nofail> + <!-- Tests that should be skipped (e.g. because they're long running), comma-separated (with no whitespace!) - some possible values: agent-comm,comm-client,native-system,postgres-plugin --> - <rhq.testng.excludedGroups>agent-comm,comm-client,postgres-plugin,native-system</rhq.testng.excludedGroups> + <rhq.testng.excludedGroups>agent-comm,comm-client,native-system,postgres-plugin</rhq.testng.excludedGroups> + + <!-- *** surefire plugin settings *** --> <!--<maven.test.skip>true</maven.test.skip>--> <!--<maven.test.failure.ignore>true</maven.test.failure.ignore>--> <!--<maven.test.error.ignore>true</maven.test.error.ignore>--> <!--<surefire.useFile>false</surefire.useFile>--> - <!-- Set the below prop to the absolute path of your RHQ trunk dir. - (the Jopr plugin poms use {rhq.rootDir}/{rhq.defaultDevContainerPath} as the dev container dir) --> - <!--<rhq.rootDir>C:/Projects/rhq-trunk</rhq.rootDir>--> - <!-- The location under rhq.rootDir where the server is found. This is used as part of - the default dev container location used by the build poms. - i.e. {rhq.rootDir}/{rhq.defaultDevContainerPath}--> - <!-- <rhq.defaultDevContainerPath>dev-container</rhq.defaultDevContainerPath> --> - <!-- Alternatively, if you don't want to use the default location of {rhq.rootDir}/{rhq.defaultDevContainerPath}/ - for your dev server container, then set the below prop to the desired location. --> - <!--<rhq.containerDir>C:/opt/rhq-server</rhq.containerDir>--> - - <!-- The full path to a checkout of the JBoss Maven repo - (svn co https://svn.jboss.org/repos/repository.jboss.org/maven2/ jboss-m2-repo) - - this is where 'mvn release' will publish distribution artifacts to. --> - <!--<jboss.repository.root>C:/Projects/jboss-m2-repo</jboss.repository.root>--> + + <!-- *** release plugin settings *** --> + <!-- Set the below properties to your fedorahosted.org username and + password (used to check in poms to RHQ git). --> + <username>SET_ME</username> + <password>SET_ME</password> </properties>
<repositories>
- <repository> - <id>jboss</id> - <name>JBoss Repository</name> - <url>http://repository.jboss.org/maven2/</url> - <snapshots> - <enabled>false</enabled> - </snapshots> - </repository> -<!-- - <repository> - <id>jboss-snapshots</id> - <name>JBoss Snapshot Repository</name> - <url>http://snapshots.jboss.org/maven2/</url> - <snapshots> - <enabled>true</enabled> - </snapshots> - </repository> ---> <!-- Oracle Driver To package the Oracle OJDBC driver set -Drhq.m2.repo.url.oracle and this repo definition will be used to pick it up at build time. --> @@ -104,28 +83,6 @@
</repositories>
- <pluginRepositories> - - <pluginRepository> - <id>jboss</id> - <name>JBoss Repository</name> - <url>http://repository.jboss.org/maven2/</url> - <snapshots> - <enabled>false</enabled> - </snapshots> - </pluginRepository> -<!-- - <pluginRepository> - <id>jboss-snapshots</id> - <name>JBoss Snapshot Repository</name> - <url>http://snapshots.jboss.org/maven2/</url> - <snapshots> - <enabled>true</enabled> - </snapshots> - </pluginRepository> ---> - </pluginRepositories> - </profile>
<profile> @@ -209,18 +166,27 @@ </properties> </profile>
+ <!-- This can be used to build RHQ using JDK6, while still enforcing that + only Java 5 APIs are used. --> <profile> - <!-- Enable this profile if you want to compile RHQ using JDK6 javac. --> <id>jdk6</id> <properties> - <!-- Set this to your a JRE5 installation dir (e.g. C:/opt/jdk-1.5.0_15/jre). --> - <java5.home>C:/opt/jdk-1.5.0_15/jre</java5.home> + <!-- Set this to your a JRE5 installation dir (e.g. /opt/jdk-1.5.0_15/jre). --> + <java5.home>/opt/jdk-1.5.0_15/jre</java5.home> </properties> </profile>
<profile> <id>dev</id> <properties> + <!-- Set the below prop to the absolute path of your RHQ trunk dir (e.g. /home/bob/projects/rhq). + (${rhq.rootDir}/dev-container will be used as the dev container dir) --> + <rhq.rootDir>SET_ME</rhq.rootDir> + + <!-- Alternatively, if you don't want to use the default location of {rhq.rootDir}/dev-container/ + for your dev container, then set the below prop to the desired location. --> + <!--<rhq.containerDir>C:/home/bob/rhq-dev-container</rhq.containerDir>--> + <!-- Set the below prop to the location to your dev JBAS 4.2/4.3 deploy location for the admin console WAR. e.g.: C:/opt/jboss-eap-4.3.0.GA_CP02/jboss-as/server/production --> <jbas4.configDir>SET_ME</jbas4.configDir> @@ -242,6 +208,7 @@
</profiles>
+ <!--**************************** PLUGIN GROUPS ****************************-->
<!-- See: http://maven.apache.org/guides/introduction/introduction-to-plugin-prefix-mapping.html --> @@ -250,28 +217,52 @@ <pluginGroup>org.rhq</pluginGroup> </pluginGroups>
+ + <!--**************************** SERVERS ****************************--> + <!-- See: http://maven.apache.org/settings.html#Servers and: http://maven.apache.org/guides/mini/guide-wagon-providers.html --> + <servers> - <server> - <id>jboss-snapshots</id> - <!-- Set the below properties to your jboss.org (i.e. external JIRA/SVN) username and password - - used by the release plugin to publish via WebDAV to the JBoss Snapshots repo. --> - <username>YOUR_USERNAME</username> - <password>YOUR_PASSWORD</password> - <configuration> - <httpConfiguration> - <put> - <params> - <param> - <name>http.authentication.preemptive</name> - <value>%b,true</value> - </param> - </params> - </put> - </httpConfiguration> - </configuration> - </server> + + <server> + <id>jboss-developer-repository-group</id> + <!-- jboss.org username and password --> + <username>SET_ME</username> + <password>SET_ME</password> + </server> + + <server> + <id>jboss-snapshots-repository</id> + <!-- jboss.org username and password --> + <username>SET_ME</username> + <password>SET_ME</password> + </server> + + <server> + <id>jboss-releases-repository</id> + <!-- jboss.org username and password --> + <username>SET_ME</username> + <password>SET_ME</password> + </server> + </servers>
+ + <!--**************************** MIRRORS ****************************--> + + <!-- Uncomment the below if you want to use the JBoss Nexus repo as a proxy + to the central, java.net, etc. repos. --> +<!-- + <mirrors> + <mirror> + <id>jboss-developer-repository-group</id> + <mirrorOf>*,!jboss-deprecated-repository,!ojdbc-repo</mirrorOf> + <name>JBoss Developer Maven Repository Group</name> + <url>https://repository.jboss.org/nexus/content/groups/developer/</url> + </mirror> + </mirrors> +--> + </settings> +
commit 28f0e62acee77b6f439ab2b114cdf9ee2fc767ae Author: John Mazzitelli mazz@redhat.com Date: Mon May 3 11:51:00 2010 -0400
BZ 588383 - make sure the server sleeps enough time to ensure the agent knows the server was down
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/startup/StartupServlet.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/startup/StartupServlet.java index 51107b2..e6f0bf4 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/startup/StartupServlet.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/startup/StartupServlet.java @@ -21,6 +21,7 @@ package org.rhq.enterprise.gui.startup; import java.net.InetAddress; import java.net.UnknownHostException; import java.sql.Connection; +import java.util.Date; import java.util.List; import java.util.Properties;
@@ -59,7 +60,6 @@ import org.rhq.enterprise.server.plugin.pc.ServerPluginServiceManagement; import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal; import org.rhq.enterprise.server.scheduler.SchedulerLocal; import org.rhq.enterprise.server.scheduler.jobs.AsyncResourceDeleteJob; -import org.rhq.enterprise.server.scheduler.jobs.SavedSearchResultCountRecalculationJob; import org.rhq.enterprise.server.scheduler.jobs.CheckForSuspectedAgentsJob; import org.rhq.enterprise.server.scheduler.jobs.CheckForTimedOutConfigUpdatesJob; import org.rhq.enterprise.server.scheduler.jobs.CheckForTimedOutContentRequestsJob; @@ -67,6 +67,7 @@ import org.rhq.enterprise.server.scheduler.jobs.CheckForTimedOutOperationsJob; import org.rhq.enterprise.server.scheduler.jobs.CloudManagerJob; import org.rhq.enterprise.server.scheduler.jobs.DataPurgeJob; import org.rhq.enterprise.server.scheduler.jobs.DynaGroupAutoRecalculationJob; +import org.rhq.enterprise.server.scheduler.jobs.SavedSearchResultCountRecalculationJob; import org.rhq.enterprise.server.util.LookupUtil; import org.rhq.enterprise.server.util.concurrent.AlertSerializer; import org.rhq.enterprise.server.util.concurrent.AvailabilityReportSerializer; @@ -293,6 +294,27 @@ public class StartupServlet extends HttpServlet { * @throws ServletException */ private void startServerCommunicationServices() throws ServletException { + + // under a rare case, if the server starts up really fast as soon as it dies, any connected + // agents will not realize the server has bounced and will not know to re-connect. When this + // happens the server's caches will not be refreshed and bad things will happen (e.g. alerts not firing). + // make sure we are down for a certain amount of time to ensure the agent's know the server was down. + long ensureDownTimeSecs = 70; + try { + ensureDownTimeSecs = Long.parseLong(System.getProperty("rhq.server.ensure-down-time-secs", "70")); + } catch (Exception e) { + } + long elapsed = getElapsedTimeSinceStartup(); + long sleepTime = (ensureDownTimeSecs * 1000L) - elapsed; + if (sleepTime > 0) { + try { + log("Forcing the server to wait [" + sleepTime + "]ms to ensure agents know we went down"); + Thread.sleep(sleepTime); + } catch (InterruptedException ignore) { + } + } + + // now start our comm layer log("Starting the server-agent communications services");
try { @@ -329,8 +351,8 @@ public class StartupServlet extends HttpServlet { // Do not check until we are up at least 1 min, and every minute thereafter. final long initialDelay = 1000L * 60; final long interval = 1000L * 60; - scheduler.scheduleSimpleRepeatingJob(SavedSearchResultCountRecalculationJob.class, true, false, initialDelay, - interval); + scheduler.scheduleSimpleRepeatingJob(SavedSearchResultCountRecalculationJob.class, true, false, + initialDelay, interval); } catch (Exception e) { log("Cannot schedule asynchronous resource deletion job: " + e.getMessage()); } @@ -593,4 +615,22 @@ public class StartupServlet extends HttpServlet { throw new ServletException("Failed to register the Server Shutdown Listener", e); } } + + /** + * Gets the number of milliseconds since the time when the server was started. + * @return elapsed time since server started, 0 if not known + */ + private long getElapsedTimeSinceStartup() throws ServletException { + long elapsed; + try { + ObjectName jbossServerName = new ObjectName("jboss.system:type=Server"); + MBeanServer jbossServer = MBeanServerLocator.locateJBoss(); + Date startTime = (Date) jbossServer.getAttribute(jbossServerName, "StartDate"); + long currentTime = System.currentTimeMillis(); + elapsed = currentTime - startTime.getTime(); + } catch (Exception e) { + elapsed = 0; + } + return elapsed; + } }
commit c839e1c24e61025fd6a8920041f06a840bb1880d Author: Ian P. Springer <ips@jetengine.(none)> Date: Mon May 3 11:36:34 2010 -0400
update to depend on RHQ 3.0.0.B05 and to use JBoss Nexus repo
diff --git a/etc/samples/custom-jmx-plugin/pom.xml b/etc/samples/custom-jmx-plugin/pom.xml index 468dd84..22daccf 100644 --- a/etc/samples/custom-jmx-plugin/pom.xml +++ b/etc/samples/custom-jmx-plugin/pom.xml @@ -12,6 +12,7 @@ <packaging>jar</packaging>
<name>RHQ Custom JMX Plugin</name> - <description>Plugin that monitors a custom set of MBeans</description> + <description>Plugin that monitors a set of custom MBeans</description>
</project> + diff --git a/etc/samples/custom-serverplugin/pom.xml b/etc/samples/custom-serverplugin/pom.xml index e1f3a15..555fe7f 100644 --- a/etc/samples/custom-serverplugin/pom.xml +++ b/etc/samples/custom-serverplugin/pom.xml @@ -12,10 +12,10 @@ <packaging>jar</packaging>
<name>Custom RHQ Server Plugin Template</name> - <description>A template for building a custom generic RHQ server plugin</description> + <description>A template for building a custom generic RHQ Server plugin</description>
<properties> - <rhq.version>3.0.0.B04</rhq.version> + <rhq.version>3.0.0.B05</rhq.version> </properties>
<dependencies> @@ -135,24 +135,14 @@
<repositories> <repository> - <id>jboss</id> - <name>JBoss Repository</name> - <url>http://repository.jboss.org/maven2/</url> - <snapshots> + <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> + </snapshots> </repository> </repositories>
- <pluginRepositories> - <pluginRepository> - <id>jboss</id> - <name>JBoss Plugin Repository</name> - <url>http://repository.jboss.org/maven2/</url> - <snapshots> - <enabled>false</enabled> - </snapshots> - </pluginRepository> - </pluginRepositories> - </project> + diff --git a/etc/samples/perspectives/sample-perspective/pom.xml b/etc/samples/perspectives/sample-perspective/pom.xml index 307f847..8398f81 100644 --- a/etc/samples/perspectives/sample-perspective/pom.xml +++ b/etc/samples/perspectives/sample-perspective/pom.xml @@ -8,12 +8,12 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.B05</version> </parent>
<groupId>org.rhq</groupId> <artifactId>rhq-sample-perspective-parent</artifactId> - <version>1.0.0-SNAPSHOT</version> + <version>1.0-SNAPSHOT</version> <packaging>pom</packaging>
<name>RHQ Sample Perspective Parent</name> @@ -28,26 +28,19 @@ <scm.module.path>etc/samples/sample-perspective/</scm.module.path> </properties>
- <profiles> + <modules> + <module>app</module> + <module>perspective</module> + </modules>
- <profile> - <id>default</id> - <activation> - <activeByDefault>true</activeByDefault> - </activation> - <modules> - <module>app</module> - <module>perspective</module> - </modules> - </profile> - - </profiles> <dependencies> - <dependency> + <dependency> <groupId>javax.faces</groupId> <artifactId>jsf-api</artifactId> <version>1.2_13</version> <scope>provided</scope> - </dependency> + </dependency> </dependencies> + </project> + diff --git a/etc/samples/simplereport-serverplugin/pom.xml b/etc/samples/simplereport-serverplugin/pom.xml index b92068d..fd219b4 100644 --- a/etc/samples/simplereport-serverplugin/pom.xml +++ b/etc/samples/simplereport-serverplugin/pom.xml @@ -12,10 +12,10 @@ <packaging>jar</packaging>
<name>RHQ Simple Report Server Plugin </name> - <description>A RHQ server plugin that periodically outputs a simple report containing some RHQ data</description> + <description>An RHQ Server plugin that periodically outputs a simple report containing some RHQ data</description>
<properties> - <rhq.version>3.0.0.B04</rhq.version> + <rhq.version>3.0.0.B05</rhq.version> </properties>
<dependencies> @@ -135,24 +135,14 @@
<repositories> <repository> - <id>jboss</id> - <name>JBoss Repository</name> - <url>http://repository.jboss.org/maven2/</url> - <snapshots> + <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> + </snapshots> </repository> </repositories>
- <pluginRepositories> - <pluginRepository> - <id>jboss</id> - <name>JBoss Plugin Repository</name> - <url>http://repository.jboss.org/maven2/</url> - <snapshots> - <enabled>false</enabled> - </snapshots> - </pluginRepository> - </pluginRepositories> - </project> + diff --git a/etc/samples/skeleton-plugin/pom.xml b/etc/samples/skeleton-plugin/pom.xml index e1be2c1..4e2d1b6 100644 --- a/etc/samples/skeleton-plugin/pom.xml +++ b/etc/samples/skeleton-plugin/pom.xml @@ -8,14 +8,14 @@
<groupId>org.rhq.sample.skeletonplugin</groupId> <artifactId>skeleton-plugin</artifactId> - <version>1.0</version> + <version>1.0-SNAPSHOT</version> <packaging>jar</packaging>
<name>Skeleton RHQ Plugin Template</name> - <description>A template for building a custom RHQ agent plugin</description> + <description>A template for building a custom RHQ Agent plugin</description>
<properties> - <rhq.version>3.0.0.B04</rhq.version> + <rhq.version>3.0.0.B05</rhq.version> </properties>
<dependencies> @@ -227,25 +227,14 @@
<repositories> <repository> - <id>jboss</id> - <name>JBoss Repository</name> - <url>http://repository.jboss.org/maven2/</url> - <snapshots> + <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> + </snapshots> </repository> </repositories>
- <pluginRepositories> - <pluginRepository> - <id>jboss</id> - <name>JBoss Plugin Repository</name> - <url>http://repository.jboss.org/maven2/</url> - <snapshots> - <enabled>false</enabled> - </snapshots> - </pluginRepository> - </pluginRepositories> - </project>
commit 1e426f7614704d25109b60ecf8ee6938e99a969f Author: John Mazzitelli mazz@redhat.com Date: Mon May 3 11:36:13 2010 -0400
tell eclipse to pass -o (offline mode) when starting mvn builds
diff --git a/etc/eclipse-tools/maven/RHQ Maven Build - Dev Profile Core GUI.launch b/etc/eclipse-tools/maven/RHQ Maven Build - Dev Profile Core GUI.launch index 6e91f27..1a4efd3 100644 --- a/etc/eclipse-tools/maven/RHQ Maven Build - Dev Profile Core GUI.launch +++ b/etc/eclipse-tools/maven/RHQ Maven Build - Dev Profile Core GUI.launch @@ -1,11 +1,11 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> -<stringAttribute key="bad_container_name" value="\rhq\etc\eclipse-tools\maven"/> -<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> -</listAttribute> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${env_var:M2_HOME}/bin/${MAVEN_EXE}"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-Dmaven.test.skip=true -Pdev install"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/rhq/modules/core/gui}"/> -</launchConfiguration> +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> +<stringAttribute key="bad_container_name" value="\rhq\etc\eclipse-tools\maven"/> +<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> +<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> +<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> +</listAttribute> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${env_var:M2_HOME}/bin/${MAVEN_EXE}"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-o -Dmaven.test.skip=true -Pdev install"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/rhq/modules/core/gui}"/> +</launchConfiguration> diff --git a/etc/eclipse-tools/maven/RHQ Maven Build - Dev Profile Web UI Only (GWT).launch b/etc/eclipse-tools/maven/RHQ Maven Build - Dev Profile Web UI Only (GWT).launch index cfe9a0e..8568305 100644 --- a/etc/eclipse-tools/maven/RHQ Maven Build - Dev Profile Web UI Only (GWT).launch +++ b/etc/eclipse-tools/maven/RHQ Maven Build - Dev Profile Web UI Only (GWT).launch @@ -6,6 +6,6 @@ <listEntry value="org.eclipse.ui.externaltools.launchGroup"/> </listAttribute> <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${env_var:M2_HOME}/bin/${MAVEN_EXE}"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-Dmaven.test.skip=true -Pdev gwt:clean install"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-o -Dmaven.test.skip=true -Pdev gwt:clean install"/> <stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/rhq/modules/enterprise/gui/coregui}"/> </launchConfiguration> diff --git a/etc/eclipse-tools/maven/RHQ Maven Build - Dev Profile Web UI Only.launch b/etc/eclipse-tools/maven/RHQ Maven Build - Dev Profile Web UI Only.launch index 4e56a6d..1daa9b2 100644 --- a/etc/eclipse-tools/maven/RHQ Maven Build - Dev Profile Web UI Only.launch +++ b/etc/eclipse-tools/maven/RHQ Maven Build - Dev Profile Web UI Only.launch @@ -1,11 +1,11 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> -<stringAttribute key="bad_container_name" value="\rhq\etc\eclipse-tools\maven"/> -<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> -</listAttribute> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${env_var:M2_HOME}/bin/${MAVEN_EXE}"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-Dmaven.test.skip=true -Pdev install"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/rhq/modules/enterprise/gui/portal-war}"/> -</launchConfiguration> +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> +<stringAttribute key="bad_container_name" value="\rhq\etc\eclipse-tools\maven"/> +<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> +<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> +<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> +</listAttribute> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${env_var:M2_HOME}/bin/${MAVEN_EXE}"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-o -Dmaven.test.skip=true -Pdev install"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/rhq/modules/enterprise/gui/portal-war}"/> +</launchConfiguration>
commit 4303afebc506c05118bee86bb7e9bb0ac6aaedbf Author: John Mazzitelli mazz@redhat.com Date: Fri Apr 30 23:20:41 2010 -0400
add javadoc
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleFileUploadServlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleFileUploadServlet.java index 7a5f478..63b6352 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleFileUploadServlet.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleFileUploadServlet.java @@ -34,6 +34,12 @@ import org.rhq.core.domain.content.Architecture; import org.rhq.enterprise.server.bundle.BundleManagerLocal; import org.rhq.enterprise.server.util.LookupUtil;
+/** + * This servlet allows the requestor to upload a bundle file and attach it to + * a given BundleVersion. + * + * @author John Mazzitelli + */ public class BundleFileUploadServlet extends FileUploadServlet { private static final long serialVersionUID = 1L;
commit 804c4e404fa68230bc97b7e63d295fc580261dad Author: John Mazzitelli mazz@redhat.com Date: Fri Apr 30 23:19:17 2010 -0400
if bundle file to be uploaded didn't say what its version is, use the bundleVersion itself
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleFileUploadServlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleFileUploadServlet.java index 644eca4..7a5f478 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleFileUploadServlet.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/BundleFileUploadServlet.java @@ -49,7 +49,7 @@ public class BundleFileUploadServlet extends FileUploadServlet {
int bundleVersionId = Integer.parseInt(getFormField(formFields, "bundleVersionId", null)); String name = getFormField(formFields, "name", file.getName()); - String version = getFormField(formFields, "version", "1.0"); + String version = getFormField(formFields, "version", Integer.toString(bundleVersionId)); Architecture architecture = new Architecture(getFormField(formFields, "arch", "noarch")); InputStream fileStream = new FileInputStream(file);
rhq-commits@lists.fedorahosted.org