modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml | 41 modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 516 +--------- modules/core/domain/src/main/java/org/rhq/core/domain/content/Advisory.java | 12 modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryPackage.java | 2 modules/core/native-system/src/main/java/org/rhq/core/system/SystemInfoFactory.java | 23 modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java | 25 modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java | 9 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java | 8 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/FavoritesUIBean.java | 12 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceUIBean.java | 5 modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-managed-beans/inventory-beans.xml | 4 modules/enterprise/gui/portal-war/src/main/webapp/js/timeline/ajax/api/scripts/units.js | 128 +- modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/summary.xhtml | 4 modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml | 2 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java | 44 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/ContentProviderManager.java | 6 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/RepoDetails.java | 13 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/RepoGroupDetails.java | 10 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/sync/RepoSourceSynchronizer.java | 2 modules/enterprise/server/plugins/jboss-software/src/main/java/org/rhq/enterprise/server/plugins/jboss/software/JBossSoftwareContentSourceAdapter.java | 2 modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/ProcessingRecipeContext.java | 15 modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java | 3 modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JBossProductType.java | 13 modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/util/DeploymentUtility.java | 2 modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JMXDiscoveryComponent.java | 35 modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml | 2 pom.xml | 10 27 files changed, 384 insertions(+), 564 deletions(-)
New commits: commit d49f3d1ce688cdfff563a1f78c66b1a516b8ccc3 Author: Ian P. Springer <ips@jetengine.(none)> Date: Fri Mar 19 15:10:45 2010 -0400
...
diff --git a/pom.xml b/pom.xml index 1a21ab1..054740c 100644 --- a/pom.xml +++ b/pom.xml @@ -587,7 +587,7 @@ </executions> </plugin>
- <plugin> + <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <executions> @@ -608,7 +608,7 @@ </configuration> </execution> </executions> - </plugin> + </plugin>
<plugin> <groupId>org.codehaus.mojo</groupId>
commit 8f9b19320ccf5fb32b1c572f4d7d8c7d8a184a65 Author: Ian P. Springer <ips@jetengine.(none)> Date: Fri Mar 19 14:37:34 2010 -0400
add id's to executions, so we will be able to override those executions in descendant poms
diff --git a/pom.xml b/pom.xml index e2cc42b..1a21ab1 100644 --- a/pom.xml +++ b/pom.xml @@ -531,9 +531,8 @@ </plugins> </pluginManagement>
- <plugins> -
+ <plugins>
<!-- Set the 'maven.version' property to the version of Maven being used, so we can include the Maven version in the MANIFEST.MF files of all @@ -614,8 +613,9 @@ <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>properties-maven-plugin</artifactId> - <executions> + <executions> <execution> + <id>read-build-properties</id> <phase>process-resources</phase> <goals> <goal>read-project-properties</goal>
commit 02f669162cdd6204c1fca900a76633ca2893ae8d Merge: 6114257... eb23f6f... Author: Ian P. Springer <ips@jetengine.(none)> Date: Fri Mar 19 13:50:56 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 6114257b990eaebd93ab552ae6ea621415099dbe Author: Ian P. Springer <ips@jetengine.(none)> Date: Thu Mar 18 18:31:34 2010 -0400
fix content source sync so status of successfully completed requests gets flipped from INPROGRESS to SUCCESS; also improve results message for sync requests
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 ab2fad2..4e078aa 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 @@ -394,8 +394,8 @@ public class RepoManagerBean implements RepoManagerLocal, RepoManagerRemote {
// Import groups first List<RepoGroupDetails> repoGroups = report.getRepoGroups(); - int repoGroupCounter = 0;
+ List<RepoGroupDetails> importedRepoGroups = new ArrayList<RepoGroupDetails>(); for (RepoGroupDetails createMe : repoGroups) { String name = createMe.getName();
@@ -411,7 +411,7 @@ public class RepoManagerBean implements RepoManagerLocal, RepoManagerRemote { // but be sure to mention it to the report try { createRepoGroup(subject, existingGroup); - repoGroupCounter++; + importedRepoGroups.add(createMe); } catch (RepoException e) {
if (e.getType() == RepoException.RepoExceptionType.NAME_ALREADY_EXISTS) { @@ -424,7 +424,13 @@ public class RepoManagerBean implements RepoManagerLocal, RepoManagerRemote { } } } - result.append("Imported [").append(repoGroupCounter).append("] repo groups.").append('\n'); + + if (importedRepoGroups.isEmpty()) { + result.append("There are new repo groups since the last time this content source was synchronized.\n"); + } else { + result.append("Imported the following [").append(importedRepoGroups.size()).append("] repo group(s): "). + append(importedRepoGroups).append('\n'); + }
// Hold on to all current candidate repos for the content provider. If any were not present in this // report, remove them from the system (the rationale being, the content provider no longer knows @@ -437,19 +443,18 @@ public class RepoManagerBean implements RepoManagerLocal, RepoManagerRemote {
// Once the groups are in the system, import any repos that were added List<RepoDetails> repos = report.getRepos(); - int repoCounter = 0;
// First add repos that have no parent. We later add repos with a parent afterwards to prevent // issues where both the parent and child are specified in this report. + List<RepoDetails> importedRepos = new ArrayList<RepoDetails>(); for (RepoDetails createMe : repos) { - if (createMe.getParentRepoName() == null) { try { - addCandidateRepo(contentSourceId, createMe); + if (addCandidateRepo(contentSourceId, createMe)) { + importedRepos.add(createMe); + } removeRepoFromList(createMe.getName(), candidatesForThisProvider); - repoCounter++; } catch (Exception e) { - if (e instanceof RepoException && ((RepoException) e).getType() == RepoException.RepoExceptionType.NAME_ALREADY_EXISTS) { result.append("Skipping addition of existing repo [").append(createMe.getName()).append("]") @@ -466,12 +471,12 @@ public class RepoManagerBean implements RepoManagerLocal, RepoManagerRemote { // Take a second pass through the list checking for any repos that were created to be // a child of another repo. for (RepoDetails createMe : repos) { - if (createMe.getParentRepoName() != null) { try { - addCandidateRepo(contentSourceId, createMe); - removeRepoFromList(createMe.getName(), candidatesForThisProvider); - repoCounter++; + if (addCandidateRepo(contentSourceId, createMe)) { + importedRepos.add(createMe); + } + removeRepoFromList(createMe.getName(), candidatesForThisProvider); } catch (Exception e) { log.error("Error processing repo [" + createMe + "]", e); result.append("Could not add repo [").append(createMe.getName()).append( @@ -480,7 +485,12 @@ public class RepoManagerBean implements RepoManagerLocal, RepoManagerRemote { } }
- result.append("Imported [").append(repoCounter).append("] repos.").append('\n'); + if (importedRepos.isEmpty()) { + result.append("There are new repos since the last time this content source was synchronized.\n"); + } else { + result.append("Imported the following ").append(importedRepos.size()).append(" repo(s): "). + append(importedRepos).append('\n'); + }
// Any repos that haven't been removed from candidatesForThisProvider were not returned in this // report, so remove them from the database. @@ -500,7 +510,7 @@ public class RepoManagerBean implements RepoManagerLocal, RepoManagerRemote { }
if (!repo.isCandidate()) { - throw new RepoException("Unable to import repo, repo is already imported. ID: " + repoId); + throw new RepoException("Unable to import repo - repo is already imported. ID: " + repoId); }
repo.setCandidate(false); @@ -865,7 +875,7 @@ public class RepoManagerBean implements RepoManagerLocal, RepoManagerRemote { * @throws Exception if there is an error associating the content source with the repo or if the repo * indicates a parent or repo group that does not exist */ - private void addCandidateRepo(int contentSourceId, RepoDetails createMe) throws Exception { + private boolean addCandidateRepo(int contentSourceId, RepoDetails createMe) throws Exception {
Subject overlord = subjectManager.getOverlord(); String name = createMe.getName(); @@ -874,7 +884,7 @@ public class RepoManagerBean implements RepoManagerLocal, RepoManagerRemote {
// If the repo doesn't exist, create it. if (existingRepo.size() != 0) { - return; + return false; }
// Create and populate the repo @@ -908,6 +918,8 @@ public class RepoManagerBean implements RepoManagerLocal, RepoManagerRemote { addRepoRelationship(overlord, addMe.getId(), parent.getId(), PARENT_RELATIONSHIP_NAME); } } + + return true; }
private void removeRepoFromList(String repoName, List<Repo> repoList) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/ContentProviderManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/ContentProviderManager.java index 21fac03..c486873 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/ContentProviderManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/ContentProviderManager.java @@ -186,7 +186,6 @@ public class ContentProviderManager { results = new ContentSourceSyncResults(contentSource); results.setResults(progress.toString()); results = contentSourceManager.persistContentSourceSyncResults(results); - }
if (results == null) { @@ -202,12 +201,15 @@ public class ContentProviderManager { // one sync will get an error and rollback its tx and no harm // will be done. log.info("Content provider [" + contentSource.getName() - + "] is already currently being synchronized, this sync request will be ignored"); + + "] is already currently being synchronized - this sync request will be ignored."); return false; }
RepoSourceSynchronizer repoSourceSynchronizer = new RepoSourceSynchronizer(contentSource, provider); repoSourceSynchronizer.synchronizeCandidateRepos(progress); + results.setStatus(ContentSyncStatus.SUCCESS); + results.setResults(progress.toString()); + } catch (Throwable t) { if (results != null) { // try to reload the results in case it was updated by the SLSB diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/RepoDetails.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/RepoDetails.java index 3ac75db..d277579 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/RepoDetails.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/RepoDetails.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 @@ -127,4 +127,15 @@ public class RepoDetails { public void setRepoGroup(String repoGroup) { this.repoGroup = repoGroup; } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("RepoDetails["); + sb.append("name='").append(this.name).append('''); + sb.append(", parentRepoName='").append(this.parentRepoName).append('''); + sb.append(", repoGroup='").append(this.repoGroup).append('''); + sb.append(']'); + return sb.toString(); + } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/RepoGroupDetails.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/RepoGroupDetails.java index 502cdea..5ae72e1 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/RepoGroupDetails.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/RepoGroupDetails.java @@ -101,4 +101,14 @@ public class RepoGroupDetails { public void setDescription(String description) { this.description = description; } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("RepoGroupDetails["); + sb.append("name='").append(this.name).append('''); + sb.append(", typeName='").append(this.typeName).append('''); + sb.append(']'); + return sb.toString(); + } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/sync/RepoSourceSynchronizer.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/sync/RepoSourceSynchronizer.java index 5f801ab..6edf1f9 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/sync/RepoSourceSynchronizer.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/sync/RepoSourceSynchronizer.java @@ -67,7 +67,7 @@ public class RepoSourceSynchronizer { }
progress.append(new Date()).append(": "); - progress.append("Asking content provider for repositories to import..."); + progress.append("Asking content provider for new repositories to import...\n");
RepoSource repoSource = (RepoSource) provider;
diff --git a/modules/enterprise/server/plugins/jboss-software/src/main/java/org/rhq/enterprise/server/plugins/jboss/software/JBossSoftwareContentSourceAdapter.java b/modules/enterprise/server/plugins/jboss-software/src/main/java/org/rhq/enterprise/server/plugins/jboss/software/JBossSoftwareContentSourceAdapter.java index 967fbcf..7f065da 100644 --- a/modules/enterprise/server/plugins/jboss-software/src/main/java/org/rhq/enterprise/server/plugins/jboss/software/JBossSoftwareContentSourceAdapter.java +++ b/modules/enterprise/server/plugins/jboss-software/src/main/java/org/rhq/enterprise/server/plugins/jboss/software/JBossSoftwareContentSourceAdapter.java @@ -126,7 +126,7 @@ public class JBossSoftwareContentSourceAdapter implements ContentProvider, Packa try { rssDocument = retrieveRssDocument(); } catch (Exception e) { - throw new SyncException("Error retrieving rss doc", e); + throw new SyncException("Error retrieving RSS document.", e); }
if (rssDocument == null) {
commit eb23f6fb9a557cb23069ae103a25905bdab5370b Author: Filip Drabek fdrabek@dhcp-lab-136.englab.brq.redhat.com Date: Thu Mar 18 22:27:23 2010 +0100
BZ - 535792 JBossCache plugin throws parsing error while checking configuration.
diff --git a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/util/DeploymentUtility.java b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/util/DeploymentUtility.java index 242084b..60d2467 100644 --- a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/util/DeploymentUtility.java +++ b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/util/DeploymentUtility.java @@ -145,7 +145,7 @@ public class DeploymentUtility {
// this is the deployment descriptor file that we are currently examining; // this is what will be returned if the MBean was configured in this file. - String file = i.eval("sdi.url").toString(); + String file = i.eval("sdi.watch").toString();
if (file.startsWith("file:/")) { file = file.substring(5);
commit 99156a79b26d6c43951ee4b1b596b6efc5b268bc Author: Joseph Marques joseph@redhat.com Date: Thu Mar 18 14:37:15 2010 -0400
search assist has not been written for resource groups yet, disable for now
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 cd31a4d..5c39367 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,5 +1,6 @@ package org.rhq.enterprise.gui.inventory.browse;
+import java.util.ArrayList; import java.util.List;
import javax.faces.model.DataModel; @@ -10,7 +11,6 @@ import org.apache.commons.logging.LogFactory; 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.SearchSubsystem; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; import org.rhq.core.gui.util.FacesContextUtility; @@ -18,7 +18,6 @@ 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.server.resource.group.ResourceGroupManagerLocal; -import org.rhq.enterprise.server.search.execution.SearchAssistManager; import org.rhq.enterprise.server.search.execution.SearchSuggestion; import org.rhq.enterprise.server.util.LookupUtil;
@@ -86,13 +85,10 @@ public class BrowseGroupsUIBean extends PagedDataTableUIBean { } }
- SearchAssistManager searchAssist = new SearchAssistManager(SearchSubsystem.Group); - public List<SearchSuggestion> autocomplete(Object suggest) { String currentInputText = (String) suggest;
- List<SearchSuggestion> suggestions = searchAssist.getAdvancedSuggestions(currentInputText, currentInputText - .length()); + List<SearchSuggestion> suggestions = new ArrayList<SearchSuggestion>();
// offer suggestions based on currentInputText return suggestions; 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 9d92183..65be544 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 @@ -39,6 +39,7 @@ <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" @@ -58,6 +59,7 @@ <h:outputText value="#{suggestItem.label}" /> </h:column> </rich:suggestionbox> + </ui:remove> rich:spacer/ <a4j:commandButton value="GO" reRender="browseGroupsDataTable, browseGroupsDataTableScroller"
commit d07e040c976d1493d4c5fae7cf70e76ed8c35273 Author: Ian P. Springer <ips@jetengine.(none)> Date: Thu Mar 18 13:51:22 2010 -0400
add support for discovering and managing JBoss EWP (https://jira.jboss.org/jira/browse/JBPAPP-3673) (cherry picked from commit f988b4721041aefe74cff16ee0d0f5e6475cdf39)
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 4c8e999..b02bd01 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 @@ -85,11 +85,14 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom 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 String[] CLIENT_JARS = new String[] { "client/jbossall-client.jar", + "client/trove.jar", + "client/javassist.jar", "common/lib/jboss-security-aspects.jar", "lib/jboss-managed.jar", "lib/jboss-metatype.jar", 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 6804195..024bc41 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 @@ -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 @@ -25,7 +25,7 @@ package org.rhq.plugins.jbossas5.helper; import java.util.jar.Attributes;
/** - * The product type of a JBoss application server installation - AS, EAP, or SOA. + * The product type of a JBoss 5.x/6.x application server installation - AS, EAP, EWP, or SOA. * * @author Jessica Sant * @author Ian Springer @@ -33,6 +33,7 @@ import java.util.jar.Attributes; 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
public final String NAME; @@ -40,6 +41,7 @@ public enum JBossProductType { public final String DEFAULT_CONFIG_NAME;
private static final String EAP_IMPLEMENTATION_TITLE = "JBoss [EAP]"; + private static final String EWP_IMPLEMENTATION_TITLE = "JBoss [EWP]"; private static final String SOA_IMPLEMENTATION_TITLE = "JBoss [SOA]";
JBossProductType(String name, String description, String defaultConfigName) { @@ -49,10 +51,11 @@ public enum JBossProductType { }
/** - * Determines the product type (AS, EAP or SOA) based on the Implementation-Title MANIFEST.MF attribute. + * Determines the product type (AS, EAP, EWP, or SOA) based on the Implementation-Title MANIFEST.MF attribute. * * @param attributes the attributes from a manifest file (typically run.jar or jboss-j2ee.jar) - * @return AS, EAP or SOA + * + * @return the product type (AS, EAP, EWP, or SOA) */ public static JBossProductType determineJBossProductType(Attributes attributes) { JBossProductType result = JBossProductType.AS; @@ -61,6 +64,8 @@ public enum JBossProductType { if (implementationTitle != null) { if (implementationTitle.equalsIgnoreCase(EAP_IMPLEMENTATION_TITLE)) { result = JBossProductType.EAP; + } else if (implementationTitle.equalsIgnoreCase(EWP_IMPLEMENTATION_TITLE)) { + result = JBossProductType.EWP; } else if (implementationTitle.equalsIgnoreCase(SOA_IMPLEMENTATION_TITLE)) { result = JBossProductType.SOA; }
commit 5d7df4e65e66115206314d19d55974166f496a76 Author: Ian P. Springer <ips@jetengine.(none)> Date: Thu Mar 18 10:14:47 2010 -0400
fix bug when trying to toggle favorite flag on current Resource (cherry picked from commit 5019f944b1cfd381f358023333e8a6ec988f58f4)
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/FavoritesUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/FavoritesUIBean.java index 25b3dfe..5bf3da5 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/FavoritesUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/FavoritesUIBean.java @@ -21,18 +21,22 @@ package org.rhq.enterprise.gui.inventory.resource; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
-import org.rhq.core.gui.util.FacesContextUtility; +import org.jboss.seam.ScopeType; +import org.jboss.seam.annotations.In; +import org.jboss.seam.annotations.Name; +import org.jboss.seam.annotations.Scope; import org.rhq.enterprise.gui.legacy.WebUser; import org.rhq.enterprise.gui.legacy.WebUserPreferences; import org.rhq.enterprise.gui.legacy.action.resource.common.QuickFavoritesUtil; import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility; -import org.rhq.enterprise.gui.util.WebUtility;
/** - * A session-scoped bean for toggling the current resource in request scope + * A session-scoped bean for toggling the current resource in request scope. * * @author Joseph Marques */ +@Name("FavoritesUIBean") +@Scope(ScopeType.EVENT) public class FavoritesUIBean {
protected final Log log = LogFactory.getLog(FavoritesUIBean.class); @@ -45,6 +49,7 @@ public class FavoritesUIBean { * requests, particularly with the raw config editor. The raw config editor however extends the life of the * current ResourceUIBean beyond the current request so that the id can be accessed through ResourceUIBean. */ + @In(value = ResourceUIBean.MANAGED_BEAN_NAME, create = true) private ResourceUIBean resourceUIBean;
public FavoritesUIBean() { @@ -88,5 +93,4 @@ public class FavoritesUIBean {
return null; } - } \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceUIBean.java index 03be73e..bc62589 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceUIBean.java @@ -25,6 +25,9 @@ import java.util.Set;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.jboss.seam.ScopeType; +import org.jboss.seam.annotations.Name; +import org.jboss.seam.annotations.Scope; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable;
@@ -62,6 +65,8 @@ import org.rhq.enterprise.server.util.LookupUtil; * * @author Ian Springer */ +@Name(ResourceUIBean.MANAGED_BEAN_NAME) +@Scope(ScopeType.EVENT) public class ResourceUIBean {
protected final Log log = LogFactory.getLog(ResourceUIBean.class); diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-managed-beans/inventory-beans.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-managed-beans/inventory-beans.xml index ff5d3d9..fb313ca 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-managed-beans/inventory-beans.xml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-managed-beans/inventory-beans.xml @@ -26,12 +26,14 @@
<!-- /rhq/resource/** -->
+ <!-- <managed-bean> <managed-bean-name>ResourceUIBean</managed-bean-name> <managed-bean-class>org.rhq.enterprise.gui.inventory.resource.ResourceUIBean</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> - + --> + <managed-bean> <managed-bean-name>ResourceOverviewUIBean</managed-bean-name> <managed-bean-class>org.rhq.enterprise.gui.inventory.resource.ResourceOverviewUIBean</managed-bean-class> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/summary.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/summary.xhtml index 4a0e1cf..9f132c8 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/summary.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/summary.xhtml @@ -85,9 +85,9 @@ groupId - the group id of the Group being accessed
<rich:toolTip for="favoritesStar"> - <h:outputText value="Add resource to favorites list" + <h:outputText value="Add group to favorites list" rendered="#{!ResourceGroupUIBean.favorite}"/> - <h:outputText value="Remove resource from favorites list" + <h:outputText value="Remove group from favorites list" rendered="#{ResourceGroupUIBean.favorite}"/> </rich:toolTip> </a4j:region>
commit ad9fe1aba113f55f9493a205c0a2f29d1a26f9e6 Merge: 450dea0... 7721e26... Author: Ian P. Springer <ips@jetengine.(none)> Date: Thu Mar 18 10:42:21 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 7721e26cda6183de4191d6ca6d70379147dc70ac Merge: db755e1... 7e4c228... Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Mar 18 10:18:44 2010 -0400
Merge branch 'bundle'
commit 7e4c2286585b5af7bdb843fb6e4ce1a1e6fe56b0 Merge: b25c245... 96a5298... Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Mar 18 10:13:36 2010 -0400
Merge branch 'bundle-jay' into bundle
commit b25c245e3cfb775f38f7102252d5009c270442f6 Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Mar 18 10:13:29 2010 -0400
LT
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/js/timeline/ajax/api/scripts/units.js b/modules/enterprise/gui/portal-war/src/main/webapp/js/timeline/ajax/api/scripts/units.js index 54f2a5b..7bdcd0d 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/js/timeline/ajax/api/scripts/units.js +++ b/modules/enterprise/gui/portal-war/src/main/webapp/js/timeline/ajax/api/scripts/units.js @@ -1,64 +1,64 @@ -/*================================================== - * Default Unit - *================================================== - */ - -SimileAjax.NativeDateUnit = new Object(); - -SimileAjax.NativeDateUnit.makeDefaultValue = function() { - return new Date(); -}; - -SimileAjax.NativeDateUnit.cloneValue = function(v) { - return new Date(v.getTime()); -}; - -SimileAjax.NativeDateUnit.getParser = function(format) { - if (typeof format == "string") { - format = format.toLowerCase(); - } - return (format == "iso8601" || format == "iso 8601") ? - SimileAjax.DateTime.parseIso8601DateTime : - SimileAjax.DateTime.parseGregorianDateTime; -}; - -SimileAjax.NativeDateUnit.parseFromObject = function(o) { - return SimileAjax.DateTime.parseGregorianDateTime(o); -}; - -SimileAjax.NativeDateUnit.toNumber = function(v) { - return v.getTime(); -}; - -SimileAjax.NativeDateUnit.fromNumber = function(n) { - return new Date(n); -}; - -SimileAjax.NativeDateUnit.compare = function(v1, v2) { - var n1, n2; - if (typeof v1 == "object") { - n1 = v1.getTime(); - } else { - n1 = Number(v1); - } - if (typeof v2 == "object") { - n2 = v2.getTime(); - } else { - n2 = Number(v2); - } - - return n1 - n2; -}; - -SimileAjax.NativeDateUnit.earlier = function(v1, v2) { - return SimileAjax.NativeDateUnit.compare(v1, v2) < 0 ? v1 : v2; -}; - -SimileAjax.NativeDateUnit.later = function(v1, v2) { - return SimileAjax.NativeDateUnit.compare(v1, v2) > 0 ? v1 : v2; -}; - -SimileAjax.NativeDateUnit.change = function(v, n) { - return new Date(v.getTime() + n); -}; - +/*================================================== + * Default Unit + *================================================== + */ + +SimileAjax.NativeDateUnit = new Object(); + +SimileAjax.NativeDateUnit.makeDefaultValue = function() { + return new Date(); +}; + +SimileAjax.NativeDateUnit.cloneValue = function(v) { + return new Date(v.getTime()); +}; + +SimileAjax.NativeDateUnit.getParser = function(format) { + if (typeof format == "string") { + format = format.toLowerCase(); + } + return (format == "iso8601" || format == "iso 8601") ? + SimileAjax.DateTime.parseIso8601DateTime : + SimileAjax.DateTime.parseGregorianDateTime; +}; + +SimileAjax.NativeDateUnit.parseFromObject = function(o) { + return SimileAjax.DateTime.parseGregorianDateTime(o); +}; + +SimileAjax.NativeDateUnit.toNumber = function(v) { + return v.getTime(); +}; + +SimileAjax.NativeDateUnit.fromNumber = function(n) { + return new Date(n); +}; + +SimileAjax.NativeDateUnit.compare = function(v1, v2) { + var n1, n2; + if (typeof v1 == "object") { + n1 = v1.getTime(); + } else { + n1 = Number(v1); + } + if (typeof v2 == "object") { + n2 = v2.getTime(); + } else { + n2 = Number(v2); + } + + return n1 - n2; +}; + +SimileAjax.NativeDateUnit.earlier = function(v1, v2) { + return SimileAjax.NativeDateUnit.compare(v1, v2) < 0 ? v1 : v2; +}; + +SimileAjax.NativeDateUnit.later = function(v1, v2) { + return SimileAjax.NativeDateUnit.compare(v1, v2) > 0 ? v1 : v2; +}; + +SimileAjax.NativeDateUnit.change = function(v, n) { + return new Date(v.getTime() + n); +}; +
commit 96a5298c91a6ced21500f864a96f636973179e4b Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Mar 17 16:37:25 2010 -0400
Just added some debug logging confirming successful command handling.
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 f4cb102..090ea3d 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 @@ -29,6 +29,9 @@ import java.util.List; import java.util.Map; import java.util.Set;
+import org.apache.commons.logging.Log; +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.content.PackageVersion; @@ -45,6 +48,8 @@ import org.rhq.core.util.file.FileUtil; */ public class ProcessingRecipeContext extends RecipeContext {
+ private final Log log = LogFactory.getLog(this.getClass()); + private final Map<PackageVersion, File> packageVersionFiles; private final SystemInfo systemInfo; private String baseWorkingDirectory; @@ -73,12 +78,14 @@ public class ProcessingRecipeContext extends RecipeContext { throw new RuntimeException("Failed to unbundle file [" + pe + "]: " + results); } // existingFile.delete(); WOULD WE WANT TO REMOVE THE COMPRESSED FILE? + log.debug("bundle deploy: unzipped " + existingFile + " to " + directory); } 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 + "]"); } + log.debug("bundle deploy: renamed " + existingFile + " to " + newFile); } }
@@ -92,6 +99,8 @@ public class ProcessingRecipeContext extends RecipeContext { try { destinationFile.getParentFile().mkdirs(); FileUtil.copyFile(sourceFile, destinationFile); + + log.debug("bundle file: copied " + sourceFile + " to " + destinationFile); } catch (Exception e) { throw new RuntimeException("Failed to copy file [" + sourceFile + "] to [" + destinationFile + "]", e); } @@ -132,6 +141,8 @@ public class ProcessingRecipeContext extends RecipeContext { if (!realizedTmpFile.renameTo(trueFile)) { throw new RuntimeException("Failed to rename realized tmp file [" + realizedTmpFile + "]"); } + + log.debug("bundle realize file: renamed realized" + realizedTmpFile + " to " + trueFile); } catch (Exception e) { throw new RuntimeException("Cannot realize file [" + file + "]", e); } finally { @@ -175,6 +186,8 @@ public class ProcessingRecipeContext extends RecipeContext { if (results.getError() != null) { throw new RuntimeException("Could not execute script [" + pe + "]: " + results, results.getError()); } + + log.debug("bundle script: executed script [" + pe + "]"); }
@Override @@ -191,6 +204,8 @@ public class ProcessingRecipeContext extends RecipeContext { if (results.getError() != null) { throw new RuntimeException("Could not execute command [" + pe + "]: " + results, results.getError()); } + + log.debug("bundle command: executed command [" + pe + "]"); }
private void ensureExecutable(File scriptFile) {
commit 99a7975b4cb031510616a62060c4d2699ca33b6f Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Mar 17 14:47:43 2010 -0400
Add unique indexes to various bundle tables to avoid logical duplicates. Also, fixed up a lot of advisory-related db-upgrade stuff left over from the former core team. The db-upgrade, at least for this stuff, now matches the schema definitions. Also, got the db-upgrade to run through from a 2.3.1 db on postgres. Also tweaked a couple of entity classes to match the schema.
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 b2663d4..683c991 100644 --- a/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml +++ b/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml @@ -410,8 +410,8 @@ <column name="SEVERITY" size="64" type="VARCHAR2" required="false"/> <column name="ISSUE_DATE" type="LONG" required="false"/> <column name="UPDATE_DATE" type="LONG" required="false"/> - <column name="CTIME" type="LONG" required="false"/> - <column name="LAST_MODIFIED" type="LONG" required="false"/> + <column name="CTIME" type="LONG" required="true"/> + <column name="LAST_MODIFIED" type="LONG" required="true"/>
<index name="RHQ_ADVISORY_NAME_UQ" unique="true"> <field ref="ADVISORY_NAME"/> @@ -423,23 +423,18 @@
<index name="RHQ_ADVISORY_UDATE_IDX" unique="false"> <field ref="UPDATE_DATE"/> - </index> - - <index name="RHQ_ADVISORY_SYN_IDX" unique="false"> - <field ref="SYNOPSIS"/> - </index> - + </index> </table>
<table name="RHQ_ADVISORY_PACKAGE"> - <column name="ID" default="sequence-only" initial="10001" primarykey="true" required="true" type="INTEGER"/> + <column name="ID" default="sequence-only" initial="10001" primarykey="true" required="true" type="INTEGER"/> <column name="ADVISORY_ID" type="INTEGER" required="true" references="RHQ_ADVISORY"/> <column name="PACKAGE_VERSION_ID" type="INTEGER" required="true" references="RHQ_PACKAGE_VERSION"/> - <column name="LAST_MODIFIED" type="LONG" required="false"/> + <column name="LAST_MODIFIED" type="LONG" required="true"/>
<index name="RHQ_ADVISORY_PKG_IDX" unique="true"> <field ref="ADVISORY_ID"/> - <field ref="PACKAGE_VERSIOn_ID"/> + <field ref="PACKAGE_VERSION_ID"/> </index> </table>
@@ -492,6 +487,11 @@ <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="RESOURCE_TYPE_ID" type="INTEGER" required="true" references="RHQ_RESOURCE_TYPE"/> + + <!-- This index is for constraint, not performance --> + <index name="RHQ_BUNDLE_TYPE_UNIQUE" unique="true"> + <field ref="NAME"/> + </index> </table>
<!-- BUNDLE is a named piece of content that can be versioned and installed somewhere --> @@ -501,6 +501,12 @@ <column name="DESCRIPTION" size="500" type="VARCHAR2" required="false"/> <column name="BUNDLE_TYPE_ID" type="INTEGER" required="true" references="RHQ_BUNDLE_TYPE"/> <column name="REPO_ID" type="INTEGER" required="true" references="RHQ_REPO"/> + + <!-- This index is for constraint, not performance --> + <index name="RHQ_BUNDLE_UNIQUE" unique="true"> + <field ref="BUNDLE_TYPE_ID"/> + <field ref="NAME"/> + </index> </table>
<!-- BUNDLE_VERSION represents an actual piece of content that needs to be installed somewhere --> @@ -513,6 +519,13 @@ <column name="CONFIG_DEF_ID" type="INTEGER" required="false" references="RHQ_CONFIG_DEF" /> <column name="BUNDLE_ID" type="INTEGER" required="true" references="RHQ_BUNDLE"/> <column name="DISTRIBUTION_ID" type="INTEGER" required="false" references="RHQ_DISTRIBUTION"/> + + <!-- This index is for constraint, not performance --> + <index name="RHQ_BUNDLE_VERSION_UNIQUE" unique="true"> + <field ref="BUNDLE_ID"/> + <field ref="NAME"/> + <field ref="VERSION"/> + </index> </table>
<!-- Many-to-many table that links many repos to a particular bundle version --> @@ -548,6 +561,12 @@ <column name="ENFORCEMENT_INTERVAL" type="INTEGER" required="false"/> <column name="BUNDLE_VERSION_ID" type="INTEGER" required="true" references="RHQ_BUNDLE_VERSION"/> <column name="BUNDLE_ID" type="INTEGER" required="false" references="RHQ_BUNDLE"/> + + <!-- This index is for constraint, not performance --> + <index name="RHQ_BUNDLE_DEPLOY_DEF_UNIQUE" unique="true"> + <field ref="BUNDLE_VERSION_ID"/> + <field ref="NAME"/> + </index> </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 85fe084..23f1fbd 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -2219,337 +2219,80 @@
<!-- RHQ Advisory Representation --> <schemaSpec version="2.71"> - <schema-directSQL> - <statement> - CREATE TABLE RHQ_ADVISORY_TYPE ( ID INTEGER PRIMARY KEY ) - </statement> - </schema-directSQL> - <schema-alterColumn table="RHQ_ADVISORY_TYPE" column="ID" nullable="false" /> - <schema-addColumn table="RHQ_ADVISORY_TYPE" column="NAME" precision="200" columnType="VARCHAR2" /> - <schema-alterColumn table="RHQ_ADVISORY_TYPE" column="NAME" nullable="false" /> - <schema-addColumn table="RHQ_ADVISORY_TYPE" column="DESCRIPTION" precision="500" columnType="VARCHAR2" /> - <schema-directSQL> - <statement> - INSERT INTO - RHQ_ADVISORY_TYPE ( ID, NAME, DESCRIPTION ) - VALUES ( 101, 'Bug Fix Advisory', 'Bug fix(RHBA) Advisory' ) - </statement> - <statement> - INSERT INTO - RHQ_ADVISORY_TYPE ( ID, NAME, DESCRIPTION ) - VALUES ( 102, 'Product Enhancement Advisory', 'Product Enhancement(RHEA) Advisory' ) - </statement> - <statement> - INSERT INTO - RHQ_ADVISORY_TYPE ( ID, NAME, DESCRIPTION ) - VALUES ( 103, 'Security Advisory', 'Security Advisory(RHSA) Advisory' ) - </statement> - </schema-directSQL> - <schema-directSQL> - <statement> - CREATE TABLE RHQ_ADVISORY_SEVERITY ( ID INTEGER PRIMARY KEY ) - </statement> - </schema-directSQL> - <schema-alterColumn table="RHQ_ADVISORY_SEVERITY" column="ID" nullable="false" /> - <schema-addColumn table="RHQ_ADVISORY_SEVERITY" column="RANK" columnType="INTEGER" /> - <schema-alterColumn table="RHQ_ADVISORY_SEVERITY" column="RANK" nullable="false" /> - <schema-addColumn table="RHQ_ADVISORY_SEVERITY" column="LABEL" precision="40" columnType="VARCHAR2" /> - <schema-alterColumn table="RHQ_ADVISORY_SEVERITY" column="LABEL" nullable="false" /> - <schema-directSQL> - <statement> - INSERT INTO - RHQ_ADVISORY_TYPE ( ID, RANK, LABEL) - VALUES ( 101, 0, 'errata.sev.label.critical' ) - </statement> - <statement> - INSERT INTO - RHQ_ADVISORY_TYPE ( ID, RANK, LABEL) - VALUES ( 102, 1, 'errata.sev.label.important' ) - </statement> - <statement> - INSERT INTO - RHQ_ADVISORY_TYPE ( ID, RANK, LABEL) - VALUES ( 103, 2, 'errata.sev.label.moderate' ) - </statement> - <statement> - INSERT INTO - RHQ_ADVISORY_TYPE ( ID, RANK, LABEL) - VALUES ( 104, 3, 'errata.sev.label.low' ) - </statement> - </schema-directSQL> - <schema-directSQL> - <statement> - CREATE TABLE RHQ_ADVISORY_FILE_TYPE ( ID INTEGER PRIMARY KEY ) - </statement> - </schema-directSQL> - <schema-alterColumn table="RHQ_ADVISORY_FILE_TYPE" column="ID" nullable="false" /> - <schema-addColumn table="RHQ_ADVISORY_FILE_TYPE" column="LABEL" precision="40" columnType="VARCHAR2" /> - <schema-alterColumn table="RHQ_ADVISORY_FILE_TYPE" column="LABEL" nullable="false" /> - <schema-directSQL> - <statement> - INSERT INTO - RHQ_ADVISORY_FILE_TYPE ( ID, LABEL) - VALUES ( 101, 'RPM' ) - </statement> - <statement> - INSERT INTO - RHQ_ADVISORY_FILE_TYPE ( ID, LABEL) - VALUES ( 102, 'SRPM' ) - </statement> - <statement> - INSERT INTO - RHQ_ADVISORY_FILE_TYPE ( ID, LABEL) - VALUES ( 103, 'IMG') - </statement> - <statement> - INSERT INTO - RHQ_ADVISORY_FILE_TYPE ( ID, LABEL) - VALUES ( 104, 'OVAL') - </statement> - </schema-directSQL> <schema-createSequence name="RHQ_ADVISORY_SEQ" initial="10001" /> <schema-directSQL> - <statement desc="Creating table RHQ_ADVISORY"> CREATE TABLE RHQ_ADVISORY ( ID INTEGER PRIMARY KEY ) </statement> </schema-directSQL> + <schema-alterColumn table="RHQ_ADVISORY" column="ID" nullable="false" columnType="INTEGER" /> <schema-addColumn table="RHQ_ADVISORY" column="ADVISORY" precision="64" columnType="VARCHAR2" /> <schema-alterColumn table="RHQ_ADVISORY" column="ADVISORY" nullable="false" /> - <schema-addColumn table="RHQ_ADVISORY" column="ADVISORY_TYPE_ID" columnType="INTEGER" /> - <schema-alterColumn table="RHQ_ADVISORY" column="ADVISORY_TYPE_ID" nullable="false" /> - <schema-addColumn table="RHQ_ADVISORY" column="ADVISORY_NAME" precision="64" columnType="VARCHAR2" /> - <schema-alterColumn table="RHQ_ADVISORY" column="ADVISORY_NAME" nullable="false" /> + <schema-addColumn table="RHQ_ADVISORY" column="ADVISORY_TYPE" precision="64" columnType="VARCHAR2" /> + <schema-alterColumn table="RHQ_ADVISORY" column="ADVISORY_TYPE" nullable="false" /> <schema-addColumn table="RHQ_ADVISORY" column="ADVISORY_REL" precision="64" columnType="VARCHAR2" /> - <schema-alterColumn table="RHQ_ADVISORY" column="ADVISORY_REL" nullable="false" /> - <schema-addColumn table="RHQ_ADVISORY" column="DESCRIPTION" precision="4000" columnType="VARCHAR2" /> - <schema-alterColumn table="RHQ_ADVISORY" column="DESCRIPTION" nullable="false" /> + <schema-addColumn table="RHQ_ADVISORY" column="ADVISORY_NAME" precision="64" columnType="VARCHAR2" /> + <schema-addColumn table="RHQ_ADVISORY" column="DESCRIPTION" precision="4000" columnType="VARCHAR2" /> <schema-addColumn table="RHQ_ADVISORY" column="SYNOPSIS" precision="4000" columnType="VARCHAR2" /> - <schema-alterColumn table="RHQ_ADVISORY" column="SYNOPSIS" nullable="false" /> + <schema-alterColumn table="RHQ_ADVISORY" column="SYNOPSIS" nullable="false" /> <schema-addColumn table="RHQ_ADVISORY" column="TOPIC" precision="4000" columnType="VARCHAR2" /> - <schema-alterColumn table="RHQ_ADVISORY" column="TOPIC" nullable="false" /> <schema-addColumn table="RHQ_ADVISORY" column="SOLUTION" precision="4000" columnType="VARCHAR2" /> - <schema-alterColumn table="RHQ_ADVISORY" column="SOLUTION" nullable="false" /> - <schema-addColumn table="RHQ_ADVISORY" column="SEVERITY_ID" columnType="INTEGER" /> - <schema-alterColumn table="RHQ_ADVISORY" column="SEVERITY_ID" nullable="false" /> + <schema-addColumn table="RHQ_ADVISORY" column="SEVERITY" precision="64" columnType="VARCHAR2" /> <schema-addColumn table="RHQ_ADVISORY" column="ISSUE_DATE" columnType="LONG" /> - <schema-alterColumn table="RHQ_ADVISORY" column="ISSUE_DATE" nullable="false" /> <schema-addColumn table="RHQ_ADVISORY" column="UPDATE_DATE" columnType="LONG" /> - <schema-alterColumn table="RHQ_ADVISORY" column="UPDATE_DATE" nullable="false" /> <schema-addColumn table="RHQ_ADVISORY" column="CTIME" columnType="LONG" /> <schema-alterColumn table="RHQ_ADVISORY" column="CTIME" nullable="false" /> <schema-addColumn table="RHQ_ADVISORY" column="LAST_MODIFIED" columnType="LONG" /> <schema-alterColumn table="RHQ_ADVISORY" column="LAST_MODIFIED" nullable="false" /> - <schema-directSQL> - <statement targetDBVendor="postgresql"> - CREATE UNIQUE INDEX RHQ_ADVISORY_NAME_UQ - ON RHQ_ADVISORY ( ADVISORY_NAME ) - </statement> - <statement targetDBVendor="oracle"> - CREATE UNIQUE INDEX RHQ_ADVISORY_NAME_UQ - ON RHQ_ADVISORY ( ADVISORY_NAME ) - </statement> - </schema-directSQL> - <schema-directSQL> - <statement targetDBVendor="postgresql"> - CREATE UNIQUE INDEX RHQ_ADVISORY_UQ - ON RHQ_ADVISORY ( ADVISORY ) - </statement> - <statement targetDBVendor="oracle"> - CREATE UNIQUE INDEX RHQ_ADVISORY_UQ - ON RHQ_ADVISORY ( ADVISORY ) - </statement> - </schema-directSQL> - - <schema-directSQL> - <statement targetDBVendor="postgresql"> - CREATE INDEX RHQ_ADVISORY_UDATE_IDX - ON RHQ_ADVISORY (UPDATE_DATE ) - </statement> - <statement targetDBVendor="oracle"> - CREATE INDEX RHQ_ADVISORY_UDATE_IDX - ON RHQ_ADVISORY (UPDATE_DATE ) - </statement> - </schema-directSQL> - <schema-directSQL> - <statement targetDBVendor="postgresql"> - CREATE INDEX RHQ_ADVISORY_SYN_IDX - ON RHQ_ADVISORY ( SYNOPSIS ) - </statement> - <statement targetDBVendor="oracle"> - CREATE INDEX RHQ_ADVISORY_SYN_IDX - ON RHQ_ADVISORY ( SYNOPSIS ) - </statement> - </schema-directSQL> - <schema-directSQL> - <statement targetDBVendor="oracle"> - ALTER TABLE RHQ_ADVISORY - ADD CONSTRAINT RHQ_ADV_TYPE_FKEY - FOREIGN KEY ( ADVISORY_TYPE_ID ) - REFERENCES RHQ_ADVISORY_TYPE ( ID ) - </statement> - <statement targetDBVendor="postgresql"> - ALTER TABLE RHQ_ADVISORY - ADD CONSTRAINT RHQ_ADV_TYPE_FKEY - FOREIGN KEY ( ADVISORY_TYPE_ID ) - REFERENCES RHQ_ADVISORY_TYPE ( ID ) - </statement> - </schema-directSQL> - <schema-directSQL> - <statement targetDBVendor="oracle"> - ALTER TABLE RHQ_ADVISORY - ADD CONSTRAINT RHQ_ADV_SEV_FKEY - FOREIGN KEY ( SEVERITY_ID ) - REFERENCES RHQ_ADVISORY_SEVERITY ( ID ) - </statement> - <statement targetDBVendor="postgresql"> - ALTER TABLE RHQ_ADVISORY - ADD CONSTRAINT RHQ_ADV_SEV_FKEY - FOREIGN KEY ( SEVERITY_ID ) - REFERENCES RHQ_ADVISORY_SEVERITY ( ID ) - </statement> - </schema-directSQL> - <schema-createSequence name="RHQ_ADVISORY_FILE_SEQ" initial="10001" /> + <schema-directSQL> <statement> - CREATE TABLE RHQ_ADVISORY_FILE ( ID INTEGER ) - </statement> - </schema-directSQL> - <schema-alterColumn table="RHQ_ADVISORY_FILE" column="ID" nullable="false" /> - <schema-addColumn table="RHQ_ADVISORY_FILE" column="ADVISORY_ID" columnType="INTEGER" /> - <schema-alterColumn table="RHQ_ADVISORY_FILE" column="ADVISORY_ID" nullable="false" /> - <schema-addColumn table="RHQ_ADVISORY_FILE" column="FILE_TYPE_ID" columnType="INTEGER" /> - <schema-alterColumn table="RHQ_ADVISORY_FILE" column="FILE_TYPE_ID" nullable="false" /> - <schema-addColumn table="RHQ_ADVISORY_FILE" column="RELATIVE_FILENAME" precision="256" columnType="VARCHAR2" /> - <schema-alterColumn table="RHQ_ADVISORY_FILE" column="RELATIVE_FILENAME" nullable="false" /> - <schema-addColumn table="RHQ_ADVISORY_FILE" column="MD5SUM" precision="64" columnType="VARCHAR2" /> - <schema-alterColumn table="RHQ_ADVISORY_FILE" column="MD5SUM" nullable="false" /> - <schema-addColumn table="RHQ_ADVISORY_FILE" column="LAST_MODIFIED" columnType="LONG" /> - <schema-alterColumn table="RHQ_ADVISORY_FILE" column="LAST_MODIFIED" nullable="false" /> - <schema-directSQL> - <statement targetDBVendor="postgresql"> - CREATE UNIQUE INDEX RHQ_ADVISORY_ID_FILE_UQ - ON RHQ_ADVISORY_FILE ( ADVISORY_ID, RELATIVE_FILENAME ) - </statement> - <statement targetDBVendor="oracle"> - CREATE UNIQUE INDEX RHQ_ADVISORY_ID_FILE_UQ - ON RHQ_ADVISORY_FILE ( ADVISORY_ID, RELATIVE_FILENAME ) - </statement> - </schema-directSQL> - <schema-directSQL> - <statement targetDBVendor="oracle"> - ALTER TABLE RHQ_ADVISORY_FILE - ADD CONSTRAINT RHQ_ADV_FILE_FKEY - FOREIGN KEY ( ADVISORY_ID) - REFERENCES RHQ_ADVISORY ( ID ) - </statement> - <statement targetDBVendor="postgresql"> - ALTER TABLE RHQ_ADVISORY_FILE - ADD CONSTRAINT RHQ_ADV_FILE_FKEY - FOREIGN KEY ( ADVISORY_ID) - REFERENCES RHQ_ADVISORY ( ID ) - </statement> - </schema-directSQL> - <schema-directSQL> - <statement targetDBVendor="oracle"> - ALTER TABLE RHQ_ADVISORY_FILE - ADD CONSTRAINT RHQ_ADV_FILE_TYPE_FKEY - FOREIGN KEY ( FILE_TYPE_ID ) - REFERENCES RHQ_ADVISORY_FILE_TYPE ( ID ) + CREATE UNIQUE INDEX RHQ_ADVISORY_NAME_UQ ON RHQ_ADVISORY ( ADVISORY_NAME ) </statement> - <statement targetDBVendor="postgresql"> - ALTER TABLE RHQ_ADVISORY_FILE - ADD CONSTRAINT RHQ_ADV_FILE_TYPE_FKEY - FOREIGN KEY ( FILE_TYPE_TYPE ) - REFERENCES RHQ_ADVISORY_FILE_TYPE ( ID ) - </statement> - </schema-directSQL> - <schema-directSQL> <statement> - CREATE TABLE RHQ_ADVISORY_PACKAGE_MAP ( ADVISORY_ID INTEGER ) - </statement> - </schema-directSQL> - <schema-alterColumn table="RHQ_ADVISORY_PACKAGE_MAP" column="ADVISORY_ID" nullable="false" /> - <schema-addColumn table="RHQ_ADVISORY_PACKAGE_MAP" column="PACKAGE_ID" columnType="INTEGER" /> - <schema-alterColumn table="RHQ_ADVISORY_PACKAGE_MAP" column="PACKAGE_ID" nullable="false" /> - <schema-directSQL> - <statement targetDBVendor="oracle"> - ALTER TABLE RHQ_ADVISORY_PACKAGE_MAP - ADD CONSTRAINT RHQ_ADV_PKG_MAP_KEY - PRIMARY KEY ( ADVISORY_ID, PACKAGE_ID ) + CREATE UNIQUE INDEX RHQ_ADVISORY_UQ ON RHQ_ADVISORY ( ADVISORY ) </statement> - <statement targetDBVendor="postgresql"> - ALTER TABLE RHQ_ADVISORY_PACKAGE_MAP - ADD CONSTRAINT RHQ_ADV_PKG_MAP_KEY - PRIMARY KEY ( ADVISORY_ID, PACKAGE_ID ) - </statement> - <statement targetDBVendor="oracle"> - ALTER TABLE RHQ_ADVISORY_PACKAGE_MAP - ADD FOREIGN KEY ( ADVISORY_ID ) - REFERENCES RHQ_ADVISORY ( ID ) - </statement> - <statement targetDBVendor="postgresql"> - ALTER TABLE RHQ_ADVISORY_PACKAGE_MAP - ADD FOREIGN KEY ( ADVISORY_ID ) - REFERENCES RHQ_ADVISORY ( ID ) - </statement> - <statement targetDBVendor="oracle"> - ALTER TABLE RHQ_ADVISORY_PACKAGE_MAP - ADD FOREIGN KEY ( PACKAGE_ID ) - REFERENCES RHQ_PACKAGE ( ID ) - </statement> - <statement targetDBVendor="postgresql"> - ALTER TABLE RHQ_ADVISORY_PACKAGE_MAP - ADD FOREIGN KEY ( PACKAGE_ID ) - REFERENCES RHQ_PACKAGE ( ID ) + <statement> + CREATE INDEX RHQ_ADVISORY_UDATE_IDX ON RHQ_ADVISORY (UPDATE_DATE ) </statement> </schema-directSQL>
+ <schema-createSequence name="RHQ_ADVISORY_PACKAGE_SEQ" initial="10001" /> <schema-directSQL> <statement> - CREATE TABLE RHQ_ADVISORY_FILE_PKG_MAP ( ADVISORY_ID INTEGER ) + CREATE TABLE RHQ_ADVISORY_PACKAGE ( ID INTEGER PRIMARY KEY ) </statement> </schema-directSQL> - <schema-alterColumn table="RHQ_ADVISORY_FILE_PKG_MAP" column="ADVISORY_FILE_ID" nullable="false" /> - <schema-addColumn table="RHQ_ADVISORY_FILE_PKG_MAP" column="PACKAGE_ID" columnType="INTEGER" /> - <schema-alterColumn table="RHQ_ADVISORY_FILE_PKG_MAP" column="PACKAGE_ID" nullable="false" /> + <schema-alterColumn table="RHQ_ADVISORY_PACKAGE" column="ID" nullable="false" /> + <schema-addColumn table="RHQ_ADVISORY_PACKAGE" column="ADVISORY_ID" columnType="INTEGER" /> + <schema-alterColumn table="RHQ_ADVISORY_PACKAGE" column="ADVISORY_ID" nullable="false" /> + <schema-addColumn table="RHQ_ADVISORY_PACKAGE" column="PACKAGE_VERSION_ID" columnType="INTEGER" /> + <schema-alterColumn table="RHQ_ADVISORY_PACKAGE" column="PACKAGE_VERSION_ID" nullable="false" /> + <schema-addColumn table="RHQ_ADVISORY_PACKAGE" column="LAST_MODIFIED" columnType="LONG" /> + <schema-alterColumn table="RHQ_ADVISORY_PACKAGE" column="LAST_MODIFIED" nullable="false" /> <schema-directSQL> - <statement targetDBVendor="oracle"> - ALTER TABLE RHQ_ADVISORY_FILE_PKG_MAP - ADD CONSTRAINT RHQ_ADV_FILE_PKG_MAP_KEY - PRIMARY KEY ( ADVISORY_FILE_ID, PACKAGE_ID ) - </statement> - <statement targetDBVendor="postgresql"> - ALTER TABLE RHQ_ADVISORY_FILE_PKG_MAP - ADD CONSTRAINT RHQ_ADV_FILE_PKG_MAP_KEY - PRIMARY KEY ( ADVISORY_FILE_ID, PACKAGE_ID ) - </statement> - <statement targetDBVendor="oracle"> - ALTER TABLE RHQ_ADVISORY_FILE_PKG_MAP - ADD FOREIGN KEY ( ADVISORY_FILE_ID ) - REFERENCES RHQ_ADVISORY_FILE ( ID ) - </statement> - <statement targetDBVendor="postgresql"> - ALTER TABLE RHQ_ADVISORY_FILE_PKG_MAP - ADD FOREIGN KEY ( ADVISORY_FILE_ID ) - REFERENCES RHQ_ADVISORY_FILE ( ID ) - </statement> - <statement targetDBVendor="oracle"> - ALTER TABLE RHQ_ADVISORY_FILE_PKG_MAP - ADD FOREIGN KEY ( PACKAGE_ID ) - REFERENCES RHQ_PACKAGE ( ID ) + <statement> + CREATE UNIQUE INDEX RHQ_ADVISORY_PACKAGE_UQ ON RHQ_ADVISORY_PACKAGE ( ADVISORY_ID, PACKAGE_VERSION_ID ) </statement> - <statement targetDBVendor="postgresql"> - ALTER TABLE RHQ_ADVISORY_FILE_PKG_MAP - ADD FOREIGN KEY ( PACKAGE_ID ) - REFERENCES RHQ_PACKAGE ( ID ) + <statement> + ALTER TABLE RHQ_ADVISORY_PACKAGE + ADD CONSTRAINT RHQ_ADVISORY_FKEY + FOREIGN KEY ( ADVISORY_ID ) + REFERENCES RHQ_ADVISORY ( ID ) + </statement> + <statement> + ALTER TABLE RHQ_ADVISORY_PACKAGE + ADD CONSTRAINT RHQ_PACKAGE_VERSION_FKEY + FOREIGN KEY ( PACKAGE_VERSION_ID ) + REFERENCES RHQ_PACKAGE_VERSION ( ID ) </statement> </schema-directSQL> + <schema-createSequence name="RHQ_CVE_SEQ" initial="101" /> <schema-directSQL> <statement> - CREATE TABLE RHQ_CVE ( ID INTEGER ) + CREATE TABLE RHQ_CVE ( ID INTEGER PRIMARY KEY ) </statement> </schema-directSQL> <schema-alterColumn table="RHQ_CVE" column="ID" nullable="false" /> @@ -2558,84 +2301,60 @@
<schema-directSQL> <statement> - CREATE TABLE RHQ_ADVISORY_CVE ( ADVISORY_ID INTEGER ) + CREATE TABLE RHQ_ADVISORY_CVE ( ID INTEGER PRIMARY KEY ) </statement> </schema-directSQL> + <schema-alterColumn table="RHQ_ADVISORY_CVE" column="ID" nullable="false" /> + <schema-addColumn table="RHQ_ADVISORY_CVE" column="ADVISORY_ID" columnType="INTEGER" /> <schema-alterColumn table="RHQ_ADVISORY_CVE" column="ADVISORY_ID" nullable="false" /> <schema-addColumn table="RHQ_ADVISORY_CVE" column="CVE_ID" columnType="INTEGER" /> <schema-alterColumn table="RHQ_ADVISORY_CVE" column="CVE_ID" nullable="false" /> - <schema-addColumn table="RHQ_ADVISORY_CVE" column="CTIME" columnType="LONG" /> - <schema-alterColumn table="RHQ_ADVISORY_CVE" column="CTIME" nullable="false" /> <schema-addColumn table="RHQ_ADVISORY_CVE" column="LAST_MODIFIED" columnType="LONG" /> <schema-alterColumn table="RHQ_ADVISORY_CVE" column="LAST_MODIFIED" nullable="false" /> <schema-directSQL> - <statement targetDBVendor="oracle"> - ALTER TABLE RHQ_ADVISORY_CVE - ADD CONSTRAINT RHQ_ADV_CVE_MAP_KEY - PRIMARY KEY ( ADVISORY_ID, CVE_ID ) - </statement> - <statement targetDBVendor="postgresql"> - ALTER TABLE RHQ_ADVISORY_CVE - ADD CONSTRAINT RHQ_ADV_CVE_MAP_KEY - PRIMARY KEY ( ADVISORY_ID, CVE_ID ) - </statement> - <statement targetDBVendor="oracle"> - ALTER TABLE RHQ_ADVISORY_CVE - ADD FOREIGN KEY ( ADVISORY_ID ) - REFERENCES RHQ_ADVISORY ( ID ) + <statement> + CREATE UNIQUE INDEX RHQ_ADVISORY_CVE_UQ ON RHQ_ADVISORY_CVE ( ADVISORY_ID, CVE_ID ) </statement> - <statement targetDBVendor="postgresql"> + <statement> ALTER TABLE RHQ_ADVISORY_CVE - ADD FOREIGN KEY ( ADVISORY_ID ) + ADD CONSTRAINT RHQ_ADVISORY_FKEY + FOREIGN KEY ( ADVISORY_ID ) REFERENCES RHQ_ADVISORY ( ID ) </statement> - <statement targetDBVendor="oracle"> - ALTER TABLE RHQ_ADVISORY_CVE - ADD FOREIGN KEY ( CVE_ID ) - REFERENCES RHQ_CVE ( ID ) - </statement> - <statement targetDBVendor="postgresql"> - ALTER TABLE RHQ_ADVISORY_CVE - ADD FOREIGN KEY ( CVE_ID ) - REFERENCES RHQ_CVE ( ID ) - </statement> + <statement> + ALTER TABLE RHQ_ADVISORY_CVE + ADD CONSTRAINT RHQ_CVE_FKEY + FOREIGN KEY ( CVE_ID ) + REFERENCES RHQ_CVE ( ID ) + </statement> </schema-directSQL>
+ <schema-createSequence name="RHQ_ADVISORY_BUGLIST_SEQ" initial="10001" /> <schema-directSQL> <statement> - CREATE TABLE RHQ_ADVISORY_BUGLIST ( ADVISORY_ID INTEGER ) + CREATE TABLE RHQ_ADVISORY_BUGLIST ( ID INTEGER PRIMARY KEY) </statement> </schema-directSQL>
+ <schema-alterColumn table="RHQ_ADVISORY_BUGLIST" column="ID" nullable="false" /> + <schema-addColumn table="RHQ_ADVISORY_BUGLIST" column="ADVISORY_ID" columnType="INTEGER" /> <schema-alterColumn table="RHQ_ADVISORY_BUGLIST" column="ADVISORY_ID" nullable="false" /> - <schema-addColumn table="RHQ_ADVISORY_BUGLIST" column="BUG_ID" columnType="INTEGER" /> + <schema-addColumn table="RHQ_ADVISORY_BUGLIST" column="BUG_ID" PRECISION="256" columnType="VARCHAR2" /> <schema-alterColumn table="RHQ_ADVISORY_BUGLIST" column="BUG_ID" nullable="false" /> - <schema-addColumn table="RHQ_ADVISORY_BUGLIST" column="CTIME" columnType="LONG" /> - <schema-alterColumn table="RHQ_ADVISORY_BUGLIST" column="CTIME" nullable="false" /> <schema-addColumn table="RHQ_ADVISORY_BUGLIST" column="LAST_MODIFIED" columnType="LONG" /> <schema-alterColumn table="RHQ_ADVISORY_BUGLIST" column="LAST_MODIFIED" nullable="false" /> <schema-directSQL> - <statement targetDBVendor="oracle"> - ALTER TABLE RHQ_ADVISORY_BUGLIST - ADD CONSTRAINT RHQ_ADV_BUG_LIST_KEY - PRIMARY KEY ( ADVISORY_ID, BUG_ID ) - </statement> - <statement targetDBVendor="postgresql"> - ALTER TABLE RHQ_ADVISORY_BUGLIST - ADD CONSTRAINT RHQ_ADV_BUG_LIST_KEY - PRIMARY KEY ( ADVISORY_ID, BUG_ID ) - </statement> - <statement targetDBVendor="oracle"> - ALTER TABLE RHQ_ADVISORY_BUGLIST - ADD FOREIGN KEY ( ADVISORY_ID ) - REFERENCES RHQ_ADVISORY ( ID ) - </statement> - <statement targetDBVendor="postgresql"> - ALTER TABLE RHQ_ADVISORY_BUGLIST - ADD FOREIGN KEY ( ADVISORY_ID ) - REFERENCES RHQ_ADVISORY ( ID ) - </statement> + <statement> + CREATE UNIQUE INDEX RHQ_ADVISORY_BUGLIST_UQ ON RHQ_ADVISORY_BUGLIST ( ADVISORY_ID, BUG_ID ) + </statement> + <statement> + ALTER TABLE RHQ_ADVISORY_BUGLIST + ADD CONSTRAINT RHQ_ADVISORY_FKEY + FOREIGN KEY ( ADVISORY_ID ) + REFERENCES RHQ_ADVISORY ( ID ) + </statement> </schema-directSQL> + <schema-directSQL> <statement> CREATE TABLE RHQ_REPO_ADVISORY ( REPO_ID INTEGER ) @@ -2644,40 +2363,25 @@ <schema-alterColumn table="RHQ_REPO_ADVISORY" column="REPO_ID" nullable="false" /> <schema-addColumn table="RHQ_REPO_ADVISORY" column="ADVISORY_ID" columnType="INTEGER" /> <schema-alterColumn table="RHQ_REPO_ADVISORY" column="ADVISORY_ID" nullable="false" /> - <schema-addColumn table="RHQ_REPO_ADVISORY" column="CTIME" columnType="LONG" /> - <schema-alterColumn table="RHQ_REPO_ADVISORY" column="CTIME" nullable="false" /> <schema-addColumn table="RHQ_REPO_ADVISORY" column="LAST_MODIFIED" columnType="LONG" /> <schema-alterColumn table="RHQ_REPO_ADVISORY" column="LAST_MODIFIED" nullable="false" /> <schema-directSQL> - <statement targetDBVendor="oracle"> - ALTER TABLE RHQ_REPO_ADVISORY - ADD CONSTRAINT RHQ_REPO_ADV_MAP_KEY - PRIMARY KEY ( REPO_ID, ADVISORY_ID ) - </statement> - <statement targetDBVendor="postgresql"> + <statement> ALTER TABLE RHQ_REPO_ADVISORY ADD CONSTRAINT RHQ_REPO_ADV_MAP_KEY PRIMARY KEY ( REPO_ID, ADVISORY_ID ) </statement> - <statement targetDBVendor="oracle"> - ALTER TABLE RHQ_REPO_ADVISORY - ADD FOREIGN KEY ( ADVISORY_ID ) - REFERENCES RHQ_ADVISORY ( ID ) - </statement> - <statement targetDBVendor="postgresql"> - ALTER TABLE RHQ_REPO_ADVISORY - ADD FOREIGN KEY ( ADVISORY_ID ) - REFERENCES RHQ_ADVISORY ( ID ) - </statement> - <statement targetDBVendor="oracle"> + <statement> ALTER TABLE RHQ_REPO_ADVISORY - ADD FOREIGN KEY ( REPO_ID ) + ADD CONSTRAINT RHQ_REPO_FKEY + FOREIGN KEY ( REPO_ID ) REFERENCES RHQ_REPO ( ID ) </statement> - <statement targetDBVendor="postgresql"> + <statement> ALTER TABLE RHQ_REPO_ADVISORY - ADD FOREIGN KEY ( REPO_ID ) - REFERENCES RHQ_REPO ( ID ) + ADD CONSTRAINT RHQ_ADVISORY_FKEY + FOREIGN KEY ( ADVISORY_ID ) + REFERENCES RHQ_ADVISORY ( ID ) </statement> </schema-directSQL> </schemaSpec> @@ -2710,54 +2414,6 @@ </schema-directSQL> </schemaSpec>
- <schemaSpec version="2.74"> - <schema-createSequence name="RHQ_ADVISORY_ID_SEQ" initial="10001" /> - <schema-createSequence name="RHQ_ADVISORY_CVE_ID_SEQ" initial="10001" /> - <schema-directSQL> - <statement> - ALTER TABLE RHQ_ADVISORY_CVE DROP CONSTRAINT RHQ_ADV_CVE_MAP_KEY - </statement> - </schema-directSQL> - <schema-addColumn table="RHQ_ADVISORY_CVE" column="ID" columnType="INTEGER" /> - <schema-alterColumn table="RHQ_ADVISORY_CVE" column="ID" nullable="false" /> - <schema-directSQL> - <statement> - ALTER TABLE RHQ_ADVISORY_CVE ALTER COLUMN ID SET DEFAULT NEXTVAL('RHQ_ADVISORY_CVE_SEQ') - </statement> - </schema-directSQL> - <schema-createSequence name="RHQ_ADVISORY_BUGLIST_ID_SEQ" initial="10001" /> - <schema-directSQL> - <statement> - ALTER TABLE RHQ_ADVISORY_BUGLIST DROP CONSTRAINT RHQ_ADV_BUG_LIST_KEY - </statement> - </schema-directSQL> - <schema-addColumn table="RHQ_ADVISORY_BUGLIST" column="ID" columnType="INTEGER" /> - <schema-alterColumn table="RHQ_ADVISORY_BUGLIST" column="ID" nullable="false" /> - <schema-directSQL> - <statement> - ALTER TABLE RHQ_ADVISORY_BUGLIST ALTER COLUMN ID SET DEFAULT NEXTVAL('RHQ_ADVISORY_BUG_SEQ') - </statement> - </schema-directSQL> - <schema-directSQL> - <statement> - ALTER TABLE RHQ_ADVISORY_PACKAGE_MAP RENAME TO RHQ_ADVISORY_PACKAGE - </statement> - </schema-directSQL> - <schema-createSequence name="RHQ_ADVISORY_PACKAGE_ID_SEQ" initial="10001" /> - <schema-directSQL> - <statement> - ALTER TABLE RHQ_ADVISORY_PACKAGE DROP CONSTRAINT RHQ_ADV_PKG_MAP_KEY - </statement> - </schema-directSQL> - <schema-addColumn table="RHQ_ADVISORY_PACKAGE" column="ID" columnType="INTEGER" /> - <schema-alterColumn table="RHQ_ADVISORY_PACKAGE" column="ID" nullable="false" /> - <schema-directSQL> - <statement> - ALTER TABLE RHQ_ADVISORY_PACKAGE ALTER COLUMN ID SET DEFAULT NEXTVAL('RHQ_ADVISORY_PKG_SEQ') - </statement> - </schema-directSQL> - </schemaSpec> - <schemaSpec version="2.75"> <schema-addColumn table="RHQ_REPO" column="SYNC_SCHEDULE" columnType="VARCHAR2" precision="64" /> </schemaSpec> @@ -3211,6 +2867,32 @@ <schema-addColumn table="RHQ_BUNDLE_VERSION" column="DESCRIPTION" columnType="VARCHAR2" precision="500" /> </schemaSpec>
+ <schemaSpec version="2.78.3"> + <schema-directSQL> + <statement desc="Creating RHQ_BUNDLE_TYPE unique constraint"> + CREATE UNIQUE INDEX RHQ_BUNDLE_TYPE_UNIQUE ON RHQ_BUNDLE_TYPE (name) + </statement> + </schema-directSQL> + + <schema-directSQL> + <statement desc="Creating RHQ_BUNDLE unique constraint"> + CREATE UNIQUE INDEX RHQ_BUNDLE_UNIQUE ON RHQ_BUNDLE (bundle_type_id, name) + </statement> + </schema-directSQL> + + <schema-directSQL> + <statement desc="Creating RHQ_BUNDLE_VERSION unique constraint"> + CREATE UNIQUE INDEX RHQ_BUNDLE_VERSION_UNIQUE ON RHQ_BUNDLE_VERSION (bundle_id, name, version) + </statement> + </schema-directSQL> + + <schema-directSQL> + <statement desc="Creating RHQ_BUNDLE_DEPLOY_DEF unique constraint"> + CREATE UNIQUE INDEX RHQ_BUNDLE_DEPLOY_DEF_UNIQUE ON RHQ_BUNDLE_DEPLOY_DEF (bundle_version_id, name) + </statement> + </schema-directSQL> + </schemaSpec> + <schemaSpec version="2.79"> <schema-directSQL> <statement desc="Normalizing resource group descriptions"> diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/Advisory.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/Advisory.java index 32d2518..205d1cc 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/Advisory.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/Advisory.java @@ -89,10 +89,10 @@ public class Advisory implements Serializable { @Column(name = "UPDATE_DATE", nullable = true) private long update_date;
- @Column(name = "CTIME", nullable = true) + @Column(name = "CTIME", nullable = false) private long ctime;
- @Column(name = "LAST_MODIFIED", nullable = true) + @Column(name = "LAST_MODIFIED", nullable = false) private long lastModifiedDate;
@OneToMany(mappedBy = "advisory", fetch = FetchType.EAGER, cascade = CascadeType.ALL) @@ -264,9 +264,15 @@ public class Advisory implements Serializable { return true; }
+ public long getCtime() { + return ctime; + } + @PrePersist void onPersist() { - this.setLastModifiedDate(System.currentTimeMillis()); + long now = System.currentTimeMillis(); + this.ctime = now; + this.setLastModifiedDate(now); }
@PreUpdate diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryPackage.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryPackage.java index 17bd2d8..2185c65 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryPackage.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryPackage.java @@ -79,7 +79,7 @@ public class AdvisoryPackage implements Serializable { @JoinColumn(name = "PACKAGE_VERSION_ID", referencedColumnName = "ID", nullable = false) private PackageVersion pkg;
- @Column(name = "LAST_MODIFIED", nullable = true) + @Column(name = "LAST_MODIFIED", nullable = false) private long lastModifiedDate;
protected AdvisoryPackage() {
commit b2cc4bca855a6a34e22f4b64ceea0f61638a4608 Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Mar 17 14:53:04 2010 -0400
LT
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/js/timeline/ajax/api/scripts/units.js b/modules/enterprise/gui/portal-war/src/main/webapp/js/timeline/ajax/api/scripts/units.js index 54f2a5b..7bdcd0d 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/js/timeline/ajax/api/scripts/units.js +++ b/modules/enterprise/gui/portal-war/src/main/webapp/js/timeline/ajax/api/scripts/units.js @@ -1,64 +1,64 @@ -/*================================================== - * Default Unit - *================================================== - */ - -SimileAjax.NativeDateUnit = new Object(); - -SimileAjax.NativeDateUnit.makeDefaultValue = function() { - return new Date(); -}; - -SimileAjax.NativeDateUnit.cloneValue = function(v) { - return new Date(v.getTime()); -}; - -SimileAjax.NativeDateUnit.getParser = function(format) { - if (typeof format == "string") { - format = format.toLowerCase(); - } - return (format == "iso8601" || format == "iso 8601") ? - SimileAjax.DateTime.parseIso8601DateTime : - SimileAjax.DateTime.parseGregorianDateTime; -}; - -SimileAjax.NativeDateUnit.parseFromObject = function(o) { - return SimileAjax.DateTime.parseGregorianDateTime(o); -}; - -SimileAjax.NativeDateUnit.toNumber = function(v) { - return v.getTime(); -}; - -SimileAjax.NativeDateUnit.fromNumber = function(n) { - return new Date(n); -}; - -SimileAjax.NativeDateUnit.compare = function(v1, v2) { - var n1, n2; - if (typeof v1 == "object") { - n1 = v1.getTime(); - } else { - n1 = Number(v1); - } - if (typeof v2 == "object") { - n2 = v2.getTime(); - } else { - n2 = Number(v2); - } - - return n1 - n2; -}; - -SimileAjax.NativeDateUnit.earlier = function(v1, v2) { - return SimileAjax.NativeDateUnit.compare(v1, v2) < 0 ? v1 : v2; -}; - -SimileAjax.NativeDateUnit.later = function(v1, v2) { - return SimileAjax.NativeDateUnit.compare(v1, v2) > 0 ? v1 : v2; -}; - -SimileAjax.NativeDateUnit.change = function(v, n) { - return new Date(v.getTime() + n); -}; - +/*================================================== + * Default Unit + *================================================== + */ + +SimileAjax.NativeDateUnit = new Object(); + +SimileAjax.NativeDateUnit.makeDefaultValue = function() { + return new Date(); +}; + +SimileAjax.NativeDateUnit.cloneValue = function(v) { + return new Date(v.getTime()); +}; + +SimileAjax.NativeDateUnit.getParser = function(format) { + if (typeof format == "string") { + format = format.toLowerCase(); + } + return (format == "iso8601" || format == "iso 8601") ? + SimileAjax.DateTime.parseIso8601DateTime : + SimileAjax.DateTime.parseGregorianDateTime; +}; + +SimileAjax.NativeDateUnit.parseFromObject = function(o) { + return SimileAjax.DateTime.parseGregorianDateTime(o); +}; + +SimileAjax.NativeDateUnit.toNumber = function(v) { + return v.getTime(); +}; + +SimileAjax.NativeDateUnit.fromNumber = function(n) { + return new Date(n); +}; + +SimileAjax.NativeDateUnit.compare = function(v1, v2) { + var n1, n2; + if (typeof v1 == "object") { + n1 = v1.getTime(); + } else { + n1 = Number(v1); + } + if (typeof v2 == "object") { + n2 = v2.getTime(); + } else { + n2 = Number(v2); + } + + return n1 - n2; +}; + +SimileAjax.NativeDateUnit.earlier = function(v1, v2) { + return SimileAjax.NativeDateUnit.compare(v1, v2) < 0 ? v1 : v2; +}; + +SimileAjax.NativeDateUnit.later = function(v1, v2) { + return SimileAjax.NativeDateUnit.compare(v1, v2) > 0 ? v1 : v2; +}; + +SimileAjax.NativeDateUnit.change = function(v, n) { + return new Date(v.getTime() + n); +}; +
commit db755e175a0b6db356ca2404fce0e5ae40c1dc33 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Mar 16 11:33:40 2010 -0400
LT
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/js/timeline/ajax/api/scripts/units.js b/modules/enterprise/gui/portal-war/src/main/webapp/js/timeline/ajax/api/scripts/units.js index 54f2a5b..7bdcd0d 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/js/timeline/ajax/api/scripts/units.js +++ b/modules/enterprise/gui/portal-war/src/main/webapp/js/timeline/ajax/api/scripts/units.js @@ -1,64 +1,64 @@ -/*================================================== - * Default Unit - *================================================== - */ - -SimileAjax.NativeDateUnit = new Object(); - -SimileAjax.NativeDateUnit.makeDefaultValue = function() { - return new Date(); -}; - -SimileAjax.NativeDateUnit.cloneValue = function(v) { - return new Date(v.getTime()); -}; - -SimileAjax.NativeDateUnit.getParser = function(format) { - if (typeof format == "string") { - format = format.toLowerCase(); - } - return (format == "iso8601" || format == "iso 8601") ? - SimileAjax.DateTime.parseIso8601DateTime : - SimileAjax.DateTime.parseGregorianDateTime; -}; - -SimileAjax.NativeDateUnit.parseFromObject = function(o) { - return SimileAjax.DateTime.parseGregorianDateTime(o); -}; - -SimileAjax.NativeDateUnit.toNumber = function(v) { - return v.getTime(); -}; - -SimileAjax.NativeDateUnit.fromNumber = function(n) { - return new Date(n); -}; - -SimileAjax.NativeDateUnit.compare = function(v1, v2) { - var n1, n2; - if (typeof v1 == "object") { - n1 = v1.getTime(); - } else { - n1 = Number(v1); - } - if (typeof v2 == "object") { - n2 = v2.getTime(); - } else { - n2 = Number(v2); - } - - return n1 - n2; -}; - -SimileAjax.NativeDateUnit.earlier = function(v1, v2) { - return SimileAjax.NativeDateUnit.compare(v1, v2) < 0 ? v1 : v2; -}; - -SimileAjax.NativeDateUnit.later = function(v1, v2) { - return SimileAjax.NativeDateUnit.compare(v1, v2) > 0 ? v1 : v2; -}; - -SimileAjax.NativeDateUnit.change = function(v, n) { - return new Date(v.getTime() + n); -}; - +/*================================================== + * Default Unit + *================================================== + */ + +SimileAjax.NativeDateUnit = new Object(); + +SimileAjax.NativeDateUnit.makeDefaultValue = function() { + return new Date(); +}; + +SimileAjax.NativeDateUnit.cloneValue = function(v) { + return new Date(v.getTime()); +}; + +SimileAjax.NativeDateUnit.getParser = function(format) { + if (typeof format == "string") { + format = format.toLowerCase(); + } + return (format == "iso8601" || format == "iso 8601") ? + SimileAjax.DateTime.parseIso8601DateTime : + SimileAjax.DateTime.parseGregorianDateTime; +}; + +SimileAjax.NativeDateUnit.parseFromObject = function(o) { + return SimileAjax.DateTime.parseGregorianDateTime(o); +}; + +SimileAjax.NativeDateUnit.toNumber = function(v) { + return v.getTime(); +}; + +SimileAjax.NativeDateUnit.fromNumber = function(n) { + return new Date(n); +}; + +SimileAjax.NativeDateUnit.compare = function(v1, v2) { + var n1, n2; + if (typeof v1 == "object") { + n1 = v1.getTime(); + } else { + n1 = Number(v1); + } + if (typeof v2 == "object") { + n2 = v2.getTime(); + } else { + n2 = Number(v2); + } + + return n1 - n2; +}; + +SimileAjax.NativeDateUnit.earlier = function(v1, v2) { + return SimileAjax.NativeDateUnit.compare(v1, v2) < 0 ? v1 : v2; +}; + +SimileAjax.NativeDateUnit.later = function(v1, v2) { + return SimileAjax.NativeDateUnit.compare(v1, v2) > 0 ? v1 : v2; +}; + +SimileAjax.NativeDateUnit.change = function(v, n) { + return new Date(v.getTime() + n); +}; +
commit 450dea0ece01d8e2f6c3602a0c7512e695ced5c8 Merge: 44ca5dd... 6278e70... Author: Ian P. Springer <ips@jetengine.(none)> Date: Tue Mar 2 08:49:43 2010 -0500
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 44ca5dd63fabe53654f1db6b17dfbbefdde1a8cb Author: Ian P. Springer <ips@jetengine.(none)> Date: Fri Feb 26 12:28:45 2010 -0500
jmx plugin will no longer log warning if SIGAR is not available; Agent, rather than PC, will log this warning once at startup, and only if the user has not explicitly disabled native support (https://bugzilla.redhat.com/show_bug.cgi?id=568760) (cherry picked from commit ab1816d9ecc4cc6e81472538fe30ae767ea0de39)
diff --git a/modules/core/native-system/src/main/java/org/rhq/core/system/SystemInfoFactory.java b/modules/core/native-system/src/main/java/org/rhq/core/system/SystemInfoFactory.java index 27a1375..b2bd37f 100644 --- a/modules/core/native-system/src/main/java/org/rhq/core/system/SystemInfoFactory.java +++ b/modules/core/native-system/src/main/java/org/rhq/core/system/SystemInfoFactory.java @@ -29,7 +29,6 @@ import java.lang.reflect.Method; import java.net.URL; import java.util.HashMap; import java.util.Map; -import java.util.TreeMap;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -50,6 +49,7 @@ public class SystemInfoFactory { private static final String NATIVE_LIBRARY_CLASS_NAME = "org.hyperic.sigar.Sigar";
private static boolean nativeLibraryLoadable; + private static Throwable nativeLibraryLoadThrowable; private static boolean disabled; private static boolean initialized = false;
@@ -78,10 +78,11 @@ public class SystemInfoFactory {
nativeLibraryLoadable = true; } catch (Throwable t) { - nativeLibraryLoadable = false; // can't load the native libs if we don't even have the JNI classes - LOG - .warn("System info API not accessible on this platform (native shared library not found in java.library.path)."); - LOG.trace("Stack trace...", t); + // We don't have the JNI classes (sigar.jar) and/or the native shared library (e.g. libsigar-amd64-linux.so). + // This might be expected (e.g. the admin console WAR (Embedded Jopr) does not include SIGAR), so don't log + // anything, but store the Throwable, so callers can log the cause when appropriate. + nativeLibraryLoadable = false; + nativeLibraryLoadThrowable = t; }
disabled = !nativeLibraryLoadable; // automatically disable native system info iff the native library is not loadable @@ -170,6 +171,17 @@ public class SystemInfoFactory { }
/** + * Returns a Throwable describing why the native library failed to initialize, or null if the native library + * initialized successfully + * + * @return a Throwable describing why the native library failed to initialize, or null if the native library + * initialized successfully + */ + public static Throwable getNativeLibraryLoadThrowable() { + return nativeLibraryLoadThrowable; + } + + /** * This returns <code>true</code> iff the native libraries have actually been initialized. This will return <code> * false</code> if this factory has been {@link #disableNativeSystemInfo() disabled} from the start (i.e. prior to * the first call to {@link #createSystemInfo()} or {@link #getNativeSystemInfoVersion()}). It will also return @@ -308,7 +320,7 @@ public class SystemInfoFactory { private static String findNativeLibrariesRootDirectory() throws Exception { String rootDir = null; File jniLocation = null; - URL jarLocation = null; + URL jarLocation;
if (isNativeSystemInfoAvailable()) { rootDir = System.getProperty("rhq.native-libraries-root-directory"); 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 94513d0..c7e03a1 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 @@ -359,6 +359,11 @@ public class AgentMain { private final AgentRestartCounter m_agentRestartCounter = new AgentRestartCounter();
/** + * The -t command line option was specified. + */ + private boolean m_disableNativeSystem; + + /** * The main method that starts the whole thing. * * @param args @@ -2056,9 +2061,20 @@ public class AgentMain { * disabled no matter what this method decides to do. */ private void prepareNativeSystem() { - if (m_configuration.isNativeSystemDisabled() && !SystemInfoFactory.isNativeSystemInfoDisabled()) { - SystemInfoFactory.disableNativeSystemInfo(); - LOG.info(AgentI18NResourceKeys.NATIVE_SYSTEM_DISABLED); + if (m_disableNativeSystem || m_configuration.isNativeSystemDisabled()) { + if (!SystemInfoFactory.isNativeSystemInfoDisabled()) { + SystemInfoFactory.disableNativeSystemInfo(); + LOG.info(AgentI18NResourceKeys.NATIVE_SYSTEM_DISABLED); + } + } else { + if (!SystemInfoFactory.isNativeSystemInfoAvailable()) { + Throwable t = SystemInfoFactory.getNativeLibraryLoadThrowable(); + if (LOG.isDebugEnabled()) { + LOG.debug(AgentI18NResourceKeys.NATIVE_SYSINFO_UNAVAILABLE_DEBUG, t); + } else { + LOG.warn(AgentI18NResourceKeys.NATIVE_SYSINFO_UNAVAILABLE); + } + } }
return; @@ -2814,8 +2830,7 @@ public class AgentMain { }
case 't': { - SystemInfoFactory.disableNativeSystemInfo(); - LOG.info(AgentI18NResourceKeys.NATIVE_SYSTEM_DISABLED); + m_disableNativeSystem = true; } } } 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 e098b2b..08d4311 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 @@ -519,6 +519,15 @@ 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.") + 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).") + String NATIVE_SYSINFO_UNAVAILABLE_DEBUG = "AgentMain.native-sysinfo-unavailable-debug"; + @I18NMessage("The agent encountered an error during startup and must abort") String STARTUP_ERROR = "AgentMain.startup-error";
diff --git a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JMXDiscoveryComponent.java b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JMXDiscoveryComponent.java index 84ae286..ce8631a 100644 --- a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JMXDiscoveryComponent.java +++ b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JMXDiscoveryComponent.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 @@ -37,6 +37,7 @@ import org.apache.commons.logging.LogFactory; import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.PropertySimple; import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; +import org.rhq.core.pluginapi.inventory.ProcessScanResult; import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent; import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; import org.rhq.core.pluginapi.inventory.ManualAddFacet; @@ -66,8 +67,8 @@ public class JMXDiscoveryComponent implements ResourceDiscoveryComponent, Manual
public static final String ADDITIONAL_CLASSPATH_ENTRIES = "additionalClassPathEntries";
- /* Ignore certain processes that are managed by their own plugin. For example The Tomcat plugin will - * handle tomcat processes configured for JMX management. + /* Ignore certain processes that are managed by their own plugin. For example, the Tomcat plugin will + * handle Tomcat processes configured for JMX management. */ private static final String[] PROCESS_FILTERS;
@@ -79,7 +80,7 @@ public class JMXDiscoveryComponent implements ResourceDiscoveryComponent, Manual processFilters = env.split(","); } } catch (Throwable t) { - log.error("Can't determine process filters, using default. Cause: " + t); + log.error("Can't determine process filters; using default... Cause: " + t); } finally { PROCESS_FILTERS = processFilters; } @@ -135,10 +136,11 @@ public class JMXDiscoveryComponent implements ResourceDiscoveryComponent, Manual // }
try { - List<ProcessInfo> processes = context.getSystemInformation().getProcesses("process|basename|match=^java.*"); + List<ProcessScanResult> processes = context.getAutoDiscoveredProcesses();
- for (ProcessInfo process : processes) { - DiscoveredResourceDetails details = discoverProcess(context, process); + for (ProcessScanResult process : processes) { + ProcessInfo processInfo = process.getProcessInfo(); + DiscoveredResourceDetails details = discoverProcess(context, processInfo); if (details != null) { boolean isFiltered = false; for (String filter : PROCESS_FILTERS) { @@ -153,10 +155,11 @@ public class JMXDiscoveryComponent implements ResourceDiscoveryComponent, Manual } } } catch (Exception e) { - if (log.isDebugEnabled()) - log.debug("Unable to complete base jmx server discovery.", e); - else - log.warn("Unable to complete base jmx server discovery (enable DEBUG for stack): " + e); + if (log.isDebugEnabled()) { + log.debug("Unable to complete base JMX server discovery.", e); + } else { + log.warn("Unable to complete base JMX server discovery (enable DEBUG for stack): " + e); + } }
return found; @@ -228,12 +231,16 @@ public class JMXDiscoveryComponent implements ResourceDiscoveryComponent, Manual String arg = process.getCommandLine()[i];
if (!arg.startsWith("-")) { - if (arg.length() < 200) { // don't use it if its really long, that's an ugly resource name + if (arg.length() <= 200) { name = arg; - break; + } else { + // Truncate it if it's really long for a more palatable Resource name. + name = arg.substring(arg.length() - 200); } + break; } else if (arg.equals("-cp") || arg.equals("-classpath")) { - i++; // skip the next arg, its the classpath, we don't want that as the name + // Skip the next arg - it's the classpath, and we don't want that as the name. + i++; } }
diff --git a/modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml index bcec166..a8131c8 100644 --- a/modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml @@ -69,6 +69,8 @@
</plugin-configuration>
+ <process-scan name="java" query="process|basename|match=^java.*"/> + <help> <![CDATA[ <p>In order to monitor your Java applications via JMX, you need to expose their MBeans to remote JMX clients.
rhq-commits@lists.fedorahosted.org